html_url
stringlengths 51
51
| title
stringlengths 6
280
| comments
stringlengths 67
24.7k
| body
stringlengths 51
36.2k
| __index_level_0__
int64 1
1.17k
| comment_length
int64 16
1.45k
| text
stringlengths 190
38.3k
| embeddings
sequence |
---|---|---|---|---|---|---|---|
https://github.com/huggingface/datasets/issues/5060 | Unable to Use Custom Dataset Locally | Hi ! I opened a PR in your repo to fix this :)
https://huggingface.co/datasets/zpn/pubchem_selfies/discussions/7
basically you need to use `open` for streaming to work properly | ## Describe the bug
I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says
```
If the data files live in the same folder or repository of the dataset script,
you can just pass the relative paths to the files instead of URLs.
```
Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs`
However, if I try to load the data using `load_dataset`, I get the following error
```
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
```
## Steps to reproduce the bug
```python
>>> from datasets import load_dataset
>>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True)
>>> t = dataset["train"]
>>> for item in t:
...... print(item)
...... break
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__
for key, example in self._iter():
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter
yield from ex_iterable
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
````
```
## Expected results
A clear and concise description of the expected results.
## Actual results
Specify the actual results or traceback.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.9.7
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 497 | 25 | Unable to Use Custom Dataset Locally
## Describe the bug
I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says
```
If the data files live in the same folder or repository of the dataset script,
you can just pass the relative paths to the files instead of URLs.
```
Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs`
However, if I try to load the data using `load_dataset`, I get the following error
```
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
```
## Steps to reproduce the bug
```python
>>> from datasets import load_dataset
>>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True)
>>> t = dataset["train"]
>>> for item in t:
...... print(item)
...... break
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__
for key, example in self._iter():
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter
yield from ex_iterable
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
````
```
## Expected results
A clear and concise description of the expected results.
## Actual results
Specify the actual results or traceback.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.9.7
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Hi ! I opened a PR in your repo to fix this :)
https://huggingface.co/datasets/zpn/pubchem_selfies/discussions/7
basically you need to use `open` for streaming to work properly | [
-1.1599531173706055,
-0.8832204937934875,
-0.7926887273788452,
1.4481226205825806,
-0.08640323579311371,
-1.2975242137908936,
0.052419692277908325,
-0.9936642050743103,
1.630454182624817,
-0.7157442569732666,
0.2275511920452118,
-1.7072192430496216,
-0.07968419790267944,
-0.5546890497207642,
-0.7071906328201294,
-0.9193564057350159,
-0.3269624412059784,
-0.8373022079467773,
0.9594717621803284,
2.43070125579834,
1.2337671518325806,
-1.3324182033538818,
2.7404181957244873,
0.6621739268302917,
-0.2667407989501953,
-1.0150493383407593,
0.5538044571876526,
-0.012768726795911789,
-1.1864982843399048,
-0.4661453068256378,
-0.9648082256317139,
-0.009995653294026852,
-0.6191022396087646,
-0.4704992175102234,
0.13297545909881592,
0.39882680773735046,
-0.2125530242919922,
-0.3121466040611267,
-0.6039059162139893,
-0.7513602375984192,
0.49188295006752014,
-0.34205928444862366,
0.9579899311065674,
-0.3141942322254181,
1.762422800064087,
-0.6155754923820496,
0.36214765906333923,
0.7449967265129089,
1.2932543754577637,
0.16240297257900238,
0.10079166293144226,
0.2541562616825104,
0.3918880820274353,
0.07357043772935867,
0.4761299192905426,
1.243356466293335,
0.5936464071273804,
0.4985269606113434,
0.6783083081245422,
-2.2237279415130615,
1.2917407751083374,
-0.9219821691513062,
0.3044464588165283,
1.3672549724578857,
-0.9136558175086975,
0.3956097364425659,
-1.8564823865890503,
-0.08381421118974686,
0.6183212995529175,
-2.2799065113067627,
0.1941240429878235,
-1.2910469770431519,
-0.5610751509666443,
0.9172014594078064,
0.28032270073890686,
-1.2132045030593872,
0.2527148425579071,
-0.5139673948287964,
1.0540896654129028,
0.45788851380348206,
1.1372547149658203,
-1.675109624862671,
-0.03479255735874176,
-0.19580358266830444,
0.07307381182909012,
-1.2736471891403198,
-1.6797246932983398,
0.5644328594207764,
0.6387646794319153,
0.6471996307373047,
-0.13819149136543274,
1.0168265104293823,
-0.9691242575645447,
0.8382067680358887,
-0.8491745591163635,
-1.6949864625930786,
-1.378326654434204,
-2.2833986282348633,
-2.3048152923583984,
0.8377746939659119,
-0.5095295310020447,
-0.41354578733444214,
1.9943904876708984,
-1.0277442932128906,
-1.7366456985473633,
1.0044834613800049,
0.2872309386730194,
0.004603161476552486,
2.3869409561157227,
0.2674437463283539,
-0.7744349837303162,
0.37002432346343994,
-0.6939654350280762,
0.820540726184845,
-0.3559147119522095,
1.3334382772445679,
0.5321639180183411,
-1.0138442516326904,
1.6571879386901855,
-0.4268079996109009,
0.526933491230011,
-0.7271395921707153,
-0.46593958139419556,
-0.8278568387031555,
0.2608349323272705,
1.8860055208206177,
-0.39577245712280273,
1.6112525463104248,
-0.24568448960781097,
-1.5657801628112793,
-1.5734440088272095,
0.7782574892044067,
0.45395880937576294,
-0.8868865966796875,
0.05270712822675705,
-0.4799964129924774,
0.17291493713855743,
-0.003991363104432821,
1.1454949378967285,
1.2041264772415161,
0.6543852686882019,
-0.2885013818740845,
-0.8108148574829102,
0.22440195083618164,
-0.12185562402009964,
-0.6330059170722961,
-1.8473153114318848,
-0.3580247461795807,
0.2968515455722809,
0.6175424456596375,
-1.2797963619232178,
1.8020641803741455,
0.8462907075881958,
1.9867030382156372,
0.9756045341491699,
-0.44762179255485535,
1.4615432024002075,
0.012605587020516396,
1.8936741352081299,
-0.46776145696640015,
0.6615831255912781,
-0.3671741783618927,
-1.1882460117340088,
0.8758564591407776,
-0.35993480682373047,
-1.9417173862457275,
-0.7622092962265015,
-0.8331809639930725,
-0.14133290946483612,
-0.6993007063865662,
0.8871323466300964,
-0.3420734405517578,
-1.4239845275878906,
0.11528274416923523,
-0.6395658254623413,
0.13311506807804108,
-1.257699728012085,
0.1677771359682083,
0.7393836975097656,
-0.7531808614730835,
-0.03074650652706623,
-0.28815957903862,
-1.3332622051239014,
-0.522429347038269,
0.3259294033050537,
1.9616143703460693,
-0.6360081434249878,
1.0255125761032104,
0.986714780330658,
-0.7243082523345947,
0.1718260943889618,
0.361423134803772,
-0.3240547180175781,
0.8461601138114929,
-1.1687991619110107,
-0.43941453099250793,
1.138960361480713,
-0.23111717402935028,
-0.7540892362594604,
1.4116616249084473,
0.8363264799118042,
-1.0768890380859375,
-0.24001024663448334,
-0.20198065042495728,
-0.8336448669433594,
0.02778708003461361,
-1.597055196762085,
-0.21052157878875732,
0.3256608843803406,
-1.4582993984222412,
-0.4419180750846863,
-0.25881972908973694,
1.340052604675293,
-0.18127316236495972,
1.4591671228408813,
-0.2857219874858856,
-0.2565121352672577,
-0.40516170859336853,
-0.4716776907444,
0.16548289358615875,
-0.17100758850574493,
-0.6145942211151123,
0.312055766582489,
-0.8806542754173279,
0.2630350887775421,
1.4793647527694702,
0.28363409638404846,
0.03224063664674759,
0.5733433365821838,
1.1612224578857422,
0.3080446124076843,
-0.08266114443540573,
-0.9445991516113281,
-1.5270572900772095,
2.0010905265808105,
-1.425409197807312,
1.9181331396102905,
0.7364264726638794,
-0.08779659867286682,
-1.8153743743896484,
-1.8356839418411255,
1.3383674621582031,
1.1186007261276245,
2.439342498779297,
0.5700075030326843,
0.40890049934387207,
-0.7642672061920166,
-0.7592599987983704,
0.38609591126441956,
-0.9734148979187012,
-0.7646390795707703,
0.19970621168613434,
2.345435380935669,
1.7818992137908936,
-0.5302845239639282,
-0.3094819486141205,
-0.9599050283432007,
1.2057474851608276,
-0.26583626866340637,
0.26570144295692444,
2.0697593688964844,
-0.3411950469017029,
-1.0011718273162842,
1.2539445161819458,
-2.365257501602173,
0.16529034078121185,
2.0496113300323486,
0.28262436389923096,
0.14409296214580536,
-1.4617249965667725,
-0.6711207032203674,
-0.24996653199195862,
-0.46596086025238037,
-1.2513928413391113,
0.5423635244369507,
-0.27135327458381653,
-0.9398403763771057,
-1.3893228769302368,
0.0009434353560209274,
-1.167630910873413,
-1.7390167713165283,
0.3192313313484192,
1.9134045839309692,
2.0524117946624756,
-0.7552879452705383,
1.3889836072921753,
-0.26093441247940063,
0.06165236234664917,
1.289401650428772,
1.3767549991607666,
3.1792523860931396,
1.8953735828399658,
-1.2534630298614502,
0.7347476482391357,
-0.17590691149234772,
-0.4479139447212219,
1.1671751737594604,
-1.0915868282318115,
1.0699182748794556,
-0.3345436155796051,
-1.2706760168075562,
-1.2499756813049316,
1.0710207223892212,
0.4534110426902771,
-0.015629000961780548,
-0.5407565832138062,
1.2743672132492065,
0.0911540687084198,
1.2926836013793945,
0.6175767183303833,
-0.45709142088890076,
0.5076019763946533,
-0.35023394227027893,
-0.5453226566314697,
1.6799463033676147,
0.14787663519382477,
-1.4741450548171997,
-2.306654214859009,
-0.24120908975601196,
-0.9378896951675415,
-0.06549806892871857,
-0.6321977376937866,
-1.0333597660064697,
1.609278678894043,
0.418491929769516,
-1.2479442358016968,
-0.27134403586387634,
-0.36614054441452026,
-0.5977646708488464,
2.5988035202026367,
-1.2969903945922852,
-0.16110743582248688,
-0.9712148904800415,
-0.49294212460517883,
1.6124134063720703,
-1.1470445394515991,
-0.2054944932460785,
-1.0419142246246338,
-0.6531163454055786,
-1.3510996103286743,
-0.4650801420211792,
0.07983478158712387,
-0.8976430892944336,
0.760857105255127,
0.042907968163490295,
-1.0652830600738525,
-0.21243491768836975,
-0.8514769673347473,
0.968434751033783,
-0.1165088564157486,
0.20514416694641113,
1.9146357774734497,
0.3978818655014038,
-0.41726014018058777,
0.7391677498817444,
1.125542402267456,
0.6895929574966431,
-0.6157598495483398,
0.16891753673553467,
-0.6610045433044434,
0.24531826376914978,
-1.423783779144287,
0.2429959774017334,
-2.9070534706115723,
0.7435224056243896,
-0.14398224651813507,
-0.09249775111675262,
0.0033473968505859375,
-1.2757625579833984,
0.99430251121521,
2.6050527095794678,
-1.189275860786438,
0.4085655212402344,
0.34657809138298035,
1.1655919551849365,
-1.5844955444335938,
0.2548030912876129,
-0.49284639954566956,
2.072544574737549,
0.11896897852420807,
1.1691182851791382,
-0.5104653239250183,
-2.1808066368103027,
0.6038888692855835,
-1.2212697267532349,
-0.9600241184234619,
0.9012254476547241,
-0.7938539385795593,
0.2191649228334427,
-1.4064959287643433,
-0.1419440060853958,
-0.913006603717804,
-1.2998192310333252,
0.8210064768791199,
0.08053506165742874,
0.4934426248073578,
-0.5503237843513489,
0.379387766122818,
-2.0930826663970947,
-1.3411650657653809,
-0.23022738099098206,
-0.9991695284843445,
0.5195143818855286,
-0.32211175560951233,
0.6557027697563171,
-0.07046966254711151,
0.10680154711008072,
0.27622801065444946,
1.4134994745254517,
3.4041435718536377,
0.14062009751796722,
0.21533317863941193,
-0.11578819900751114,
-0.9698457717895508,
1.414471983909607,
0.980476438999176,
-0.130156472325325,
-0.6499751806259155,
-1.0307831764221191,
1.291959285736084,
2.016864776611328,
1.1351029872894287,
0.20010070502758026,
-0.8699898719787598,
-0.7704647183418274,
0.022114576771855354,
0.22247305512428284,
0.569118320941925,
0.9115040898323059,
-0.044283390045166016,
0.110776387155056,
1.3876893520355225,
1.2150095701217651,
-0.2629190981388092,
0.39403054118156433,
-0.9693810939788818,
-0.4136784076690674,
0.45554816722869873,
0.22475403547286987,
0.1039111390709877,
0.4187837839126587,
-1.1249096393585205,
-0.2924586534500122,
-0.2993539273738861,
-0.9612467885017395,
-0.7271600961685181,
-0.38115182518959045,
-0.4094609022140503,
1.5900925397872925,
0.05629865080118179,
-0.5005894303321838,
0.01870524324476719,
-0.696627140045166,
-0.1419655829668045,
-1.0638412237167358,
0.20627425611019135,
-0.07330460846424103,
-0.044247500598430634,
-0.16374999284744263,
1.717194676399231,
-0.9315411448478699,
-2.1651885509490967,
0.2259054332971573,
0.2501697838306427,
-0.4378006160259247,
0.14256910979747772,
1.7419313192367554,
0.5256298184394836,
1.3684412240982056,
1.2866129875183105,
0.9981094598770142,
-0.5816152095794678,
-1.2245674133300781,
0.6464868187904358,
0.9438194632530212,
-1.3935004472732544,
0.9460755586624146,
-0.20365434885025024,
-0.5124761462211609,
0.7017033696174622,
1.2851824760437012,
0.35703572630882263,
-2.0288379192352295,
0.8464350700378418,
-0.9285821318626404,
0.7524464130401611,
0.6660990715026855,
0.8352888226509094,
0.27282583713531494,
0.8693289756774902,
-1.2333734035491943,
-1.0922070741653442,
-0.6820957064628601,
-0.5680295825004578,
1.9552180767059326,
-0.11413872987031937,
0.5044447779655457,
-0.15259243547916412,
-1.2633568048477173,
-0.13114388287067413,
0.7750524878501892,
0.3771117031574249,
-0.39705953001976013,
0.9028304815292358,
-0.6568604707717896,
-0.9720158576965332,
-1.312097191810608,
-0.47519952058792114,
-1.017914891242981,
-0.9154948592185974,
1.0089045763015747,
0.8238838911056519,
0.4499119818210602,
1.924628496170044,
0.5590946078300476,
0.28212711215019226,
-2.6597981452941895,
0.9073570966720581,
0.34429696202278137,
-0.07173394411802292,
0.8984972238540649,
0.23280315101146698,
1.1741352081298828,
-0.07435624301433563,
0.5927035212516785,
-2.3183679580688477,
2.206918478012085,
-0.21580752730369568,
0.6646187901496887,
0.07047295570373535,
-0.2064519226551056,
1.094822645187378,
0.5388506054878235,
0.6034104824066162,
-1.050142526626587,
0.7557433247566223,
-0.6043292880058289,
1.0905241966247559,
0.932344913482666,
-0.9059374332427979,
0.06623584032058716,
1.4134650230407715,
0.49570325016975403,
-0.3910103738307953,
-0.9161400198936462,
-0.848978579044342,
0.940642237663269,
1.738348126411438,
-0.024283306673169136,
0.00845232605934143,
0.8860236406326294,
0.6504519581794739,
-1.230729579925537,
0.12559624016284943,
-0.730343222618103,
-0.6279548406600952,
1.6932692527770996,
1.9435758590698242,
-0.1110256090760231,
-0.13485562801361084,
-0.7715292572975159,
-1.2465431690216064,
0.7545424103736877,
-0.052565738558769226,
0.07530371844768524,
0.7518282532691956,
-0.7259292602539062,
1.1673485040664673,
0.6382168531417847,
0.9391353726387024,
0.05791071057319641,
0.33397355675697327,
0.34453898668289185,
-0.34268808364868164,
-1.1781818866729736,
-0.3895254135131836,
-1.0471653938293457,
-2.5892083644866943,
0.4777570068836212,
-0.22079956531524658,
-1.4398373365402222,
0.04115729033946991,
-0.9914795756340027,
0.8623201847076416,
-0.6316068768501282,
-1.1223618984222412,
-1.4537909030914307,
0.3192620873451233,
-0.22993755340576172,
0.9283134937286377,
-1.6595180034637451,
-0.08733875304460526,
1.2514073848724365,
0.8841186165809631,
-0.5474697351455688,
0.9086982011795044,
0.19942186772823334,
1.011123538017273,
0.8450766801834106,
-0.3362942337989807,
0.524515688419342,
0.07235994935035706,
-1.3154480457305908,
0.4364224970340729,
1.1195011138916016,
0.1363634616136551,
1.3723753690719604,
-0.5013875365257263,
0.037775568664073944,
0.4316612780094147,
-0.5533267259597778,
-0.48907941579818726,
-0.4997873604297638,
0.6852911710739136,
0.08062972128391266,
-1.013570785522461,
-0.06975234299898148,
-0.09405369311571121,
-0.16845208406448364,
0.2044135183095932,
-1.4582781791687012,
-0.25894737243652344,
-0.3261280059814453,
-0.4484684467315674,
-1.330014705657959,
0.0689987763762474,
1.299703598022461,
-0.7861059308052063,
-0.2349081188440323,
0.5065377354621887,
0.328580766916275,
0.5162233114242554,
0.5452449917793274,
-0.7149947285652161,
-0.29333099722862244,
-0.3198826313018799,
-0.38364771008491516,
0.2584657371044159,
1.2153432369232178,
-0.12536638975143433,
-0.9320756196975708,
0.7348420023918152,
-0.3967944085597992,
0.10752909630537033,
2.005664110183716,
0.03886076807975769,
-0.805954098701477,
0.3217465281486511,
-0.7050211429595947,
1.818147897720337,
1.6879935264587402,
1.2423142194747925,
-0.10233980417251587,
-0.8252561688423157,
0.5805153846740723,
-0.2864883542060852,
-0.3700122833251953,
0.9133087396621704,
0.41543132066726685,
-0.17950321733951569,
-1.4391814470291138,
0.6176684498786926,
1.3230960369110107,
-0.8415480852127075,
-0.7910216450691223,
0.11024528741836548,
-0.9102627038955688,
1.079403281211853,
0.6623474955558777,
0.4085792601108551,
0.16852429509162903,
1.5374397039413452,
0.7288132309913635,
-0.4599646329879761,
0.46951788663864136,
0.455910861492157,
-0.16230671107769012,
-2.1046628952026367,
-1.058676838874817,
0.2993447482585907,
-0.3487149775028229,
-1.6119880676269531,
1.3436170816421509,
-1.1713857650756836,
-0.9785284399986267,
0.5394349694252014,
0.16659541428089142,
1.3382093906402588,
0.3050794303417206,
1.697406530380249,
2.079353094100952,
0.8603568077087402,
0.3383898437023163,
1.2918070554733276,
0.0009822649881243706,
-0.4587371349334717,
1.8574341535568237,
-0.47990649938583374,
0.5941085815429688,
1.0138291120529175,
-0.3577002286911011,
-1.0640063285827637,
-0.7386326193809509,
-1.1682871580123901,
-0.6371704339981079,
1.2320032119750977,
0.11937505006790161,
-0.9996719360351562,
0.17709964513778687,
1.5833784341812134,
0.15644051134586334,
-0.21588100492954254,
0.7245688438415527,
0.43844085931777954,
-0.7287231087684631,
-0.0557127520442009,
-0.8666210770606995,
0.547211766242981,
-0.09262436628341675,
-0.2913822829723358,
0.25839313864707947,
0.544781506061554,
1.330491542816162,
-0.004849693272262812,
0.1312452256679535,
1.2733843326568604,
-1.3645528554916382,
1.5830940008163452,
-0.6330500841140747,
0.2991306781768799,
-2.5243003368377686,
1.4059361219406128,
-0.829452633857727,
1.9145150184631348,
-2.586064100265503,
0.40157419443130493,
-0.5474298596382141,
-0.49923789501190186,
0.2859051525592804,
-0.36093124747276306,
0.0930948406457901,
-0.17639276385307312,
-1.0198540687561035,
-0.0009481748566031456,
-0.7570739388465881,
0.5937613248825073,
1.250430703163147,
1.4084633588790894,
-1.1085011959075928,
-0.28096920251846313,
-1.8220125436782837,
-0.20018833875656128,
-0.7319782972335815,
0.3871273398399353,
-1.9688581228256226,
-0.1331861913204193,
-1.9349024295806885,
-2.4176104068756104,
-1.4793756008148193,
-0.8745415806770325,
1.0659412145614624,
0.17352060973644257,
-0.9915206432342529,
1.189674973487854,
-0.36494627594947815,
-1.8398399353027344,
1.0959017276763916,
-2.2618329524993896
] |
https://github.com/huggingface/datasets/issues/5060 | Unable to Use Custom Dataset Locally | Thank you so much for this! Naive question, is this a feature of `open` or have you all overloaded it to be able to read from a URL? Any links to code/documentation would be greatly appreciated, I'd love to learn more | ## Describe the bug
I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says
```
If the data files live in the same folder or repository of the dataset script,
you can just pass the relative paths to the files instead of URLs.
```
Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs`
However, if I try to load the data using `load_dataset`, I get the following error
```
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
```
## Steps to reproduce the bug
```python
>>> from datasets import load_dataset
>>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True)
>>> t = dataset["train"]
>>> for item in t:
...... print(item)
...... break
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__
for key, example in self._iter():
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter
yield from ex_iterable
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
````
```
## Expected results
A clear and concise description of the expected results.
## Actual results
Specify the actual results or traceback.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.9.7
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 497 | 41 | Unable to Use Custom Dataset Locally
## Describe the bug
I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says
```
If the data files live in the same folder or repository of the dataset script,
you can just pass the relative paths to the files instead of URLs.
```
Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs`
However, if I try to load the data using `load_dataset`, I get the following error
```
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
```
## Steps to reproduce the bug
```python
>>> from datasets import load_dataset
>>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True)
>>> t = dataset["train"]
>>> for item in t:
...... print(item)
...... break
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__
for key, example in self._iter():
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter
yield from ex_iterable
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
````
```
## Expected results
A clear and concise description of the expected results.
## Actual results
Specify the actual results or traceback.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.9.7
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Thank you so much for this! Naive question, is this a feature of `open` or have you all overloaded it to be able to read from a URL? Any links to code/documentation would be greatly appreciated, I'd love to learn more | [
-1.1599531173706055,
-0.8832204937934875,
-0.7926887273788452,
1.4481226205825806,
-0.08640323579311371,
-1.2975242137908936,
0.052419692277908325,
-0.9936642050743103,
1.630454182624817,
-0.7157442569732666,
0.2275511920452118,
-1.7072192430496216,
-0.07968419790267944,
-0.5546890497207642,
-0.7071906328201294,
-0.9193564057350159,
-0.3269624412059784,
-0.8373022079467773,
0.9594717621803284,
2.43070125579834,
1.2337671518325806,
-1.3324182033538818,
2.7404181957244873,
0.6621739268302917,
-0.2667407989501953,
-1.0150493383407593,
0.5538044571876526,
-0.012768726795911789,
-1.1864982843399048,
-0.4661453068256378,
-0.9648082256317139,
-0.009995653294026852,
-0.6191022396087646,
-0.4704992175102234,
0.13297545909881592,
0.39882680773735046,
-0.2125530242919922,
-0.3121466040611267,
-0.6039059162139893,
-0.7513602375984192,
0.49188295006752014,
-0.34205928444862366,
0.9579899311065674,
-0.3141942322254181,
1.762422800064087,
-0.6155754923820496,
0.36214765906333923,
0.7449967265129089,
1.2932543754577637,
0.16240297257900238,
0.10079166293144226,
0.2541562616825104,
0.3918880820274353,
0.07357043772935867,
0.4761299192905426,
1.243356466293335,
0.5936464071273804,
0.4985269606113434,
0.6783083081245422,
-2.2237279415130615,
1.2917407751083374,
-0.9219821691513062,
0.3044464588165283,
1.3672549724578857,
-0.9136558175086975,
0.3956097364425659,
-1.8564823865890503,
-0.08381421118974686,
0.6183212995529175,
-2.2799065113067627,
0.1941240429878235,
-1.2910469770431519,
-0.5610751509666443,
0.9172014594078064,
0.28032270073890686,
-1.2132045030593872,
0.2527148425579071,
-0.5139673948287964,
1.0540896654129028,
0.45788851380348206,
1.1372547149658203,
-1.675109624862671,
-0.03479255735874176,
-0.19580358266830444,
0.07307381182909012,
-1.2736471891403198,
-1.6797246932983398,
0.5644328594207764,
0.6387646794319153,
0.6471996307373047,
-0.13819149136543274,
1.0168265104293823,
-0.9691242575645447,
0.8382067680358887,
-0.8491745591163635,
-1.6949864625930786,
-1.378326654434204,
-2.2833986282348633,
-2.3048152923583984,
0.8377746939659119,
-0.5095295310020447,
-0.41354578733444214,
1.9943904876708984,
-1.0277442932128906,
-1.7366456985473633,
1.0044834613800049,
0.2872309386730194,
0.004603161476552486,
2.3869409561157227,
0.2674437463283539,
-0.7744349837303162,
0.37002432346343994,
-0.6939654350280762,
0.820540726184845,
-0.3559147119522095,
1.3334382772445679,
0.5321639180183411,
-1.0138442516326904,
1.6571879386901855,
-0.4268079996109009,
0.526933491230011,
-0.7271395921707153,
-0.46593958139419556,
-0.8278568387031555,
0.2608349323272705,
1.8860055208206177,
-0.39577245712280273,
1.6112525463104248,
-0.24568448960781097,
-1.5657801628112793,
-1.5734440088272095,
0.7782574892044067,
0.45395880937576294,
-0.8868865966796875,
0.05270712822675705,
-0.4799964129924774,
0.17291493713855743,
-0.003991363104432821,
1.1454949378967285,
1.2041264772415161,
0.6543852686882019,
-0.2885013818740845,
-0.8108148574829102,
0.22440195083618164,
-0.12185562402009964,
-0.6330059170722961,
-1.8473153114318848,
-0.3580247461795807,
0.2968515455722809,
0.6175424456596375,
-1.2797963619232178,
1.8020641803741455,
0.8462907075881958,
1.9867030382156372,
0.9756045341491699,
-0.44762179255485535,
1.4615432024002075,
0.012605587020516396,
1.8936741352081299,
-0.46776145696640015,
0.6615831255912781,
-0.3671741783618927,
-1.1882460117340088,
0.8758564591407776,
-0.35993480682373047,
-1.9417173862457275,
-0.7622092962265015,
-0.8331809639930725,
-0.14133290946483612,
-0.6993007063865662,
0.8871323466300964,
-0.3420734405517578,
-1.4239845275878906,
0.11528274416923523,
-0.6395658254623413,
0.13311506807804108,
-1.257699728012085,
0.1677771359682083,
0.7393836975097656,
-0.7531808614730835,
-0.03074650652706623,
-0.28815957903862,
-1.3332622051239014,
-0.522429347038269,
0.3259294033050537,
1.9616143703460693,
-0.6360081434249878,
1.0255125761032104,
0.986714780330658,
-0.7243082523345947,
0.1718260943889618,
0.361423134803772,
-0.3240547180175781,
0.8461601138114929,
-1.1687991619110107,
-0.43941453099250793,
1.138960361480713,
-0.23111717402935028,
-0.7540892362594604,
1.4116616249084473,
0.8363264799118042,
-1.0768890380859375,
-0.24001024663448334,
-0.20198065042495728,
-0.8336448669433594,
0.02778708003461361,
-1.597055196762085,
-0.21052157878875732,
0.3256608843803406,
-1.4582993984222412,
-0.4419180750846863,
-0.25881972908973694,
1.340052604675293,
-0.18127316236495972,
1.4591671228408813,
-0.2857219874858856,
-0.2565121352672577,
-0.40516170859336853,
-0.4716776907444,
0.16548289358615875,
-0.17100758850574493,
-0.6145942211151123,
0.312055766582489,
-0.8806542754173279,
0.2630350887775421,
1.4793647527694702,
0.28363409638404846,
0.03224063664674759,
0.5733433365821838,
1.1612224578857422,
0.3080446124076843,
-0.08266114443540573,
-0.9445991516113281,
-1.5270572900772095,
2.0010905265808105,
-1.425409197807312,
1.9181331396102905,
0.7364264726638794,
-0.08779659867286682,
-1.8153743743896484,
-1.8356839418411255,
1.3383674621582031,
1.1186007261276245,
2.439342498779297,
0.5700075030326843,
0.40890049934387207,
-0.7642672061920166,
-0.7592599987983704,
0.38609591126441956,
-0.9734148979187012,
-0.7646390795707703,
0.19970621168613434,
2.345435380935669,
1.7818992137908936,
-0.5302845239639282,
-0.3094819486141205,
-0.9599050283432007,
1.2057474851608276,
-0.26583626866340637,
0.26570144295692444,
2.0697593688964844,
-0.3411950469017029,
-1.0011718273162842,
1.2539445161819458,
-2.365257501602173,
0.16529034078121185,
2.0496113300323486,
0.28262436389923096,
0.14409296214580536,
-1.4617249965667725,
-0.6711207032203674,
-0.24996653199195862,
-0.46596086025238037,
-1.2513928413391113,
0.5423635244369507,
-0.27135327458381653,
-0.9398403763771057,
-1.3893228769302368,
0.0009434353560209274,
-1.167630910873413,
-1.7390167713165283,
0.3192313313484192,
1.9134045839309692,
2.0524117946624756,
-0.7552879452705383,
1.3889836072921753,
-0.26093441247940063,
0.06165236234664917,
1.289401650428772,
1.3767549991607666,
3.1792523860931396,
1.8953735828399658,
-1.2534630298614502,
0.7347476482391357,
-0.17590691149234772,
-0.4479139447212219,
1.1671751737594604,
-1.0915868282318115,
1.0699182748794556,
-0.3345436155796051,
-1.2706760168075562,
-1.2499756813049316,
1.0710207223892212,
0.4534110426902771,
-0.015629000961780548,
-0.5407565832138062,
1.2743672132492065,
0.0911540687084198,
1.2926836013793945,
0.6175767183303833,
-0.45709142088890076,
0.5076019763946533,
-0.35023394227027893,
-0.5453226566314697,
1.6799463033676147,
0.14787663519382477,
-1.4741450548171997,
-2.306654214859009,
-0.24120908975601196,
-0.9378896951675415,
-0.06549806892871857,
-0.6321977376937866,
-1.0333597660064697,
1.609278678894043,
0.418491929769516,
-1.2479442358016968,
-0.27134403586387634,
-0.36614054441452026,
-0.5977646708488464,
2.5988035202026367,
-1.2969903945922852,
-0.16110743582248688,
-0.9712148904800415,
-0.49294212460517883,
1.6124134063720703,
-1.1470445394515991,
-0.2054944932460785,
-1.0419142246246338,
-0.6531163454055786,
-1.3510996103286743,
-0.4650801420211792,
0.07983478158712387,
-0.8976430892944336,
0.760857105255127,
0.042907968163490295,
-1.0652830600738525,
-0.21243491768836975,
-0.8514769673347473,
0.968434751033783,
-0.1165088564157486,
0.20514416694641113,
1.9146357774734497,
0.3978818655014038,
-0.41726014018058777,
0.7391677498817444,
1.125542402267456,
0.6895929574966431,
-0.6157598495483398,
0.16891753673553467,
-0.6610045433044434,
0.24531826376914978,
-1.423783779144287,
0.2429959774017334,
-2.9070534706115723,
0.7435224056243896,
-0.14398224651813507,
-0.09249775111675262,
0.0033473968505859375,
-1.2757625579833984,
0.99430251121521,
2.6050527095794678,
-1.189275860786438,
0.4085655212402344,
0.34657809138298035,
1.1655919551849365,
-1.5844955444335938,
0.2548030912876129,
-0.49284639954566956,
2.072544574737549,
0.11896897852420807,
1.1691182851791382,
-0.5104653239250183,
-2.1808066368103027,
0.6038888692855835,
-1.2212697267532349,
-0.9600241184234619,
0.9012254476547241,
-0.7938539385795593,
0.2191649228334427,
-1.4064959287643433,
-0.1419440060853958,
-0.913006603717804,
-1.2998192310333252,
0.8210064768791199,
0.08053506165742874,
0.4934426248073578,
-0.5503237843513489,
0.379387766122818,
-2.0930826663970947,
-1.3411650657653809,
-0.23022738099098206,
-0.9991695284843445,
0.5195143818855286,
-0.32211175560951233,
0.6557027697563171,
-0.07046966254711151,
0.10680154711008072,
0.27622801065444946,
1.4134994745254517,
3.4041435718536377,
0.14062009751796722,
0.21533317863941193,
-0.11578819900751114,
-0.9698457717895508,
1.414471983909607,
0.980476438999176,
-0.130156472325325,
-0.6499751806259155,
-1.0307831764221191,
1.291959285736084,
2.016864776611328,
1.1351029872894287,
0.20010070502758026,
-0.8699898719787598,
-0.7704647183418274,
0.022114576771855354,
0.22247305512428284,
0.569118320941925,
0.9115040898323059,
-0.044283390045166016,
0.110776387155056,
1.3876893520355225,
1.2150095701217651,
-0.2629190981388092,
0.39403054118156433,
-0.9693810939788818,
-0.4136784076690674,
0.45554816722869873,
0.22475403547286987,
0.1039111390709877,
0.4187837839126587,
-1.1249096393585205,
-0.2924586534500122,
-0.2993539273738861,
-0.9612467885017395,
-0.7271600961685181,
-0.38115182518959045,
-0.4094609022140503,
1.5900925397872925,
0.05629865080118179,
-0.5005894303321838,
0.01870524324476719,
-0.696627140045166,
-0.1419655829668045,
-1.0638412237167358,
0.20627425611019135,
-0.07330460846424103,
-0.044247500598430634,
-0.16374999284744263,
1.717194676399231,
-0.9315411448478699,
-2.1651885509490967,
0.2259054332971573,
0.2501697838306427,
-0.4378006160259247,
0.14256910979747772,
1.7419313192367554,
0.5256298184394836,
1.3684412240982056,
1.2866129875183105,
0.9981094598770142,
-0.5816152095794678,
-1.2245674133300781,
0.6464868187904358,
0.9438194632530212,
-1.3935004472732544,
0.9460755586624146,
-0.20365434885025024,
-0.5124761462211609,
0.7017033696174622,
1.2851824760437012,
0.35703572630882263,
-2.0288379192352295,
0.8464350700378418,
-0.9285821318626404,
0.7524464130401611,
0.6660990715026855,
0.8352888226509094,
0.27282583713531494,
0.8693289756774902,
-1.2333734035491943,
-1.0922070741653442,
-0.6820957064628601,
-0.5680295825004578,
1.9552180767059326,
-0.11413872987031937,
0.5044447779655457,
-0.15259243547916412,
-1.2633568048477173,
-0.13114388287067413,
0.7750524878501892,
0.3771117031574249,
-0.39705953001976013,
0.9028304815292358,
-0.6568604707717896,
-0.9720158576965332,
-1.312097191810608,
-0.47519952058792114,
-1.017914891242981,
-0.9154948592185974,
1.0089045763015747,
0.8238838911056519,
0.4499119818210602,
1.924628496170044,
0.5590946078300476,
0.28212711215019226,
-2.6597981452941895,
0.9073570966720581,
0.34429696202278137,
-0.07173394411802292,
0.8984972238540649,
0.23280315101146698,
1.1741352081298828,
-0.07435624301433563,
0.5927035212516785,
-2.3183679580688477,
2.206918478012085,
-0.21580752730369568,
0.6646187901496887,
0.07047295570373535,
-0.2064519226551056,
1.094822645187378,
0.5388506054878235,
0.6034104824066162,
-1.050142526626587,
0.7557433247566223,
-0.6043292880058289,
1.0905241966247559,
0.932344913482666,
-0.9059374332427979,
0.06623584032058716,
1.4134650230407715,
0.49570325016975403,
-0.3910103738307953,
-0.9161400198936462,
-0.848978579044342,
0.940642237663269,
1.738348126411438,
-0.024283306673169136,
0.00845232605934143,
0.8860236406326294,
0.6504519581794739,
-1.230729579925537,
0.12559624016284943,
-0.730343222618103,
-0.6279548406600952,
1.6932692527770996,
1.9435758590698242,
-0.1110256090760231,
-0.13485562801361084,
-0.7715292572975159,
-1.2465431690216064,
0.7545424103736877,
-0.052565738558769226,
0.07530371844768524,
0.7518282532691956,
-0.7259292602539062,
1.1673485040664673,
0.6382168531417847,
0.9391353726387024,
0.05791071057319641,
0.33397355675697327,
0.34453898668289185,
-0.34268808364868164,
-1.1781818866729736,
-0.3895254135131836,
-1.0471653938293457,
-2.5892083644866943,
0.4777570068836212,
-0.22079956531524658,
-1.4398373365402222,
0.04115729033946991,
-0.9914795756340027,
0.8623201847076416,
-0.6316068768501282,
-1.1223618984222412,
-1.4537909030914307,
0.3192620873451233,
-0.22993755340576172,
0.9283134937286377,
-1.6595180034637451,
-0.08733875304460526,
1.2514073848724365,
0.8841186165809631,
-0.5474697351455688,
0.9086982011795044,
0.19942186772823334,
1.011123538017273,
0.8450766801834106,
-0.3362942337989807,
0.524515688419342,
0.07235994935035706,
-1.3154480457305908,
0.4364224970340729,
1.1195011138916016,
0.1363634616136551,
1.3723753690719604,
-0.5013875365257263,
0.037775568664073944,
0.4316612780094147,
-0.5533267259597778,
-0.48907941579818726,
-0.4997873604297638,
0.6852911710739136,
0.08062972128391266,
-1.013570785522461,
-0.06975234299898148,
-0.09405369311571121,
-0.16845208406448364,
0.2044135183095932,
-1.4582781791687012,
-0.25894737243652344,
-0.3261280059814453,
-0.4484684467315674,
-1.330014705657959,
0.0689987763762474,
1.299703598022461,
-0.7861059308052063,
-0.2349081188440323,
0.5065377354621887,
0.328580766916275,
0.5162233114242554,
0.5452449917793274,
-0.7149947285652161,
-0.29333099722862244,
-0.3198826313018799,
-0.38364771008491516,
0.2584657371044159,
1.2153432369232178,
-0.12536638975143433,
-0.9320756196975708,
0.7348420023918152,
-0.3967944085597992,
0.10752909630537033,
2.005664110183716,
0.03886076807975769,
-0.805954098701477,
0.3217465281486511,
-0.7050211429595947,
1.818147897720337,
1.6879935264587402,
1.2423142194747925,
-0.10233980417251587,
-0.8252561688423157,
0.5805153846740723,
-0.2864883542060852,
-0.3700122833251953,
0.9133087396621704,
0.41543132066726685,
-0.17950321733951569,
-1.4391814470291138,
0.6176684498786926,
1.3230960369110107,
-0.8415480852127075,
-0.7910216450691223,
0.11024528741836548,
-0.9102627038955688,
1.079403281211853,
0.6623474955558777,
0.4085792601108551,
0.16852429509162903,
1.5374397039413452,
0.7288132309913635,
-0.4599646329879761,
0.46951788663864136,
0.455910861492157,
-0.16230671107769012,
-2.1046628952026367,
-1.058676838874817,
0.2993447482585907,
-0.3487149775028229,
-1.6119880676269531,
1.3436170816421509,
-1.1713857650756836,
-0.9785284399986267,
0.5394349694252014,
0.16659541428089142,
1.3382093906402588,
0.3050794303417206,
1.697406530380249,
2.079353094100952,
0.8603568077087402,
0.3383898437023163,
1.2918070554733276,
0.0009822649881243706,
-0.4587371349334717,
1.8574341535568237,
-0.47990649938583374,
0.5941085815429688,
1.0138291120529175,
-0.3577002286911011,
-1.0640063285827637,
-0.7386326193809509,
-1.1682871580123901,
-0.6371704339981079,
1.2320032119750977,
0.11937505006790161,
-0.9996719360351562,
0.17709964513778687,
1.5833784341812134,
0.15644051134586334,
-0.21588100492954254,
0.7245688438415527,
0.43844085931777954,
-0.7287231087684631,
-0.0557127520442009,
-0.8666210770606995,
0.547211766242981,
-0.09262436628341675,
-0.2913822829723358,
0.25839313864707947,
0.544781506061554,
1.330491542816162,
-0.004849693272262812,
0.1312452256679535,
1.2733843326568604,
-1.3645528554916382,
1.5830940008163452,
-0.6330500841140747,
0.2991306781768799,
-2.5243003368377686,
1.4059361219406128,
-0.829452633857727,
1.9145150184631348,
-2.586064100265503,
0.40157419443130493,
-0.5474298596382141,
-0.49923789501190186,
0.2859051525592804,
-0.36093124747276306,
0.0930948406457901,
-0.17639276385307312,
-1.0198540687561035,
-0.0009481748566031456,
-0.7570739388465881,
0.5937613248825073,
1.250430703163147,
1.4084633588790894,
-1.1085011959075928,
-0.28096920251846313,
-1.8220125436782837,
-0.20018833875656128,
-0.7319782972335815,
0.3871273398399353,
-1.9688581228256226,
-0.1331861913204193,
-1.9349024295806885,
-2.4176104068756104,
-1.4793756008148193,
-0.8745415806770325,
1.0659412145614624,
0.17352060973644257,
-0.9915206432342529,
1.189674973487854,
-0.36494627594947815,
-1.8398399353027344,
1.0959017276763916,
-2.2618329524993896
] |
https://github.com/huggingface/datasets/issues/5060 | Unable to Use Custom Dataset Locally | `datasets` extends `open` in dataset scripts to work with URLs. The builtin `open` from python only works with local files.
You can find the extension here: https://github.com/huggingface/datasets/blob/6ad430ba0cdeeb601170f732d4bd977f5c04594d/src/datasets/download/streaming_download_manager.py#L435-L451
I think we can create a docs section dedicated to streaming to explain how this works | ## Describe the bug
I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says
```
If the data files live in the same folder or repository of the dataset script,
you can just pass the relative paths to the files instead of URLs.
```
Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs`
However, if I try to load the data using `load_dataset`, I get the following error
```
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
```
## Steps to reproduce the bug
```python
>>> from datasets import load_dataset
>>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True)
>>> t = dataset["train"]
>>> for item in t:
...... print(item)
...... break
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__
for key, example in self._iter():
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter
yield from ex_iterable
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
````
```
## Expected results
A clear and concise description of the expected results.
## Actual results
Specify the actual results or traceback.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.9.7
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 497 | 43 | Unable to Use Custom Dataset Locally
## Describe the bug
I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says
```
If the data files live in the same folder or repository of the dataset script,
you can just pass the relative paths to the files instead of URLs.
```
Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs`
However, if I try to load the data using `load_dataset`, I get the following error
```
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
```
## Steps to reproduce the bug
```python
>>> from datasets import load_dataset
>>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True)
>>> t = dataset["train"]
>>> for item in t:
...... print(item)
...... break
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__
for key, example in self._iter():
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter
yield from ex_iterable
File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples
with gzip.open(filepath, mode="rt") as f:
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "/usr/local/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz'
````
```
## Expected results
A clear and concise description of the expected results.
## Actual results
Specify the actual results or traceback.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.9.7
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
`datasets` extends `open` in dataset scripts to work with URLs. The builtin `open` from python only works with local files.
You can find the extension here: https://github.com/huggingface/datasets/blob/6ad430ba0cdeeb601170f732d4bd977f5c04594d/src/datasets/download/streaming_download_manager.py#L435-L451
I think we can create a docs section dedicated to streaming to explain how this works | [
-1.1599531173706055,
-0.8832204937934875,
-0.7926887273788452,
1.4481226205825806,
-0.08640323579311371,
-1.2975242137908936,
0.052419692277908325,
-0.9936642050743103,
1.630454182624817,
-0.7157442569732666,
0.2275511920452118,
-1.7072192430496216,
-0.07968419790267944,
-0.5546890497207642,
-0.7071906328201294,
-0.9193564057350159,
-0.3269624412059784,
-0.8373022079467773,
0.9594717621803284,
2.43070125579834,
1.2337671518325806,
-1.3324182033538818,
2.7404181957244873,
0.6621739268302917,
-0.2667407989501953,
-1.0150493383407593,
0.5538044571876526,
-0.012768726795911789,
-1.1864982843399048,
-0.4661453068256378,
-0.9648082256317139,
-0.009995653294026852,
-0.6191022396087646,
-0.4704992175102234,
0.13297545909881592,
0.39882680773735046,
-0.2125530242919922,
-0.3121466040611267,
-0.6039059162139893,
-0.7513602375984192,
0.49188295006752014,
-0.34205928444862366,
0.9579899311065674,
-0.3141942322254181,
1.762422800064087,
-0.6155754923820496,
0.36214765906333923,
0.7449967265129089,
1.2932543754577637,
0.16240297257900238,
0.10079166293144226,
0.2541562616825104,
0.3918880820274353,
0.07357043772935867,
0.4761299192905426,
1.243356466293335,
0.5936464071273804,
0.4985269606113434,
0.6783083081245422,
-2.2237279415130615,
1.2917407751083374,
-0.9219821691513062,
0.3044464588165283,
1.3672549724578857,
-0.9136558175086975,
0.3956097364425659,
-1.8564823865890503,
-0.08381421118974686,
0.6183212995529175,
-2.2799065113067627,
0.1941240429878235,
-1.2910469770431519,
-0.5610751509666443,
0.9172014594078064,
0.28032270073890686,
-1.2132045030593872,
0.2527148425579071,
-0.5139673948287964,
1.0540896654129028,
0.45788851380348206,
1.1372547149658203,
-1.675109624862671,
-0.03479255735874176,
-0.19580358266830444,
0.07307381182909012,
-1.2736471891403198,
-1.6797246932983398,
0.5644328594207764,
0.6387646794319153,
0.6471996307373047,
-0.13819149136543274,
1.0168265104293823,
-0.9691242575645447,
0.8382067680358887,
-0.8491745591163635,
-1.6949864625930786,
-1.378326654434204,
-2.2833986282348633,
-2.3048152923583984,
0.8377746939659119,
-0.5095295310020447,
-0.41354578733444214,
1.9943904876708984,
-1.0277442932128906,
-1.7366456985473633,
1.0044834613800049,
0.2872309386730194,
0.004603161476552486,
2.3869409561157227,
0.2674437463283539,
-0.7744349837303162,
0.37002432346343994,
-0.6939654350280762,
0.820540726184845,
-0.3559147119522095,
1.3334382772445679,
0.5321639180183411,
-1.0138442516326904,
1.6571879386901855,
-0.4268079996109009,
0.526933491230011,
-0.7271395921707153,
-0.46593958139419556,
-0.8278568387031555,
0.2608349323272705,
1.8860055208206177,
-0.39577245712280273,
1.6112525463104248,
-0.24568448960781097,
-1.5657801628112793,
-1.5734440088272095,
0.7782574892044067,
0.45395880937576294,
-0.8868865966796875,
0.05270712822675705,
-0.4799964129924774,
0.17291493713855743,
-0.003991363104432821,
1.1454949378967285,
1.2041264772415161,
0.6543852686882019,
-0.2885013818740845,
-0.8108148574829102,
0.22440195083618164,
-0.12185562402009964,
-0.6330059170722961,
-1.8473153114318848,
-0.3580247461795807,
0.2968515455722809,
0.6175424456596375,
-1.2797963619232178,
1.8020641803741455,
0.8462907075881958,
1.9867030382156372,
0.9756045341491699,
-0.44762179255485535,
1.4615432024002075,
0.012605587020516396,
1.8936741352081299,
-0.46776145696640015,
0.6615831255912781,
-0.3671741783618927,
-1.1882460117340088,
0.8758564591407776,
-0.35993480682373047,
-1.9417173862457275,
-0.7622092962265015,
-0.8331809639930725,
-0.14133290946483612,
-0.6993007063865662,
0.8871323466300964,
-0.3420734405517578,
-1.4239845275878906,
0.11528274416923523,
-0.6395658254623413,
0.13311506807804108,
-1.257699728012085,
0.1677771359682083,
0.7393836975097656,
-0.7531808614730835,
-0.03074650652706623,
-0.28815957903862,
-1.3332622051239014,
-0.522429347038269,
0.3259294033050537,
1.9616143703460693,
-0.6360081434249878,
1.0255125761032104,
0.986714780330658,
-0.7243082523345947,
0.1718260943889618,
0.361423134803772,
-0.3240547180175781,
0.8461601138114929,
-1.1687991619110107,
-0.43941453099250793,
1.138960361480713,
-0.23111717402935028,
-0.7540892362594604,
1.4116616249084473,
0.8363264799118042,
-1.0768890380859375,
-0.24001024663448334,
-0.20198065042495728,
-0.8336448669433594,
0.02778708003461361,
-1.597055196762085,
-0.21052157878875732,
0.3256608843803406,
-1.4582993984222412,
-0.4419180750846863,
-0.25881972908973694,
1.340052604675293,
-0.18127316236495972,
1.4591671228408813,
-0.2857219874858856,
-0.2565121352672577,
-0.40516170859336853,
-0.4716776907444,
0.16548289358615875,
-0.17100758850574493,
-0.6145942211151123,
0.312055766582489,
-0.8806542754173279,
0.2630350887775421,
1.4793647527694702,
0.28363409638404846,
0.03224063664674759,
0.5733433365821838,
1.1612224578857422,
0.3080446124076843,
-0.08266114443540573,
-0.9445991516113281,
-1.5270572900772095,
2.0010905265808105,
-1.425409197807312,
1.9181331396102905,
0.7364264726638794,
-0.08779659867286682,
-1.8153743743896484,
-1.8356839418411255,
1.3383674621582031,
1.1186007261276245,
2.439342498779297,
0.5700075030326843,
0.40890049934387207,
-0.7642672061920166,
-0.7592599987983704,
0.38609591126441956,
-0.9734148979187012,
-0.7646390795707703,
0.19970621168613434,
2.345435380935669,
1.7818992137908936,
-0.5302845239639282,
-0.3094819486141205,
-0.9599050283432007,
1.2057474851608276,
-0.26583626866340637,
0.26570144295692444,
2.0697593688964844,
-0.3411950469017029,
-1.0011718273162842,
1.2539445161819458,
-2.365257501602173,
0.16529034078121185,
2.0496113300323486,
0.28262436389923096,
0.14409296214580536,
-1.4617249965667725,
-0.6711207032203674,
-0.24996653199195862,
-0.46596086025238037,
-1.2513928413391113,
0.5423635244369507,
-0.27135327458381653,
-0.9398403763771057,
-1.3893228769302368,
0.0009434353560209274,
-1.167630910873413,
-1.7390167713165283,
0.3192313313484192,
1.9134045839309692,
2.0524117946624756,
-0.7552879452705383,
1.3889836072921753,
-0.26093441247940063,
0.06165236234664917,
1.289401650428772,
1.3767549991607666,
3.1792523860931396,
1.8953735828399658,
-1.2534630298614502,
0.7347476482391357,
-0.17590691149234772,
-0.4479139447212219,
1.1671751737594604,
-1.0915868282318115,
1.0699182748794556,
-0.3345436155796051,
-1.2706760168075562,
-1.2499756813049316,
1.0710207223892212,
0.4534110426902771,
-0.015629000961780548,
-0.5407565832138062,
1.2743672132492065,
0.0911540687084198,
1.2926836013793945,
0.6175767183303833,
-0.45709142088890076,
0.5076019763946533,
-0.35023394227027893,
-0.5453226566314697,
1.6799463033676147,
0.14787663519382477,
-1.4741450548171997,
-2.306654214859009,
-0.24120908975601196,
-0.9378896951675415,
-0.06549806892871857,
-0.6321977376937866,
-1.0333597660064697,
1.609278678894043,
0.418491929769516,
-1.2479442358016968,
-0.27134403586387634,
-0.36614054441452026,
-0.5977646708488464,
2.5988035202026367,
-1.2969903945922852,
-0.16110743582248688,
-0.9712148904800415,
-0.49294212460517883,
1.6124134063720703,
-1.1470445394515991,
-0.2054944932460785,
-1.0419142246246338,
-0.6531163454055786,
-1.3510996103286743,
-0.4650801420211792,
0.07983478158712387,
-0.8976430892944336,
0.760857105255127,
0.042907968163490295,
-1.0652830600738525,
-0.21243491768836975,
-0.8514769673347473,
0.968434751033783,
-0.1165088564157486,
0.20514416694641113,
1.9146357774734497,
0.3978818655014038,
-0.41726014018058777,
0.7391677498817444,
1.125542402267456,
0.6895929574966431,
-0.6157598495483398,
0.16891753673553467,
-0.6610045433044434,
0.24531826376914978,
-1.423783779144287,
0.2429959774017334,
-2.9070534706115723,
0.7435224056243896,
-0.14398224651813507,
-0.09249775111675262,
0.0033473968505859375,
-1.2757625579833984,
0.99430251121521,
2.6050527095794678,
-1.189275860786438,
0.4085655212402344,
0.34657809138298035,
1.1655919551849365,
-1.5844955444335938,
0.2548030912876129,
-0.49284639954566956,
2.072544574737549,
0.11896897852420807,
1.1691182851791382,
-0.5104653239250183,
-2.1808066368103027,
0.6038888692855835,
-1.2212697267532349,
-0.9600241184234619,
0.9012254476547241,
-0.7938539385795593,
0.2191649228334427,
-1.4064959287643433,
-0.1419440060853958,
-0.913006603717804,
-1.2998192310333252,
0.8210064768791199,
0.08053506165742874,
0.4934426248073578,
-0.5503237843513489,
0.379387766122818,
-2.0930826663970947,
-1.3411650657653809,
-0.23022738099098206,
-0.9991695284843445,
0.5195143818855286,
-0.32211175560951233,
0.6557027697563171,
-0.07046966254711151,
0.10680154711008072,
0.27622801065444946,
1.4134994745254517,
3.4041435718536377,
0.14062009751796722,
0.21533317863941193,
-0.11578819900751114,
-0.9698457717895508,
1.414471983909607,
0.980476438999176,
-0.130156472325325,
-0.6499751806259155,
-1.0307831764221191,
1.291959285736084,
2.016864776611328,
1.1351029872894287,
0.20010070502758026,
-0.8699898719787598,
-0.7704647183418274,
0.022114576771855354,
0.22247305512428284,
0.569118320941925,
0.9115040898323059,
-0.044283390045166016,
0.110776387155056,
1.3876893520355225,
1.2150095701217651,
-0.2629190981388092,
0.39403054118156433,
-0.9693810939788818,
-0.4136784076690674,
0.45554816722869873,
0.22475403547286987,
0.1039111390709877,
0.4187837839126587,
-1.1249096393585205,
-0.2924586534500122,
-0.2993539273738861,
-0.9612467885017395,
-0.7271600961685181,
-0.38115182518959045,
-0.4094609022140503,
1.5900925397872925,
0.05629865080118179,
-0.5005894303321838,
0.01870524324476719,
-0.696627140045166,
-0.1419655829668045,
-1.0638412237167358,
0.20627425611019135,
-0.07330460846424103,
-0.044247500598430634,
-0.16374999284744263,
1.717194676399231,
-0.9315411448478699,
-2.1651885509490967,
0.2259054332971573,
0.2501697838306427,
-0.4378006160259247,
0.14256910979747772,
1.7419313192367554,
0.5256298184394836,
1.3684412240982056,
1.2866129875183105,
0.9981094598770142,
-0.5816152095794678,
-1.2245674133300781,
0.6464868187904358,
0.9438194632530212,
-1.3935004472732544,
0.9460755586624146,
-0.20365434885025024,
-0.5124761462211609,
0.7017033696174622,
1.2851824760437012,
0.35703572630882263,
-2.0288379192352295,
0.8464350700378418,
-0.9285821318626404,
0.7524464130401611,
0.6660990715026855,
0.8352888226509094,
0.27282583713531494,
0.8693289756774902,
-1.2333734035491943,
-1.0922070741653442,
-0.6820957064628601,
-0.5680295825004578,
1.9552180767059326,
-0.11413872987031937,
0.5044447779655457,
-0.15259243547916412,
-1.2633568048477173,
-0.13114388287067413,
0.7750524878501892,
0.3771117031574249,
-0.39705953001976013,
0.9028304815292358,
-0.6568604707717896,
-0.9720158576965332,
-1.312097191810608,
-0.47519952058792114,
-1.017914891242981,
-0.9154948592185974,
1.0089045763015747,
0.8238838911056519,
0.4499119818210602,
1.924628496170044,
0.5590946078300476,
0.28212711215019226,
-2.6597981452941895,
0.9073570966720581,
0.34429696202278137,
-0.07173394411802292,
0.8984972238540649,
0.23280315101146698,
1.1741352081298828,
-0.07435624301433563,
0.5927035212516785,
-2.3183679580688477,
2.206918478012085,
-0.21580752730369568,
0.6646187901496887,
0.07047295570373535,
-0.2064519226551056,
1.094822645187378,
0.5388506054878235,
0.6034104824066162,
-1.050142526626587,
0.7557433247566223,
-0.6043292880058289,
1.0905241966247559,
0.932344913482666,
-0.9059374332427979,
0.06623584032058716,
1.4134650230407715,
0.49570325016975403,
-0.3910103738307953,
-0.9161400198936462,
-0.848978579044342,
0.940642237663269,
1.738348126411438,
-0.024283306673169136,
0.00845232605934143,
0.8860236406326294,
0.6504519581794739,
-1.230729579925537,
0.12559624016284943,
-0.730343222618103,
-0.6279548406600952,
1.6932692527770996,
1.9435758590698242,
-0.1110256090760231,
-0.13485562801361084,
-0.7715292572975159,
-1.2465431690216064,
0.7545424103736877,
-0.052565738558769226,
0.07530371844768524,
0.7518282532691956,
-0.7259292602539062,
1.1673485040664673,
0.6382168531417847,
0.9391353726387024,
0.05791071057319641,
0.33397355675697327,
0.34453898668289185,
-0.34268808364868164,
-1.1781818866729736,
-0.3895254135131836,
-1.0471653938293457,
-2.5892083644866943,
0.4777570068836212,
-0.22079956531524658,
-1.4398373365402222,
0.04115729033946991,
-0.9914795756340027,
0.8623201847076416,
-0.6316068768501282,
-1.1223618984222412,
-1.4537909030914307,
0.3192620873451233,
-0.22993755340576172,
0.9283134937286377,
-1.6595180034637451,
-0.08733875304460526,
1.2514073848724365,
0.8841186165809631,
-0.5474697351455688,
0.9086982011795044,
0.19942186772823334,
1.011123538017273,
0.8450766801834106,
-0.3362942337989807,
0.524515688419342,
0.07235994935035706,
-1.3154480457305908,
0.4364224970340729,
1.1195011138916016,
0.1363634616136551,
1.3723753690719604,
-0.5013875365257263,
0.037775568664073944,
0.4316612780094147,
-0.5533267259597778,
-0.48907941579818726,
-0.4997873604297638,
0.6852911710739136,
0.08062972128391266,
-1.013570785522461,
-0.06975234299898148,
-0.09405369311571121,
-0.16845208406448364,
0.2044135183095932,
-1.4582781791687012,
-0.25894737243652344,
-0.3261280059814453,
-0.4484684467315674,
-1.330014705657959,
0.0689987763762474,
1.299703598022461,
-0.7861059308052063,
-0.2349081188440323,
0.5065377354621887,
0.328580766916275,
0.5162233114242554,
0.5452449917793274,
-0.7149947285652161,
-0.29333099722862244,
-0.3198826313018799,
-0.38364771008491516,
0.2584657371044159,
1.2153432369232178,
-0.12536638975143433,
-0.9320756196975708,
0.7348420023918152,
-0.3967944085597992,
0.10752909630537033,
2.005664110183716,
0.03886076807975769,
-0.805954098701477,
0.3217465281486511,
-0.7050211429595947,
1.818147897720337,
1.6879935264587402,
1.2423142194747925,
-0.10233980417251587,
-0.8252561688423157,
0.5805153846740723,
-0.2864883542060852,
-0.3700122833251953,
0.9133087396621704,
0.41543132066726685,
-0.17950321733951569,
-1.4391814470291138,
0.6176684498786926,
1.3230960369110107,
-0.8415480852127075,
-0.7910216450691223,
0.11024528741836548,
-0.9102627038955688,
1.079403281211853,
0.6623474955558777,
0.4085792601108551,
0.16852429509162903,
1.5374397039413452,
0.7288132309913635,
-0.4599646329879761,
0.46951788663864136,
0.455910861492157,
-0.16230671107769012,
-2.1046628952026367,
-1.058676838874817,
0.2993447482585907,
-0.3487149775028229,
-1.6119880676269531,
1.3436170816421509,
-1.1713857650756836,
-0.9785284399986267,
0.5394349694252014,
0.16659541428089142,
1.3382093906402588,
0.3050794303417206,
1.697406530380249,
2.079353094100952,
0.8603568077087402,
0.3383898437023163,
1.2918070554733276,
0.0009822649881243706,
-0.4587371349334717,
1.8574341535568237,
-0.47990649938583374,
0.5941085815429688,
1.0138291120529175,
-0.3577002286911011,
-1.0640063285827637,
-0.7386326193809509,
-1.1682871580123901,
-0.6371704339981079,
1.2320032119750977,
0.11937505006790161,
-0.9996719360351562,
0.17709964513778687,
1.5833784341812134,
0.15644051134586334,
-0.21588100492954254,
0.7245688438415527,
0.43844085931777954,
-0.7287231087684631,
-0.0557127520442009,
-0.8666210770606995,
0.547211766242981,
-0.09262436628341675,
-0.2913822829723358,
0.25839313864707947,
0.544781506061554,
1.330491542816162,
-0.004849693272262812,
0.1312452256679535,
1.2733843326568604,
-1.3645528554916382,
1.5830940008163452,
-0.6330500841140747,
0.2991306781768799,
-2.5243003368377686,
1.4059361219406128,
-0.829452633857727,
1.9145150184631348,
-2.586064100265503,
0.40157419443130493,
-0.5474298596382141,
-0.49923789501190186,
0.2859051525592804,
-0.36093124747276306,
0.0930948406457901,
-0.17639276385307312,
-1.0198540687561035,
-0.0009481748566031456,
-0.7570739388465881,
0.5937613248825073,
1.250430703163147,
1.4084633588790894,
-1.1085011959075928,
-0.28096920251846313,
-1.8220125436782837,
-0.20018833875656128,
-0.7319782972335815,
0.3871273398399353,
-1.9688581228256226,
-0.1331861913204193,
-1.9349024295806885,
-2.4176104068756104,
-1.4793756008148193,
-0.8745415806770325,
1.0659412145614624,
0.17352060973644257,
-0.9915206432342529,
1.189674973487854,
-0.36494627594947815,
-1.8398399353027344,
1.0959017276763916,
-2.2618329524993896
] |
https://github.com/huggingface/datasets/issues/5053 | Intermittent JSON parse error when streaming the Pile | Maybe #2838 can help. In this PR we allow to skip bad chunks of JSON data to not crash the training
Did you have warning messages before the error ?
something like this maybe ?
```
03/24/2022 02:19:46 - WARNING - datasets.utils.streaming_download_manager - Got disconnected from remote data host. Retrying in 5sec [1/20]
03/24/2022 02:20:01 - WARNING - datasets.utils.streaming_download_manager - Got disconnected from remote data host. Retrying in 5sec [2/20]
03/24/2022 02:20:09 - ERROR - datasets.packaged_modules.json.json - Failed to read file 'gzip://file-000000000007.json::https://huggingface.co/datasets/lvwerra/codeparrot-clean-train/resolve/1d740acb9d09cf7a3307553323e2c677a6535407/file-000000000007.json.gz' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0
``` | ## Describe the bug
I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash.
This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it.
I'm using a remote machine with 8 A6000 GPUs via runpod.io
## Expected results
I have a DataLoader which can iterate through the whole Pile
## Actual results
Stack trace:
```
Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0
```
I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation
```
Traceback (most recent call last):
File "ddp_script.py", line 1258, in <module>
main()
File "ddp_script.py", line 1143, in main
for c, batch in tqdm.tqdm(enumerate(data_iter)):
File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__
for obj in iterable:
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__
next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator)
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches
broadcast_object_list(batch_info)
File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list
torch.distributed.broadcast_object_list(object_list, src=from_process)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list
object_list[i] = _tensor_to_object(obj_view, obj_size)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object
return _unpickler(io.BytesIO(buf)).load()
_pickle.UnpicklingError: invalid load key, '@'.
```
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset(
cfg["dataset_name"], streaming=True, split="train")
dataset = dataset.remove_columns("meta")
dataset = dataset.map(tokenize_and_concatenate, batched=True)
dataset = dataset.with_format(type="torch")
train_data_loader = DataLoader(
dataset, batch_size=cfg["batch_size"], num_workers=3)
for batch in train_data_loader:
continue
```
`tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization:
```
import numpy as np
import einops
import torch
def tokenize_and_concatenate(examples):
texts = examples["text"]
full_text = tokenizer.eos_token.join(texts)
div = 20
length = len(full_text) // div
text_list = [full_text[i * length: (i + 1) * length]
for i in range(div)]
tokens = tokenizer(text_list, return_tensors="np", padding=True)[
"input_ids"
].flatten()
tokens = tokens[tokens != tokenizer.pad_token_id]
n = len(tokens)
curr_batch_size = n // (seq_len - 1)
tokens = tokens[: (seq_len - 1) * curr_batch_size]
tokens = einops.rearrange(
tokens,
"(batch_size seq) -> batch_size seq",
batch_size=curr_batch_size,
seq=seq_len - 1,
)
prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \
tokenizer.bos_token_id
return {
"text": np.concatenate([prefix, tokens], axis=1)
}
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.13
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
ZStandard data:
Version: 0.18.0
Summary: Zstandard bindings for Python
Home-page: https://github.com/indygreg/python-zstandard
Author: Gregory Szorc
Author-email: [email protected]
License: BSD
Location: /opt/conda/lib/python3.7/site-packages
Requires:
Required-by: | 498 | 95 | Intermittent JSON parse error when streaming the Pile
## Describe the bug
I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash.
This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it.
I'm using a remote machine with 8 A6000 GPUs via runpod.io
## Expected results
I have a DataLoader which can iterate through the whole Pile
## Actual results
Stack trace:
```
Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0
```
I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation
```
Traceback (most recent call last):
File "ddp_script.py", line 1258, in <module>
main()
File "ddp_script.py", line 1143, in main
for c, batch in tqdm.tqdm(enumerate(data_iter)):
File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__
for obj in iterable:
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__
next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator)
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches
broadcast_object_list(batch_info)
File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list
torch.distributed.broadcast_object_list(object_list, src=from_process)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list
object_list[i] = _tensor_to_object(obj_view, obj_size)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object
return _unpickler(io.BytesIO(buf)).load()
_pickle.UnpicklingError: invalid load key, '@'.
```
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset(
cfg["dataset_name"], streaming=True, split="train")
dataset = dataset.remove_columns("meta")
dataset = dataset.map(tokenize_and_concatenate, batched=True)
dataset = dataset.with_format(type="torch")
train_data_loader = DataLoader(
dataset, batch_size=cfg["batch_size"], num_workers=3)
for batch in train_data_loader:
continue
```
`tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization:
```
import numpy as np
import einops
import torch
def tokenize_and_concatenate(examples):
texts = examples["text"]
full_text = tokenizer.eos_token.join(texts)
div = 20
length = len(full_text) // div
text_list = [full_text[i * length: (i + 1) * length]
for i in range(div)]
tokens = tokenizer(text_list, return_tensors="np", padding=True)[
"input_ids"
].flatten()
tokens = tokens[tokens != tokenizer.pad_token_id]
n = len(tokens)
curr_batch_size = n // (seq_len - 1)
tokens = tokens[: (seq_len - 1) * curr_batch_size]
tokens = einops.rearrange(
tokens,
"(batch_size seq) -> batch_size seq",
batch_size=curr_batch_size,
seq=seq_len - 1,
)
prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \
tokenizer.bos_token_id
return {
"text": np.concatenate([prefix, tokens], axis=1)
}
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.13
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
ZStandard data:
Version: 0.18.0
Summary: Zstandard bindings for Python
Home-page: https://github.com/indygreg/python-zstandard
Author: Gregory Szorc
Author-email: [email protected]
License: BSD
Location: /opt/conda/lib/python3.7/site-packages
Requires:
Required-by:
Maybe #2838 can help. In this PR we allow to skip bad chunks of JSON data to not crash the training
Did you have warning messages before the error ?
something like this maybe ?
```
03/24/2022 02:19:46 - WARNING - datasets.utils.streaming_download_manager - Got disconnected from remote data host. Retrying in 5sec [1/20]
03/24/2022 02:20:01 - WARNING - datasets.utils.streaming_download_manager - Got disconnected from remote data host. Retrying in 5sec [2/20]
03/24/2022 02:20:09 - ERROR - datasets.packaged_modules.json.json - Failed to read file 'gzip://file-000000000007.json::https://huggingface.co/datasets/lvwerra/codeparrot-clean-train/resolve/1d740acb9d09cf7a3307553323e2c677a6535407/file-000000000007.json.gz' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0
``` | [
-1.2191113233566284,
-0.9156204462051392,
-0.7389153838157654,
1.5429012775421143,
-0.12181570380926132,
-1.2346680164337158,
0.13972830772399902,
-1.0470380783081055,
1.591078281402588,
-0.729797899723053,
0.2936500310897827,
-1.6115782260894775,
-0.00279034860432148,
-0.5238010287284851,
-0.720940887928009,
-0.8774689435958862,
-0.28591087460517883,
-0.8879272937774658,
1.0772978067398071,
2.518803358078003,
1.2589366436004639,
-1.4383103847503662,
2.7704124450683594,
0.6237699389457703,
-0.1954907476902008,
-1.061689019203186,
0.5653862953186035,
-0.04299786686897278,
-1.2091938257217407,
-0.5265007019042969,
-0.9053720235824585,
-0.11411307752132416,
-0.618169903755188,
-0.4119351804256439,
0.0709003210067749,
0.450403094291687,
-0.22259873151779175,
-0.3509442210197449,
-0.5695215463638306,
-0.7302826046943665,
0.5018925666809082,
-0.3856104016304016,
0.9687541127204895,
-0.2748778164386749,
1.7889574766159058,
-0.5797628164291382,
0.40413665771484375,
0.7866300344467163,
1.3558224439620972,
0.2044781595468521,
0.043033719062805176,
0.24266113340854645,
0.34846800565719604,
0.002807709388434887,
0.5452602505683899,
1.122096061706543,
0.6085554361343384,
0.5069047808647156,
0.6622787117958069,
-2.2118353843688965,
1.2946594953536987,
-1.003332495689392,
0.28618350625038147,
1.2530171871185303,
-0.9298065900802612,
0.36867570877075195,
-1.8287379741668701,
-0.0886266827583313,
0.6281752586364746,
-2.2374393939971924,
0.2881385087966919,
-1.2812635898590088,
-0.4939998686313629,
0.9304503798484802,
0.2580527067184448,
-1.2735024690628052,
0.11709436774253845,
-0.46546611189842224,
1.0607107877731323,
0.3867669105529785,
1.095651626586914,
-1.6985507011413574,
-0.041627757251262665,
-0.2432524710893631,
0.15718498826026917,
-1.2403335571289062,
-1.5833380222320557,
0.535782516002655,
0.5782720446586609,
0.6202570796012878,
-0.10504209995269775,
1.0087146759033203,
-1.0798431634902954,
0.8521778583526611,
-0.9699952602386475,
-1.5921708345413208,
-1.436285376548767,
-2.3582160472869873,
-2.311224937438965,
0.7729031443595886,
-0.5273078680038452,
-0.482120156288147,
2.0947163105010986,
-0.9920226335525513,
-1.7114670276641846,
1.1561908721923828,
0.2628895938396454,
0.026435963809490204,
2.408498525619507,
0.17765295505523682,
-0.7524499893188477,
0.48309677839279175,
-0.7561836242675781,
0.8157228231430054,
-0.4418449401855469,
1.3043419122695923,
0.4251973032951355,
-0.9142493009567261,
1.5805437564849854,
-0.4373943507671356,
0.604282557964325,
-0.6897341012954712,
-0.49209079146385193,
-0.8100910186767578,
0.3038685619831085,
1.9486163854599,
-0.2757244110107422,
1.513746738433838,
-0.22935152053833008,
-1.5529406070709229,
-1.5285778045654297,
0.8861242532730103,
0.4311331808567047,
-0.8818513751029968,
0.11975935101509094,
-0.4418952465057373,
0.21341009438037872,
-0.027223847806453705,
1.1213104724884033,
1.2481590509414673,
0.7316437363624573,
-0.26900604367256165,
-0.9249610900878906,
0.2183573842048645,
-0.1877463161945343,
-0.6984044313430786,
-1.8268409967422485,
-0.36512815952301025,
0.14287084341049194,
0.6438822746276855,
-1.20779287815094,
1.7921112775802612,
0.8872368335723877,
1.9683853387832642,
0.9868384599685669,
-0.364469975233078,
1.5120141506195068,
0.02941155806183815,
1.9000561237335205,
-0.4988453686237335,
0.582719087600708,
-0.45301228761672974,
-1.133462905883789,
0.8479575514793396,
-0.357129842042923,
-1.9348591566085815,
-0.7416850924491882,
-0.7690762281417847,
-0.1996084451675415,
-0.7142690420150757,
0.8773180246353149,
-0.3551708459854126,
-1.4267042875289917,
0.22767487168312073,
-0.683142900466919,
0.13970161974430084,
-1.2263809442520142,
0.3112972676753998,
0.653246283531189,
-0.6133058071136475,
0.03978462889790535,
-0.30045032501220703,
-1.2890647649765015,
-0.5152468085289001,
0.34741586446762085,
1.9597959518432617,
-0.663115918636322,
0.9306424856185913,
0.9954590201377869,
-0.6804344058036804,
0.06032177805900574,
0.3030819892883301,
-0.36498481035232544,
0.785775899887085,
-1.1419153213500977,
-0.4955969750881195,
1.1613136529922485,
-0.296647310256958,
-0.6346798539161682,
1.4121299982070923,
0.7839541435241699,
-1.0917636156082153,
-0.2275020331144333,
-0.18904544413089752,
-0.8223744630813599,
0.08951814472675323,
-1.594362735748291,
-0.1367211490869522,
0.39408156275749207,
-1.5192458629608154,
-0.4939413368701935,
-0.17729692161083221,
1.298814058303833,
-0.1397106796503067,
1.428389310836792,
-0.32013604044914246,
-0.12781868875026703,
-0.31033337116241455,
-0.49865424633026123,
0.17277435958385468,
-0.17207345366477966,
-0.5202435255050659,
0.18255281448364258,
-0.7785977125167847,
0.27564311027526855,
1.487248182296753,
0.2942625880241394,
0.03874259069561958,
0.47394028306007385,
1.085066795349121,
0.44217410683631897,
-0.006666968110948801,
-0.9098306894302368,
-1.4717705249786377,
2.0264554023742676,
-1.5045983791351318,
2.025583505630493,
0.8354787826538086,
-0.012473931536078453,
-1.7913405895233154,
-1.7952635288238525,
1.3357900381088257,
1.0847994089126587,
2.3593385219573975,
0.5204823613166809,
0.4121226966381073,
-0.8287284970283508,
-0.6589127779006958,
0.2951476573944092,
-1.029312252998352,
-0.7335090041160583,
0.13664524257183075,
2.401451826095581,
1.767465591430664,
-0.4919847249984741,
-0.17628639936447144,
-0.857226550579071,
1.3348641395568848,
-0.212080180644989,
0.25794845819473267,
2.0466549396514893,
-0.22773009538650513,
-1.0523043870925903,
1.1862717866897583,
-2.4132208824157715,
0.19112862646579742,
2.089878797531128,
0.31559720635414124,
0.1507394015789032,
-1.4448168277740479,
-0.6374940872192383,
-0.24356500804424286,
-0.4350726008415222,
-1.2224153280258179,
0.5832535028457642,
-0.25445953011512756,
-0.8367152810096741,
-1.456840991973877,
0.1179356724023819,
-1.145835518836975,
-1.7384406328201294,
0.23201881349086761,
1.8904603719711304,
2.146355152130127,
-0.8463751673698425,
1.5106580257415771,
-0.3063041865825653,
0.1146715059876442,
1.2712457180023193,
1.205582618713379,
3.1439497470855713,
1.8807810544967651,
-1.2337121963500977,
0.6128384470939636,
-0.28207921981811523,
-0.5072899460792542,
1.1036666631698608,
-1.165204405784607,
1.14589524269104,
-0.19588181376457214,
-1.1283180713653564,
-1.1934012174606323,
1.0227556228637695,
0.47873836755752563,
-0.00813994649797678,
-0.46979227662086487,
1.2460235357284546,
0.12890294194221497,
1.3218157291412354,
0.5425217747688293,
-0.29975929856300354,
0.5136103630065918,
-0.3933422863483429,
-0.5385788083076477,
1.6671078205108643,
0.2174299955368042,
-1.496058464050293,
-2.31242036819458,
-0.25382035970687866,
-0.8978428244590759,
0.04516017064452171,
-0.6211386919021606,
-1.0173883438110352,
1.5800011157989502,
0.30861857533454895,
-1.169174313545227,
-0.28984829783439636,
-0.355847030878067,
-0.600735068321228,
2.638139486312866,
-1.326196551322937,
-0.23349574208259583,
-0.902152419090271,
-0.5921874642372131,
1.6111159324645996,
-1.2738862037658691,
-0.24712203443050385,
-1.0464595556259155,
-0.6012017130851746,
-1.232864499092102,
-0.4939861595630646,
0.042526841163635254,
-0.912719190120697,
0.7836614847183228,
0.2434188276529312,
-1.1842759847640991,
-0.2737334072589874,
-0.9273951649665833,
0.9211450219154358,
-0.015157556161284447,
0.2156122624874115,
1.835759162902832,
0.2930334806442261,
-0.42802292108535767,
0.7805541157722473,
1.1716134548187256,
0.6196908354759216,
-0.688716471195221,
0.1079103872179985,
-0.6859329342842102,
0.3255971372127533,
-1.3419365882873535,
0.23278017342090607,
-2.913660764694214,
0.6889317631721497,
-0.08375991880893707,
-0.10992290079593658,
-0.07707717269659042,
-1.2609171867370605,
1.0920898914337158,
2.6357312202453613,
-1.1123487949371338,
0.5038865208625793,
0.39164671301841736,
1.263143539428711,
-1.6403460502624512,
0.3484712541103363,
-0.43565911054611206,
2.1413309574127197,
0.1845710575580597,
1.2162058353424072,
-0.465851753950119,
-2.394157886505127,
0.6152612566947937,
-1.2493916749954224,
-1.0900973081588745,
0.7722745537757874,
-0.8762367367744446,
0.09584417194128036,
-1.427474856376648,
-0.1484108865261078,
-0.887164294719696,
-1.2448567152023315,
0.7042757868766785,
0.16366513073444366,
0.40421730279922485,
-0.5870957970619202,
0.3111123740673065,
-2.168240785598755,
-1.4431405067443848,
-0.19808928668498993,
-0.9832085371017456,
0.4723881781101227,
-0.4540335536003113,
0.6756823062896729,
-0.14662612974643707,
0.08181830495595932,
0.3488982617855072,
1.5119297504425049,
3.3888628482818604,
0.11025795340538025,
0.36904412508010864,
-0.19859746098518372,
-0.9824867248535156,
1.4610832929611206,
0.881545901298523,
-0.2134321630001068,
-0.5750620365142822,
-1.0447832345962524,
1.2847036123275757,
2.0607051849365234,
1.0276364088058472,
0.11874222755432129,
-0.8010240793228149,
-0.6814361214637756,
-0.07921436429023743,
0.162919282913208,
0.5264397263526917,
0.9426724314689636,
-0.03120248019695282,
0.03005237877368927,
1.4195830821990967,
1.1871087551116943,
-0.35107359290122986,
0.35539424419403076,
-0.9040112495422363,
-0.3713434040546417,
0.4657585918903351,
0.24973289668560028,
0.010696259327232838,
0.38097134232521057,
-0.956432580947876,
-0.30468589067459106,
-0.33852699398994446,
-0.9007614254951477,
-0.7440593838691711,
-0.4423683285713196,
-0.32972005009651184,
1.704506754875183,
0.13833148777484894,
-0.5217041373252869,
0.04261660575866699,
-0.6782217025756836,
-0.06149120628833771,
-1.130866289138794,
0.09556396305561066,
-0.14445607364177704,
-0.10851576924324036,
-0.10481437295675278,
1.7503339052200317,
-0.9387463331222534,
-2.138899087905884,
0.1954951137304306,
0.27224376797676086,
-0.2971554696559906,
0.22108671069145203,
1.7099807262420654,
0.4866676926612854,
1.3842297792434692,
1.3214685916900635,
0.9813061356544495,
-0.6631098985671997,
-1.276108980178833,
0.7457456588745117,
1.001458764076233,
-1.3593697547912598,
0.8572913408279419,
-0.11373298615217209,
-0.5224976539611816,
0.6489959955215454,
1.2849527597427368,
0.44516754150390625,
-2.052284002304077,
0.8394718170166016,
-0.9803959131240845,
0.8082391023635864,
0.6803008317947388,
0.6926944255828857,
0.2520177960395813,
0.8492142558097839,
-1.1753789186477661,
-1.115705966949463,
-0.7182711362838745,
-0.7371697425842285,
1.9881428480148315,
-0.231907919049263,
0.5365510582923889,
-0.13233554363250732,
-1.2855035066604614,
-0.09078996628522873,
0.7134495377540588,
0.36092790961265564,
-0.4075171947479248,
0.8000345826148987,
-0.7221972346305847,
-1.0660582780838013,
-1.3315749168395996,
-0.430756539106369,
-1.0566524267196655,
-1.0001169443130493,
1.0562061071395874,
0.7400211691856384,
0.3682767152786255,
1.9063982963562012,
0.6942290663719177,
0.28312352299690247,
-2.550290107727051,
0.9019937515258789,
0.3111255168914795,
-0.09435924142599106,
0.8595073223114014,
0.2594820261001587,
1.100785493850708,
-0.022937562316656113,
0.5822885632514954,
-2.331354856491089,
2.2924201488494873,
-0.2216770350933075,
0.7120442986488342,
0.07510881125926971,
-0.2544063627719879,
1.1110856533050537,
0.5423018932342529,
0.5756866931915283,
-1.0789979696273804,
0.6528425812721252,
-0.6127087473869324,
1.215514063835144,
0.9176843762397766,
-0.8557487726211548,
0.047077473253011703,
1.315967082977295,
0.44641807675361633,
-0.539249062538147,
-0.9975607395172119,
-0.9169594049453735,
0.9727256298065186,
1.71586012840271,
-0.07392919808626175,
-0.012660006061196327,
0.8232237100601196,
0.614736795425415,
-1.190904974937439,
0.047056470066308975,
-0.7543500065803528,
-0.792529821395874,
1.6686371564865112,
2.056464433670044,
-0.16504274308681488,
-0.1827690601348877,
-0.7574935555458069,
-1.3409453630447388,
0.7751039862632751,
-0.07645496726036072,
0.0939725860953331,
0.6326501965522766,
-0.6486917734146118,
1.0778127908706665,
0.7456876039505005,
1.035041093826294,
0.10662097483873367,
0.25752896070480347,
0.3515438735485077,
-0.4244159758090973,
-1.1118192672729492,
-0.30871132016181946,
-1.0954725742340088,
-2.5566153526306152,
0.4236915409564972,
-0.17668463289737701,
-1.4720395803451538,
0.0588371604681015,
-0.96457839012146,
0.9562774300575256,
-0.5648408532142639,
-1.0844838619232178,
-1.419722318649292,
0.27405229210853577,
-0.23732124269008636,
0.9004951119422913,
-1.6580686569213867,
-0.17943023145198822,
1.2477405071258545,
0.9067879915237427,
-0.6208553910255432,
1.0224714279174805,
0.2283526510000229,
1.0159194469451904,
0.7787153720855713,
-0.40725719928741455,
0.5660700798034668,
0.06737607717514038,
-1.318454384803772,
0.46088525652885437,
1.1721136569976807,
0.199560284614563,
1.4496965408325195,
-0.4853820502758026,
0.002379431389272213,
0.3952271044254303,
-0.6261102557182312,
-0.5325931310653687,
-0.5073496103286743,
0.7612929940223694,
-0.006029264070093632,
-0.9745800495147705,
-0.03959942236542702,
-0.1372929960489273,
-0.21018756926059723,
0.1765913963317871,
-1.5320194959640503,
-0.20299623906612396,
-0.3770276606082916,
-0.4868222177028656,
-1.3110454082489014,
0.01502563152462244,
1.3780953884124756,
-0.7282369136810303,
-0.2526996433734894,
0.3917868733406067,
0.455919086933136,
0.5136627554893494,
0.5778684616088867,
-0.7281674742698669,
-0.348836213350296,
-0.2477787733078003,
-0.35777175426483154,
0.288227379322052,
1.2873952388763428,
-0.07287680357694626,
-0.9216547012329102,
0.664555549621582,
-0.38405054807662964,
0.1544116884469986,
1.9386534690856934,
0.12327568233013153,
-0.7507631182670593,
0.3366105258464813,
-0.7204040288925171,
1.8517464399337769,
1.659456729888916,
1.254983901977539,
-0.1004992425441742,
-0.8170977234840393,
0.6662321090698242,
-0.3429369032382965,
-0.3663859963417053,
0.8210203647613525,
0.42419424653053284,
-0.2706078588962555,
-1.4599190950393677,
0.6216173768043518,
1.2584258317947388,
-0.7549421787261963,
-0.8114931583404541,
0.0828925222158432,
-0.8018436431884766,
1.167971134185791,
0.655950665473938,
0.4639568328857422,
0.23279908299446106,
1.632743239402771,
0.7943997383117676,
-0.600450336933136,
0.5560333132743835,
0.4917180836200714,
-0.19794811308383942,
-2.1102659702301025,
-1.1144917011260986,
0.31557565927505493,
-0.490113228559494,
-1.578315258026123,
1.4198484420776367,
-1.0746270418167114,
-0.9671279191970825,
0.5685468316078186,
0.063133604824543,
1.3644464015960693,
0.360385537147522,
1.5839976072311401,
2.0526857376098633,
0.8472216129302979,
0.44212907552719116,
1.2005943059921265,
-0.17333528399467468,
-0.5461134314537048,
1.9211198091506958,
-0.3964235782623291,
0.4794475734233856,
1.060426950454712,
-0.3554094135761261,
-1.0476047992706299,
-0.8329038619995117,
-1.1426756381988525,
-0.6694195866584778,
1.1523077487945557,
0.12385915219783783,
-1.0979629755020142,
0.24456222355365753,
1.6203614473342896,
0.16575270891189575,
-0.3235507905483246,
0.6864588856697083,
0.4071302115917206,
-0.7379087209701538,
-0.018652789294719696,
-0.8755087852478027,
0.5096253752708435,
-0.20360003411769867,
-0.37452933192253113,
0.3556095063686371,
0.5306294560432434,
1.33039128780365,
-0.015990525484085083,
0.1035160943865776,
1.1474906206130981,
-1.4232511520385742,
1.4780927896499634,
-0.636873185634613,
0.32676059007644653,
-2.329059362411499,
1.34224534034729,
-0.7493369579315186,
1.9838658571243286,
-2.6034457683563232,
0.4038888216018677,
-0.6182806491851807,
-0.4647480249404907,
0.28312063217163086,
-0.3728730082511902,
0.12721599638462067,
-0.15886341035366058,
-1.0085229873657227,
-0.014422274194657803,
-0.7146932482719421,
0.6060628294944763,
1.1438319683074951,
1.3706448078155518,
-1.0529481172561646,
-0.2472625970840454,
-1.7477442026138306,
-0.1432034969329834,
-0.7422771453857422,
0.2737634778022766,
-2.0297045707702637,
-0.21480117738246918,
-2.0034971237182617,
-2.193467140197754,
-1.3753567934036255,
-0.8936824202537537,
1.0960465669631958,
0.2091684639453888,
-0.9031140208244324,
1.193304419517517,
-0.32622912526130676,
-1.7863287925720215,
1.1140077114105225,
-2.095116138458252
] |
https://github.com/huggingface/datasets/issues/5053 | Intermittent JSON parse error when streaming the Pile | Ah, thanks! I did get errors like that. Sad that PR wasn't merged in!
I'm currently just downloading 200GB of the Pile locally to avoid streaming (I have space and it's faster anyway), but that's really useful! I can probably apply the dumb patch of just commenting out the bits that raise the JSON Parse Error lol, based on your code - if I continue the loop should it be fine? | ## Describe the bug
I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash.
This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it.
I'm using a remote machine with 8 A6000 GPUs via runpod.io
## Expected results
I have a DataLoader which can iterate through the whole Pile
## Actual results
Stack trace:
```
Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0
```
I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation
```
Traceback (most recent call last):
File "ddp_script.py", line 1258, in <module>
main()
File "ddp_script.py", line 1143, in main
for c, batch in tqdm.tqdm(enumerate(data_iter)):
File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__
for obj in iterable:
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__
next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator)
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches
broadcast_object_list(batch_info)
File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list
torch.distributed.broadcast_object_list(object_list, src=from_process)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list
object_list[i] = _tensor_to_object(obj_view, obj_size)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object
return _unpickler(io.BytesIO(buf)).load()
_pickle.UnpicklingError: invalid load key, '@'.
```
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset(
cfg["dataset_name"], streaming=True, split="train")
dataset = dataset.remove_columns("meta")
dataset = dataset.map(tokenize_and_concatenate, batched=True)
dataset = dataset.with_format(type="torch")
train_data_loader = DataLoader(
dataset, batch_size=cfg["batch_size"], num_workers=3)
for batch in train_data_loader:
continue
```
`tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization:
```
import numpy as np
import einops
import torch
def tokenize_and_concatenate(examples):
texts = examples["text"]
full_text = tokenizer.eos_token.join(texts)
div = 20
length = len(full_text) // div
text_list = [full_text[i * length: (i + 1) * length]
for i in range(div)]
tokens = tokenizer(text_list, return_tensors="np", padding=True)[
"input_ids"
].flatten()
tokens = tokens[tokens != tokenizer.pad_token_id]
n = len(tokens)
curr_batch_size = n // (seq_len - 1)
tokens = tokens[: (seq_len - 1) * curr_batch_size]
tokens = einops.rearrange(
tokens,
"(batch_size seq) -> batch_size seq",
batch_size=curr_batch_size,
seq=seq_len - 1,
)
prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \
tokenizer.bos_token_id
return {
"text": np.concatenate([prefix, tokens], axis=1)
}
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.13
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
ZStandard data:
Version: 0.18.0
Summary: Zstandard bindings for Python
Home-page: https://github.com/indygreg/python-zstandard
Author: Gregory Szorc
Author-email: [email protected]
License: BSD
Location: /opt/conda/lib/python3.7/site-packages
Requires:
Required-by: | 498 | 71 | Intermittent JSON parse error when streaming the Pile
## Describe the bug
I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash.
This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it.
I'm using a remote machine with 8 A6000 GPUs via runpod.io
## Expected results
I have a DataLoader which can iterate through the whole Pile
## Actual results
Stack trace:
```
Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0
```
I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation
```
Traceback (most recent call last):
File "ddp_script.py", line 1258, in <module>
main()
File "ddp_script.py", line 1143, in main
for c, batch in tqdm.tqdm(enumerate(data_iter)):
File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__
for obj in iterable:
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__
next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator)
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches
broadcast_object_list(batch_info)
File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list
torch.distributed.broadcast_object_list(object_list, src=from_process)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list
object_list[i] = _tensor_to_object(obj_view, obj_size)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object
return _unpickler(io.BytesIO(buf)).load()
_pickle.UnpicklingError: invalid load key, '@'.
```
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset(
cfg["dataset_name"], streaming=True, split="train")
dataset = dataset.remove_columns("meta")
dataset = dataset.map(tokenize_and_concatenate, batched=True)
dataset = dataset.with_format(type="torch")
train_data_loader = DataLoader(
dataset, batch_size=cfg["batch_size"], num_workers=3)
for batch in train_data_loader:
continue
```
`tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization:
```
import numpy as np
import einops
import torch
def tokenize_and_concatenate(examples):
texts = examples["text"]
full_text = tokenizer.eos_token.join(texts)
div = 20
length = len(full_text) // div
text_list = [full_text[i * length: (i + 1) * length]
for i in range(div)]
tokens = tokenizer(text_list, return_tensors="np", padding=True)[
"input_ids"
].flatten()
tokens = tokens[tokens != tokenizer.pad_token_id]
n = len(tokens)
curr_batch_size = n // (seq_len - 1)
tokens = tokens[: (seq_len - 1) * curr_batch_size]
tokens = einops.rearrange(
tokens,
"(batch_size seq) -> batch_size seq",
batch_size=curr_batch_size,
seq=seq_len - 1,
)
prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \
tokenizer.bos_token_id
return {
"text": np.concatenate([prefix, tokens], axis=1)
}
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.13
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
ZStandard data:
Version: 0.18.0
Summary: Zstandard bindings for Python
Home-page: https://github.com/indygreg/python-zstandard
Author: Gregory Szorc
Author-email: [email protected]
License: BSD
Location: /opt/conda/lib/python3.7/site-packages
Requires:
Required-by:
Ah, thanks! I did get errors like that. Sad that PR wasn't merged in!
I'm currently just downloading 200GB of the Pile locally to avoid streaming (I have space and it's faster anyway), but that's really useful! I can probably apply the dumb patch of just commenting out the bits that raise the JSON Parse Error lol, based on your code - if I continue the loop should it be fine? | [
-1.2191113233566284,
-0.9156204462051392,
-0.7389153838157654,
1.5429012775421143,
-0.12181570380926132,
-1.2346680164337158,
0.13972830772399902,
-1.0470380783081055,
1.591078281402588,
-0.729797899723053,
0.2936500310897827,
-1.6115782260894775,
-0.00279034860432148,
-0.5238010287284851,
-0.720940887928009,
-0.8774689435958862,
-0.28591087460517883,
-0.8879272937774658,
1.0772978067398071,
2.518803358078003,
1.2589366436004639,
-1.4383103847503662,
2.7704124450683594,
0.6237699389457703,
-0.1954907476902008,
-1.061689019203186,
0.5653862953186035,
-0.04299786686897278,
-1.2091938257217407,
-0.5265007019042969,
-0.9053720235824585,
-0.11411307752132416,
-0.618169903755188,
-0.4119351804256439,
0.0709003210067749,
0.450403094291687,
-0.22259873151779175,
-0.3509442210197449,
-0.5695215463638306,
-0.7302826046943665,
0.5018925666809082,
-0.3856104016304016,
0.9687541127204895,
-0.2748778164386749,
1.7889574766159058,
-0.5797628164291382,
0.40413665771484375,
0.7866300344467163,
1.3558224439620972,
0.2044781595468521,
0.043033719062805176,
0.24266113340854645,
0.34846800565719604,
0.002807709388434887,
0.5452602505683899,
1.122096061706543,
0.6085554361343384,
0.5069047808647156,
0.6622787117958069,
-2.2118353843688965,
1.2946594953536987,
-1.003332495689392,
0.28618350625038147,
1.2530171871185303,
-0.9298065900802612,
0.36867570877075195,
-1.8287379741668701,
-0.0886266827583313,
0.6281752586364746,
-2.2374393939971924,
0.2881385087966919,
-1.2812635898590088,
-0.4939998686313629,
0.9304503798484802,
0.2580527067184448,
-1.2735024690628052,
0.11709436774253845,
-0.46546611189842224,
1.0607107877731323,
0.3867669105529785,
1.095651626586914,
-1.6985507011413574,
-0.041627757251262665,
-0.2432524710893631,
0.15718498826026917,
-1.2403335571289062,
-1.5833380222320557,
0.535782516002655,
0.5782720446586609,
0.6202570796012878,
-0.10504209995269775,
1.0087146759033203,
-1.0798431634902954,
0.8521778583526611,
-0.9699952602386475,
-1.5921708345413208,
-1.436285376548767,
-2.3582160472869873,
-2.311224937438965,
0.7729031443595886,
-0.5273078680038452,
-0.482120156288147,
2.0947163105010986,
-0.9920226335525513,
-1.7114670276641846,
1.1561908721923828,
0.2628895938396454,
0.026435963809490204,
2.408498525619507,
0.17765295505523682,
-0.7524499893188477,
0.48309677839279175,
-0.7561836242675781,
0.8157228231430054,
-0.4418449401855469,
1.3043419122695923,
0.4251973032951355,
-0.9142493009567261,
1.5805437564849854,
-0.4373943507671356,
0.604282557964325,
-0.6897341012954712,
-0.49209079146385193,
-0.8100910186767578,
0.3038685619831085,
1.9486163854599,
-0.2757244110107422,
1.513746738433838,
-0.22935152053833008,
-1.5529406070709229,
-1.5285778045654297,
0.8861242532730103,
0.4311331808567047,
-0.8818513751029968,
0.11975935101509094,
-0.4418952465057373,
0.21341009438037872,
-0.027223847806453705,
1.1213104724884033,
1.2481590509414673,
0.7316437363624573,
-0.26900604367256165,
-0.9249610900878906,
0.2183573842048645,
-0.1877463161945343,
-0.6984044313430786,
-1.8268409967422485,
-0.36512815952301025,
0.14287084341049194,
0.6438822746276855,
-1.20779287815094,
1.7921112775802612,
0.8872368335723877,
1.9683853387832642,
0.9868384599685669,
-0.364469975233078,
1.5120141506195068,
0.02941155806183815,
1.9000561237335205,
-0.4988453686237335,
0.582719087600708,
-0.45301228761672974,
-1.133462905883789,
0.8479575514793396,
-0.357129842042923,
-1.9348591566085815,
-0.7416850924491882,
-0.7690762281417847,
-0.1996084451675415,
-0.7142690420150757,
0.8773180246353149,
-0.3551708459854126,
-1.4267042875289917,
0.22767487168312073,
-0.683142900466919,
0.13970161974430084,
-1.2263809442520142,
0.3112972676753998,
0.653246283531189,
-0.6133058071136475,
0.03978462889790535,
-0.30045032501220703,
-1.2890647649765015,
-0.5152468085289001,
0.34741586446762085,
1.9597959518432617,
-0.663115918636322,
0.9306424856185913,
0.9954590201377869,
-0.6804344058036804,
0.06032177805900574,
0.3030819892883301,
-0.36498481035232544,
0.785775899887085,
-1.1419153213500977,
-0.4955969750881195,
1.1613136529922485,
-0.296647310256958,
-0.6346798539161682,
1.4121299982070923,
0.7839541435241699,
-1.0917636156082153,
-0.2275020331144333,
-0.18904544413089752,
-0.8223744630813599,
0.08951814472675323,
-1.594362735748291,
-0.1367211490869522,
0.39408156275749207,
-1.5192458629608154,
-0.4939413368701935,
-0.17729692161083221,
1.298814058303833,
-0.1397106796503067,
1.428389310836792,
-0.32013604044914246,
-0.12781868875026703,
-0.31033337116241455,
-0.49865424633026123,
0.17277435958385468,
-0.17207345366477966,
-0.5202435255050659,
0.18255281448364258,
-0.7785977125167847,
0.27564311027526855,
1.487248182296753,
0.2942625880241394,
0.03874259069561958,
0.47394028306007385,
1.085066795349121,
0.44217410683631897,
-0.006666968110948801,
-0.9098306894302368,
-1.4717705249786377,
2.0264554023742676,
-1.5045983791351318,
2.025583505630493,
0.8354787826538086,
-0.012473931536078453,
-1.7913405895233154,
-1.7952635288238525,
1.3357900381088257,
1.0847994089126587,
2.3593385219573975,
0.5204823613166809,
0.4121226966381073,
-0.8287284970283508,
-0.6589127779006958,
0.2951476573944092,
-1.029312252998352,
-0.7335090041160583,
0.13664524257183075,
2.401451826095581,
1.767465591430664,
-0.4919847249984741,
-0.17628639936447144,
-0.857226550579071,
1.3348641395568848,
-0.212080180644989,
0.25794845819473267,
2.0466549396514893,
-0.22773009538650513,
-1.0523043870925903,
1.1862717866897583,
-2.4132208824157715,
0.19112862646579742,
2.089878797531128,
0.31559720635414124,
0.1507394015789032,
-1.4448168277740479,
-0.6374940872192383,
-0.24356500804424286,
-0.4350726008415222,
-1.2224153280258179,
0.5832535028457642,
-0.25445953011512756,
-0.8367152810096741,
-1.456840991973877,
0.1179356724023819,
-1.145835518836975,
-1.7384406328201294,
0.23201881349086761,
1.8904603719711304,
2.146355152130127,
-0.8463751673698425,
1.5106580257415771,
-0.3063041865825653,
0.1146715059876442,
1.2712457180023193,
1.205582618713379,
3.1439497470855713,
1.8807810544967651,
-1.2337121963500977,
0.6128384470939636,
-0.28207921981811523,
-0.5072899460792542,
1.1036666631698608,
-1.165204405784607,
1.14589524269104,
-0.19588181376457214,
-1.1283180713653564,
-1.1934012174606323,
1.0227556228637695,
0.47873836755752563,
-0.00813994649797678,
-0.46979227662086487,
1.2460235357284546,
0.12890294194221497,
1.3218157291412354,
0.5425217747688293,
-0.29975929856300354,
0.5136103630065918,
-0.3933422863483429,
-0.5385788083076477,
1.6671078205108643,
0.2174299955368042,
-1.496058464050293,
-2.31242036819458,
-0.25382035970687866,
-0.8978428244590759,
0.04516017064452171,
-0.6211386919021606,
-1.0173883438110352,
1.5800011157989502,
0.30861857533454895,
-1.169174313545227,
-0.28984829783439636,
-0.355847030878067,
-0.600735068321228,
2.638139486312866,
-1.326196551322937,
-0.23349574208259583,
-0.902152419090271,
-0.5921874642372131,
1.6111159324645996,
-1.2738862037658691,
-0.24712203443050385,
-1.0464595556259155,
-0.6012017130851746,
-1.232864499092102,
-0.4939861595630646,
0.042526841163635254,
-0.912719190120697,
0.7836614847183228,
0.2434188276529312,
-1.1842759847640991,
-0.2737334072589874,
-0.9273951649665833,
0.9211450219154358,
-0.015157556161284447,
0.2156122624874115,
1.835759162902832,
0.2930334806442261,
-0.42802292108535767,
0.7805541157722473,
1.1716134548187256,
0.6196908354759216,
-0.688716471195221,
0.1079103872179985,
-0.6859329342842102,
0.3255971372127533,
-1.3419365882873535,
0.23278017342090607,
-2.913660764694214,
0.6889317631721497,
-0.08375991880893707,
-0.10992290079593658,
-0.07707717269659042,
-1.2609171867370605,
1.0920898914337158,
2.6357312202453613,
-1.1123487949371338,
0.5038865208625793,
0.39164671301841736,
1.263143539428711,
-1.6403460502624512,
0.3484712541103363,
-0.43565911054611206,
2.1413309574127197,
0.1845710575580597,
1.2162058353424072,
-0.465851753950119,
-2.394157886505127,
0.6152612566947937,
-1.2493916749954224,
-1.0900973081588745,
0.7722745537757874,
-0.8762367367744446,
0.09584417194128036,
-1.427474856376648,
-0.1484108865261078,
-0.887164294719696,
-1.2448567152023315,
0.7042757868766785,
0.16366513073444366,
0.40421730279922485,
-0.5870957970619202,
0.3111123740673065,
-2.168240785598755,
-1.4431405067443848,
-0.19808928668498993,
-0.9832085371017456,
0.4723881781101227,
-0.4540335536003113,
0.6756823062896729,
-0.14662612974643707,
0.08181830495595932,
0.3488982617855072,
1.5119297504425049,
3.3888628482818604,
0.11025795340538025,
0.36904412508010864,
-0.19859746098518372,
-0.9824867248535156,
1.4610832929611206,
0.881545901298523,
-0.2134321630001068,
-0.5750620365142822,
-1.0447832345962524,
1.2847036123275757,
2.0607051849365234,
1.0276364088058472,
0.11874222755432129,
-0.8010240793228149,
-0.6814361214637756,
-0.07921436429023743,
0.162919282913208,
0.5264397263526917,
0.9426724314689636,
-0.03120248019695282,
0.03005237877368927,
1.4195830821990967,
1.1871087551116943,
-0.35107359290122986,
0.35539424419403076,
-0.9040112495422363,
-0.3713434040546417,
0.4657585918903351,
0.24973289668560028,
0.010696259327232838,
0.38097134232521057,
-0.956432580947876,
-0.30468589067459106,
-0.33852699398994446,
-0.9007614254951477,
-0.7440593838691711,
-0.4423683285713196,
-0.32972005009651184,
1.704506754875183,
0.13833148777484894,
-0.5217041373252869,
0.04261660575866699,
-0.6782217025756836,
-0.06149120628833771,
-1.130866289138794,
0.09556396305561066,
-0.14445607364177704,
-0.10851576924324036,
-0.10481437295675278,
1.7503339052200317,
-0.9387463331222534,
-2.138899087905884,
0.1954951137304306,
0.27224376797676086,
-0.2971554696559906,
0.22108671069145203,
1.7099807262420654,
0.4866676926612854,
1.3842297792434692,
1.3214685916900635,
0.9813061356544495,
-0.6631098985671997,
-1.276108980178833,
0.7457456588745117,
1.001458764076233,
-1.3593697547912598,
0.8572913408279419,
-0.11373298615217209,
-0.5224976539611816,
0.6489959955215454,
1.2849527597427368,
0.44516754150390625,
-2.052284002304077,
0.8394718170166016,
-0.9803959131240845,
0.8082391023635864,
0.6803008317947388,
0.6926944255828857,
0.2520177960395813,
0.8492142558097839,
-1.1753789186477661,
-1.115705966949463,
-0.7182711362838745,
-0.7371697425842285,
1.9881428480148315,
-0.231907919049263,
0.5365510582923889,
-0.13233554363250732,
-1.2855035066604614,
-0.09078996628522873,
0.7134495377540588,
0.36092790961265564,
-0.4075171947479248,
0.8000345826148987,
-0.7221972346305847,
-1.0660582780838013,
-1.3315749168395996,
-0.430756539106369,
-1.0566524267196655,
-1.0001169443130493,
1.0562061071395874,
0.7400211691856384,
0.3682767152786255,
1.9063982963562012,
0.6942290663719177,
0.28312352299690247,
-2.550290107727051,
0.9019937515258789,
0.3111255168914795,
-0.09435924142599106,
0.8595073223114014,
0.2594820261001587,
1.100785493850708,
-0.022937562316656113,
0.5822885632514954,
-2.331354856491089,
2.2924201488494873,
-0.2216770350933075,
0.7120442986488342,
0.07510881125926971,
-0.2544063627719879,
1.1110856533050537,
0.5423018932342529,
0.5756866931915283,
-1.0789979696273804,
0.6528425812721252,
-0.6127087473869324,
1.215514063835144,
0.9176843762397766,
-0.8557487726211548,
0.047077473253011703,
1.315967082977295,
0.44641807675361633,
-0.539249062538147,
-0.9975607395172119,
-0.9169594049453735,
0.9727256298065186,
1.71586012840271,
-0.07392919808626175,
-0.012660006061196327,
0.8232237100601196,
0.614736795425415,
-1.190904974937439,
0.047056470066308975,
-0.7543500065803528,
-0.792529821395874,
1.6686371564865112,
2.056464433670044,
-0.16504274308681488,
-0.1827690601348877,
-0.7574935555458069,
-1.3409453630447388,
0.7751039862632751,
-0.07645496726036072,
0.0939725860953331,
0.6326501965522766,
-0.6486917734146118,
1.0778127908706665,
0.7456876039505005,
1.035041093826294,
0.10662097483873367,
0.25752896070480347,
0.3515438735485077,
-0.4244159758090973,
-1.1118192672729492,
-0.30871132016181946,
-1.0954725742340088,
-2.5566153526306152,
0.4236915409564972,
-0.17668463289737701,
-1.4720395803451538,
0.0588371604681015,
-0.96457839012146,
0.9562774300575256,
-0.5648408532142639,
-1.0844838619232178,
-1.419722318649292,
0.27405229210853577,
-0.23732124269008636,
0.9004951119422913,
-1.6580686569213867,
-0.17943023145198822,
1.2477405071258545,
0.9067879915237427,
-0.6208553910255432,
1.0224714279174805,
0.2283526510000229,
1.0159194469451904,
0.7787153720855713,
-0.40725719928741455,
0.5660700798034668,
0.06737607717514038,
-1.318454384803772,
0.46088525652885437,
1.1721136569976807,
0.199560284614563,
1.4496965408325195,
-0.4853820502758026,
0.002379431389272213,
0.3952271044254303,
-0.6261102557182312,
-0.5325931310653687,
-0.5073496103286743,
0.7612929940223694,
-0.006029264070093632,
-0.9745800495147705,
-0.03959942236542702,
-0.1372929960489273,
-0.21018756926059723,
0.1765913963317871,
-1.5320194959640503,
-0.20299623906612396,
-0.3770276606082916,
-0.4868222177028656,
-1.3110454082489014,
0.01502563152462244,
1.3780953884124756,
-0.7282369136810303,
-0.2526996433734894,
0.3917868733406067,
0.455919086933136,
0.5136627554893494,
0.5778684616088867,
-0.7281674742698669,
-0.348836213350296,
-0.2477787733078003,
-0.35777175426483154,
0.288227379322052,
1.2873952388763428,
-0.07287680357694626,
-0.9216547012329102,
0.664555549621582,
-0.38405054807662964,
0.1544116884469986,
1.9386534690856934,
0.12327568233013153,
-0.7507631182670593,
0.3366105258464813,
-0.7204040288925171,
1.8517464399337769,
1.659456729888916,
1.254983901977539,
-0.1004992425441742,
-0.8170977234840393,
0.6662321090698242,
-0.3429369032382965,
-0.3663859963417053,
0.8210203647613525,
0.42419424653053284,
-0.2706078588962555,
-1.4599190950393677,
0.6216173768043518,
1.2584258317947388,
-0.7549421787261963,
-0.8114931583404541,
0.0828925222158432,
-0.8018436431884766,
1.167971134185791,
0.655950665473938,
0.4639568328857422,
0.23279908299446106,
1.632743239402771,
0.7943997383117676,
-0.600450336933136,
0.5560333132743835,
0.4917180836200714,
-0.19794811308383942,
-2.1102659702301025,
-1.1144917011260986,
0.31557565927505493,
-0.490113228559494,
-1.578315258026123,
1.4198484420776367,
-1.0746270418167114,
-0.9671279191970825,
0.5685468316078186,
0.063133604824543,
1.3644464015960693,
0.360385537147522,
1.5839976072311401,
2.0526857376098633,
0.8472216129302979,
0.44212907552719116,
1.2005943059921265,
-0.17333528399467468,
-0.5461134314537048,
1.9211198091506958,
-0.3964235782623291,
0.4794475734233856,
1.060426950454712,
-0.3554094135761261,
-1.0476047992706299,
-0.8329038619995117,
-1.1426756381988525,
-0.6694195866584778,
1.1523077487945557,
0.12385915219783783,
-1.0979629755020142,
0.24456222355365753,
1.6203614473342896,
0.16575270891189575,
-0.3235507905483246,
0.6864588856697083,
0.4071302115917206,
-0.7379087209701538,
-0.018652789294719696,
-0.8755087852478027,
0.5096253752708435,
-0.20360003411769867,
-0.37452933192253113,
0.3556095063686371,
0.5306294560432434,
1.33039128780365,
-0.015990525484085083,
0.1035160943865776,
1.1474906206130981,
-1.4232511520385742,
1.4780927896499634,
-0.636873185634613,
0.32676059007644653,
-2.329059362411499,
1.34224534034729,
-0.7493369579315186,
1.9838658571243286,
-2.6034457683563232,
0.4038888216018677,
-0.6182806491851807,
-0.4647480249404907,
0.28312063217163086,
-0.3728730082511902,
0.12721599638462067,
-0.15886341035366058,
-1.0085229873657227,
-0.014422274194657803,
-0.7146932482719421,
0.6060628294944763,
1.1438319683074951,
1.3706448078155518,
-1.0529481172561646,
-0.2472625970840454,
-1.7477442026138306,
-0.1432034969329834,
-0.7422771453857422,
0.2737634778022766,
-2.0297045707702637,
-0.21480117738246918,
-2.0034971237182617,
-2.193467140197754,
-1.3753567934036255,
-0.8936824202537537,
1.0960465669631958,
0.2091684639453888,
-0.9031140208244324,
1.193304419517517,
-0.32622912526130676,
-1.7863287925720215,
1.1140077114105225,
-2.095116138458252
] |
https://github.com/huggingface/datasets/issues/5053 | Intermittent JSON parse error when streaming the Pile | Yup you can get some inspiration from this PR. It simply ignores the bad chunks (a chunk is ~a few MBs of data).
We'll try to merge this PR soon | ## Describe the bug
I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash.
This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it.
I'm using a remote machine with 8 A6000 GPUs via runpod.io
## Expected results
I have a DataLoader which can iterate through the whole Pile
## Actual results
Stack trace:
```
Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0
```
I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation
```
Traceback (most recent call last):
File "ddp_script.py", line 1258, in <module>
main()
File "ddp_script.py", line 1143, in main
for c, batch in tqdm.tqdm(enumerate(data_iter)):
File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__
for obj in iterable:
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__
next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator)
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches
broadcast_object_list(batch_info)
File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list
torch.distributed.broadcast_object_list(object_list, src=from_process)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list
object_list[i] = _tensor_to_object(obj_view, obj_size)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object
return _unpickler(io.BytesIO(buf)).load()
_pickle.UnpicklingError: invalid load key, '@'.
```
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset(
cfg["dataset_name"], streaming=True, split="train")
dataset = dataset.remove_columns("meta")
dataset = dataset.map(tokenize_and_concatenate, batched=True)
dataset = dataset.with_format(type="torch")
train_data_loader = DataLoader(
dataset, batch_size=cfg["batch_size"], num_workers=3)
for batch in train_data_loader:
continue
```
`tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization:
```
import numpy as np
import einops
import torch
def tokenize_and_concatenate(examples):
texts = examples["text"]
full_text = tokenizer.eos_token.join(texts)
div = 20
length = len(full_text) // div
text_list = [full_text[i * length: (i + 1) * length]
for i in range(div)]
tokens = tokenizer(text_list, return_tensors="np", padding=True)[
"input_ids"
].flatten()
tokens = tokens[tokens != tokenizer.pad_token_id]
n = len(tokens)
curr_batch_size = n // (seq_len - 1)
tokens = tokens[: (seq_len - 1) * curr_batch_size]
tokens = einops.rearrange(
tokens,
"(batch_size seq) -> batch_size seq",
batch_size=curr_batch_size,
seq=seq_len - 1,
)
prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \
tokenizer.bos_token_id
return {
"text": np.concatenate([prefix, tokens], axis=1)
}
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.13
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
ZStandard data:
Version: 0.18.0
Summary: Zstandard bindings for Python
Home-page: https://github.com/indygreg/python-zstandard
Author: Gregory Szorc
Author-email: [email protected]
License: BSD
Location: /opt/conda/lib/python3.7/site-packages
Requires:
Required-by: | 498 | 30 | Intermittent JSON parse error when streaming the Pile
## Describe the bug
I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash.
This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it.
I'm using a remote machine with 8 A6000 GPUs via runpod.io
## Expected results
I have a DataLoader which can iterate through the whole Pile
## Actual results
Stack trace:
```
Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0
```
I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation
```
Traceback (most recent call last):
File "ddp_script.py", line 1258, in <module>
main()
File "ddp_script.py", line 1143, in main
for c, batch in tqdm.tqdm(enumerate(data_iter)):
File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__
for obj in iterable:
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__
next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator)
File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches
broadcast_object_list(batch_info)
File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list
torch.distributed.broadcast_object_list(object_list, src=from_process)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list
object_list[i] = _tensor_to_object(obj_view, obj_size)
File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object
return _unpickler(io.BytesIO(buf)).load()
_pickle.UnpicklingError: invalid load key, '@'.
```
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset(
cfg["dataset_name"], streaming=True, split="train")
dataset = dataset.remove_columns("meta")
dataset = dataset.map(tokenize_and_concatenate, batched=True)
dataset = dataset.with_format(type="torch")
train_data_loader = DataLoader(
dataset, batch_size=cfg["batch_size"], num_workers=3)
for batch in train_data_loader:
continue
```
`tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization:
```
import numpy as np
import einops
import torch
def tokenize_and_concatenate(examples):
texts = examples["text"]
full_text = tokenizer.eos_token.join(texts)
div = 20
length = len(full_text) // div
text_list = [full_text[i * length: (i + 1) * length]
for i in range(div)]
tokens = tokenizer(text_list, return_tensors="np", padding=True)[
"input_ids"
].flatten()
tokens = tokens[tokens != tokenizer.pad_token_id]
n = len(tokens)
curr_batch_size = n // (seq_len - 1)
tokens = tokens[: (seq_len - 1) * curr_batch_size]
tokens = einops.rearrange(
tokens,
"(batch_size seq) -> batch_size seq",
batch_size=curr_batch_size,
seq=seq_len - 1,
)
prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \
tokenizer.bos_token_id
return {
"text": np.concatenate([prefix, tokens], axis=1)
}
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.13
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
ZStandard data:
Version: 0.18.0
Summary: Zstandard bindings for Python
Home-page: https://github.com/indygreg/python-zstandard
Author: Gregory Szorc
Author-email: [email protected]
License: BSD
Location: /opt/conda/lib/python3.7/site-packages
Requires:
Required-by:
Yup you can get some inspiration from this PR. It simply ignores the bad chunks (a chunk is ~a few MBs of data).
We'll try to merge this PR soon | [
-1.2191113233566284,
-0.9156204462051392,
-0.7389153838157654,
1.5429012775421143,
-0.12181570380926132,
-1.2346680164337158,
0.13972830772399902,
-1.0470380783081055,
1.591078281402588,
-0.729797899723053,
0.2936500310897827,
-1.6115782260894775,
-0.00279034860432148,
-0.5238010287284851,
-0.720940887928009,
-0.8774689435958862,
-0.28591087460517883,
-0.8879272937774658,
1.0772978067398071,
2.518803358078003,
1.2589366436004639,
-1.4383103847503662,
2.7704124450683594,
0.6237699389457703,
-0.1954907476902008,
-1.061689019203186,
0.5653862953186035,
-0.04299786686897278,
-1.2091938257217407,
-0.5265007019042969,
-0.9053720235824585,
-0.11411307752132416,
-0.618169903755188,
-0.4119351804256439,
0.0709003210067749,
0.450403094291687,
-0.22259873151779175,
-0.3509442210197449,
-0.5695215463638306,
-0.7302826046943665,
0.5018925666809082,
-0.3856104016304016,
0.9687541127204895,
-0.2748778164386749,
1.7889574766159058,
-0.5797628164291382,
0.40413665771484375,
0.7866300344467163,
1.3558224439620972,
0.2044781595468521,
0.043033719062805176,
0.24266113340854645,
0.34846800565719604,
0.002807709388434887,
0.5452602505683899,
1.122096061706543,
0.6085554361343384,
0.5069047808647156,
0.6622787117958069,
-2.2118353843688965,
1.2946594953536987,
-1.003332495689392,
0.28618350625038147,
1.2530171871185303,
-0.9298065900802612,
0.36867570877075195,
-1.8287379741668701,
-0.0886266827583313,
0.6281752586364746,
-2.2374393939971924,
0.2881385087966919,
-1.2812635898590088,
-0.4939998686313629,
0.9304503798484802,
0.2580527067184448,
-1.2735024690628052,
0.11709436774253845,
-0.46546611189842224,
1.0607107877731323,
0.3867669105529785,
1.095651626586914,
-1.6985507011413574,
-0.041627757251262665,
-0.2432524710893631,
0.15718498826026917,
-1.2403335571289062,
-1.5833380222320557,
0.535782516002655,
0.5782720446586609,
0.6202570796012878,
-0.10504209995269775,
1.0087146759033203,
-1.0798431634902954,
0.8521778583526611,
-0.9699952602386475,
-1.5921708345413208,
-1.436285376548767,
-2.3582160472869873,
-2.311224937438965,
0.7729031443595886,
-0.5273078680038452,
-0.482120156288147,
2.0947163105010986,
-0.9920226335525513,
-1.7114670276641846,
1.1561908721923828,
0.2628895938396454,
0.026435963809490204,
2.408498525619507,
0.17765295505523682,
-0.7524499893188477,
0.48309677839279175,
-0.7561836242675781,
0.8157228231430054,
-0.4418449401855469,
1.3043419122695923,
0.4251973032951355,
-0.9142493009567261,
1.5805437564849854,
-0.4373943507671356,
0.604282557964325,
-0.6897341012954712,
-0.49209079146385193,
-0.8100910186767578,
0.3038685619831085,
1.9486163854599,
-0.2757244110107422,
1.513746738433838,
-0.22935152053833008,
-1.5529406070709229,
-1.5285778045654297,
0.8861242532730103,
0.4311331808567047,
-0.8818513751029968,
0.11975935101509094,
-0.4418952465057373,
0.21341009438037872,
-0.027223847806453705,
1.1213104724884033,
1.2481590509414673,
0.7316437363624573,
-0.26900604367256165,
-0.9249610900878906,
0.2183573842048645,
-0.1877463161945343,
-0.6984044313430786,
-1.8268409967422485,
-0.36512815952301025,
0.14287084341049194,
0.6438822746276855,
-1.20779287815094,
1.7921112775802612,
0.8872368335723877,
1.9683853387832642,
0.9868384599685669,
-0.364469975233078,
1.5120141506195068,
0.02941155806183815,
1.9000561237335205,
-0.4988453686237335,
0.582719087600708,
-0.45301228761672974,
-1.133462905883789,
0.8479575514793396,
-0.357129842042923,
-1.9348591566085815,
-0.7416850924491882,
-0.7690762281417847,
-0.1996084451675415,
-0.7142690420150757,
0.8773180246353149,
-0.3551708459854126,
-1.4267042875289917,
0.22767487168312073,
-0.683142900466919,
0.13970161974430084,
-1.2263809442520142,
0.3112972676753998,
0.653246283531189,
-0.6133058071136475,
0.03978462889790535,
-0.30045032501220703,
-1.2890647649765015,
-0.5152468085289001,
0.34741586446762085,
1.9597959518432617,
-0.663115918636322,
0.9306424856185913,
0.9954590201377869,
-0.6804344058036804,
0.06032177805900574,
0.3030819892883301,
-0.36498481035232544,
0.785775899887085,
-1.1419153213500977,
-0.4955969750881195,
1.1613136529922485,
-0.296647310256958,
-0.6346798539161682,
1.4121299982070923,
0.7839541435241699,
-1.0917636156082153,
-0.2275020331144333,
-0.18904544413089752,
-0.8223744630813599,
0.08951814472675323,
-1.594362735748291,
-0.1367211490869522,
0.39408156275749207,
-1.5192458629608154,
-0.4939413368701935,
-0.17729692161083221,
1.298814058303833,
-0.1397106796503067,
1.428389310836792,
-0.32013604044914246,
-0.12781868875026703,
-0.31033337116241455,
-0.49865424633026123,
0.17277435958385468,
-0.17207345366477966,
-0.5202435255050659,
0.18255281448364258,
-0.7785977125167847,
0.27564311027526855,
1.487248182296753,
0.2942625880241394,
0.03874259069561958,
0.47394028306007385,
1.085066795349121,
0.44217410683631897,
-0.006666968110948801,
-0.9098306894302368,
-1.4717705249786377,
2.0264554023742676,
-1.5045983791351318,
2.025583505630493,
0.8354787826538086,
-0.012473931536078453,
-1.7913405895233154,
-1.7952635288238525,
1.3357900381088257,
1.0847994089126587,
2.3593385219573975,
0.5204823613166809,
0.4121226966381073,
-0.8287284970283508,
-0.6589127779006958,
0.2951476573944092,
-1.029312252998352,
-0.7335090041160583,
0.13664524257183075,
2.401451826095581,
1.767465591430664,
-0.4919847249984741,
-0.17628639936447144,
-0.857226550579071,
1.3348641395568848,
-0.212080180644989,
0.25794845819473267,
2.0466549396514893,
-0.22773009538650513,
-1.0523043870925903,
1.1862717866897583,
-2.4132208824157715,
0.19112862646579742,
2.089878797531128,
0.31559720635414124,
0.1507394015789032,
-1.4448168277740479,
-0.6374940872192383,
-0.24356500804424286,
-0.4350726008415222,
-1.2224153280258179,
0.5832535028457642,
-0.25445953011512756,
-0.8367152810096741,
-1.456840991973877,
0.1179356724023819,
-1.145835518836975,
-1.7384406328201294,
0.23201881349086761,
1.8904603719711304,
2.146355152130127,
-0.8463751673698425,
1.5106580257415771,
-0.3063041865825653,
0.1146715059876442,
1.2712457180023193,
1.205582618713379,
3.1439497470855713,
1.8807810544967651,
-1.2337121963500977,
0.6128384470939636,
-0.28207921981811523,
-0.5072899460792542,
1.1036666631698608,
-1.165204405784607,
1.14589524269104,
-0.19588181376457214,
-1.1283180713653564,
-1.1934012174606323,
1.0227556228637695,
0.47873836755752563,
-0.00813994649797678,
-0.46979227662086487,
1.2460235357284546,
0.12890294194221497,
1.3218157291412354,
0.5425217747688293,
-0.29975929856300354,
0.5136103630065918,
-0.3933422863483429,
-0.5385788083076477,
1.6671078205108643,
0.2174299955368042,
-1.496058464050293,
-2.31242036819458,
-0.25382035970687866,
-0.8978428244590759,
0.04516017064452171,
-0.6211386919021606,
-1.0173883438110352,
1.5800011157989502,
0.30861857533454895,
-1.169174313545227,
-0.28984829783439636,
-0.355847030878067,
-0.600735068321228,
2.638139486312866,
-1.326196551322937,
-0.23349574208259583,
-0.902152419090271,
-0.5921874642372131,
1.6111159324645996,
-1.2738862037658691,
-0.24712203443050385,
-1.0464595556259155,
-0.6012017130851746,
-1.232864499092102,
-0.4939861595630646,
0.042526841163635254,
-0.912719190120697,
0.7836614847183228,
0.2434188276529312,
-1.1842759847640991,
-0.2737334072589874,
-0.9273951649665833,
0.9211450219154358,
-0.015157556161284447,
0.2156122624874115,
1.835759162902832,
0.2930334806442261,
-0.42802292108535767,
0.7805541157722473,
1.1716134548187256,
0.6196908354759216,
-0.688716471195221,
0.1079103872179985,
-0.6859329342842102,
0.3255971372127533,
-1.3419365882873535,
0.23278017342090607,
-2.913660764694214,
0.6889317631721497,
-0.08375991880893707,
-0.10992290079593658,
-0.07707717269659042,
-1.2609171867370605,
1.0920898914337158,
2.6357312202453613,
-1.1123487949371338,
0.5038865208625793,
0.39164671301841736,
1.263143539428711,
-1.6403460502624512,
0.3484712541103363,
-0.43565911054611206,
2.1413309574127197,
0.1845710575580597,
1.2162058353424072,
-0.465851753950119,
-2.394157886505127,
0.6152612566947937,
-1.2493916749954224,
-1.0900973081588745,
0.7722745537757874,
-0.8762367367744446,
0.09584417194128036,
-1.427474856376648,
-0.1484108865261078,
-0.887164294719696,
-1.2448567152023315,
0.7042757868766785,
0.16366513073444366,
0.40421730279922485,
-0.5870957970619202,
0.3111123740673065,
-2.168240785598755,
-1.4431405067443848,
-0.19808928668498993,
-0.9832085371017456,
0.4723881781101227,
-0.4540335536003113,
0.6756823062896729,
-0.14662612974643707,
0.08181830495595932,
0.3488982617855072,
1.5119297504425049,
3.3888628482818604,
0.11025795340538025,
0.36904412508010864,
-0.19859746098518372,
-0.9824867248535156,
1.4610832929611206,
0.881545901298523,
-0.2134321630001068,
-0.5750620365142822,
-1.0447832345962524,
1.2847036123275757,
2.0607051849365234,
1.0276364088058472,
0.11874222755432129,
-0.8010240793228149,
-0.6814361214637756,
-0.07921436429023743,
0.162919282913208,
0.5264397263526917,
0.9426724314689636,
-0.03120248019695282,
0.03005237877368927,
1.4195830821990967,
1.1871087551116943,
-0.35107359290122986,
0.35539424419403076,
-0.9040112495422363,
-0.3713434040546417,
0.4657585918903351,
0.24973289668560028,
0.010696259327232838,
0.38097134232521057,
-0.956432580947876,
-0.30468589067459106,
-0.33852699398994446,
-0.9007614254951477,
-0.7440593838691711,
-0.4423683285713196,
-0.32972005009651184,
1.704506754875183,
0.13833148777484894,
-0.5217041373252869,
0.04261660575866699,
-0.6782217025756836,
-0.06149120628833771,
-1.130866289138794,
0.09556396305561066,
-0.14445607364177704,
-0.10851576924324036,
-0.10481437295675278,
1.7503339052200317,
-0.9387463331222534,
-2.138899087905884,
0.1954951137304306,
0.27224376797676086,
-0.2971554696559906,
0.22108671069145203,
1.7099807262420654,
0.4866676926612854,
1.3842297792434692,
1.3214685916900635,
0.9813061356544495,
-0.6631098985671997,
-1.276108980178833,
0.7457456588745117,
1.001458764076233,
-1.3593697547912598,
0.8572913408279419,
-0.11373298615217209,
-0.5224976539611816,
0.6489959955215454,
1.2849527597427368,
0.44516754150390625,
-2.052284002304077,
0.8394718170166016,
-0.9803959131240845,
0.8082391023635864,
0.6803008317947388,
0.6926944255828857,
0.2520177960395813,
0.8492142558097839,
-1.1753789186477661,
-1.115705966949463,
-0.7182711362838745,
-0.7371697425842285,
1.9881428480148315,
-0.231907919049263,
0.5365510582923889,
-0.13233554363250732,
-1.2855035066604614,
-0.09078996628522873,
0.7134495377540588,
0.36092790961265564,
-0.4075171947479248,
0.8000345826148987,
-0.7221972346305847,
-1.0660582780838013,
-1.3315749168395996,
-0.430756539106369,
-1.0566524267196655,
-1.0001169443130493,
1.0562061071395874,
0.7400211691856384,
0.3682767152786255,
1.9063982963562012,
0.6942290663719177,
0.28312352299690247,
-2.550290107727051,
0.9019937515258789,
0.3111255168914795,
-0.09435924142599106,
0.8595073223114014,
0.2594820261001587,
1.100785493850708,
-0.022937562316656113,
0.5822885632514954,
-2.331354856491089,
2.2924201488494873,
-0.2216770350933075,
0.7120442986488342,
0.07510881125926971,
-0.2544063627719879,
1.1110856533050537,
0.5423018932342529,
0.5756866931915283,
-1.0789979696273804,
0.6528425812721252,
-0.6127087473869324,
1.215514063835144,
0.9176843762397766,
-0.8557487726211548,
0.047077473253011703,
1.315967082977295,
0.44641807675361633,
-0.539249062538147,
-0.9975607395172119,
-0.9169594049453735,
0.9727256298065186,
1.71586012840271,
-0.07392919808626175,
-0.012660006061196327,
0.8232237100601196,
0.614736795425415,
-1.190904974937439,
0.047056470066308975,
-0.7543500065803528,
-0.792529821395874,
1.6686371564865112,
2.056464433670044,
-0.16504274308681488,
-0.1827690601348877,
-0.7574935555458069,
-1.3409453630447388,
0.7751039862632751,
-0.07645496726036072,
0.0939725860953331,
0.6326501965522766,
-0.6486917734146118,
1.0778127908706665,
0.7456876039505005,
1.035041093826294,
0.10662097483873367,
0.25752896070480347,
0.3515438735485077,
-0.4244159758090973,
-1.1118192672729492,
-0.30871132016181946,
-1.0954725742340088,
-2.5566153526306152,
0.4236915409564972,
-0.17668463289737701,
-1.4720395803451538,
0.0588371604681015,
-0.96457839012146,
0.9562774300575256,
-0.5648408532142639,
-1.0844838619232178,
-1.419722318649292,
0.27405229210853577,
-0.23732124269008636,
0.9004951119422913,
-1.6580686569213867,
-0.17943023145198822,
1.2477405071258545,
0.9067879915237427,
-0.6208553910255432,
1.0224714279174805,
0.2283526510000229,
1.0159194469451904,
0.7787153720855713,
-0.40725719928741455,
0.5660700798034668,
0.06737607717514038,
-1.318454384803772,
0.46088525652885437,
1.1721136569976807,
0.199560284614563,
1.4496965408325195,
-0.4853820502758026,
0.002379431389272213,
0.3952271044254303,
-0.6261102557182312,
-0.5325931310653687,
-0.5073496103286743,
0.7612929940223694,
-0.006029264070093632,
-0.9745800495147705,
-0.03959942236542702,
-0.1372929960489273,
-0.21018756926059723,
0.1765913963317871,
-1.5320194959640503,
-0.20299623906612396,
-0.3770276606082916,
-0.4868222177028656,
-1.3110454082489014,
0.01502563152462244,
1.3780953884124756,
-0.7282369136810303,
-0.2526996433734894,
0.3917868733406067,
0.455919086933136,
0.5136627554893494,
0.5778684616088867,
-0.7281674742698669,
-0.348836213350296,
-0.2477787733078003,
-0.35777175426483154,
0.288227379322052,
1.2873952388763428,
-0.07287680357694626,
-0.9216547012329102,
0.664555549621582,
-0.38405054807662964,
0.1544116884469986,
1.9386534690856934,
0.12327568233013153,
-0.7507631182670593,
0.3366105258464813,
-0.7204040288925171,
1.8517464399337769,
1.659456729888916,
1.254983901977539,
-0.1004992425441742,
-0.8170977234840393,
0.6662321090698242,
-0.3429369032382965,
-0.3663859963417053,
0.8210203647613525,
0.42419424653053284,
-0.2706078588962555,
-1.4599190950393677,
0.6216173768043518,
1.2584258317947388,
-0.7549421787261963,
-0.8114931583404541,
0.0828925222158432,
-0.8018436431884766,
1.167971134185791,
0.655950665473938,
0.4639568328857422,
0.23279908299446106,
1.632743239402771,
0.7943997383117676,
-0.600450336933136,
0.5560333132743835,
0.4917180836200714,
-0.19794811308383942,
-2.1102659702301025,
-1.1144917011260986,
0.31557565927505493,
-0.490113228559494,
-1.578315258026123,
1.4198484420776367,
-1.0746270418167114,
-0.9671279191970825,
0.5685468316078186,
0.063133604824543,
1.3644464015960693,
0.360385537147522,
1.5839976072311401,
2.0526857376098633,
0.8472216129302979,
0.44212907552719116,
1.2005943059921265,
-0.17333528399467468,
-0.5461134314537048,
1.9211198091506958,
-0.3964235782623291,
0.4794475734233856,
1.060426950454712,
-0.3554094135761261,
-1.0476047992706299,
-0.8329038619995117,
-1.1426756381988525,
-0.6694195866584778,
1.1523077487945557,
0.12385915219783783,
-1.0979629755020142,
0.24456222355365753,
1.6203614473342896,
0.16575270891189575,
-0.3235507905483246,
0.6864588856697083,
0.4071302115917206,
-0.7379087209701538,
-0.018652789294719696,
-0.8755087852478027,
0.5096253752708435,
-0.20360003411769867,
-0.37452933192253113,
0.3556095063686371,
0.5306294560432434,
1.33039128780365,
-0.015990525484085083,
0.1035160943865776,
1.1474906206130981,
-1.4232511520385742,
1.4780927896499634,
-0.636873185634613,
0.32676059007644653,
-2.329059362411499,
1.34224534034729,
-0.7493369579315186,
1.9838658571243286,
-2.6034457683563232,
0.4038888216018677,
-0.6182806491851807,
-0.4647480249404907,
0.28312063217163086,
-0.3728730082511902,
0.12721599638462067,
-0.15886341035366058,
-1.0085229873657227,
-0.014422274194657803,
-0.7146932482719421,
0.6060628294944763,
1.1438319683074951,
1.3706448078155518,
-1.0529481172561646,
-0.2472625970840454,
-1.7477442026138306,
-0.1432034969329834,
-0.7422771453857422,
0.2737634778022766,
-2.0297045707702637,
-0.21480117738246918,
-2.0034971237182617,
-2.193467140197754,
-1.3753567934036255,
-0.8936824202537537,
1.0960465669631958,
0.2091684639453888,
-0.9031140208244324,
1.193304419517517,
-0.32622912526130676,
-1.7863287925720215,
1.1140077114105225,
-2.095116138458252
] |
https://github.com/huggingface/datasets/issues/5046 | Audiofolder creates empty Dataset if files same level as metadata | Hi! Unfortunately, I can't reproduce this behavior. Instead, I get `ValueError: audio at 2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav doesn't have metadata in /audio-data/metadata.csv`, which can be fixed by removing the `./` from the file name.
(Link to a Colab that tries to reproduce this behavior: https://colab.research.google.com/drive/1IhQzULYi0Van1xLrN_SddBX1JF7mLZZK?usp=sharing) | ## Describe the bug
When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns.
https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88
## Steps to reproduce the bug
`metadata.csv`:
```csv
file_name,duration,transcription
./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello
```
```python
>>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/")
>>> audio_dataset
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
I've tried, with no success,:
- setting `split` to something else so I don't get a `DatasetDict`,
- removing the `./`,
- using `.jsonl`.
## Expected results
```
Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 1
})
```
## Actual results
```
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
## Environment info
- `datasets` version: 2.5.1
- Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 500 | 42 | Audiofolder creates empty Dataset if files same level as metadata
## Describe the bug
When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns.
https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88
## Steps to reproduce the bug
`metadata.csv`:
```csv
file_name,duration,transcription
./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello
```
```python
>>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/")
>>> audio_dataset
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
I've tried, with no success,:
- setting `split` to something else so I don't get a `DatasetDict`,
- removing the `./`,
- using `.jsonl`.
## Expected results
```
Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 1
})
```
## Actual results
```
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
## Environment info
- `datasets` version: 2.5.1
- Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Hi! Unfortunately, I can't reproduce this behavior. Instead, I get `ValueError: audio at 2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav doesn't have metadata in /audio-data/metadata.csv`, which can be fixed by removing the `./` from the file name.
(Link to a Colab that tries to reproduce this behavior: https://colab.research.google.com/drive/1IhQzULYi0Van1xLrN_SddBX1JF7mLZZK?usp=sharing) | [
-1.0984050035476685,
-0.8700841665267944,
-0.8108354210853577,
1.521761417388916,
-0.1715753674507141,
-1.229474663734436,
0.1277168095111847,
-1.0119003057479858,
1.7276331186294556,
-0.6917034983634949,
0.28527912497520447,
-1.7581384181976318,
-0.04742668196558952,
-0.7117543816566467,
-0.7580369710922241,
-0.7877431511878967,
-0.3482806980609894,
-0.7880861163139343,
1.0022697448730469,
2.4686291217803955,
1.1296412944793701,
-1.3622938394546509,
2.6850900650024414,
0.7294648289680481,
-0.1924981027841568,
-0.9649866819381714,
0.5479466319084167,
-0.11084571480751038,
-1.2334164381027222,
-0.36062926054000854,
-0.8558696508407593,
-0.006561658810824156,
-0.5591222643852234,
-0.5716955065727234,
0.011913595721125603,
0.537900984287262,
-0.34111103415489197,
-0.5384940505027771,
-0.45885899662971497,
-0.8217993974685669,
0.4104755222797394,
-0.4085390567779541,
0.9179748892784119,
-0.24281607568264008,
1.736130952835083,
-0.5020362734794617,
0.32034793496131897,
0.6724489331245422,
1.366161584854126,
0.14834603667259216,
0.06925682723522186,
0.40866586565971375,
0.4009895622730255,
-0.02396230772137642,
0.4910864531993866,
1.1923385858535767,
0.6268468499183655,
0.43510618805885315,
0.8618782162666321,
-2.3697926998138428,
1.1768839359283447,
-0.9807748794555664,
0.30609628558158875,
1.3487331867218018,
-0.9403254985809326,
0.34614914655685425,
-1.8286430835723877,
0.056574854999780655,
0.5749227404594421,
-2.126497983932495,
0.36251088976860046,
-1.365035891532898,
-0.38269272446632385,
0.9859547019004822,
0.3454667627811432,
-1.20636785030365,
0.17827068269252777,
-0.2978113889694214,
1.0235432386398315,
0.39038923382759094,
1.1003828048706055,
-1.718106746673584,
0.018326062709093094,
-0.3334304690361023,
0.13378497958183289,
-1.2307491302490234,
-1.5703452825546265,
0.5334740877151489,
0.6398745775222778,
0.6979865431785583,
-0.24024635553359985,
0.9947444200515747,
-1.0285874605178833,
0.6335550546646118,
-1.0633814334869385,
-1.8191527128219604,
-1.3457204103469849,
-2.133718967437744,
-2.3108863830566406,
0.7112571597099304,
-0.5240370035171509,
-0.4336525499820709,
2.041755199432373,
-0.9289556741714478,
-1.7822892665863037,
1.1586978435516357,
0.4101862609386444,
-0.03215217590332031,
2.2937655448913574,
0.2808017432689667,
-0.7452642321586609,
0.49725571274757385,
-0.8076401352882385,
0.7718405723571777,
-0.323098361492157,
1.3432106971740723,
0.4401094317436218,
-1.0042122602462769,
1.7009503841400146,
-0.4574141204357147,
0.6254280209541321,
-0.683502197265625,
-0.4242122173309326,
-0.7525671720504761,
0.35068270564079285,
1.9447088241577148,
-0.2927137017250061,
1.4999140501022339,
-0.4096083343029022,
-1.6136581897735596,
-1.499792218208313,
0.9054527282714844,
0.5257716774940491,
-0.8579610586166382,
0.1628391295671463,
-0.3943701386451721,
0.17651380598545074,
-0.1685228943824768,
1.2081983089447021,
1.2779290676116943,
0.7069229483604431,
-0.3138362467288971,
-0.9162172079086304,
0.19454292953014374,
0.03416334092617035,
-0.7402023673057556,
-1.7606163024902344,
-0.30846187472343445,
0.14504468441009521,
0.5838578343391418,
-1.1638966798782349,
1.7237786054611206,
0.7946417331695557,
1.9530662298202515,
0.9739816188812256,
-0.41926947236061096,
1.5327637195587158,
0.11215853691101074,
1.9012620449066162,
-0.5369160175323486,
0.6401401162147522,
-0.45263099670410156,
-1.1460564136505127,
0.9684323072433472,
-0.28788265585899353,
-1.9852333068847656,
-0.680686891078949,
-0.8612626791000366,
-0.2223752737045288,
-0.7474745512008667,
0.8947058916091919,
-0.2604582905769348,
-1.4863269329071045,
0.22023335099220276,
-0.7712931036949158,
0.17055369913578033,
-1.271657109260559,
0.24654386937618256,
0.7072717547416687,
-0.6175756454467773,
0.06682927906513214,
-0.30920183658599854,
-1.3119374513626099,
-0.44297972321510315,
0.392689049243927,
1.856957197189331,
-0.8020246624946594,
0.9002234935760498,
1.0584014654159546,
-0.6522687673568726,
-0.011548799462616444,
0.22232604026794434,
-0.2734343707561493,
0.7996840476989746,
-1.0749268531799316,
-0.4912269115447998,
1.167676329612732,
-0.14254483580589294,
-0.6005434393882751,
1.403560757637024,
0.7569501996040344,
-1.0588709115982056,
-0.2212676852941513,
-0.2081570327281952,
-0.7995304465293884,
-0.0058482326567173,
-1.6167373657226562,
-0.12446466088294983,
0.49806955456733704,
-1.5031497478485107,
-0.520416796207428,
-0.2864776849746704,
1.2599066495895386,
-0.18864107131958008,
1.339627981185913,
-0.3212462365627289,
-0.17447225749492645,
-0.3815174698829651,
-0.46105387806892395,
0.14225414395332336,
-0.2250845581293106,
-0.619460940361023,
0.129024475812912,
-0.7774202823638916,
0.38245445489883423,
1.3689353466033936,
0.26210910081863403,
0.03411601483821869,
0.515464186668396,
1.1912500858306885,
0.43304774165153503,
0.12846426665782928,
-0.9019847512245178,
-1.5938568115234375,
1.9498467445373535,
-1.5252931118011475,
1.930159091949463,
0.6280083060264587,
0.08389827609062195,
-1.7697935104370117,
-1.892690658569336,
1.488358736038208,
1.1274869441986084,
2.316688060760498,
0.613460123538971,
0.4464138448238373,
-0.8297078609466553,
-0.6264867782592773,
0.26443392038345337,
-0.9400790929794312,
-0.7120968103408813,
0.204756498336792,
2.412175416946411,
1.72145676612854,
-0.5358238816261292,
-0.3070678412914276,
-0.9144553542137146,
1.4049813747406006,
-0.21094492077827454,
0.3060641586780548,
1.98164701461792,
-0.29622769355773926,
-1.0200399160385132,
1.331128478050232,
-2.4434404373168945,
0.1857789307832718,
2.0369675159454346,
0.15637293457984924,
0.1993243545293808,
-1.3452492952346802,
-0.7075554132461548,
-0.12367016077041626,
-0.5074623823165894,
-1.2820082902908325,
0.5514904856681824,
-0.2200831174850464,
-0.7651302814483643,
-1.4396644830703735,
0.25156089663505554,
-1.0883830785751343,
-1.6478772163391113,
0.19339603185653687,
1.9559862613677979,
2.0370306968688965,
-0.8579050302505493,
1.6289039850234985,
-0.25745460391044617,
0.31042617559432983,
1.2753584384918213,
1.3116179704666138,
3.0342202186584473,
1.8460557460784912,
-1.2409664392471313,
0.7018234133720398,
-0.20937824249267578,
-0.5544893741607666,
1.2595189809799194,
-1.1322200298309326,
1.1277607679367065,
-0.2298327088356018,
-1.2175054550170898,
-1.2624601125717163,
0.8351966738700867,
0.47873759269714355,
0.06035934016108513,
-0.449623167514801,
1.1834110021591187,
-0.026833051815629005,
1.2587217092514038,
0.7037503719329834,
-0.37400493025779724,
0.6250112652778625,
-0.33281591534614563,
-0.5171686410903931,
1.5300753116607666,
0.14590290188789368,
-1.330614686012268,
-2.324679374694824,
-0.2613128125667572,
-0.8211491703987122,
-0.008405283093452454,
-0.5959542393684387,
-1.0452555418014526,
1.582782506942749,
0.3552117645740509,
-1.168088674545288,
-0.24073536694049835,
-0.3095903992652893,
-0.45019614696502686,
2.630180835723877,
-1.3712812662124634,
-0.27726608514785767,
-1.0067355632781982,
-0.5930476784706116,
1.7492432594299316,
-1.0717201232910156,
-0.21368657052516937,
-1.0582307577133179,
-0.482153981924057,
-1.3953289985656738,
-0.5890079140663147,
0.031978901475667953,
-0.853888213634491,
0.9354169964790344,
0.23574741184711456,
-1.261154294013977,
-0.2958575487136841,
-0.9680110216140747,
0.9070561528205872,
-0.29479485750198364,
0.20467910170555115,
1.9487652778625488,
0.48094820976257324,
-0.32887616753578186,
0.8194990754127502,
1.1622670888900757,
0.6302666068077087,
-0.6268411874771118,
0.2293667197227478,
-0.6552621126174927,
0.2755924463272095,
-1.4438188076019287,
0.18921586871147156,
-2.817540168762207,
0.630674421787262,
0.01394917443394661,
-0.07978707551956177,
-0.04814000427722931,
-1.4075126647949219,
1.0853705406188965,
2.5582735538482666,
-1.3031721115112305,
0.5077382326126099,
0.29248327016830444,
1.327467441558838,
-1.6486217975616455,
0.12035337090492249,
-0.41382184624671936,
2.1529150009155273,
0.1056978702545166,
1.2858259677886963,
-0.34052345156669617,
-2.380702257156372,
0.5401220321655273,
-1.305955171585083,
-1.1274741888046265,
0.6998111009597778,
-0.878807544708252,
0.16879653930664062,
-1.5649272203445435,
-0.24189263582229614,
-0.9542926549911499,
-1.1810334920883179,
0.7566661834716797,
0.08236315846443176,
0.3795308470726013,
-0.6343581676483154,
0.4001632332801819,
-2.1527724266052246,
-1.42438805103302,
-0.16023431718349457,
-0.9226727485656738,
0.49450328946113586,
-0.3176764249801636,
0.690153181552887,
-0.17532838881015778,
-0.008848287165164948,
0.34041517972946167,
1.4867628812789917,
3.4466359615325928,
0.22865702211856842,
0.2989245355129242,
-0.22848115861415863,
-0.9240094423294067,
1.4735629558563232,
0.9595984220504761,
-0.11862674355506897,
-0.49462708830833435,
-1.1035248041152954,
1.2835732698440552,
2.037139892578125,
1.0245500802993774,
-0.026823673397302628,
-0.7898147106170654,
-0.7323269844055176,
-0.02464103326201439,
0.12597857415676117,
0.4839600622653961,
0.79305100440979,
0.15095922350883484,
0.030657276511192322,
1.3079832792282104,
1.0236876010894775,
-0.3600747287273407,
0.4660877287387848,
-0.9074681401252747,
-0.46704670786857605,
0.49184897541999817,
0.2095557153224945,
0.033046141266822815,
0.36522915959358215,
-1.080376148223877,
-0.30654409527778625,
-0.34112516045570374,
-0.8380724787712097,
-0.7095232009887695,
-0.43996313214302063,
-0.32113462686538696,
1.558367133140564,
0.12410014867782593,
-0.6411164402961731,
-0.09019462764263153,
-0.6981253027915955,
-0.11349916458129883,
-1.0003489255905151,
0.16169854998588562,
-0.28351056575775146,
-0.10320942103862762,
-0.12110620737075806,
1.6058064699172974,
-0.9412860870361328,
-1.9950734376907349,
0.1399325728416443,
0.37330010533332825,
-0.35361453890800476,
0.20142221450805664,
1.7084338665008545,
0.6216105818748474,
1.4269336462020874,
1.3934718370437622,
1.0480906963348389,
-0.646555483341217,
-1.3166636228561401,
0.6558077931404114,
0.9527031183242798,
-1.3256858587265015,
0.727656900882721,
-0.0019829003140330315,
-0.5701408386230469,
0.563497006893158,
1.334420084953308,
0.5111966133117676,
-2.038207530975342,
0.7418956756591797,
-0.9979702830314636,
0.7737375497817993,
0.7759928703308105,
0.7921025156974792,
0.23723550140857697,
0.7456181645393372,
-1.2586172819137573,
-1.1008323431015015,
-0.7563111186027527,
-0.6965799331665039,
1.9103816747665405,
-0.2424211949110031,
0.549501895904541,
-0.16030077636241913,
-1.2617971897125244,
-0.10323698818683624,
0.7261724472045898,
0.37558460235595703,
-0.5898724794387817,
0.7260280251502991,
-0.5543731451034546,
-1.0956308841705322,
-1.2806366682052612,
-0.5060421228408813,
-1.0386921167373657,
-0.9907510876655579,
0.9083486199378967,
0.7937672734260559,
0.3874407708644867,
1.7778807878494263,
0.7594537734985352,
0.16767741739749908,
-2.548724889755249,
0.9251827597618103,
0.31143683195114136,
-0.15070247650146484,
0.7629579305648804,
0.38211318850517273,
1.0636062622070312,
-0.08436037600040436,
0.6938899159431458,
-2.3819167613983154,
2.242574691772461,
-0.21248234808444977,
0.6121127009391785,
-0.049087733030319214,
-0.19328127801418304,
1.0107593536376953,
0.4033491015434265,
0.5422647595405579,
-1.125423789024353,
0.6543198823928833,
-0.622628927230835,
1.1869374513626099,
0.8931963443756104,
-0.9042195677757263,
-0.03712153434753418,
1.4583745002746582,
0.44942182302474976,
-0.6406657695770264,
-0.9626075625419617,
-0.9099765419960022,
0.9502641558647156,
1.659165620803833,
-0.18175141513347626,
-0.032066043466329575,
0.9370765089988708,
0.7064216136932373,
-1.3258033990859985,
0.03250100836157799,
-0.6007665991783142,
-0.6324458122253418,
1.7812142372131348,
1.9839798212051392,
-0.23754428327083588,
-0.11083751916885376,
-0.8044993877410889,
-1.2446211576461792,
0.7688701748847961,
0.047821756452322006,
-0.04235866665840149,
0.7366845011711121,
-0.6691776514053345,
1.111541509628296,
0.7429271936416626,
0.8401782512664795,
0.16604749858379364,
0.35694894194602966,
0.39698296785354614,
-0.38444334268569946,
-1.0809515714645386,
-0.3313397467136383,
-1.1516284942626953,
-2.4343135356903076,
0.46210020780563354,
-0.17506729066371918,
-1.2943536043167114,
0.031215902417898178,
-1.0366501808166504,
1.039839506149292,
-0.6215646862983704,
-1.10397207736969,
-1.3916239738464355,
0.3331880569458008,
0.007678281515836716,
0.8766912817955017,
-1.6547582149505615,
-0.012242876924574375,
1.2653635740280151,
0.9589892029762268,
-0.8435853719711304,
0.9754360914230347,
0.2876514196395874,
1.0429140329360962,
0.8390370011329651,
-0.34150612354278564,
0.5293456315994263,
0.017903152853250504,
-1.3236362934112549,
0.5531676411628723,
1.1985177993774414,
0.18843229115009308,
1.524823784828186,
-0.4648253619670868,
-0.07131480425596237,
0.4410966634750366,
-0.46004873514175415,
-0.46811264753341675,
-0.525667667388916,
0.5455625057220459,
0.16032487154006958,
-0.8873641490936279,
-0.01607847586274147,
0.11050868034362793,
-0.162043958902359,
0.2025076150894165,
-1.5159145593643188,
-0.14384843409061432,
-0.3338085114955902,
-0.543308436870575,
-1.1389662027359009,
-0.10997574031352997,
1.3630701303482056,
-0.6267086863517761,
-0.23558220267295837,
0.5840803384780884,
0.24989323318004608,
0.4081248939037323,
0.5388978719711304,
-0.6608248353004456,
-0.34624606370925903,
-0.28717508912086487,
-0.37870514392852783,
0.2660495936870575,
1.3382790088653564,
-0.10254524648189545,
-1.0327690839767456,
0.7114254832267761,
-0.38046741485595703,
0.01790117658674717,
1.8204545974731445,
0.009437302127480507,
-0.9040486216545105,
0.2595925033092499,
-0.6948704123497009,
1.9545464515686035,
1.771316647529602,
1.3141553401947021,
-0.12411923706531525,
-0.9034814238548279,
0.6248620748519897,
-0.4119490087032318,
-0.4104163944721222,
0.9021079540252686,
0.35273948311805725,
-0.18379825353622437,
-1.3998280763626099,
0.7535114884376526,
1.3365199565887451,
-0.885562539100647,
-0.837596595287323,
0.2050173282623291,
-0.7372769713401794,
1.1346616744995117,
0.7069920301437378,
0.36494210362434387,
0.264854371547699,
1.6612539291381836,
0.7748580574989319,
-0.36307522654533386,
0.6234508156776428,
0.54510098695755,
-0.13862374424934387,
-2.1084771156311035,
-1.2475379705429077,
0.2782052457332611,
-0.32765358686447144,
-1.6985596418380737,
1.3621885776519775,
-1.1679692268371582,
-0.9273279905319214,
0.5356234312057495,
0.08876463770866394,
1.4736016988754272,
0.4506278336048126,
1.5498456954956055,
2.0143654346466064,
0.8060800433158875,
0.38713338971138,
1.2457935810089111,
-0.18072067201137543,
-0.45483389496803284,
1.7565395832061768,
-0.48845431208610535,
0.5341606140136719,
1.0391696691513062,
-0.2912955582141876,
-1.15715491771698,
-0.8647501468658447,
-1.3981245756149292,
-0.670551598072052,
1.143888235092163,
0.07142786681652069,
-1.1933984756469727,
0.3859086334705353,
1.6795963048934937,
0.0005821483209729195,
-0.39323410391807556,
0.8481015563011169,
0.42741501331329346,
-0.9191299080848694,
-0.04010928422212601,
-0.8566521406173706,
0.525891900062561,
-0.16485999524593353,
-0.20299573242664337,
0.41587892174720764,
0.5348073244094849,
1.403336763381958,
0.04098198190331459,
0.08019441366195679,
1.1230913400650024,
-1.381697654724121,
1.5325405597686768,
-0.7483851313591003,
0.29072099924087524,
-2.3449883460998535,
1.3125332593917847,
-0.8098343014717102,
1.9965510368347168,
-2.663119316101074,
0.3781888484954834,
-0.4693680703639984,
-0.5356724262237549,
0.2624192535877228,
-0.34097111225128174,
0.09846833348274231,
-0.0646752119064331,
-1.1243101358413696,
-0.005706239491701126,
-0.7109706997871399,
0.541766345500946,
1.1603875160217285,
1.4559165239334106,
-1.1147295236587524,
-0.27344533801078796,
-1.7659717798233032,
-0.14729997515678406,
-0.5644429922103882,
0.3436012268066406,
-2.0014591217041016,
-0.24446378648281097,
-1.9051896333694458,
-2.3825135231018066,
-1.2486176490783691,
-0.8706293106079102,
1.0980435609817505,
0.021268397569656372,
-0.8840084671974182,
1.2674859762191772,
-0.31626832485198975,
-1.816851019859314,
1.0969473123550415,
-2.1013362407684326
] |
https://github.com/huggingface/datasets/issues/5046 | Audiofolder creates empty Dataset if files same level as metadata | I think we can make the file name matching part more robust by replacing `file_name` with `os.path.normpath(file_name)`, to ignore "./" among other things, in these two places:
* https://github.com/huggingface/datasets/blob/85cd129bde605cd9acacdff0d065fc02e39e09b1/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L319
* https://github.com/huggingface/datasets/blob/85cd129bde605cd9acacdff0d065fc02e39e09b1/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L388 | ## Describe the bug
When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns.
https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88
## Steps to reproduce the bug
`metadata.csv`:
```csv
file_name,duration,transcription
./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello
```
```python
>>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/")
>>> audio_dataset
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
I've tried, with no success,:
- setting `split` to something else so I don't get a `DatasetDict`,
- removing the `./`,
- using `.jsonl`.
## Expected results
```
Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 1
})
```
## Actual results
```
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
## Environment info
- `datasets` version: 2.5.1
- Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 500 | 31 | Audiofolder creates empty Dataset if files same level as metadata
## Describe the bug
When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns.
https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88
## Steps to reproduce the bug
`metadata.csv`:
```csv
file_name,duration,transcription
./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello
```
```python
>>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/")
>>> audio_dataset
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
I've tried, with no success,:
- setting `split` to something else so I don't get a `DatasetDict`,
- removing the `./`,
- using `.jsonl`.
## Expected results
```
Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 1
})
```
## Actual results
```
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
## Environment info
- `datasets` version: 2.5.1
- Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
I think we can make the file name matching part more robust by replacing `file_name` with `os.path.normpath(file_name)`, to ignore "./" among other things, in these two places:
* https://github.com/huggingface/datasets/blob/85cd129bde605cd9acacdff0d065fc02e39e09b1/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L319
* https://github.com/huggingface/datasets/blob/85cd129bde605cd9acacdff0d065fc02e39e09b1/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L388 | [
-1.0984050035476685,
-0.8700841665267944,
-0.8108354210853577,
1.521761417388916,
-0.1715753674507141,
-1.229474663734436,
0.1277168095111847,
-1.0119003057479858,
1.7276331186294556,
-0.6917034983634949,
0.28527912497520447,
-1.7581384181976318,
-0.04742668196558952,
-0.7117543816566467,
-0.7580369710922241,
-0.7877431511878967,
-0.3482806980609894,
-0.7880861163139343,
1.0022697448730469,
2.4686291217803955,
1.1296412944793701,
-1.3622938394546509,
2.6850900650024414,
0.7294648289680481,
-0.1924981027841568,
-0.9649866819381714,
0.5479466319084167,
-0.11084571480751038,
-1.2334164381027222,
-0.36062926054000854,
-0.8558696508407593,
-0.006561658810824156,
-0.5591222643852234,
-0.5716955065727234,
0.011913595721125603,
0.537900984287262,
-0.34111103415489197,
-0.5384940505027771,
-0.45885899662971497,
-0.8217993974685669,
0.4104755222797394,
-0.4085390567779541,
0.9179748892784119,
-0.24281607568264008,
1.736130952835083,
-0.5020362734794617,
0.32034793496131897,
0.6724489331245422,
1.366161584854126,
0.14834603667259216,
0.06925682723522186,
0.40866586565971375,
0.4009895622730255,
-0.02396230772137642,
0.4910864531993866,
1.1923385858535767,
0.6268468499183655,
0.43510618805885315,
0.8618782162666321,
-2.3697926998138428,
1.1768839359283447,
-0.9807748794555664,
0.30609628558158875,
1.3487331867218018,
-0.9403254985809326,
0.34614914655685425,
-1.8286430835723877,
0.056574854999780655,
0.5749227404594421,
-2.126497983932495,
0.36251088976860046,
-1.365035891532898,
-0.38269272446632385,
0.9859547019004822,
0.3454667627811432,
-1.20636785030365,
0.17827068269252777,
-0.2978113889694214,
1.0235432386398315,
0.39038923382759094,
1.1003828048706055,
-1.718106746673584,
0.018326062709093094,
-0.3334304690361023,
0.13378497958183289,
-1.2307491302490234,
-1.5703452825546265,
0.5334740877151489,
0.6398745775222778,
0.6979865431785583,
-0.24024635553359985,
0.9947444200515747,
-1.0285874605178833,
0.6335550546646118,
-1.0633814334869385,
-1.8191527128219604,
-1.3457204103469849,
-2.133718967437744,
-2.3108863830566406,
0.7112571597099304,
-0.5240370035171509,
-0.4336525499820709,
2.041755199432373,
-0.9289556741714478,
-1.7822892665863037,
1.1586978435516357,
0.4101862609386444,
-0.03215217590332031,
2.2937655448913574,
0.2808017432689667,
-0.7452642321586609,
0.49725571274757385,
-0.8076401352882385,
0.7718405723571777,
-0.323098361492157,
1.3432106971740723,
0.4401094317436218,
-1.0042122602462769,
1.7009503841400146,
-0.4574141204357147,
0.6254280209541321,
-0.683502197265625,
-0.4242122173309326,
-0.7525671720504761,
0.35068270564079285,
1.9447088241577148,
-0.2927137017250061,
1.4999140501022339,
-0.4096083343029022,
-1.6136581897735596,
-1.499792218208313,
0.9054527282714844,
0.5257716774940491,
-0.8579610586166382,
0.1628391295671463,
-0.3943701386451721,
0.17651380598545074,
-0.1685228943824768,
1.2081983089447021,
1.2779290676116943,
0.7069229483604431,
-0.3138362467288971,
-0.9162172079086304,
0.19454292953014374,
0.03416334092617035,
-0.7402023673057556,
-1.7606163024902344,
-0.30846187472343445,
0.14504468441009521,
0.5838578343391418,
-1.1638966798782349,
1.7237786054611206,
0.7946417331695557,
1.9530662298202515,
0.9739816188812256,
-0.41926947236061096,
1.5327637195587158,
0.11215853691101074,
1.9012620449066162,
-0.5369160175323486,
0.6401401162147522,
-0.45263099670410156,
-1.1460564136505127,
0.9684323072433472,
-0.28788265585899353,
-1.9852333068847656,
-0.680686891078949,
-0.8612626791000366,
-0.2223752737045288,
-0.7474745512008667,
0.8947058916091919,
-0.2604582905769348,
-1.4863269329071045,
0.22023335099220276,
-0.7712931036949158,
0.17055369913578033,
-1.271657109260559,
0.24654386937618256,
0.7072717547416687,
-0.6175756454467773,
0.06682927906513214,
-0.30920183658599854,
-1.3119374513626099,
-0.44297972321510315,
0.392689049243927,
1.856957197189331,
-0.8020246624946594,
0.9002234935760498,
1.0584014654159546,
-0.6522687673568726,
-0.011548799462616444,
0.22232604026794434,
-0.2734343707561493,
0.7996840476989746,
-1.0749268531799316,
-0.4912269115447998,
1.167676329612732,
-0.14254483580589294,
-0.6005434393882751,
1.403560757637024,
0.7569501996040344,
-1.0588709115982056,
-0.2212676852941513,
-0.2081570327281952,
-0.7995304465293884,
-0.0058482326567173,
-1.6167373657226562,
-0.12446466088294983,
0.49806955456733704,
-1.5031497478485107,
-0.520416796207428,
-0.2864776849746704,
1.2599066495895386,
-0.18864107131958008,
1.339627981185913,
-0.3212462365627289,
-0.17447225749492645,
-0.3815174698829651,
-0.46105387806892395,
0.14225414395332336,
-0.2250845581293106,
-0.619460940361023,
0.129024475812912,
-0.7774202823638916,
0.38245445489883423,
1.3689353466033936,
0.26210910081863403,
0.03411601483821869,
0.515464186668396,
1.1912500858306885,
0.43304774165153503,
0.12846426665782928,
-0.9019847512245178,
-1.5938568115234375,
1.9498467445373535,
-1.5252931118011475,
1.930159091949463,
0.6280083060264587,
0.08389827609062195,
-1.7697935104370117,
-1.892690658569336,
1.488358736038208,
1.1274869441986084,
2.316688060760498,
0.613460123538971,
0.4464138448238373,
-0.8297078609466553,
-0.6264867782592773,
0.26443392038345337,
-0.9400790929794312,
-0.7120968103408813,
0.204756498336792,
2.412175416946411,
1.72145676612854,
-0.5358238816261292,
-0.3070678412914276,
-0.9144553542137146,
1.4049813747406006,
-0.21094492077827454,
0.3060641586780548,
1.98164701461792,
-0.29622769355773926,
-1.0200399160385132,
1.331128478050232,
-2.4434404373168945,
0.1857789307832718,
2.0369675159454346,
0.15637293457984924,
0.1993243545293808,
-1.3452492952346802,
-0.7075554132461548,
-0.12367016077041626,
-0.5074623823165894,
-1.2820082902908325,
0.5514904856681824,
-0.2200831174850464,
-0.7651302814483643,
-1.4396644830703735,
0.25156089663505554,
-1.0883830785751343,
-1.6478772163391113,
0.19339603185653687,
1.9559862613677979,
2.0370306968688965,
-0.8579050302505493,
1.6289039850234985,
-0.25745460391044617,
0.31042617559432983,
1.2753584384918213,
1.3116179704666138,
3.0342202186584473,
1.8460557460784912,
-1.2409664392471313,
0.7018234133720398,
-0.20937824249267578,
-0.5544893741607666,
1.2595189809799194,
-1.1322200298309326,
1.1277607679367065,
-0.2298327088356018,
-1.2175054550170898,
-1.2624601125717163,
0.8351966738700867,
0.47873759269714355,
0.06035934016108513,
-0.449623167514801,
1.1834110021591187,
-0.026833051815629005,
1.2587217092514038,
0.7037503719329834,
-0.37400493025779724,
0.6250112652778625,
-0.33281591534614563,
-0.5171686410903931,
1.5300753116607666,
0.14590290188789368,
-1.330614686012268,
-2.324679374694824,
-0.2613128125667572,
-0.8211491703987122,
-0.008405283093452454,
-0.5959542393684387,
-1.0452555418014526,
1.582782506942749,
0.3552117645740509,
-1.168088674545288,
-0.24073536694049835,
-0.3095903992652893,
-0.45019614696502686,
2.630180835723877,
-1.3712812662124634,
-0.27726608514785767,
-1.0067355632781982,
-0.5930476784706116,
1.7492432594299316,
-1.0717201232910156,
-0.21368657052516937,
-1.0582307577133179,
-0.482153981924057,
-1.3953289985656738,
-0.5890079140663147,
0.031978901475667953,
-0.853888213634491,
0.9354169964790344,
0.23574741184711456,
-1.261154294013977,
-0.2958575487136841,
-0.9680110216140747,
0.9070561528205872,
-0.29479485750198364,
0.20467910170555115,
1.9487652778625488,
0.48094820976257324,
-0.32887616753578186,
0.8194990754127502,
1.1622670888900757,
0.6302666068077087,
-0.6268411874771118,
0.2293667197227478,
-0.6552621126174927,
0.2755924463272095,
-1.4438188076019287,
0.18921586871147156,
-2.817540168762207,
0.630674421787262,
0.01394917443394661,
-0.07978707551956177,
-0.04814000427722931,
-1.4075126647949219,
1.0853705406188965,
2.5582735538482666,
-1.3031721115112305,
0.5077382326126099,
0.29248327016830444,
1.327467441558838,
-1.6486217975616455,
0.12035337090492249,
-0.41382184624671936,
2.1529150009155273,
0.1056978702545166,
1.2858259677886963,
-0.34052345156669617,
-2.380702257156372,
0.5401220321655273,
-1.305955171585083,
-1.1274741888046265,
0.6998111009597778,
-0.878807544708252,
0.16879653930664062,
-1.5649272203445435,
-0.24189263582229614,
-0.9542926549911499,
-1.1810334920883179,
0.7566661834716797,
0.08236315846443176,
0.3795308470726013,
-0.6343581676483154,
0.4001632332801819,
-2.1527724266052246,
-1.42438805103302,
-0.16023431718349457,
-0.9226727485656738,
0.49450328946113586,
-0.3176764249801636,
0.690153181552887,
-0.17532838881015778,
-0.008848287165164948,
0.34041517972946167,
1.4867628812789917,
3.4466359615325928,
0.22865702211856842,
0.2989245355129242,
-0.22848115861415863,
-0.9240094423294067,
1.4735629558563232,
0.9595984220504761,
-0.11862674355506897,
-0.49462708830833435,
-1.1035248041152954,
1.2835732698440552,
2.037139892578125,
1.0245500802993774,
-0.026823673397302628,
-0.7898147106170654,
-0.7323269844055176,
-0.02464103326201439,
0.12597857415676117,
0.4839600622653961,
0.79305100440979,
0.15095922350883484,
0.030657276511192322,
1.3079832792282104,
1.0236876010894775,
-0.3600747287273407,
0.4660877287387848,
-0.9074681401252747,
-0.46704670786857605,
0.49184897541999817,
0.2095557153224945,
0.033046141266822815,
0.36522915959358215,
-1.080376148223877,
-0.30654409527778625,
-0.34112516045570374,
-0.8380724787712097,
-0.7095232009887695,
-0.43996313214302063,
-0.32113462686538696,
1.558367133140564,
0.12410014867782593,
-0.6411164402961731,
-0.09019462764263153,
-0.6981253027915955,
-0.11349916458129883,
-1.0003489255905151,
0.16169854998588562,
-0.28351056575775146,
-0.10320942103862762,
-0.12110620737075806,
1.6058064699172974,
-0.9412860870361328,
-1.9950734376907349,
0.1399325728416443,
0.37330010533332825,
-0.35361453890800476,
0.20142221450805664,
1.7084338665008545,
0.6216105818748474,
1.4269336462020874,
1.3934718370437622,
1.0480906963348389,
-0.646555483341217,
-1.3166636228561401,
0.6558077931404114,
0.9527031183242798,
-1.3256858587265015,
0.727656900882721,
-0.0019829003140330315,
-0.5701408386230469,
0.563497006893158,
1.334420084953308,
0.5111966133117676,
-2.038207530975342,
0.7418956756591797,
-0.9979702830314636,
0.7737375497817993,
0.7759928703308105,
0.7921025156974792,
0.23723550140857697,
0.7456181645393372,
-1.2586172819137573,
-1.1008323431015015,
-0.7563111186027527,
-0.6965799331665039,
1.9103816747665405,
-0.2424211949110031,
0.549501895904541,
-0.16030077636241913,
-1.2617971897125244,
-0.10323698818683624,
0.7261724472045898,
0.37558460235595703,
-0.5898724794387817,
0.7260280251502991,
-0.5543731451034546,
-1.0956308841705322,
-1.2806366682052612,
-0.5060421228408813,
-1.0386921167373657,
-0.9907510876655579,
0.9083486199378967,
0.7937672734260559,
0.3874407708644867,
1.7778807878494263,
0.7594537734985352,
0.16767741739749908,
-2.548724889755249,
0.9251827597618103,
0.31143683195114136,
-0.15070247650146484,
0.7629579305648804,
0.38211318850517273,
1.0636062622070312,
-0.08436037600040436,
0.6938899159431458,
-2.3819167613983154,
2.242574691772461,
-0.21248234808444977,
0.6121127009391785,
-0.049087733030319214,
-0.19328127801418304,
1.0107593536376953,
0.4033491015434265,
0.5422647595405579,
-1.125423789024353,
0.6543198823928833,
-0.622628927230835,
1.1869374513626099,
0.8931963443756104,
-0.9042195677757263,
-0.03712153434753418,
1.4583745002746582,
0.44942182302474976,
-0.6406657695770264,
-0.9626075625419617,
-0.9099765419960022,
0.9502641558647156,
1.659165620803833,
-0.18175141513347626,
-0.032066043466329575,
0.9370765089988708,
0.7064216136932373,
-1.3258033990859985,
0.03250100836157799,
-0.6007665991783142,
-0.6324458122253418,
1.7812142372131348,
1.9839798212051392,
-0.23754428327083588,
-0.11083751916885376,
-0.8044993877410889,
-1.2446211576461792,
0.7688701748847961,
0.047821756452322006,
-0.04235866665840149,
0.7366845011711121,
-0.6691776514053345,
1.111541509628296,
0.7429271936416626,
0.8401782512664795,
0.16604749858379364,
0.35694894194602966,
0.39698296785354614,
-0.38444334268569946,
-1.0809515714645386,
-0.3313397467136383,
-1.1516284942626953,
-2.4343135356903076,
0.46210020780563354,
-0.17506729066371918,
-1.2943536043167114,
0.031215902417898178,
-1.0366501808166504,
1.039839506149292,
-0.6215646862983704,
-1.10397207736969,
-1.3916239738464355,
0.3331880569458008,
0.007678281515836716,
0.8766912817955017,
-1.6547582149505615,
-0.012242876924574375,
1.2653635740280151,
0.9589892029762268,
-0.8435853719711304,
0.9754360914230347,
0.2876514196395874,
1.0429140329360962,
0.8390370011329651,
-0.34150612354278564,
0.5293456315994263,
0.017903152853250504,
-1.3236362934112549,
0.5531676411628723,
1.1985177993774414,
0.18843229115009308,
1.524823784828186,
-0.4648253619670868,
-0.07131480425596237,
0.4410966634750366,
-0.46004873514175415,
-0.46811264753341675,
-0.525667667388916,
0.5455625057220459,
0.16032487154006958,
-0.8873641490936279,
-0.01607847586274147,
0.11050868034362793,
-0.162043958902359,
0.2025076150894165,
-1.5159145593643188,
-0.14384843409061432,
-0.3338085114955902,
-0.543308436870575,
-1.1389662027359009,
-0.10997574031352997,
1.3630701303482056,
-0.6267086863517761,
-0.23558220267295837,
0.5840803384780884,
0.24989323318004608,
0.4081248939037323,
0.5388978719711304,
-0.6608248353004456,
-0.34624606370925903,
-0.28717508912086487,
-0.37870514392852783,
0.2660495936870575,
1.3382790088653564,
-0.10254524648189545,
-1.0327690839767456,
0.7114254832267761,
-0.38046741485595703,
0.01790117658674717,
1.8204545974731445,
0.009437302127480507,
-0.9040486216545105,
0.2595925033092499,
-0.6948704123497009,
1.9545464515686035,
1.771316647529602,
1.3141553401947021,
-0.12411923706531525,
-0.9034814238548279,
0.6248620748519897,
-0.4119490087032318,
-0.4104163944721222,
0.9021079540252686,
0.35273948311805725,
-0.18379825353622437,
-1.3998280763626099,
0.7535114884376526,
1.3365199565887451,
-0.885562539100647,
-0.837596595287323,
0.2050173282623291,
-0.7372769713401794,
1.1346616744995117,
0.7069920301437378,
0.36494210362434387,
0.264854371547699,
1.6612539291381836,
0.7748580574989319,
-0.36307522654533386,
0.6234508156776428,
0.54510098695755,
-0.13862374424934387,
-2.1084771156311035,
-1.2475379705429077,
0.2782052457332611,
-0.32765358686447144,
-1.6985596418380737,
1.3621885776519775,
-1.1679692268371582,
-0.9273279905319214,
0.5356234312057495,
0.08876463770866394,
1.4736016988754272,
0.4506278336048126,
1.5498456954956055,
2.0143654346466064,
0.8060800433158875,
0.38713338971138,
1.2457935810089111,
-0.18072067201137543,
-0.45483389496803284,
1.7565395832061768,
-0.48845431208610535,
0.5341606140136719,
1.0391696691513062,
-0.2912955582141876,
-1.15715491771698,
-0.8647501468658447,
-1.3981245756149292,
-0.670551598072052,
1.143888235092163,
0.07142786681652069,
-1.1933984756469727,
0.3859086334705353,
1.6795963048934937,
0.0005821483209729195,
-0.39323410391807556,
0.8481015563011169,
0.42741501331329346,
-0.9191299080848694,
-0.04010928422212601,
-0.8566521406173706,
0.525891900062561,
-0.16485999524593353,
-0.20299573242664337,
0.41587892174720764,
0.5348073244094849,
1.403336763381958,
0.04098198190331459,
0.08019441366195679,
1.1230913400650024,
-1.381697654724121,
1.5325405597686768,
-0.7483851313591003,
0.29072099924087524,
-2.3449883460998535,
1.3125332593917847,
-0.8098343014717102,
1.9965510368347168,
-2.663119316101074,
0.3781888484954834,
-0.4693680703639984,
-0.5356724262237549,
0.2624192535877228,
-0.34097111225128174,
0.09846833348274231,
-0.0646752119064331,
-1.1243101358413696,
-0.005706239491701126,
-0.7109706997871399,
0.541766345500946,
1.1603875160217285,
1.4559165239334106,
-1.1147295236587524,
-0.27344533801078796,
-1.7659717798233032,
-0.14729997515678406,
-0.5644429922103882,
0.3436012268066406,
-2.0014591217041016,
-0.24446378648281097,
-1.9051896333694458,
-2.3825135231018066,
-1.2486176490783691,
-0.8706293106079102,
1.0980435609817505,
0.021268397569656372,
-0.8840084671974182,
1.2674859762191772,
-0.31626832485198975,
-1.816851019859314,
1.0969473123550415,
-2.1013362407684326
] |
https://github.com/huggingface/datasets/issues/5046 | Audiofolder creates empty Dataset if files same level as metadata | I realized what I was doing wrong.
The documentation puts the files in a subfolder.
Once I have done that, it worked.
But l agree that this should be handled better if possible. | ## Describe the bug
When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns.
https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88
## Steps to reproduce the bug
`metadata.csv`:
```csv
file_name,duration,transcription
./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello
```
```python
>>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/")
>>> audio_dataset
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
I've tried, with no success,:
- setting `split` to something else so I don't get a `DatasetDict`,
- removing the `./`,
- using `.jsonl`.
## Expected results
```
Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 1
})
```
## Actual results
```
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
## Environment info
- `datasets` version: 2.5.1
- Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 500 | 33 | Audiofolder creates empty Dataset if files same level as metadata
## Describe the bug
When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns.
https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88
## Steps to reproduce the bug
`metadata.csv`:
```csv
file_name,duration,transcription
./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello
```
```python
>>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/")
>>> audio_dataset
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
I've tried, with no success,:
- setting `split` to something else so I don't get a `DatasetDict`,
- removing the `./`,
- using `.jsonl`.
## Expected results
```
Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 1
})
```
## Actual results
```
DatasetDict({
train: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
validation: Dataset({
features: ['audio', 'duration', 'transcription'],
num_rows: 0
})
})
```
## Environment info
- `datasets` version: 2.5.1
- Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
I realized what I was doing wrong.
The documentation puts the files in a subfolder.
Once I have done that, it worked.
But l agree that this should be handled better if possible. | [
-1.0984050035476685,
-0.8700841665267944,
-0.8108354210853577,
1.521761417388916,
-0.1715753674507141,
-1.229474663734436,
0.1277168095111847,
-1.0119003057479858,
1.7276331186294556,
-0.6917034983634949,
0.28527912497520447,
-1.7581384181976318,
-0.04742668196558952,
-0.7117543816566467,
-0.7580369710922241,
-0.7877431511878967,
-0.3482806980609894,
-0.7880861163139343,
1.0022697448730469,
2.4686291217803955,
1.1296412944793701,
-1.3622938394546509,
2.6850900650024414,
0.7294648289680481,
-0.1924981027841568,
-0.9649866819381714,
0.5479466319084167,
-0.11084571480751038,
-1.2334164381027222,
-0.36062926054000854,
-0.8558696508407593,
-0.006561658810824156,
-0.5591222643852234,
-0.5716955065727234,
0.011913595721125603,
0.537900984287262,
-0.34111103415489197,
-0.5384940505027771,
-0.45885899662971497,
-0.8217993974685669,
0.4104755222797394,
-0.4085390567779541,
0.9179748892784119,
-0.24281607568264008,
1.736130952835083,
-0.5020362734794617,
0.32034793496131897,
0.6724489331245422,
1.366161584854126,
0.14834603667259216,
0.06925682723522186,
0.40866586565971375,
0.4009895622730255,
-0.02396230772137642,
0.4910864531993866,
1.1923385858535767,
0.6268468499183655,
0.43510618805885315,
0.8618782162666321,
-2.3697926998138428,
1.1768839359283447,
-0.9807748794555664,
0.30609628558158875,
1.3487331867218018,
-0.9403254985809326,
0.34614914655685425,
-1.8286430835723877,
0.056574854999780655,
0.5749227404594421,
-2.126497983932495,
0.36251088976860046,
-1.365035891532898,
-0.38269272446632385,
0.9859547019004822,
0.3454667627811432,
-1.20636785030365,
0.17827068269252777,
-0.2978113889694214,
1.0235432386398315,
0.39038923382759094,
1.1003828048706055,
-1.718106746673584,
0.018326062709093094,
-0.3334304690361023,
0.13378497958183289,
-1.2307491302490234,
-1.5703452825546265,
0.5334740877151489,
0.6398745775222778,
0.6979865431785583,
-0.24024635553359985,
0.9947444200515747,
-1.0285874605178833,
0.6335550546646118,
-1.0633814334869385,
-1.8191527128219604,
-1.3457204103469849,
-2.133718967437744,
-2.3108863830566406,
0.7112571597099304,
-0.5240370035171509,
-0.4336525499820709,
2.041755199432373,
-0.9289556741714478,
-1.7822892665863037,
1.1586978435516357,
0.4101862609386444,
-0.03215217590332031,
2.2937655448913574,
0.2808017432689667,
-0.7452642321586609,
0.49725571274757385,
-0.8076401352882385,
0.7718405723571777,
-0.323098361492157,
1.3432106971740723,
0.4401094317436218,
-1.0042122602462769,
1.7009503841400146,
-0.4574141204357147,
0.6254280209541321,
-0.683502197265625,
-0.4242122173309326,
-0.7525671720504761,
0.35068270564079285,
1.9447088241577148,
-0.2927137017250061,
1.4999140501022339,
-0.4096083343029022,
-1.6136581897735596,
-1.499792218208313,
0.9054527282714844,
0.5257716774940491,
-0.8579610586166382,
0.1628391295671463,
-0.3943701386451721,
0.17651380598545074,
-0.1685228943824768,
1.2081983089447021,
1.2779290676116943,
0.7069229483604431,
-0.3138362467288971,
-0.9162172079086304,
0.19454292953014374,
0.03416334092617035,
-0.7402023673057556,
-1.7606163024902344,
-0.30846187472343445,
0.14504468441009521,
0.5838578343391418,
-1.1638966798782349,
1.7237786054611206,
0.7946417331695557,
1.9530662298202515,
0.9739816188812256,
-0.41926947236061096,
1.5327637195587158,
0.11215853691101074,
1.9012620449066162,
-0.5369160175323486,
0.6401401162147522,
-0.45263099670410156,
-1.1460564136505127,
0.9684323072433472,
-0.28788265585899353,
-1.9852333068847656,
-0.680686891078949,
-0.8612626791000366,
-0.2223752737045288,
-0.7474745512008667,
0.8947058916091919,
-0.2604582905769348,
-1.4863269329071045,
0.22023335099220276,
-0.7712931036949158,
0.17055369913578033,
-1.271657109260559,
0.24654386937618256,
0.7072717547416687,
-0.6175756454467773,
0.06682927906513214,
-0.30920183658599854,
-1.3119374513626099,
-0.44297972321510315,
0.392689049243927,
1.856957197189331,
-0.8020246624946594,
0.9002234935760498,
1.0584014654159546,
-0.6522687673568726,
-0.011548799462616444,
0.22232604026794434,
-0.2734343707561493,
0.7996840476989746,
-1.0749268531799316,
-0.4912269115447998,
1.167676329612732,
-0.14254483580589294,
-0.6005434393882751,
1.403560757637024,
0.7569501996040344,
-1.0588709115982056,
-0.2212676852941513,
-0.2081570327281952,
-0.7995304465293884,
-0.0058482326567173,
-1.6167373657226562,
-0.12446466088294983,
0.49806955456733704,
-1.5031497478485107,
-0.520416796207428,
-0.2864776849746704,
1.2599066495895386,
-0.18864107131958008,
1.339627981185913,
-0.3212462365627289,
-0.17447225749492645,
-0.3815174698829651,
-0.46105387806892395,
0.14225414395332336,
-0.2250845581293106,
-0.619460940361023,
0.129024475812912,
-0.7774202823638916,
0.38245445489883423,
1.3689353466033936,
0.26210910081863403,
0.03411601483821869,
0.515464186668396,
1.1912500858306885,
0.43304774165153503,
0.12846426665782928,
-0.9019847512245178,
-1.5938568115234375,
1.9498467445373535,
-1.5252931118011475,
1.930159091949463,
0.6280083060264587,
0.08389827609062195,
-1.7697935104370117,
-1.892690658569336,
1.488358736038208,
1.1274869441986084,
2.316688060760498,
0.613460123538971,
0.4464138448238373,
-0.8297078609466553,
-0.6264867782592773,
0.26443392038345337,
-0.9400790929794312,
-0.7120968103408813,
0.204756498336792,
2.412175416946411,
1.72145676612854,
-0.5358238816261292,
-0.3070678412914276,
-0.9144553542137146,
1.4049813747406006,
-0.21094492077827454,
0.3060641586780548,
1.98164701461792,
-0.29622769355773926,
-1.0200399160385132,
1.331128478050232,
-2.4434404373168945,
0.1857789307832718,
2.0369675159454346,
0.15637293457984924,
0.1993243545293808,
-1.3452492952346802,
-0.7075554132461548,
-0.12367016077041626,
-0.5074623823165894,
-1.2820082902908325,
0.5514904856681824,
-0.2200831174850464,
-0.7651302814483643,
-1.4396644830703735,
0.25156089663505554,
-1.0883830785751343,
-1.6478772163391113,
0.19339603185653687,
1.9559862613677979,
2.0370306968688965,
-0.8579050302505493,
1.6289039850234985,
-0.25745460391044617,
0.31042617559432983,
1.2753584384918213,
1.3116179704666138,
3.0342202186584473,
1.8460557460784912,
-1.2409664392471313,
0.7018234133720398,
-0.20937824249267578,
-0.5544893741607666,
1.2595189809799194,
-1.1322200298309326,
1.1277607679367065,
-0.2298327088356018,
-1.2175054550170898,
-1.2624601125717163,
0.8351966738700867,
0.47873759269714355,
0.06035934016108513,
-0.449623167514801,
1.1834110021591187,
-0.026833051815629005,
1.2587217092514038,
0.7037503719329834,
-0.37400493025779724,
0.6250112652778625,
-0.33281591534614563,
-0.5171686410903931,
1.5300753116607666,
0.14590290188789368,
-1.330614686012268,
-2.324679374694824,
-0.2613128125667572,
-0.8211491703987122,
-0.008405283093452454,
-0.5959542393684387,
-1.0452555418014526,
1.582782506942749,
0.3552117645740509,
-1.168088674545288,
-0.24073536694049835,
-0.3095903992652893,
-0.45019614696502686,
2.630180835723877,
-1.3712812662124634,
-0.27726608514785767,
-1.0067355632781982,
-0.5930476784706116,
1.7492432594299316,
-1.0717201232910156,
-0.21368657052516937,
-1.0582307577133179,
-0.482153981924057,
-1.3953289985656738,
-0.5890079140663147,
0.031978901475667953,
-0.853888213634491,
0.9354169964790344,
0.23574741184711456,
-1.261154294013977,
-0.2958575487136841,
-0.9680110216140747,
0.9070561528205872,
-0.29479485750198364,
0.20467910170555115,
1.9487652778625488,
0.48094820976257324,
-0.32887616753578186,
0.8194990754127502,
1.1622670888900757,
0.6302666068077087,
-0.6268411874771118,
0.2293667197227478,
-0.6552621126174927,
0.2755924463272095,
-1.4438188076019287,
0.18921586871147156,
-2.817540168762207,
0.630674421787262,
0.01394917443394661,
-0.07978707551956177,
-0.04814000427722931,
-1.4075126647949219,
1.0853705406188965,
2.5582735538482666,
-1.3031721115112305,
0.5077382326126099,
0.29248327016830444,
1.327467441558838,
-1.6486217975616455,
0.12035337090492249,
-0.41382184624671936,
2.1529150009155273,
0.1056978702545166,
1.2858259677886963,
-0.34052345156669617,
-2.380702257156372,
0.5401220321655273,
-1.305955171585083,
-1.1274741888046265,
0.6998111009597778,
-0.878807544708252,
0.16879653930664062,
-1.5649272203445435,
-0.24189263582229614,
-0.9542926549911499,
-1.1810334920883179,
0.7566661834716797,
0.08236315846443176,
0.3795308470726013,
-0.6343581676483154,
0.4001632332801819,
-2.1527724266052246,
-1.42438805103302,
-0.16023431718349457,
-0.9226727485656738,
0.49450328946113586,
-0.3176764249801636,
0.690153181552887,
-0.17532838881015778,
-0.008848287165164948,
0.34041517972946167,
1.4867628812789917,
3.4466359615325928,
0.22865702211856842,
0.2989245355129242,
-0.22848115861415863,
-0.9240094423294067,
1.4735629558563232,
0.9595984220504761,
-0.11862674355506897,
-0.49462708830833435,
-1.1035248041152954,
1.2835732698440552,
2.037139892578125,
1.0245500802993774,
-0.026823673397302628,
-0.7898147106170654,
-0.7323269844055176,
-0.02464103326201439,
0.12597857415676117,
0.4839600622653961,
0.79305100440979,
0.15095922350883484,
0.030657276511192322,
1.3079832792282104,
1.0236876010894775,
-0.3600747287273407,
0.4660877287387848,
-0.9074681401252747,
-0.46704670786857605,
0.49184897541999817,
0.2095557153224945,
0.033046141266822815,
0.36522915959358215,
-1.080376148223877,
-0.30654409527778625,
-0.34112516045570374,
-0.8380724787712097,
-0.7095232009887695,
-0.43996313214302063,
-0.32113462686538696,
1.558367133140564,
0.12410014867782593,
-0.6411164402961731,
-0.09019462764263153,
-0.6981253027915955,
-0.11349916458129883,
-1.0003489255905151,
0.16169854998588562,
-0.28351056575775146,
-0.10320942103862762,
-0.12110620737075806,
1.6058064699172974,
-0.9412860870361328,
-1.9950734376907349,
0.1399325728416443,
0.37330010533332825,
-0.35361453890800476,
0.20142221450805664,
1.7084338665008545,
0.6216105818748474,
1.4269336462020874,
1.3934718370437622,
1.0480906963348389,
-0.646555483341217,
-1.3166636228561401,
0.6558077931404114,
0.9527031183242798,
-1.3256858587265015,
0.727656900882721,
-0.0019829003140330315,
-0.5701408386230469,
0.563497006893158,
1.334420084953308,
0.5111966133117676,
-2.038207530975342,
0.7418956756591797,
-0.9979702830314636,
0.7737375497817993,
0.7759928703308105,
0.7921025156974792,
0.23723550140857697,
0.7456181645393372,
-1.2586172819137573,
-1.1008323431015015,
-0.7563111186027527,
-0.6965799331665039,
1.9103816747665405,
-0.2424211949110031,
0.549501895904541,
-0.16030077636241913,
-1.2617971897125244,
-0.10323698818683624,
0.7261724472045898,
0.37558460235595703,
-0.5898724794387817,
0.7260280251502991,
-0.5543731451034546,
-1.0956308841705322,
-1.2806366682052612,
-0.5060421228408813,
-1.0386921167373657,
-0.9907510876655579,
0.9083486199378967,
0.7937672734260559,
0.3874407708644867,
1.7778807878494263,
0.7594537734985352,
0.16767741739749908,
-2.548724889755249,
0.9251827597618103,
0.31143683195114136,
-0.15070247650146484,
0.7629579305648804,
0.38211318850517273,
1.0636062622070312,
-0.08436037600040436,
0.6938899159431458,
-2.3819167613983154,
2.242574691772461,
-0.21248234808444977,
0.6121127009391785,
-0.049087733030319214,
-0.19328127801418304,
1.0107593536376953,
0.4033491015434265,
0.5422647595405579,
-1.125423789024353,
0.6543198823928833,
-0.622628927230835,
1.1869374513626099,
0.8931963443756104,
-0.9042195677757263,
-0.03712153434753418,
1.4583745002746582,
0.44942182302474976,
-0.6406657695770264,
-0.9626075625419617,
-0.9099765419960022,
0.9502641558647156,
1.659165620803833,
-0.18175141513347626,
-0.032066043466329575,
0.9370765089988708,
0.7064216136932373,
-1.3258033990859985,
0.03250100836157799,
-0.6007665991783142,
-0.6324458122253418,
1.7812142372131348,
1.9839798212051392,
-0.23754428327083588,
-0.11083751916885376,
-0.8044993877410889,
-1.2446211576461792,
0.7688701748847961,
0.047821756452322006,
-0.04235866665840149,
0.7366845011711121,
-0.6691776514053345,
1.111541509628296,
0.7429271936416626,
0.8401782512664795,
0.16604749858379364,
0.35694894194602966,
0.39698296785354614,
-0.38444334268569946,
-1.0809515714645386,
-0.3313397467136383,
-1.1516284942626953,
-2.4343135356903076,
0.46210020780563354,
-0.17506729066371918,
-1.2943536043167114,
0.031215902417898178,
-1.0366501808166504,
1.039839506149292,
-0.6215646862983704,
-1.10397207736969,
-1.3916239738464355,
0.3331880569458008,
0.007678281515836716,
0.8766912817955017,
-1.6547582149505615,
-0.012242876924574375,
1.2653635740280151,
0.9589892029762268,
-0.8435853719711304,
0.9754360914230347,
0.2876514196395874,
1.0429140329360962,
0.8390370011329651,
-0.34150612354278564,
0.5293456315994263,
0.017903152853250504,
-1.3236362934112549,
0.5531676411628723,
1.1985177993774414,
0.18843229115009308,
1.524823784828186,
-0.4648253619670868,
-0.07131480425596237,
0.4410966634750366,
-0.46004873514175415,
-0.46811264753341675,
-0.525667667388916,
0.5455625057220459,
0.16032487154006958,
-0.8873641490936279,
-0.01607847586274147,
0.11050868034362793,
-0.162043958902359,
0.2025076150894165,
-1.5159145593643188,
-0.14384843409061432,
-0.3338085114955902,
-0.543308436870575,
-1.1389662027359009,
-0.10997574031352997,
1.3630701303482056,
-0.6267086863517761,
-0.23558220267295837,
0.5840803384780884,
0.24989323318004608,
0.4081248939037323,
0.5388978719711304,
-0.6608248353004456,
-0.34624606370925903,
-0.28717508912086487,
-0.37870514392852783,
0.2660495936870575,
1.3382790088653564,
-0.10254524648189545,
-1.0327690839767456,
0.7114254832267761,
-0.38046741485595703,
0.01790117658674717,
1.8204545974731445,
0.009437302127480507,
-0.9040486216545105,
0.2595925033092499,
-0.6948704123497009,
1.9545464515686035,
1.771316647529602,
1.3141553401947021,
-0.12411923706531525,
-0.9034814238548279,
0.6248620748519897,
-0.4119490087032318,
-0.4104163944721222,
0.9021079540252686,
0.35273948311805725,
-0.18379825353622437,
-1.3998280763626099,
0.7535114884376526,
1.3365199565887451,
-0.885562539100647,
-0.837596595287323,
0.2050173282623291,
-0.7372769713401794,
1.1346616744995117,
0.7069920301437378,
0.36494210362434387,
0.264854371547699,
1.6612539291381836,
0.7748580574989319,
-0.36307522654533386,
0.6234508156776428,
0.54510098695755,
-0.13862374424934387,
-2.1084771156311035,
-1.2475379705429077,
0.2782052457332611,
-0.32765358686447144,
-1.6985596418380737,
1.3621885776519775,
-1.1679692268371582,
-0.9273279905319214,
0.5356234312057495,
0.08876463770866394,
1.4736016988754272,
0.4506278336048126,
1.5498456954956055,
2.0143654346466064,
0.8060800433158875,
0.38713338971138,
1.2457935810089111,
-0.18072067201137543,
-0.45483389496803284,
1.7565395832061768,
-0.48845431208610535,
0.5341606140136719,
1.0391696691513062,
-0.2912955582141876,
-1.15715491771698,
-0.8647501468658447,
-1.3981245756149292,
-0.670551598072052,
1.143888235092163,
0.07142786681652069,
-1.1933984756469727,
0.3859086334705353,
1.6795963048934937,
0.0005821483209729195,
-0.39323410391807556,
0.8481015563011169,
0.42741501331329346,
-0.9191299080848694,
-0.04010928422212601,
-0.8566521406173706,
0.525891900062561,
-0.16485999524593353,
-0.20299573242664337,
0.41587892174720764,
0.5348073244094849,
1.403336763381958,
0.04098198190331459,
0.08019441366195679,
1.1230913400650024,
-1.381697654724121,
1.5325405597686768,
-0.7483851313591003,
0.29072099924087524,
-2.3449883460998535,
1.3125332593917847,
-0.8098343014717102,
1.9965510368347168,
-2.663119316101074,
0.3781888484954834,
-0.4693680703639984,
-0.5356724262237549,
0.2624192535877228,
-0.34097111225128174,
0.09846833348274231,
-0.0646752119064331,
-1.1243101358413696,
-0.005706239491701126,
-0.7109706997871399,
0.541766345500946,
1.1603875160217285,
1.4559165239334106,
-1.1147295236587524,
-0.27344533801078796,
-1.7659717798233032,
-0.14729997515678406,
-0.5644429922103882,
0.3436012268066406,
-2.0014591217041016,
-0.24446378648281097,
-1.9051896333694458,
-2.3825135231018066,
-1.2486176490783691,
-0.8706293106079102,
1.0980435609817505,
0.021268397569656372,
-0.8840084671974182,
1.2674859762191772,
-0.31626832485198975,
-1.816851019859314,
1.0969473123550415,
-2.1013362407684326
] |
https://github.com/huggingface/datasets/issues/5045 | Automatically revert to last successful commit to hub when a push_to_hub is interrupted | Could you share the error you got please ? Maybe the full stack trace if you have it ?
Maybe `push_to_hub` be implemented as a single commit @Wauplin ? This way if it fails, the repo is still at the previous (valid) state instead of ending-up in an invalid/incimplete state. | **Is your feature request related to a problem? Please describe.**
I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again.
**Describe the solution you'd like**
Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision?
**Describe alternatives you've considered**
Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem.
**Additional context**
Provide useful defaults
| 501 | 50 | Automatically revert to last successful commit to hub when a push_to_hub is interrupted
**Is your feature request related to a problem? Please describe.**
I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again.
**Describe the solution you'd like**
Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision?
**Describe alternatives you've considered**
Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem.
**Additional context**
Provide useful defaults
Could you share the error you got please ? Maybe the full stack trace if you have it ?
Maybe `push_to_hub` be implemented as a single commit @Wauplin ? This way if it fails, the repo is still at the previous (valid) state instead of ending-up in an invalid/incimplete state. | [
-1.282714605331421,
-0.9852394461631775,
-0.7773692011833191,
1.3867173194885254,
-0.2464248239994049,
-1.2668240070343018,
0.056551624089479446,
-1.0400426387786865,
1.700188159942627,
-0.8427140116691589,
0.30681657791137695,
-1.6150896549224854,
0.07817649096250534,
-0.5741980075836182,
-0.8220849633216858,
-0.8454585075378418,
-0.4714192748069763,
-0.8856649994850159,
0.9728972911834717,
2.5489959716796875,
1.1787924766540527,
-1.531184434890747,
2.808342933654785,
0.7291838526725769,
-0.0804077535867691,
-0.9947054982185364,
0.4182760417461395,
0.06978311389684677,
-1.0831787586212158,
-0.5413673520088196,
-0.927950382232666,
-0.1218171939253807,
-0.5568557977676392,
-0.5271410942077637,
0.08494369685649872,
0.35300421714782715,
-0.20085406303405762,
-0.383788526058197,
-0.5455654859542847,
-0.7117002606391907,
0.5676053762435913,
-0.47888535261154175,
0.9564464688301086,
-0.4105769991874695,
1.887347936630249,
-0.6113677620887756,
0.41556644439697266,
0.7036136984825134,
1.4733494520187378,
0.2528798580169678,
-0.051205113530159,
0.41855332255363464,
0.37605020403862,
-0.05040023848414421,
0.4232986271381378,
1.1378674507141113,
0.6417730450630188,
0.580248236656189,
0.6947717070579529,
-2.165525436401367,
1.3722708225250244,
-1.1580508947372437,
0.2922092378139496,
1.296912670135498,
-0.8721687197685242,
0.3596620261669159,
-1.7758533954620361,
-0.06497100740671158,
0.6294029355049133,
-2.3230297565460205,
0.17695584893226624,
-1.3209471702575684,
-0.594683051109314,
0.9251331090927124,
0.23493103682994843,
-1.3096777200698853,
0.1872764676809311,
-0.5127159357070923,
1.0482615232467651,
0.46000415086746216,
1.0832164287567139,
-1.7149420976638794,
-0.032630667090415955,
-0.18302664160728455,
0.1015617847442627,
-1.3342140913009644,
-1.5455267429351807,
0.5900222063064575,
0.44678419828414917,
0.5340078473091125,
-0.06684684008359909,
0.9899376630783081,
-1.0146931409835815,
0.9047819972038269,
-1.035109043121338,
-1.53023362159729,
-1.5313714742660522,
-2.2336325645446777,
-2.293947219848633,
0.8702507019042969,
-0.4874722361564636,
-0.6101939678192139,
1.9964182376861572,
-1.0523455142974854,
-1.72348153591156,
1.2344478368759155,
0.2702828049659729,
0.09839493036270142,
2.3737266063690186,
0.0965447872877121,
-0.6480693221092224,
0.41212350130081177,
-0.6902981996536255,
0.9374008178710938,
-0.47167760133743286,
1.4415959119796753,
0.46185094118118286,
-0.9685776233673096,
1.5826486349105835,
-0.45900437235832214,
0.5140247344970703,
-0.6050440669059753,
-0.5747817158699036,
-0.9652516841888428,
0.4130919873714447,
1.8956035375595093,
-0.22842922806739807,
1.6503180265426636,
-0.49407514929771423,
-1.612808108329773,
-1.6505969762802124,
1.022226095199585,
0.5498138666152954,
-1.0103075504302979,
0.06968370079994202,
-0.42998144030570984,
0.06531941890716553,
-0.04626135155558586,
1.090265154838562,
1.158871054649353,
0.7034388780593872,
-0.3714098632335663,
-0.8182844519615173,
0.11646520346403122,
-0.10011224448680878,
-0.6574507355690002,
-1.8495908975601196,
-0.40124082565307617,
0.2588886320590973,
0.5997527837753296,
-1.1804841756820679,
1.662156581878662,
1.0214086771011353,
1.892985463142395,
1.0256625413894653,
-0.2247825413942337,
1.4621270895004272,
-0.009265164844691753,
1.790861964225769,
-0.6351749300956726,
0.7021623253822327,
-0.4462674856185913,
-1.034198522567749,
0.8178451657295227,
-0.3840654790401459,
-2.1748013496398926,
-0.7884357571601868,
-0.7826758027076721,
-0.2780892252922058,
-0.7235141396522522,
0.9637130498886108,
-0.35669079422950745,
-1.2332687377929688,
0.2277175486087799,
-0.6491910815238953,
0.11276684701442719,
-1.1548781394958496,
0.38170474767684937,
0.752948522567749,
-0.6319164037704468,
0.012222168035805225,
-0.24610787630081177,
-1.2622337341308594,
-0.43933743238449097,
0.26834744215011597,
1.9145606756210327,
-0.7861745953559875,
0.8903762102127075,
0.9026055335998535,
-0.7024496793746948,
-0.02714730054140091,
0.34523704648017883,
-0.24016106128692627,
0.8193254470825195,
-0.9672799110412598,
-0.312541663646698,
1.2367533445358276,
-0.25354868173599243,
-0.534362256526947,
1.473103642463684,
0.724807620048523,
-0.8864409923553467,
-0.10939383506774902,
-0.2940964102745056,
-0.9556933045387268,
-0.08749888092279434,
-1.5446174144744873,
-0.17259839177131653,
0.2641311585903168,
-1.4716336727142334,
-0.4554346799850464,
-0.1982228308916092,
1.1719273328781128,
-0.19424259662628174,
1.3960671424865723,
-0.4309994578361511,
-0.33282509446144104,
-0.39484232664108276,
-0.38695934414863586,
0.17729689180850983,
-0.18114638328552246,
-0.6230871677398682,
0.16771294176578522,
-0.7693852186203003,
0.35364609956741333,
1.3917607069015503,
0.47274351119995117,
0.08984015136957169,
0.491971880197525,
1.0577698945999146,
0.28678667545318604,
0.045468881726264954,
-0.8106902241706848,
-1.5758135318756104,
2.0394606590270996,
-1.4703043699264526,
1.974885106086731,
0.8142113089561462,
-0.055187568068504333,
-1.7569243907928467,
-1.7014600038528442,
1.314134120941162,
1.230431079864502,
2.32537579536438,
0.4993652403354645,
0.2965039312839508,
-0.8611394166946411,
-0.6869742274284363,
0.3895586431026459,
-1.1530777215957642,
-0.7689107060432434,
-0.052920062094926834,
2.3644564151763916,
1.8200019598007202,
-0.4918844997882843,
-0.17878605425357819,
-0.9897677898406982,
1.4689632654190063,
-0.2059146910905838,
0.284518837928772,
1.9761320352554321,
-0.286685585975647,
-1.0715889930725098,
1.2357743978500366,
-2.2994916439056396,
0.08015176653862,
1.9974489212036133,
0.3828788101673126,
0.10229460895061493,
-1.4494693279266357,
-0.525477945804596,
-0.3044567406177521,
-0.36109718680381775,
-1.3548862934112549,
0.5197411775588989,
-0.3476504385471344,
-0.7615281343460083,
-1.4723565578460693,
0.1031491830945015,
-1.240217924118042,
-1.5527130365371704,
0.3712695837020874,
1.9316195249557495,
2.0971505641937256,
-0.5209699273109436,
1.5467545986175537,
-0.2469339668750763,
0.17253626883029938,
1.274361252784729,
1.1793813705444336,
3.1786892414093018,
1.885575294494629,
-1.2018226385116577,
0.48891666531562805,
-0.2073218822479248,
-0.5742443799972534,
1.1244322061538696,
-1.0646659135818481,
1.2535299062728882,
-0.07817444950342178,
-1.104648470878601,
-1.2250250577926636,
1.0514603853225708,
0.479574978351593,
0.08522932976484299,
-0.5073874592781067,
1.227577567100525,
0.042114969342947006,
1.2961176633834839,
0.5761619210243225,
-0.4654631018638611,
0.539661169052124,
-0.4306255578994751,
-0.6621515154838562,
1.6524357795715332,
0.24726754426956177,
-1.4760301113128662,
-2.2423641681671143,
-0.18573951721191406,
-0.8219442367553711,
0.07883540540933609,
-0.5413544178009033,
-1.0142320394515991,
1.6458386182785034,
0.37725234031677246,
-1.3712384700775146,
-0.24822542071342468,
-0.39013996720314026,
-0.6729971170425415,
2.6052587032318115,
-1.4419242143630981,
-0.2666306495666504,
-0.930485725402832,
-0.5518386960029602,
1.5788977146148682,
-1.252745270729065,
-0.1395316869020462,
-0.9483306407928467,
-0.5714399814605713,
-1.2234736680984497,
-0.5358192920684814,
-0.18990370631217957,
-0.9130159616470337,
0.8145213723182678,
0.08333645761013031,
-1.1624348163604736,
-0.32056811451911926,
-0.8184546828269958,
0.7900435328483582,
-0.06813153624534607,
0.29984143376350403,
1.886616587638855,
0.3505398631095886,
-0.3368491530418396,
0.7918258905410767,
1.2222293615341187,
0.5554265975952148,
-0.626751184463501,
0.12416102737188339,
-0.632407546043396,
0.31795069575309753,
-1.2749087810516357,
0.3086579740047455,
-2.931426763534546,
0.6889249086380005,
-0.06661215424537659,
-0.2180766761302948,
0.032797280699014664,
-1.2971830368041992,
1.0595537424087524,
2.633192777633667,
-1.1502532958984375,
0.4047616124153137,
0.29936882853507996,
1.1860496997833252,
-1.7273783683776855,
0.36363735795021057,
-0.3947873115539551,
2.0890626907348633,
0.30041271448135376,
1.1020793914794922,
-0.556111752986908,
-2.25817608833313,
0.5833825469017029,
-1.260634422302246,
-1.2794859409332275,
0.6210488080978394,
-0.8773126006126404,
0.06421104818582535,
-1.5448018312454224,
-0.17718768119812012,
-0.9284851551055908,
-1.215504765510559,
0.7750617861747742,
0.2087218463420868,
0.373934268951416,
-0.527980387210846,
0.20791999995708466,
-2.2127063274383545,
-1.365067958831787,
-0.2562752962112427,
-0.8478517532348633,
0.5704371333122253,
-0.3872215151786804,
0.6592401266098022,
-0.09636257588863373,
0.11281060427427292,
0.3953782618045807,
1.4464668035507202,
3.343723773956299,
0.2867370545864105,
0.4409017562866211,
-0.19639796018600464,
-0.8103082180023193,
1.391479253768921,
1.0007731914520264,
-0.01622743345797062,
-0.5890763401985168,
-0.9967553019523621,
1.3503543138504028,
1.9214965105056763,
0.8981263041496277,
0.09243465960025787,
-0.7435106635093689,
-0.5714338421821594,
-0.03773915022611618,
0.10358000546693802,
0.3782825171947479,
1.0044262409210205,
0.001759636215865612,
0.18687161803245544,
1.5182772874832153,
1.316086769104004,
-0.445048063993454,
0.3737928867340088,
-0.7504048943519592,
-0.47305724024772644,
0.4550710618495941,
0.31268513202667236,
-0.16171351075172424,
0.35722020268440247,
-0.8403192758560181,
-0.2352895438671112,
-0.46145856380462646,
-0.9897537231445312,
-0.6788864135742188,
-0.5213351845741272,
-0.3948999047279358,
1.6323728561401367,
0.15358810126781464,
-0.4723118245601654,
-0.1048453152179718,
-0.8085854053497314,
-0.13601596653461456,
-1.090285301208496,
0.2691982686519623,
0.018718909472227097,
-0.209828719496727,
-0.11957993358373642,
1.7593101263046265,
-0.9582096934318542,
-2.1114273071289062,
0.26725873351097107,
0.21813876926898956,
-0.3753690719604492,
0.1694798767566681,
1.552765965461731,
0.4369487166404724,
1.4375618696212769,
1.4345073699951172,
0.8408756256103516,
-0.5779780149459839,
-1.3046925067901611,
0.6647761464118958,
0.8434090614318848,
-1.4047051668167114,
0.8313548564910889,
0.00453261099755764,
-0.4813041687011719,
0.761821448802948,
1.23163902759552,
0.4487673044204712,
-1.992920160293579,
0.8310675024986267,
-0.9162713289260864,
0.8084755539894104,
0.7224776744842529,
0.6264838576316833,
0.341511994600296,
0.8808165192604065,
-1.201926350593567,
-1.2007445096969604,
-0.9296090602874756,
-0.6917434930801392,
2.0233774185180664,
-0.26206105947494507,
0.5246594548225403,
-0.13768047094345093,
-1.207478404045105,
-0.10464465618133545,
0.7656382322311401,
0.44165435433387756,
-0.3780162036418915,
0.8373488187789917,
-0.679273784160614,
-1.068371057510376,
-1.4506975412368774,
-0.3669438064098358,
-0.9455626606941223,
-0.8220664858818054,
1.1145744323730469,
0.8978074789047241,
0.2282954305410385,
1.9359400272369385,
0.6158056855201721,
0.2580600678920746,
-2.6654253005981445,
0.858980655670166,
0.23377031087875366,
-0.04861338436603546,
0.9794319272041321,
0.3257061243057251,
0.9086936116218567,
0.03405844420194626,
0.4945131838321686,
-2.454568386077881,
2.2316415309906006,
-0.26816579699516296,
0.7157058715820312,
-0.02768249437212944,
-0.14481964707374573,
1.262163758277893,
0.5349663496017456,
0.5212680101394653,
-1.0619382858276367,
0.6993964910507202,
-0.39765024185180664,
1.1928296089172363,
0.9685105681419373,
-0.7520118951797485,
-0.043926019221544266,
1.376878261566162,
0.43996167182922363,
-0.6029963493347168,
-0.9637448787689209,
-0.8166354298591614,
0.9392485022544861,
1.814528465270996,
-0.048126693814992905,
-0.05655598267912865,
0.8317555785179138,
0.6136353611946106,
-1.2384589910507202,
0.2581712007522583,
-0.7836770415306091,
-0.8992566466331482,
1.5450704097747803,
2.1298110485076904,
-0.09161342680454254,
-0.09760744869709015,
-0.6279227137565613,
-1.2696807384490967,
0.7858957648277283,
0.020952392369508743,
0.10980381816625595,
0.6665604114532471,
-0.5885512232780457,
1.0997867584228516,
0.9816591143608093,
0.8901653289794922,
0.0754198357462883,
0.3512282073497772,
0.4667719900608063,
-0.2900352478027344,
-1.0256493091583252,
-0.2685452103614807,
-1.144283413887024,
-2.4163081645965576,
0.42325499653816223,
-0.2878907024860382,
-1.455649733543396,
0.033680833876132965,
-1.0311013460159302,
0.9323240518569946,
-0.514970064163208,
-1.099046230316162,
-1.609548568725586,
0.08428110927343369,
0.019871145486831665,
0.9537923336029053,
-1.5772150754928589,
-0.04950155317783356,
1.1338776350021362,
0.7618501782417297,
-0.5829334855079651,
1.010762333869934,
0.258403480052948,
0.9695169925689697,
0.8207191824913025,
-0.5158392786979675,
0.4534928500652313,
0.11818135529756546,
-1.3671208620071411,
0.5226287245750427,
1.1493926048278809,
0.16891862452030182,
1.4195301532745361,
-0.47834697365760803,
0.04821356013417244,
0.40863731503486633,
-0.6474572420120239,
-0.3282471299171448,
-0.4828565716743469,
0.7244017124176025,
0.13740254938602448,
-0.8606399893760681,
0.014140198938548565,
-0.0933384969830513,
-0.3963722288608551,
0.13606923818588257,
-1.5192610025405884,
-0.19490370154380798,
-0.4609542787075043,
-0.5052459836006165,
-1.240425705909729,
-0.09128886461257935,
1.450614094734192,
-0.7820837497711182,
-0.22344334423542023,
0.5367286205291748,
0.5587548017501831,
0.6059610247612,
0.721202552318573,
-0.679098904132843,
-0.3564470112323761,
-0.2336646467447281,
-0.28297677636146545,
0.17357267439365387,
1.2292543649673462,
-0.20702485740184784,
-0.9700607657432556,
0.6922056674957275,
-0.3815891146659851,
-0.021448221057653427,
1.86878502368927,
0.11586448550224304,
-0.6601741313934326,
0.37493619322776794,
-0.7328377962112427,
1.9026305675506592,
1.772794485092163,
1.251589298248291,
-0.058889374136924744,
-0.921562135219574,
0.6216855049133301,
-0.2661585211753845,
-0.3865966498851776,
0.9270658493041992,
0.5130751132965088,
-0.19071131944656372,
-1.3637975454330444,
0.5864431262016296,
1.2322096824645996,
-0.9155239462852478,
-0.7913241982460022,
0.04230935499072075,
-0.8129609823226929,
1.1075470447540283,
0.5879065990447998,
0.48090842366218567,
0.20196515321731567,
1.740469217300415,
0.6837461590766907,
-0.5651149153709412,
0.5845423936843872,
0.5667937397956848,
-0.1311580091714859,
-2.2028846740722656,
-1.1692614555358887,
0.36952072381973267,
-0.4575304090976715,
-1.5446375608444214,
1.3024098873138428,
-1.1141778230667114,
-0.8889369964599609,
0.5851190090179443,
0.07260044664144516,
1.5280113220214844,
0.23786884546279907,
1.6126313209533691,
2.1492421627044678,
0.9853043556213379,
0.43702948093414307,
1.3653011322021484,
-0.01024514902383089,
-0.45129525661468506,
1.8719935417175293,
-0.3447877764701843,
0.49588075280189514,
1.050159215927124,
-0.39132651686668396,
-1.0294132232666016,
-0.6827467679977417,
-1.1744612455368042,
-0.6412701606750488,
1.068069338798523,
0.13320361077785492,
-1.0980544090270996,
0.15560778975486755,
1.5945812463760376,
0.17201577126979828,
-0.3106229305267334,
0.40578535199165344,
0.4414941668510437,
-0.7173958420753479,
-0.045630719512701035,
-0.9905911087989807,
0.4285612106323242,
-0.17309927940368652,
-0.36524805426597595,
0.3574775159358978,
0.4143277406692505,
1.2002826929092407,
-0.10301544517278671,
0.09838695824146271,
1.1697171926498413,
-1.5280482769012451,
1.3603019714355469,
-0.606461226940155,
0.1961987465620041,
-2.4441075325012207,
1.4739148616790771,
-0.704001247882843,
1.9298079013824463,
-2.633920192718506,
0.38853469491004944,
-0.7749884724617004,
-0.45800331234931946,
0.4284954071044922,
-0.22884543240070343,
0.11623436212539673,
-0.1557057946920395,
-1.1563209295272827,
0.08676081150770187,
-0.6871674656867981,
0.5094788074493408,
1.0874232053756714,
1.3640050888061523,
-1.1807222366333008,
-0.26207002997398376,
-1.7359975576400757,
-0.09471049159765244,
-0.7639981508255005,
0.2496315836906433,
-2.0660104751586914,
-0.028777144849300385,
-1.9337579011917114,
-2.1936919689178467,
-1.4419022798538208,
-0.783617377281189,
1.0669182538986206,
0.12885119020938873,
-0.8862457275390625,
1.157578945159912,
-0.36477547883987427,
-1.8018419742584229,
1.0500526428222656,
-2.0511474609375
] |
https://github.com/huggingface/datasets/issues/5045 | Automatically revert to last successful commit to hub when a push_to_hub is interrupted | > Maybe push_to_hub be implemented as a single commit ?
I think that would definitely be the way to go. Do you know the reasons why not implementing it like this in the first place ? I guess it is because of not been able to upload all at once with `huggingface_hub` but if there was another reason, please let me know.
About pushing all at once, it seems to be a more and more requested feature. I have created this issue https://github.com/huggingface/huggingface_hub/issues/1085 recently but other discussions already happened in the past. The `moon-landing` team is working on it (cc @coyotte508). The `huggingface_hub` integration will come afterwards.
For now, maybe it's best to wait for a proper implementation instead of creating a temporary workaround :)
| **Is your feature request related to a problem? Please describe.**
I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again.
**Describe the solution you'd like**
Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision?
**Describe alternatives you've considered**
Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem.
**Additional context**
Provide useful defaults
| 501 | 125 | Automatically revert to last successful commit to hub when a push_to_hub is interrupted
**Is your feature request related to a problem? Please describe.**
I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again.
**Describe the solution you'd like**
Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision?
**Describe alternatives you've considered**
Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem.
**Additional context**
Provide useful defaults
> Maybe push_to_hub be implemented as a single commit ?
I think that would definitely be the way to go. Do you know the reasons why not implementing it like this in the first place ? I guess it is because of not been able to upload all at once with `huggingface_hub` but if there was another reason, please let me know.
About pushing all at once, it seems to be a more and more requested feature. I have created this issue https://github.com/huggingface/huggingface_hub/issues/1085 recently but other discussions already happened in the past. The `moon-landing` team is working on it (cc @coyotte508). The `huggingface_hub` integration will come afterwards.
For now, maybe it's best to wait for a proper implementation instead of creating a temporary workaround :)
| [
-1.2234011888504028,
-0.9979527592658997,
-0.7721341252326965,
1.4266746044158936,
-0.17232169210910797,
-1.2619614601135254,
0.08357291668653488,
-1.0178554058074951,
1.6838761568069458,
-0.7901459336280823,
0.3415718972682953,
-1.627397894859314,
0.07699312269687653,
-0.5828276872634888,
-0.8217529654502869,
-0.8359689116477966,
-0.45237496495246887,
-0.8635482788085938,
0.9818172454833984,
2.5341908931732178,
1.1806845664978027,
-1.5132907629013062,
2.7606801986694336,
0.6524543166160583,
-0.11114015430212021,
-1.0825814008712769,
0.42908141016960144,
0.021070361137390137,
-1.1697211265563965,
-0.5556013584136963,
-0.9061509370803833,
-0.07690194994211197,
-0.5758638978004456,
-0.5560824871063232,
0.0984412208199501,
0.41663095355033875,
-0.18094827234745026,
-0.40035903453826904,
-0.5934233665466309,
-0.7249462604522705,
0.5383734703063965,
-0.438090056180954,
0.9799835681915283,
-0.34210702776908875,
1.8845980167388916,
-0.5816949009895325,
0.44032561779022217,
0.7427135705947876,
1.4527350664138794,
0.2552889287471771,
-0.04101739823818207,
0.32828235626220703,
0.42076313495635986,
-0.08536135405302048,
0.43191638588905334,
1.1432344913482666,
0.6685002446174622,
0.5435695648193359,
0.6928367018699646,
-2.171412467956543,
1.4330207109451294,
-1.1014598608016968,
0.3406584560871124,
1.3206617832183838,
-0.8953472971916199,
0.34128323197364807,
-1.8029100894927979,
-0.06398382782936096,
0.5924485921859741,
-2.2922215461730957,
0.15606969594955444,
-1.2727264165878296,
-0.5337203145027161,
0.9790256023406982,
0.23499421775341034,
-1.3462814092636108,
0.17828550934791565,
-0.4638311266899109,
1.0446553230285645,
0.48541760444641113,
1.1269508600234985,
-1.6896615028381348,
-0.02530614659190178,
-0.22479036450386047,
0.13461387157440186,
-1.2761822938919067,
-1.5581732988357544,
0.5548266768455505,
0.5264391899108887,
0.5053129196166992,
-0.06137055903673172,
0.9872943162918091,
-0.9941235780715942,
0.8693678379058838,
-0.9688715934753418,
-1.5814440250396729,
-1.5066335201263428,
-2.2460994720458984,
-2.3007729053497314,
0.8157472610473633,
-0.5061762928962708,
-0.5515340566635132,
1.9864128828048706,
-1.0663655996322632,
-1.7440237998962402,
1.2011133432388306,
0.25338995456695557,
0.0946655124425888,
2.385467767715454,
0.1420263946056366,
-0.6569517850875854,
0.3988635838031769,
-0.6806597113609314,
0.9084739685058594,
-0.42412686347961426,
1.4042625427246094,
0.47093188762664795,
-1.0211962461471558,
1.5871872901916504,
-0.4150408208370209,
0.49042561650276184,
-0.6422873735427856,
-0.5528518557548523,
-0.888446569442749,
0.3749633729457855,
1.8829913139343262,
-0.29287540912628174,
1.596091389656067,
-0.47241857647895813,
-1.6107934713363647,
-1.6195796728134155,
1.0001591444015503,
0.5532123446464539,
-0.9790058732032776,
0.052636779844760895,
-0.4303191602230072,
0.06297411769628525,
-0.017430149018764496,
1.1097122430801392,
1.2056798934936523,
0.7117873430252075,
-0.3773174285888672,
-0.8637135028839111,
0.15009300410747528,
-0.1027512401342392,
-0.6360892057418823,
-1.8092525005340576,
-0.396258682012558,
0.2519248127937317,
0.5788142085075378,
-1.1622267961502075,
1.7310782670974731,
1.016694188117981,
1.923879623413086,
1.0367234945297241,
-0.28694450855255127,
1.473360300064087,
0.03260991722345352,
1.8373032808303833,
-0.5906720757484436,
0.6566082835197449,
-0.42203420400619507,
-1.1110798120498657,
0.8371208906173706,
-0.356884241104126,
-2.1237776279449463,
-0.7380072474479675,
-0.7943066358566284,
-0.2643318772315979,
-0.7219418883323669,
0.9447181224822998,
-0.30799657106399536,
-1.26205575466156,
0.2351522445678711,
-0.6417112946510315,
0.12951406836509705,
-1.1693717241287231,
0.3438452184200287,
0.7781849503517151,
-0.7210230827331543,
0.03605346381664276,
-0.2579384744167328,
-1.2657901048660278,
-0.48234784603118896,
0.29906007647514343,
1.902696967124939,
-0.7346304655075073,
0.903975248336792,
0.9404705166816711,
-0.6458094120025635,
-0.011091449297964573,
0.3480532467365265,
-0.2714542746543884,
0.8676590323448181,
-1.003516435623169,
-0.34134772419929504,
1.1733486652374268,
-0.24210646748542786,
-0.566609799861908,
1.4514256715774536,
0.716158926486969,
-0.9194319844245911,
-0.1447458118200302,
-0.22751709818840027,
-0.9044225811958313,
-0.004295022692531347,
-1.5348392724990845,
-0.08077076077461243,
0.3090119957923889,
-1.513718605041504,
-0.45939749479293823,
-0.2346176952123642,
1.1922816038131714,
-0.17049379646778107,
1.4003392457962036,
-0.40134602785110474,
-0.27400195598602295,
-0.4067666530609131,
-0.3603631258010864,
0.17895208299160004,
-0.20031510293483734,
-0.6428649425506592,
0.17892982065677643,
-0.7906201481819153,
0.3753546476364136,
1.4396778345108032,
0.41396254301071167,
0.06512855738401413,
0.46744582056999207,
1.1009317636489868,
0.3028472363948822,
0.02868950553238392,
-0.8433811068534851,
-1.5544575452804565,
2.067627191543579,
-1.4899682998657227,
1.9903215169906616,
0.8617263436317444,
-0.02093522995710373,
-1.752116322517395,
-1.7362245321273804,
1.338018536567688,
1.1836484670639038,
2.3954250812530518,
0.5182861685752869,
0.3288689851760864,
-0.8621713519096375,
-0.6461647748947144,
0.42254358530044556,
-1.1019781827926636,
-0.7878586649894714,
0.01360662467777729,
2.3451197147369385,
1.7994680404663086,
-0.46904098987579346,
-0.20205000042915344,
-1.0039479732513428,
1.4566863775253296,
-0.1571020632982254,
0.21276378631591797,
2.0128707885742188,
-0.23511037230491638,
-1.1036440134048462,
1.2515685558319092,
-2.305654525756836,
0.12361995875835419,
1.997769832611084,
0.34991514682769775,
0.07107885926961899,
-1.4489376544952393,
-0.5389286875724792,
-0.28713709115982056,
-0.38424813747406006,
-1.3414372205734253,
0.5470396876335144,
-0.2931573688983917,
-0.797623336315155,
-1.498367428779602,
0.10624545812606812,
-1.2413630485534668,
-1.5964306592941284,
0.2951619327068329,
1.855117917060852,
2.0684680938720703,
-0.6267207264900208,
1.5611131191253662,
-0.25230908393859863,
0.1479112207889557,
1.2295864820480347,
1.180709719657898,
3.155517816543579,
1.9119857549667358,
-1.2309077978134155,
0.5146597027778625,
-0.21820281445980072,
-0.539832353591919,
1.1464987993240356,
-1.0583809614181519,
1.2651262283325195,
-0.17743107676506042,
-1.1696056127548218,
-1.2689590454101562,
1.0518347024917603,
0.513343870639801,
0.06057753413915634,
-0.5074665546417236,
1.181623101234436,
0.09163466095924377,
1.2726305723190308,
0.5496107339859009,
-0.42221105098724365,
0.6020260453224182,
-0.42430579662323,
-0.6358409523963928,
1.6137938499450684,
0.23372545838356018,
-1.4624385833740234,
-2.228783130645752,
-0.1960967779159546,
-0.837241530418396,
0.05175120383501053,
-0.5642530918121338,
-1.0048037767410278,
1.624303936958313,
0.38262811303138733,
-1.3928260803222656,
-0.27764326333999634,
-0.39335229992866516,
-0.6759836077690125,
2.60638427734375,
-1.3917479515075684,
-0.2408393770456314,
-0.9571294784545898,
-0.5640766024589539,
1.5719623565673828,
-1.259431004524231,
-0.18066971004009247,
-1.0240113735198975,
-0.5635241270065308,
-1.2312990427017212,
-0.5656185746192932,
-0.16870269179344177,
-0.8625860214233398,
0.7504761219024658,
0.11140810698270798,
-1.1595789194107056,
-0.3023647367954254,
-0.8188357949256897,
0.7905968427658081,
-0.09310786426067352,
0.26640135049819946,
1.8803915977478027,
0.35467106103897095,
-0.3345329463481903,
0.7570818066596985,
1.1430065631866455,
0.5559509992599487,
-0.599983274936676,
0.1738985776901245,
-0.6267236471176147,
0.26171404123306274,
-1.2695590257644653,
0.3386455178260803,
-2.9161922931671143,
0.692224383354187,
-0.035458385944366455,
-0.14274081587791443,
0.005730639211833477,
-1.2891900539398193,
1.0813429355621338,
2.6282339096069336,
-1.1381334066390991,
0.43828973174095154,
0.3242107927799225,
1.1453016996383667,
-1.727400779724121,
0.37695586681365967,
-0.40072816610336304,
2.115091562271118,
0.25183331966400146,
1.1126569509506226,
-0.5533062815666199,
-2.2774658203125,
0.5290694236755371,
-1.255839467048645,
-1.2234666347503662,
0.6616472005844116,
-0.8209919929504395,
-0.01800789311528206,
-1.4593204259872437,
-0.21637797355651855,
-0.8996937274932861,
-1.2136707305908203,
0.7803204655647278,
0.13265635073184967,
0.43737682700157166,
-0.5935215353965759,
0.25172314047813416,
-2.2251675128936768,
-1.3801651000976562,
-0.26865580677986145,
-0.9122838973999023,
0.5227289795875549,
-0.34960243105888367,
0.6588625311851501,
-0.10429591685533524,
0.08623509854078293,
0.36497336626052856,
1.444931149482727,
3.393589973449707,
0.28881213068962097,
0.4436822831630707,
-0.17430676519870758,
-0.8254759311676025,
1.4195232391357422,
0.9510256052017212,
-0.05981455743312836,
-0.6116496324539185,
-1.0092477798461914,
1.3098978996276855,
1.9216501712799072,
0.924260139465332,
0.10629018396139145,
-0.7630429267883301,
-0.6809630990028381,
-0.042544588446617126,
0.10845522582530975,
0.401685506105423,
0.9692606925964355,
0.045737192034721375,
0.1884913295507431,
1.470201849937439,
1.336467981338501,
-0.43684378266334534,
0.37888485193252563,
-0.7660293579101562,
-0.440662682056427,
0.4492526352405548,
0.31672659516334534,
-0.10732212662696838,
0.34642744064331055,
-0.9317873120307922,
-0.20558221638202667,
-0.45905330777168274,
-1.0271886587142944,
-0.70490962266922,
-0.45417672395706177,
-0.35845401883125305,
1.6615842580795288,
0.13490954041481018,
-0.4882484972476959,
-0.048916928470134735,
-0.7940688133239746,
-0.13315771520137787,
-1.086020588874817,
0.2842414975166321,
0.011237142607569695,
-0.1920706331729889,
-0.09645836055278778,
1.7810962200164795,
-0.9718967080116272,
-2.1709601879119873,
0.26642799377441406,
0.2458810955286026,
-0.43775883316993713,
0.20079101622104645,
1.588963508605957,
0.4303417205810547,
1.4153732061386108,
1.4381097555160522,
0.9051279425621033,
-0.6077201962471008,
-1.2968149185180664,
0.6439093351364136,
0.8658731579780579,
-1.4196454286575317,
0.8282907009124756,
0.007872262969613075,
-0.4168589115142822,
0.776911199092865,
1.266494870185852,
0.45393049716949463,
-2.0305683612823486,
0.8002716898918152,
-0.8910108804702759,
0.7942966222763062,
0.6871328353881836,
0.6628857851028442,
0.29271799325942993,
0.815729022026062,
-1.197917103767395,
-1.1929763555526733,
-0.8296502232551575,
-0.660891056060791,
1.9982714653015137,
-0.2934051752090454,
0.5686564445495605,
-0.14065150916576385,
-1.2747634649276733,
-0.14365991950035095,
0.7707104086875916,
0.41579189896583557,
-0.43807798624038696,
0.7978914380073547,
-0.6811059713363647,
-1.1344174146652222,
-1.4281060695648193,
-0.3696996867656708,
-0.9719995856285095,
-0.8838459849357605,
1.0410206317901611,
0.8416222333908081,
0.2541654109954834,
1.9233086109161377,
0.6267802715301514,
0.23838810622692108,
-2.707530975341797,
0.8520779609680176,
0.2963646352291107,
-0.02443787269294262,
1.0054377317428589,
0.32923564314842224,
0.9462562203407288,
0.028337007388472557,
0.5441190004348755,
-2.45526123046875,
2.280292272567749,
-0.2484789937734604,
0.7696800231933594,
-0.033091336488723755,
-0.2296915203332901,
1.1917074918746948,
0.5871267914772034,
0.5710452198982239,
-1.1403872966766357,
0.7004035711288452,
-0.4538676142692566,
1.168479084968567,
0.8875222206115723,
-0.7827665209770203,
-0.023783819749951363,
1.3540071249008179,
0.4373658001422882,
-0.5702916979789734,
-0.9499174356460571,
-0.8931770920753479,
0.8676257133483887,
1.8138338327407837,
-0.0198243148624897,
-0.021650344133377075,
0.8265950679779053,
0.6202517747879028,
-1.2334709167480469,
0.20839343965053558,
-0.7597281336784363,
-0.8599288463592529,
1.6075465679168701,
2.066399335861206,
-0.09525559842586517,
-0.15756118297576904,
-0.6572290658950806,
-1.2705934047698975,
0.7713996171951294,
0.02329331822693348,
0.12434451282024384,
0.6500985622406006,
-0.6159501075744629,
1.1043751239776611,
0.920074999332428,
0.9620527029037476,
0.08465347439050674,
0.33366602659225464,
0.4412674307823181,
-0.3318043649196625,
-1.0929337739944458,
-0.2698856592178345,
-1.1907809972763062,
-2.409374952316284,
0.4171431064605713,
-0.24483893811702728,
-1.460298776626587,
0.02553906850516796,
-0.9967477917671204,
0.8753361701965332,
-0.5543901920318604,
-1.1110544204711914,
-1.563962459564209,
0.1432192623615265,
-0.04292396456003189,
0.9179084300994873,
-1.5975937843322754,
-0.0678137019276619,
1.156575083732605,
0.8442606329917908,
-0.6058445572853088,
1.0078935623168945,
0.23919491469860077,
0.9526455998420715,
0.880955159664154,
-0.47861361503601074,
0.5072189569473267,
0.15457576513290405,
-1.3804998397827148,
0.48643073439598083,
1.1496825218200684,
0.17376433312892914,
1.3862799406051636,
-0.5061236023902893,
0.040903300046920776,
0.3929483890533447,
-0.6029901504516602,
-0.32492566108703613,
-0.4880284368991852,
0.7286945581436157,
0.06799249351024628,
-0.8859289288520813,
0.10382924228906631,
-0.10492763668298721,
-0.2847791314125061,
0.12285716831684113,
-1.5208271741867065,
-0.1916450411081314,
-0.43505731225013733,
-0.5349488854408264,
-1.2320609092712402,
-0.09842612594366074,
1.4394166469573975,
-0.7822843194007874,
-0.22470514476299286,
0.524137556552887,
0.539664089679718,
0.5784071087837219,
0.6643256545066833,
-0.643069326877594,
-0.3919394016265869,
-0.2195013463497162,
-0.29867371916770935,
0.24506835639476776,
1.2404115200042725,
-0.17018075287342072,
-0.889739990234375,
0.6914178133010864,
-0.4090317487716675,
0.016214167699217796,
1.889186978340149,
0.11941121518611908,
-0.715661346912384,
0.34690073132514954,
-0.6727288961410522,
1.927212119102478,
1.7685530185699463,
1.2510308027267456,
-0.09634429961442947,
-0.9301499724388123,
0.6438291072845459,
-0.30241280794143677,
-0.3602376878261566,
0.9732041954994202,
0.48042309284210205,
-0.19880808889865875,
-1.3725626468658447,
0.581656813621521,
1.2649861574172974,
-0.8694775104522705,
-0.8245411515235901,
0.05558958649635315,
-0.8322668075561523,
1.0956711769104004,
0.6024818420410156,
0.5002104043960571,
0.1313318908214569,
1.690751552581787,
0.6979255080223083,
-0.5064224600791931,
0.6099759340286255,
0.5010582804679871,
-0.17236129939556122,
-2.1921608448028564,
-1.1563223600387573,
0.3391445577144623,
-0.42615270614624023,
-1.5327281951904297,
1.304141640663147,
-1.1398411989212036,
-0.9402533173561096,
0.5287706255912781,
0.03755246847867966,
1.4987621307373047,
0.2625516653060913,
1.590798020362854,
2.147571563720703,
0.9575724601745605,
0.4084641933441162,
1.3397266864776611,
-0.0027200020849704742,
-0.44501039385795593,
1.8903363943099976,
-0.3811955749988556,
0.5033597946166992,
1.116997241973877,
-0.3837818205356598,
-1.065190076828003,
-0.7118610143661499,
-1.1539407968521118,
-0.6709439754486084,
1.0936270952224731,
0.13435940444469452,
-1.1120500564575195,
0.24602656066417694,
1.5857549905776978,
0.14287696778774261,
-0.27546995878219604,
0.4773804545402527,
0.42638638615608215,
-0.725459098815918,
-0.0440325066447258,
-0.9037212133407593,
0.46060484647750854,
-0.2222130000591278,
-0.3480895757675171,
0.3670327663421631,
0.389533132314682,
1.1935553550720215,
-0.08311634510755539,
0.07182585448026657,
1.1992676258087158,
-1.4949703216552734,
1.3867380619049072,
-0.595412015914917,
0.18097533285617828,
-2.4033455848693848,
1.4581117630004883,
-0.6966627836227417,
1.9364445209503174,
-2.634678840637207,
0.39277252554893494,
-0.7381731867790222,
-0.4632236659526825,
0.4029116630554199,
-0.26112183928489685,
0.0876142755150795,
-0.1827550232410431,
-1.1040912866592407,
-0.004731487017124891,
-0.6794989705085754,
0.5082190632820129,
1.10947585105896,
1.3372399806976318,
-1.1181820631027222,
-0.26350659132003784,
-1.7598973512649536,
-0.09418012201786041,
-0.7017284035682678,
0.23298610746860504,
-2.0173280239105225,
-0.09660667181015015,
-1.9409658908843994,
-2.245807647705078,
-1.3996466398239136,
-0.7595505714416504,
1.0487794876098633,
0.22031275928020477,
-0.8535277247428894,
1.181719422340393,
-0.3416329324245453,
-1.782444953918457,
1.0443782806396484,
-2.1060049533843994
] |
https://github.com/huggingface/datasets/issues/5045 | Automatically revert to last successful commit to hub when a push_to_hub is interrupted | > I think that would definitely be the way to go. Do you know the reasons why not implementing it like this in the first place ? I guess it is because of not been able to upload all at once with huggingface_hub but if there was another reason, please let me know.
Ideally we would want to upload the files iteratively - and then once everything is uploaded we proceed to commit. When we implemented `push_to_hub`, using `upload_file` for each shard was the only option.
For more context: for each shard to upload we do:
1. load the arrow shard in memory
2. convert to parquet
3. upload
So to avoid OOM we need to upload the files iteratively.
> For now, maybe it's best to wait for a proper implementation instead of creating a temporary workaround :)
Let us know if we can help ! | **Is your feature request related to a problem? Please describe.**
I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again.
**Describe the solution you'd like**
Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision?
**Describe alternatives you've considered**
Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem.
**Additional context**
Provide useful defaults
| 501 | 147 | Automatically revert to last successful commit to hub when a push_to_hub is interrupted
**Is your feature request related to a problem? Please describe.**
I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again.
**Describe the solution you'd like**
Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision?
**Describe alternatives you've considered**
Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem.
**Additional context**
Provide useful defaults
> I think that would definitely be the way to go. Do you know the reasons why not implementing it like this in the first place ? I guess it is because of not been able to upload all at once with huggingface_hub but if there was another reason, please let me know.
Ideally we would want to upload the files iteratively - and then once everything is uploaded we proceed to commit. When we implemented `push_to_hub`, using `upload_file` for each shard was the only option.
For more context: for each shard to upload we do:
1. load the arrow shard in memory
2. convert to parquet
3. upload
So to avoid OOM we need to upload the files iteratively.
> For now, maybe it's best to wait for a proper implementation instead of creating a temporary workaround :)
Let us know if we can help ! | [
-1.2375420331954956,
-0.995596170425415,
-0.7598696351051331,
1.444139838218689,
-0.17955611646175385,
-1.2800627946853638,
0.08093342185020447,
-1.0618536472320557,
1.674431562423706,
-0.8222494721412659,
0.39525970816612244,
-1.6433428525924683,
0.1320047825574875,
-0.5959837436676025,
-0.8074865341186523,
-0.8251933455467224,
-0.4911872148513794,
-0.8486418724060059,
0.98922199010849,
2.5451250076293945,
1.167101263999939,
-1.532630205154419,
2.7181670665740967,
0.652251124382019,
-0.12809662520885468,
-1.0532093048095703,
0.4856951832771301,
0.02968362718820572,
-1.207887887954712,
-0.5322838425636292,
-0.9033597707748413,
-0.0961180180311203,
-0.5732517242431641,
-0.5133808851242065,
0.06010948494076729,
0.3806777000427246,
-0.17289792001247406,
-0.40521085262298584,
-0.6079050898551941,
-0.7054964303970337,
0.5277869701385498,
-0.4414348006248474,
0.9879616498947144,
-0.36346256732940674,
1.895237684249878,
-0.5837281942367554,
0.45705893635749817,
0.7191991209983826,
1.4684149026870728,
0.2429938167333603,
-0.04840387403964996,
0.30461686849594116,
0.4266914129257202,
-0.09082338213920593,
0.40185171365737915,
1.0530335903167725,
0.6722944378852844,
0.5559883117675781,
0.6689280867576599,
-2.177743434906006,
1.4166290760040283,
-1.143206238746643,
0.3413105607032776,
1.3670777082443237,
-0.9007329940795898,
0.3687136769294739,
-1.7817760705947876,
-0.04498714208602905,
0.5933288931846619,
-2.2768850326538086,
0.19022609293460846,
-1.2863385677337646,
-0.5046210885047913,
0.9534246325492859,
0.27203240990638733,
-1.3304874897003174,
0.18495288491249084,
-0.4888456165790558,
1.0109518766403198,
0.45369359850883484,
1.1384028196334839,
-1.7012114524841309,
-0.04152052477002144,
-0.24734526872634888,
0.11572647094726562,
-1.2849223613739014,
-1.537866473197937,
0.6112862229347229,
0.5175125598907471,
0.44606032967567444,
-0.04538893699645996,
1.0051860809326172,
-1.0095123052597046,
0.8554084897041321,
-0.9598239064216614,
-1.6152344942092896,
-1.5052629709243774,
-2.2265336513519287,
-2.298457145690918,
0.8235763311386108,
-0.504757285118103,
-0.5514441728591919,
2.006918430328369,
-1.1056550741195679,
-1.7358614206314087,
1.2555687427520752,
0.25479474663734436,
0.04980430006980896,
2.403409481048584,
0.08136288821697235,
-0.6176542639732361,
0.410033255815506,
-0.6912274956703186,
0.8778282999992371,
-0.4543014466762543,
1.3652390241622925,
0.38470378518104553,
-1.00118887424469,
1.5757149457931519,
-0.4103911221027374,
0.5579294562339783,
-0.6110675930976868,
-0.5527167916297913,
-0.9054446816444397,
0.3749109208583832,
1.9210643768310547,
-0.2649891972541809,
1.5868785381317139,
-0.4774041473865509,
-1.5879920721054077,
-1.5923528671264648,
1.031693458557129,
0.5409855842590332,
-0.9573459029197693,
0.013414014130830765,
-0.3982095420360565,
0.12353621423244476,
-0.048907969146966934,
1.0935391187667847,
1.1963797807693481,
0.7047387361526489,
-0.38673263788223267,
-0.8935800194740295,
0.14605535566806793,
-0.1259966641664505,
-0.683233916759491,
-1.8089723587036133,
-0.39612820744514465,
0.21579620242118835,
0.6270456910133362,
-1.166718602180481,
1.6728026866912842,
1.0318118333816528,
1.9386104345321655,
1.0398560762405396,
-0.31676679849624634,
1.4624494314193726,
0.050785016268491745,
1.8484588861465454,
-0.5990575551986694,
0.6462092995643616,
-0.36715903878211975,
-1.133880376815796,
0.8252236843109131,
-0.32439371943473816,
-2.1261181831359863,
-0.7508985996246338,
-0.7604082226753235,
-0.29415246844291687,
-0.7248663306236267,
0.9203507900238037,
-0.3283213973045349,
-1.2717989683151245,
0.2472042292356491,
-0.6409780383110046,
0.15613017976284027,
-1.1797000169754028,
0.40271270275115967,
0.7793863415718079,
-0.6688467860221863,
-0.0071029155515134335,
-0.2745046615600586,
-1.277891755104065,
-0.4517382085323334,
0.26698389649391174,
1.8456488847732544,
-0.7677330374717712,
0.9385643601417542,
0.9553912281990051,
-0.6336665749549866,
-0.08002837002277374,
0.3463256061077118,
-0.22909358143806458,
0.8826695084571838,
-1.004502296447754,
-0.41457968950271606,
1.2111250162124634,
-0.24112817645072937,
-0.5552241206169128,
1.4774340391159058,
0.7009206414222717,
-0.9023401141166687,
-0.18499253690242767,
-0.21744510531425476,
-0.8920577168464661,
0.014914216473698616,
-1.608841061592102,
-0.16102412343025208,
0.3225124776363373,
-1.5260387659072876,
-0.46475040912628174,
-0.2349144071340561,
1.152933120727539,
-0.1908089816570282,
1.428726315498352,
-0.41673922538757324,
-0.26421675086021423,
-0.3963502049446106,
-0.351333886384964,
0.17956435680389404,
-0.16381731629371643,
-0.6533837914466858,
0.22023163735866547,
-0.7791277170181274,
0.42708685994148254,
1.452169418334961,
0.4129658341407776,
0.07615958154201508,
0.48039865493774414,
1.084705114364624,
0.3101184368133545,
0.023095622658729553,
-0.8773605227470398,
-1.554656744003296,
2.093040704727173,
-1.511272668838501,
2.0199503898620605,
0.8775207996368408,
-0.02389003336429596,
-1.7167010307312012,
-1.7206348180770874,
1.3513240814208984,
1.1658085584640503,
2.298250913619995,
0.48083949089050293,
0.32218804955482483,
-0.8209717869758606,
-0.6228007078170776,
0.364000141620636,
-1.063338041305542,
-0.7836800813674927,
0.04071475937962532,
2.3541877269744873,
1.7756352424621582,
-0.46189790964126587,
-0.1426418423652649,
-1.0146039724349976,
1.4269856214523315,
-0.12409104406833649,
0.22529517114162445,
2.031306028366089,
-0.24326881766319275,
-1.1366825103759766,
1.230494737625122,
-2.2980470657348633,
0.11113445460796356,
1.9745762348175049,
0.37810981273651123,
0.0655682384967804,
-1.4300658702850342,
-0.5033774375915527,
-0.2793603241443634,
-0.32346588373184204,
-1.3263155221939087,
0.5377184748649597,
-0.3028712570667267,
-0.7269842028617859,
-1.4798622131347656,
0.11251533031463623,
-1.2590450048446655,
-1.5677887201309204,
0.2832473814487457,
1.8954557180404663,
2.0659899711608887,
-0.6049783229827881,
1.5616623163223267,
-0.2754802405834198,
0.12211392819881439,
1.2118054628372192,
1.1389693021774292,
3.164620876312256,
1.9211819171905518,
-1.2739344835281372,
0.5162598490715027,
-0.21584059298038483,
-0.514160692691803,
1.129947304725647,
-1.030398964881897,
1.300016164779663,
-0.11843802034854889,
-1.1340970993041992,
-1.2399513721466064,
1.034468412399292,
0.4750364124774933,
0.08261117339134216,
-0.5055570006370544,
1.1704736948013306,
0.06464524567127228,
1.2947511672973633,
0.5533284544944763,
-0.4350501298904419,
0.6314974427223206,
-0.42769482731819153,
-0.6044436693191528,
1.653652310371399,
0.2024194300174713,
-1.4675849676132202,
-2.2524094581604004,
-0.24412478506565094,
-0.8211740851402283,
0.12409910559654236,
-0.5698302984237671,
-0.9828296899795532,
1.636974811553955,
0.362338662147522,
-1.4647800922393799,
-0.30174750089645386,
-0.37019482254981995,
-0.6905556321144104,
2.6190474033355713,
-1.4190033674240112,
-0.2264595627784729,
-0.9775437116622925,
-0.6088070273399353,
1.5440914630889893,
-1.293819785118103,
-0.18062175810337067,
-1.0209393501281738,
-0.5693973898887634,
-1.1766304969787598,
-0.5450023412704468,
-0.15143872797489166,
-0.900919497013092,
0.786138653755188,
0.10635940730571747,
-1.1650941371917725,
-0.3540428876876831,
-0.8386220932006836,
0.7964848279953003,
-0.08031614124774933,
0.27772074937820435,
1.8350584506988525,
0.43875810503959656,
-0.34332358837127686,
0.768271803855896,
1.149987816810608,
0.5870916247367859,
-0.6192488670349121,
0.1850280463695526,
-0.6536876559257507,
0.25262343883514404,
-1.2101529836654663,
0.38374772667884827,
-2.8671276569366455,
0.6573610901832581,
-0.0329616442322731,
-0.10229948163032532,
0.03279566764831543,
-1.2804102897644043,
1.076346516609192,
2.6230640411376953,
-1.1185005903244019,
0.47006985545158386,
0.2986002266407013,
1.1394797563552856,
-1.718768835067749,
0.3760489225387573,
-0.36337023973464966,
2.1565394401550293,
0.285549134016037,
1.0990917682647705,
-0.565772294998169,
-2.3064992427825928,
0.5573849081993103,
-1.27280592918396,
-1.2689357995986938,
0.6577668190002441,
-0.8584234714508057,
-0.04067221283912659,
-1.4384316205978394,
-0.23298999667167664,
-0.8845551013946533,
-1.2367799282073975,
0.7518380284309387,
0.12342070043087006,
0.42067092657089233,
-0.5736814141273499,
0.21797634661197662,
-2.2512660026550293,
-1.380311369895935,
-0.26426804065704346,
-0.950624406337738,
0.49536842107772827,
-0.3713577687740326,
0.693853497505188,
-0.09102757275104523,
0.08841662108898163,
0.3592933714389801,
1.4215465784072876,
3.39056134223938,
0.3358660340309143,
0.4593251049518585,
-0.1914183646440506,
-0.823683500289917,
1.423777461051941,
0.9259582161903381,
-0.022656289860606194,
-0.6203988790512085,
-1.0075018405914307,
1.3466811180114746,
1.9113837480545044,
0.9017756581306458,
0.06588611006736755,
-0.716270387172699,
-0.6580419540405273,
-0.07816803455352783,
0.13159488141536713,
0.44377508759498596,
0.9393881559371948,
0.026263415813446045,
0.2354331761598587,
1.404132604598999,
1.328338623046875,
-0.4629436731338501,
0.3366233706474304,
-0.7414158582687378,
-0.43908262252807617,
0.46250754594802856,
0.30834370851516724,
-0.05801234766840935,
0.3561307489871979,
-0.8862735629081726,
-0.1926138550043106,
-0.49317067861557007,
-1.01339590549469,
-0.6911222338676453,
-0.41588717699050903,
-0.3620454967021942,
1.6536084413528442,
0.14845497906208038,
-0.45935001969337463,
-0.08481614291667938,
-0.7910842895507812,
-0.10578730702400208,
-1.1244412660598755,
0.25188693404197693,
-0.011975815519690514,
-0.18769331276416779,
-0.05815781280398369,
1.8106790781021118,
-0.9799865484237671,
-2.12621808052063,
0.2826746106147766,
0.1679314821958542,
-0.3932196795940399,
0.19109514355659485,
1.5781559944152832,
0.42528852820396423,
1.4245914220809937,
1.4509930610656738,
0.8844578266143799,
-0.6480902433395386,
-1.3058490753173828,
0.691997230052948,
0.8669204711914062,
-1.4156041145324707,
0.8538671135902405,
0.030417215079069138,
-0.4581819772720337,
0.7964367270469666,
1.258290410041809,
0.4662221074104309,
-2.080922842025757,
0.8147178888320923,
-0.9452260732650757,
0.7883598208427429,
0.7364069223403931,
0.6313700079917908,
0.2737196087837219,
0.8205932378768921,
-1.1888048648834229,
-1.1705644130706787,
-0.836410403251648,
-0.662175178527832,
2.0425972938537598,
-0.2668708860874176,
0.5617213845252991,
-0.07753969728946686,
-1.2824739217758179,
-0.12738999724388123,
0.6908485889434814,
0.4265618324279785,
-0.3809479773044586,
0.7758837938308716,
-0.7315611243247986,
-1.2091575860977173,
-1.4567749500274658,
-0.39341017603874207,
-0.9680251479148865,
-0.8692856431007385,
1.097643256187439,
0.894743025302887,
0.24672310054302216,
1.887022614479065,
0.6299059987068176,
0.2041618824005127,
-2.7183854579925537,
0.8622197508811951,
0.2586291432380676,
-0.08940514922142029,
0.9855262041091919,
0.3590031862258911,
0.9268977642059326,
0.053898051381111145,
0.5147265791893005,
-2.453486919403076,
2.3151142597198486,
-0.27589258551597595,
0.7965112328529358,
-0.05662849172949791,
-0.17369090020656586,
1.1854058504104614,
0.6091338992118835,
0.584757387638092,
-1.127319097518921,
0.7337235808372498,
-0.4277700185775757,
1.1607030630111694,
0.9168932437896729,
-0.727917492389679,
-0.07911895215511322,
1.340415358543396,
0.45077475905418396,
-0.6051870584487915,
-0.9567409753799438,
-0.8882741332054138,
0.8689700365066528,
1.8561749458312988,
-0.03402990475296974,
-0.025252902880311012,
0.8402716517448425,
0.6181581020355225,
-1.2050915956497192,
0.22099678218364716,
-0.7393568754196167,
-0.900575578212738,
1.5381438732147217,
2.067606210708618,
-0.0830075740814209,
-0.18522901833057404,
-0.6134700775146484,
-1.2819048166275024,
0.7673522233963013,
-0.017448805272579193,
0.18576811254024506,
0.5888450741767883,
-0.6075131893157959,
1.1026675701141357,
0.9870229959487915,
0.9650747179985046,
0.08913716673851013,
0.268582820892334,
0.43549755215644836,
-0.31880947947502136,
-1.0163371562957764,
-0.22082799673080444,
-1.1468554735183716,
-2.4193875789642334,
0.4866301119327545,
-0.26935359835624695,
-1.455323338508606,
-0.013643600046634674,
-1.0120779275894165,
0.8480013012886047,
-0.5737522840499878,
-1.0922634601593018,
-1.5568205118179321,
0.11104525625705719,
-0.028696639463305473,
0.9435489773750305,
-1.6397854089736938,
-0.075977623462677,
1.1045544147491455,
0.8193058967590332,
-0.5681894421577454,
1.0504262447357178,
0.23762920498847961,
0.951416015625,
0.8191789984703064,
-0.4576394259929657,
0.45439234375953674,
0.15308856964111328,
-1.3538321256637573,
0.4762827157974243,
1.1183102130889893,
0.16274027526378632,
1.3973662853240967,
-0.49512597918510437,
0.04315466061234474,
0.3782947361469269,
-0.5390832424163818,
-0.3297257721424103,
-0.5231655836105347,
0.7504746913909912,
0.08953453600406647,
-0.8547831177711487,
0.09528638422489166,
-0.15935590863227844,
-0.2697581350803375,
0.11238324642181396,
-1.5145576000213623,
-0.23504658043384552,
-0.48526671528816223,
-0.5857667326927185,
-1.2341926097869873,
-0.16254091262817383,
1.508322834968567,
-0.7766386866569519,
-0.18739907443523407,
0.5178907513618469,
0.5456171035766602,
0.5782288312911987,
0.6878305673599243,
-0.6251501441001892,
-0.39150625467300415,
-0.20203465223312378,
-0.2952691912651062,
0.24151884019374847,
1.2820683717727661,
-0.19865211844444275,
-0.8908221125602722,
0.680407702922821,
-0.40080076456069946,
0.007489149458706379,
1.8975406885147095,
0.13981826603412628,
-0.6986777186393738,
0.33661332726478577,
-0.7167485356330872,
1.9143038988113403,
1.745468020439148,
1.3058139085769653,
-0.09651727974414825,
-0.9714845418930054,
0.6588882207870483,
-0.2734164595603943,
-0.3780510425567627,
0.9398428201675415,
0.456956148147583,
-0.1967431753873825,
-1.398171067237854,
0.6051138043403625,
1.2767366170883179,
-0.8594507575035095,
-0.8175662755966187,
0.052638519555330276,
-0.7955482602119446,
1.066596508026123,
0.5863947868347168,
0.47144615650177,
0.14376939833164215,
1.6528680324554443,
0.7318369150161743,
-0.5605188608169556,
0.5740476250648499,
0.5198861956596375,
-0.22240832448005676,
-2.2167325019836426,
-1.1697652339935303,
0.3144892156124115,
-0.3994557559490204,
-1.572096347808838,
1.3383989334106445,
-1.1343340873718262,
-0.9207115173339844,
0.5418538451194763,
0.046039942651987076,
1.5082303285598755,
0.30584612488746643,
1.575122356414795,
2.1480586528778076,
0.9631192088127136,
0.43183276057243347,
1.3937207460403442,
-0.05410042032599449,
-0.49510452151298523,
1.8836978673934937,
-0.3576050400733948,
0.45588088035583496,
1.1337413787841797,
-0.3869231343269348,
-1.0282028913497925,
-0.6751783490180969,
-1.1324186325073242,
-0.6953197121620178,
1.1259301900863647,
0.11521810293197632,
-1.0455161333084106,
0.19915881752967834,
1.6041858196258545,
0.1482699066400528,
-0.26317352056503296,
0.4618333876132965,
0.4347538948059082,
-0.7275612354278564,
-0.07763364911079407,
-0.935929000377655,
0.47459399700164795,
-0.23361319303512573,
-0.34195849299430847,
0.3681618571281433,
0.4169577360153198,
1.1853466033935547,
-0.07229882478713989,
0.05408858135342598,
1.1905401945114136,
-1.523427128791809,
1.375923752784729,
-0.5514463186264038,
0.20404495298862457,
-2.415156364440918,
1.4347245693206787,
-0.6935580968856812,
1.9529314041137695,
-2.601571559906006,
0.3905159533023834,
-0.787659227848053,
-0.46547242999076843,
0.3755953907966614,
-0.24482248723506927,
0.10949680209159851,
-0.1855466067790985,
-1.1291590929031372,
-0.021703772246837616,
-0.6856108903884888,
0.5146308541297913,
1.0809439420700073,
1.3290547132492065,
-1.0942034721374512,
-0.26034852862358093,
-1.7434715032577515,
-0.07873834669589996,
-0.6848939061164856,
0.2315087765455246,
-1.9838547706604004,
-0.10844126343727112,
-1.9412485361099243,
-2.2219181060791016,
-1.351304292678833,
-0.7520172595977783,
1.058655023574829,
0.24125903844833374,
-0.8314006924629211,
1.1626750230789185,
-0.3616337776184082,
-1.7969251871109009,
1.0595022439956665,
-2.111625909805298
] |
https://github.com/huggingface/datasets/issues/5045 | Automatically revert to last successful commit to hub when a push_to_hub is interrupted | > Ideally we would want to upload the files iteratively - and then once everything is uploaded we proceed to commit.
Oh I see. So maybe this has to be done in an implementation specific to `datasets/` as it is not a very common case (upload a bunch of files on the fly).
You can maybe have a look at how `huggingface_hub` is implemented for LFS files (arrow shards are LFS anyway, right?).
In [`upload_lfs_files`](https://github.com/huggingface/huggingface_hub/blob/e28646c977fc9304a4c3576ce61ff07f9778950b/src/huggingface_hub/_commit_api.py#L164) LFS files are uploaded 1 by 1 (multithreaded) and then [the commit is pushed](https://github.com/huggingface/huggingface_hub/blob/e28646c977fc9304a4c3576ce61ff07f9778950b/src/huggingface_hub/hf_api.py#L1926) to the Hub once all files have been uploaded. This is pretty much what you need, right ?
I can help you if you have questions how to do it in `datasets`. If that makes sense we could then move the implementation from `datasets` to `huggingface_hub` once it's mature. Next week I'm on holidays but feel free to start without my input.
(also cc @coyotte508 and @SBrandeis who implemented LFS upload in `hfh`) | **Is your feature request related to a problem? Please describe.**
I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again.
**Describe the solution you'd like**
Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision?
**Describe alternatives you've considered**
Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem.
**Additional context**
Provide useful defaults
| 501 | 162 | Automatically revert to last successful commit to hub when a push_to_hub is interrupted
**Is your feature request related to a problem? Please describe.**
I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again.
**Describe the solution you'd like**
Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision?
**Describe alternatives you've considered**
Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem.
**Additional context**
Provide useful defaults
> Ideally we would want to upload the files iteratively - and then once everything is uploaded we proceed to commit.
Oh I see. So maybe this has to be done in an implementation specific to `datasets/` as it is not a very common case (upload a bunch of files on the fly).
You can maybe have a look at how `huggingface_hub` is implemented for LFS files (arrow shards are LFS anyway, right?).
In [`upload_lfs_files`](https://github.com/huggingface/huggingface_hub/blob/e28646c977fc9304a4c3576ce61ff07f9778950b/src/huggingface_hub/_commit_api.py#L164) LFS files are uploaded 1 by 1 (multithreaded) and then [the commit is pushed](https://github.com/huggingface/huggingface_hub/blob/e28646c977fc9304a4c3576ce61ff07f9778950b/src/huggingface_hub/hf_api.py#L1926) to the Hub once all files have been uploaded. This is pretty much what you need, right ?
I can help you if you have questions how to do it in `datasets`. If that makes sense we could then move the implementation from `datasets` to `huggingface_hub` once it's mature. Next week I'm on holidays but feel free to start without my input.
(also cc @coyotte508 and @SBrandeis who implemented LFS upload in `hfh`) | [
-1.2141484022140503,
-0.9943633079528809,
-0.7305504083633423,
1.440214991569519,
-0.09992605447769165,
-1.2616418600082397,
0.060931503772735596,
-1.0214463472366333,
1.660380244255066,
-0.7346534132957458,
0.28889262676239014,
-1.6858946084976196,
-0.004218694753944874,
-0.5836886763572693,
-0.7968330383300781,
-0.819739818572998,
-0.36561810970306396,
-0.8552607297897339,
0.9212429523468018,
2.5611965656280518,
1.208713173866272,
-1.3802170753479004,
2.766228675842285,
0.6856883764266968,
-0.2615675628185272,
-1.0224123001098633,
0.42436444759368896,
0.002047993242740631,
-1.1625784635543823,
-0.4874609112739563,
-0.951480507850647,
-0.03891410678625107,
-0.5612888932228088,
-0.5189523100852966,
0.10505253076553345,
0.40387818217277527,
-0.17406994104385376,
-0.3654100298881531,
-0.5922012329101562,
-0.7004163265228271,
0.5681249499320984,
-0.42523297667503357,
0.9449319243431091,
-0.2631779611110687,
1.8723245859146118,
-0.653676450252533,
0.39022594690322876,
0.6709990501403809,
1.4716265201568604,
0.19124792516231537,
-0.028373301029205322,
0.3252476453781128,
0.3666902482509613,
-0.0698351338505745,
0.44366106390953064,
1.252239465713501,
0.6525901556015015,
0.5244029760360718,
0.7066068053245544,
-2.2086966037750244,
1.3988521099090576,
-1.0434292554855347,
0.27430394291877747,
1.3001117706298828,
-0.909452497959137,
0.3351099193096161,
-1.840050220489502,
-0.04055418446660042,
0.5809912085533142,
-2.326056957244873,
0.22120343148708344,
-1.3588647842407227,
-0.5725598335266113,
0.9451048374176025,
0.23554039001464844,
-1.3045161962509155,
0.21350575983524323,
-0.5447995662689209,
1.050916075706482,
0.4763592779636383,
1.132397174835205,
-1.7599387168884277,
-0.079744853079319,
-0.20029714703559875,
0.14161431789398193,
-1.3305429220199585,
-1.576969861984253,
0.6228665709495544,
0.5611346364021301,
0.5709717869758606,
-0.09117884933948517,
1.0038833618164062,
-1.0316178798675537,
0.8290132880210876,
-0.9488885402679443,
-1.622280478477478,
-1.460914134979248,
-2.2193210124969482,
-2.263277053833008,
0.8024405837059021,
-0.5060681700706482,
-0.5519421696662903,
1.988022804260254,
-1.1063382625579834,
-1.781463861465454,
1.174884557723999,
0.24626854062080383,
0.10028215497732162,
2.438483238220215,
0.2002217024564743,
-0.7062637209892273,
0.379886656999588,
-0.7113099694252014,
0.8985938429832458,
-0.4007449150085449,
1.4088720083236694,
0.4748849868774414,
-0.9855676293373108,
1.58469557762146,
-0.4338882565498352,
0.5116404891014099,
-0.6748561263084412,
-0.5854431390762329,
-0.8408321738243103,
0.38196057081222534,
1.9316754341125488,
-0.361550897359848,
1.574575424194336,
-0.46918460726737976,
-1.6080118417739868,
-1.5982292890548706,
0.9767013192176819,
0.5917141437530518,
-0.9609473347663879,
-0.012207802385091782,
-0.512136697769165,
0.10936202108860016,
-0.029701456427574158,
1.0928810834884644,
1.2292190790176392,
0.6703845262527466,
-0.380232572555542,
-0.8458484411239624,
0.1337234228849411,
-0.08962379395961761,
-0.626173734664917,
-1.8486249446868896,
-0.35996901988983154,
0.3125987648963928,
0.6393356323242188,
-1.229927897453308,
1.7106866836547852,
0.9854483604431152,
1.9505797624588013,
1.0002648830413818,
-0.29043054580688477,
1.4988504648208618,
0.026850853115320206,
1.8041564226150513,
-0.5590931177139282,
0.6784874796867371,
-0.4435895085334778,
-1.124150276184082,
0.7854129076004028,
-0.35195523500442505,
-2.0727357864379883,
-0.7850616574287415,
-0.7433448433876038,
-0.2276006042957306,
-0.7592576742172241,
0.8890296220779419,
-0.35007113218307495,
-1.3363767862319946,
0.17671003937721252,
-0.6666430830955505,
0.16238407790660858,
-1.1657745838165283,
0.25901684165000916,
0.7238532304763794,
-0.6920103430747986,
-0.008243164047598839,
-0.19661203026771545,
-1.2955619096755981,
-0.4260111153125763,
0.2616621255874634,
1.9033485651016235,
-0.6837857961654663,
0.9010789394378662,
1.0292695760726929,
-0.6238541007041931,
0.0432201586663723,
0.3641843795776367,
-0.20759466290473938,
0.8261564373970032,
-1.0260058641433716,
-0.27124783396720886,
1.1911060810089111,
-0.1673087775707245,
-0.6405499577522278,
1.4750391244888306,
0.7997666001319885,
-0.9356120824813843,
-0.21358154714107513,
-0.2063073366880417,
-0.7978916764259338,
-0.03328265994787216,
-1.5623525381088257,
-0.1616867184638977,
0.3565273880958557,
-1.4260812997817993,
-0.429334819316864,
-0.2862696647644043,
1.2084898948669434,
-0.21326392889022827,
1.4102689027786255,
-0.3498799204826355,
-0.22794003784656525,
-0.3548935055732727,
-0.40332528948783875,
0.1734597533941269,
-0.21573875844478607,
-0.6131819486618042,
0.22512096166610718,
-0.7926191687583923,
0.4078335165977478,
1.4652447700500488,
0.4425746500492096,
0.12163669615983963,
0.42682138085365295,
1.151703953742981,
0.29217347502708435,
-0.018191080540418625,
-0.8781403303146362,
-1.6342906951904297,
1.993927001953125,
-1.5580782890319824,
2.017638921737671,
0.8622357249259949,
-0.04335291311144829,
-1.703068733215332,
-1.8138720989227295,
1.2977761030197144,
1.16935396194458,
2.4184141159057617,
0.46291878819465637,
0.33611342310905457,
-0.8404886722564697,
-0.6712328195571899,
0.4137042760848999,
-1.04835844039917,
-0.6952807307243347,
0.04860125854611397,
2.3613879680633545,
1.8035825490951538,
-0.4942406415939331,
-0.24424050748348236,
-0.9947194457054138,
1.407075047492981,
-0.18659397959709167,
0.28024783730506897,
1.9875768423080444,
-0.26887956261634827,
-1.1094416379928589,
1.2863430976867676,
-2.263596773147583,
0.11366625875234604,
1.9809974431991577,
0.2886931896209717,
0.07069660723209381,
-1.4478267431259155,
-0.5334245562553406,
-0.3178250193595886,
-0.38091883063316345,
-1.3248668909072876,
0.5118057131767273,
-0.323703795671463,
-0.847509503364563,
-1.5497071743011475,
0.10386651009321213,
-1.2432798147201538,
-1.6081117391586304,
0.3534435033798218,
1.922402024269104,
2.072866201400757,
-0.6919419765472412,
1.5426048040390015,
-0.3009583055973053,
0.11135435104370117,
1.2211915254592896,
1.2351759672164917,
3.089851140975952,
1.8316519260406494,
-1.2330836057662964,
0.6247309446334839,
-0.26674962043762207,
-0.5280628800392151,
1.1534026861190796,
-1.0335054397583008,
1.25067937374115,
-0.14463546872138977,
-1.1659231185913086,
-1.2073816061019897,
1.0476924180984497,
0.49271488189697266,
0.038463350385427475,
-0.5005264282226562,
1.1596406698226929,
0.1164611205458641,
1.3161532878875732,
0.6117534637451172,
-0.4208361506462097,
0.6212643980979919,
-0.3686543107032776,
-0.6338568925857544,
1.609344244003296,
0.17473894357681274,
-1.4712505340576172,
-2.2312896251678467,
-0.26010945439338684,
-0.837412416934967,
0.08983724564313889,
-0.603647768497467,
-1.0797946453094482,
1.6277366876602173,
0.35191842913627625,
-1.3955726623535156,
-0.2610674798488617,
-0.36311665177345276,
-0.5556435585021973,
2.581449270248413,
-1.4085363149642944,
-0.18602652847766876,
-0.9815082550048828,
-0.5204541087150574,
1.5675185918807983,
-1.1540087461471558,
-0.1480347067117691,
-0.9933574199676514,
-0.5284976959228516,
-1.2437387704849243,
-0.5734617710113525,
-0.09705200791358948,
-0.9291598200798035,
0.6592713594436646,
0.1488877832889557,
-1.1107144355773926,
-0.3175969123840332,
-0.8278622627258301,
0.901746928691864,
-0.09050185978412628,
0.20934274792671204,
1.864343523979187,
0.39447668194770813,
-0.3996788561344147,
0.7780323624610901,
1.1206821203231812,
0.5047785639762878,
-0.5970456004142761,
0.11559794843196869,
-0.6783895492553711,
0.23893007636070251,
-1.3488636016845703,
0.3183631896972656,
-2.8749442100524902,
0.7007343769073486,
-0.06794605404138565,
-0.12042229622602463,
0.06949266046285629,
-1.3413364887237549,
1.081729769706726,
2.650761842727661,
-1.123664140701294,
0.4556885361671448,
0.3215025067329407,
1.2083076238632202,
-1.676206111907959,
0.30755484104156494,
-0.4020167589187622,
2.055262565612793,
0.2060394138097763,
1.2115330696105957,
-0.5654786229133606,
-2.238875389099121,
0.5463118553161621,
-1.2622603178024292,
-1.2079977989196777,
0.7642770409584045,
-0.9258765578269958,
0.0649089366197586,
-1.4607008695602417,
-0.22581686079502106,
-0.9250827431678772,
-1.2073915004730225,
0.7430793642997742,
0.1393761783838272,
0.4521060287952423,
-0.5969493985176086,
0.3088648021221161,
-2.196438789367676,
-1.3485262393951416,
-0.2120070606470108,
-0.9245402812957764,
0.5605491995811462,
-0.3203051686286926,
0.6091375350952148,
-0.11669009923934937,
0.1132606714963913,
0.40013203024864197,
1.471043586730957,
3.346921920776367,
0.31598350405693054,
0.40951472520828247,
-0.1298711597919464,
-0.8841713666915894,
1.3690565824508667,
0.972797155380249,
-0.08599533885717392,
-0.6309625506401062,
-0.9783427119255066,
1.3231350183486938,
1.9653146266937256,
0.9553247690200806,
0.06741555035114288,
-0.8025514483451843,
-0.7238051891326904,
-0.015203461050987244,
0.12671974301338196,
0.39458703994750977,
0.95565265417099,
0.018165547400712967,
0.21205434203147888,
1.4031106233596802,
1.2871776819229126,
-0.548132061958313,
0.42625588178634644,
-0.8524143099784851,
-0.44455409049987793,
0.36535608768463135,
0.243271142244339,
-0.11530618369579315,
0.3826592266559601,
-1.0039197206497192,
-0.21563725173473358,
-0.4626271724700928,
-0.9683248996734619,
-0.7436720728874207,
-0.41891953349113464,
-0.34684306383132935,
1.6243274211883545,
0.1332617849111557,
-0.4363704025745392,
-0.02476518601179123,
-0.7236990928649902,
-0.19514712691307068,
-1.0732755661010742,
0.2634713351726532,
-0.04830419272184372,
-0.10092686116695404,
-0.08911941945552826,
1.7361501455307007,
-0.9335325956344604,
-2.0679678916931152,
0.2467673122882843,
0.18091577291488647,
-0.41522881388664246,
0.19316519796848297,
1.6686582565307617,
0.49821382761001587,
1.4391695261001587,
1.4010450839996338,
0.9201428890228271,
-0.6410360932350159,
-1.2559325695037842,
0.6928156614303589,
0.833314061164856,
-1.3795584440231323,
0.883445143699646,
-0.07352635264396667,
-0.464366614818573,
0.7577396035194397,
1.2988635301589966,
0.42429259419441223,
-2.0578322410583496,
0.827895998954773,
-0.9498684406280518,
0.7172339558601379,
0.7027381658554077,
0.7062109708786011,
0.28983062505722046,
0.8492647409439087,
-1.1410490274429321,
-1.1891981363296509,
-0.820161759853363,
-0.6563421487808228,
1.971958875656128,
-0.24314016103744507,
0.5335597991943359,
-0.12744121253490448,
-1.2227896451950073,
-0.1702844500541687,
0.7570613622665405,
0.4249304234981537,
-0.39240762591362,
0.828660249710083,
-0.6397989988327026,
-1.0767478942871094,
-1.3573307991027832,
-0.4653456509113312,
-0.9467477202415466,
-0.9025543332099915,
0.9960944652557373,
0.8326017260551453,
0.29436060786247253,
1.9456528425216675,
0.6042163372039795,
0.26536133885383606,
-2.689044237136841,
0.8838664293289185,
0.3242775499820709,
-0.0630849227309227,
0.9983510971069336,
0.32052692770957947,
0.9866204857826233,
0.026839226484298706,
0.4980301260948181,
-2.362384557723999,
2.225630521774292,
-0.21939781308174133,
0.7939034104347229,
-0.09974232316017151,
-0.18251942098140717,
1.137654185295105,
0.492454469203949,
0.6014798283576965,
-1.1605321168899536,
0.6783192157745361,
-0.48012658953666687,
1.066313624382019,
0.9029547572135925,
-0.8113744258880615,
0.014804222621023655,
1.367055058479309,
0.4476378262042999,
-0.5444883108139038,
-0.9483415484428406,
-0.8400067687034607,
0.8601239323616028,
1.8357462882995605,
-0.02265280857682228,
0.058558374643325806,
0.8651201128959656,
0.6361097693443298,
-1.2548619508743286,
0.11142317950725555,
-0.7044566869735718,
-0.8474830985069275,
1.6215437650680542,
2.1210761070251465,
-0.11865616589784622,
-0.17261765897274017,
-0.657922625541687,
-1.2273045778274536,
0.8159890174865723,
-0.05905483290553093,
0.18398453295230865,
0.6438288688659668,
-0.6443236470222473,
1.1715030670166016,
0.8241510391235352,
0.9610902070999146,
0.08248584717512131,
0.32944825291633606,
0.45171889662742615,
-0.32145336270332336,
-1.0720175504684448,
-0.30752694606781006,
-1.1963733434677124,
-2.439436674118042,
0.4627586305141449,
-0.21459196507930756,
-1.4825907945632935,
0.0910152867436409,
-1.0059444904327393,
0.8683708310127258,
-0.5910190343856812,
-1.089918613433838,
-1.52955961227417,
0.20017336308956146,
-0.08568408340215683,
0.9056558609008789,
-1.6474913358688354,
-0.07439710199832916,
1.1179962158203125,
0.8782263994216919,
-0.536944568157196,
0.981089174747467,
0.28666064143180847,
0.9631075859069824,
0.8725986480712891,
-0.4254990518093109,
0.5130196809768677,
0.1268843710422516,
-1.317357063293457,
0.4572362005710602,
1.238460898399353,
0.14731420576572418,
1.4113969802856445,
-0.4608595371246338,
0.05003341659903526,
0.4548422396183014,
-0.55372154712677,
-0.319190114736557,
-0.4199843406677246,
0.7066086530685425,
0.09339343011379242,
-0.9061543941497803,
0.012557138688862324,
-0.13017268478870392,
-0.28298673033714294,
0.1877547800540924,
-1.502170205116272,
-0.2512089014053345,
-0.45188817381858826,
-0.5633038878440857,
-1.2684298753738403,
-0.06455536186695099,
1.4171533584594727,
-0.7904760241508484,
-0.23438261449337006,
0.5257459282875061,
0.4951247572898865,
0.5957536101341248,
0.6709986925125122,
-0.6996012330055237,
-0.34837961196899414,
-0.2546672821044922,
-0.3744398057460785,
0.283567875623703,
1.241763710975647,
-0.13919755816459656,
-0.9441282153129578,
0.6899213790893555,
-0.419246107339859,
0.054832249879837036,
1.932674527168274,
0.09873419255018234,
-0.6831917762756348,
0.3062852919101715,
-0.7053745985031128,
1.8795669078826904,
1.7934882640838623,
1.251045823097229,
-0.12876388430595398,
-0.9403344988822937,
0.6194893717765808,
-0.24609030783176422,
-0.30986085534095764,
1.0014821290969849,
0.4165247082710266,
-0.18700344860553741,
-1.4080100059509277,
0.5917882323265076,
1.3158862590789795,
-0.9114095568656921,
-0.7276911735534668,
-0.009443681687116623,
-0.8215819001197815,
1.1750010251998901,
0.6268819570541382,
0.36540383100509644,
0.19318145513534546,
1.6915878057479858,
0.6823294162750244,
-0.5175961852073669,
0.5519159436225891,
0.47509145736694336,
-0.15668043494224548,
-2.288670301437378,
-1.0879976749420166,
0.29200392961502075,
-0.31491100788116455,
-1.5398956537246704,
1.2632981538772583,
-1.1194653511047363,
-0.9303355813026428,
0.5180065035820007,
0.04930070787668228,
1.5009456872940063,
0.27641743421554565,
1.643532395362854,
2.1983795166015625,
0.9395294189453125,
0.35506671667099,
1.3162585496902466,
-0.026736710220575333,
-0.4750659465789795,
1.8634653091430664,
-0.4562704563140869,
0.5137915015220642,
1.0513923168182373,
-0.4226461946964264,
-1.0446274280548096,
-0.7651199698448181,
-1.1713001728057861,
-0.6524134278297424,
1.11420476436615,
0.10421878099441528,
-1.1026651859283447,
0.2227003425359726,
1.611289620399475,
0.14686086773872375,
-0.2591923177242279,
0.5765914916992188,
0.4545719623565674,
-0.6925855875015259,
-0.10429157316684723,
-0.8735005259513855,
0.4623967409133911,
-0.1954963356256485,
-0.3169809877872467,
0.31620481610298157,
0.4642333686351776,
1.1379356384277344,
-0.04273363575339317,
0.032374799251556396,
1.2081074714660645,
-1.4956729412078857,
1.4292973279953003,
-0.5887566804885864,
0.2806415557861328,
-2.4384288787841797,
1.4794471263885498,
-0.7492228150367737,
1.9174400568008423,
-2.5941247940063477,
0.42413899302482605,
-0.6521707773208618,
-0.5010842680931091,
0.24206605553627014,
-0.2676810622215271,
0.11938440054655075,
-0.11214946210384369,
-1.0876681804656982,
-0.03948947787284851,
-0.6822454333305359,
0.5922698974609375,
1.0324629545211792,
1.3720558881759644,
-1.0947209596633911,
-0.18004150688648224,
-1.7740484476089478,
-0.14663438498973846,
-0.7858195304870605,
0.2112893909215927,
-2.0130560398101807,
-0.11970211565494537,
-2.0149455070495605,
-2.2912497520446777,
-1.4315874576568604,
-0.8183513879776001,
1.0610356330871582,
0.2256850153207779,
-0.8637012839317322,
1.1389609575271606,
-0.37773385643959045,
-1.8020505905151367,
1.0881792306900024,
-2.1291439533233643
] |
https://github.com/huggingface/datasets/issues/5045 | Automatically revert to last successful commit to hub when a push_to_hub is interrupted | > Could you share the error you got please ? Maybe the full stack trace if you have it ?
Here’s part of the stack trace, that I can reproduce at the moment from a photo I took (potential typos from OCR):
```
ValueError
Traceback (most recent call last)
<ipython-input-4-274613b7d3f5> in <module>
from datasets import load dataset
ds = load_dataset('jrahn/chessv6', use_auth_token-True)
/us/local/1ib/python3.7/dist-packages/datasets/table.py in cast_table _to_schema (table, schema)
Line 2005 raise ValueError()
ValueError: Couldn't cast
fen: string
move: string
res: string
eco: string
move_id: int64
res_num: int64 to
{ 'fen': Value(dtype='string', id=None),
'move': Value(dtype=' string', id=None),
'res': Value(dtype='string', id=None),
'eco': Value(dtype='string', id=None),
'hc': Value(dtype='string', id=None),
'move_ id': Value(dtype='int64', id=None),
'res_num': Value(dtype= 'int64' , id=None) }
because column names don't match
```
The column 'hc' was removed before the interrupted push_to_hub(). It appears in the column list in curly brackets but not in the column list above.
Let me know, if I can be of any help. | **Is your feature request related to a problem? Please describe.**
I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again.
**Describe the solution you'd like**
Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision?
**Describe alternatives you've considered**
Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem.
**Additional context**
Provide useful defaults
| 501 | 155 | Automatically revert to last successful commit to hub when a push_to_hub is interrupted
**Is your feature request related to a problem? Please describe.**
I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again.
**Describe the solution you'd like**
Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision?
**Describe alternatives you've considered**
Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem.
**Additional context**
Provide useful defaults
> Could you share the error you got please ? Maybe the full stack trace if you have it ?
Here’s part of the stack trace, that I can reproduce at the moment from a photo I took (potential typos from OCR):
```
ValueError
Traceback (most recent call last)
<ipython-input-4-274613b7d3f5> in <module>
from datasets import load dataset
ds = load_dataset('jrahn/chessv6', use_auth_token-True)
/us/local/1ib/python3.7/dist-packages/datasets/table.py in cast_table _to_schema (table, schema)
Line 2005 raise ValueError()
ValueError: Couldn't cast
fen: string
move: string
res: string
eco: string
move_id: int64
res_num: int64 to
{ 'fen': Value(dtype='string', id=None),
'move': Value(dtype=' string', id=None),
'res': Value(dtype='string', id=None),
'eco': Value(dtype='string', id=None),
'hc': Value(dtype='string', id=None),
'move_ id': Value(dtype='int64', id=None),
'res_num': Value(dtype= 'int64' , id=None) }
because column names don't match
```
The column 'hc' was removed before the interrupted push_to_hub(). It appears in the column list in curly brackets but not in the column list above.
Let me know, if I can be of any help. | [
-1.2842884063720703,
-1.0282859802246094,
-0.7214094400405884,
1.5064098834991455,
-0.19420255720615387,
-1.1425659656524658,
0.04558410495519638,
-1.0709927082061768,
1.6257476806640625,
-0.6876556873321533,
0.2519381046295166,
-1.6229039430618286,
0.03975336253643036,
-0.6142179369926453,
-0.7802671194076538,
-0.7766684293746948,
-0.4250190258026123,
-0.8705973625183105,
1.0520364046096802,
2.4992387294769287,
1.2171783447265625,
-1.5499086380004883,
2.8340725898742676,
0.7934530377388,
-0.11164793372154236,
-1.0686806440353394,
0.45604270696640015,
-0.032868556678295135,
-1.183521032333374,
-0.5312174558639526,
-0.9367779493331909,
-0.07093624025583267,
-0.5984107255935669,
-0.4458632171154022,
0.057645417749881744,
0.42022258043289185,
-0.16779936850070953,
-0.3980410695075989,
-0.6123998165130615,
-0.6884670853614807,
0.5313959717750549,
-0.40466877818107605,
0.8963187336921692,
-0.28404170274734497,
1.791221022605896,
-0.5144944190979004,
0.3567155599594116,
0.7010930776596069,
1.4056799411773682,
0.20350678265094757,
-0.032133668661117554,
0.4036726951599121,
0.3749256730079651,
-0.05199421942234039,
0.5237134695053101,
1.1982524394989014,
0.6907039880752563,
0.473943829536438,
0.7567373514175415,
-2.2643918991088867,
1.2613067626953125,
-1.0691263675689697,
0.363800048828125,
1.318860650062561,
-0.8854073882102966,
0.4224129915237427,
-1.8054242134094238,
-0.02377454563975334,
0.64583820104599,
-2.24949049949646,
0.29359716176986694,
-1.2638596296310425,
-0.5262247920036316,
0.9586634635925293,
0.26375502347946167,
-1.275774598121643,
0.17641082406044006,
-0.45836958289146423,
1.0610589981079102,
0.3764782249927521,
1.1114825010299683,
-1.7013906240463257,
0.04290191829204559,
-0.1812308132648468,
0.15038657188415527,
-1.2505652904510498,
-1.5659334659576416,
0.5358932018280029,
0.48263758420944214,
0.6119998693466187,
-0.17746125161647797,
1.060666561126709,
-1.0968425273895264,
0.7957587242126465,
-1.0186848640441895,
-1.6287051439285278,
-1.4723047018051147,
-2.3096117973327637,
-2.2438526153564453,
0.7401149868965149,
-0.5122652649879456,
-0.5052759647369385,
2.022599935531616,
-1.0157537460327148,
-1.7767975330352783,
1.2348984479904175,
0.38742026686668396,
0.06859369575977325,
2.393821954727173,
0.1580142080783844,
-0.7072606086730957,
0.4474831521511078,
-0.7226389050483704,
0.8379656672477722,
-0.37414607405662537,
1.4703508615493774,
0.4305190145969391,
-0.9089465141296387,
1.6119258403778076,
-0.46871283650398254,
0.5842418074607849,
-0.6256280541419983,
-0.49185267090797424,
-0.8567086458206177,
0.3701159656047821,
1.8788716793060303,
-0.24818605184555054,
1.5222605466842651,
-0.4874431788921356,
-1.603766918182373,
-1.5668607950210571,
0.966538667678833,
0.5117437839508057,
-0.9778933525085449,
0.12285680323839188,
-0.48149973154067993,
0.1342289000749588,
-0.0636894628405571,
1.1329810619354248,
1.2022998332977295,
0.6586281657218933,
-0.3395518958568573,
-0.8858120441436768,
0.09927612543106079,
-0.11694159358739853,
-0.6468117237091064,
-1.8233697414398193,
-0.3430807292461395,
0.24731573462486267,
0.6148604154586792,
-1.2241957187652588,
1.6395361423492432,
0.971120297908783,
1.9077658653259277,
1.031247854232788,
-0.3385056257247925,
1.5385059118270874,
0.052255742251873016,
1.799584150314331,
-0.6140302419662476,
0.6273939609527588,
-0.41583016514778137,
-1.1327769756317139,
0.8360052108764648,
-0.3264336585998535,
-2.132080078125,
-0.7210944890975952,
-0.7641662955284119,
-0.28298434615135193,
-0.7432360649108887,
0.9202921986579895,
-0.3541731834411621,
-1.3383103609085083,
0.21311776340007782,
-0.7222887277603149,
0.19613943994045258,
-1.1307181119918823,
0.3634265959262848,
0.7417780756950378,
-0.6525386571884155,
-0.0035630566999316216,
-0.27315303683280945,
-1.2695854902267456,
-0.48976075649261475,
0.3765198588371277,
1.8188040256500244,
-0.7896093130111694,
0.8315655589103699,
0.9987667798995972,
-0.6483126282691956,
0.044850945472717285,
0.29337337613105774,
-0.2681404948234558,
0.8412842154502869,
-1.0505266189575195,
-0.49041447043418884,
1.1776227951049805,
-0.1984095722436905,
-0.543661892414093,
1.4020960330963135,
0.7567116618156433,
-0.99198317527771,
-0.23631291091442108,
-0.19609732925891876,
-0.9193496108055115,
-0.029477039352059364,
-1.5484626293182373,
-0.17021523416042328,
0.3694040775299072,
-1.5365840196609497,
-0.4464434087276459,
-0.23955917358398438,
1.2812650203704834,
-0.12203129380941391,
1.426176905632019,
-0.4198662340641022,
-0.18649418652057648,
-0.30646708607673645,
-0.3534480333328247,
0.19588251411914825,
-0.20861610770225525,
-0.6281911134719849,
0.08397774398326874,
-0.832690954208374,
0.40438222885131836,
1.4759066104888916,
0.4145200252532959,
0.0783633142709732,
0.5146742463111877,
1.1218260526657104,
0.41506972908973694,
0.08533620089292526,
-0.8088750243186951,
-1.5737950801849365,
2.0132007598876953,
-1.5569275617599487,
1.9763448238372803,
0.7759222984313965,
-0.03064672462642193,
-1.7440718412399292,
-1.7762383222579956,
1.355751633644104,
1.162421464920044,
2.35142183303833,
0.5268274545669556,
0.36255207657814026,
-0.8902063965797424,
-0.6860361099243164,
0.2933366596698761,
-1.0018390417099,
-0.7889296412467957,
0.08087272197008133,
2.467606544494629,
1.870835781097412,
-0.4837314784526825,
-0.23781950771808624,
-0.9146912097930908,
1.5068941116333008,
-0.2554052472114563,
0.278350830078125,
2.0032906532287598,
-0.20339691638946533,
-1.0649816989898682,
1.2844557762145996,
-2.4184937477111816,
0.17213362455368042,
2.018538236618042,
0.35880136489868164,
0.1317022740840912,
-1.417587399482727,
-0.5894376635551453,
-0.21520817279815674,
-0.46955177187919617,
-1.299188494682312,
0.5137689709663391,
-0.35477572679519653,
-0.768696665763855,
-1.4734017848968506,
0.13697002828121185,
-1.2234992980957031,
-1.6225990056991577,
0.2842130959033966,
1.9204496145248413,
2.1219797134399414,
-0.6798996329307556,
1.5919294357299805,
-0.2691754996776581,
0.18140192329883575,
1.2607054710388184,
1.2252494096755981,
3.0784764289855957,
1.8389960527420044,
-1.2793632745742798,
0.4852796196937561,
-0.16285791993141174,
-0.5415112376213074,
1.1186339855194092,
-1.1233384609222412,
1.2231833934783936,
-0.09560130536556244,
-1.1660536527633667,
-1.1539461612701416,
0.9933018684387207,
0.5342267751693726,
0.05240514129400253,
-0.5275425314903259,
1.1582449674606323,
0.046684302389621735,
1.2704936265945435,
0.6189454197883606,
-0.4247853457927704,
0.5514522194862366,
-0.3991478383541107,
-0.6346133351325989,
1.594237208366394,
0.12865261733531952,
-1.453676700592041,
-2.223026990890503,
-0.20007815957069397,
-0.8389870524406433,
0.04500263184309006,
-0.5716435313224792,
-1.0080077648162842,
1.530051827430725,
0.32024702429771423,
-1.3006846904754639,
-0.23077130317687988,
-0.36100348830223083,
-0.5472841262817383,
2.5863189697265625,
-1.3474044799804688,
-0.31211036443710327,
-0.9306901097297668,
-0.5344496965408325,
1.5730339288711548,
-1.1089754104614258,
-0.25171974301338196,
-1.0730781555175781,
-0.5924043655395508,
-1.2418690919876099,
-0.5689661502838135,
-0.025312848389148712,
-0.8483273983001709,
0.8588083386421204,
0.21088354289531708,
-1.180984616279602,
-0.32669568061828613,
-0.8669584393501282,
0.9278585314750671,
-0.12919393181800842,
0.18800415098667145,
1.8723368644714355,
0.3414084315299988,
-0.38346782326698303,
0.8419711589813232,
1.1830013990402222,
0.6059002876281738,
-0.5952464938163757,
0.15495552122592926,
-0.595319390296936,
0.3372076153755188,
-1.4009013175964355,
0.2632942497730255,
-2.934566020965576,
0.7039483189582825,
0.025545580312609673,
-0.09934194386005402,
0.0019614221528172493,
-1.3357981443405151,
1.0308531522750854,
2.5583078861236572,
-1.1649631261825562,
0.5192627310752869,
0.38097262382507324,
1.1891541481018066,
-1.8005800247192383,
0.2510944902896881,
-0.4231396019458771,
2.1056792736053467,
0.18967586755752563,
1.1879392862319946,
-0.5425213575363159,
-2.3740880489349365,
0.558980405330658,
-1.2693644762039185,
-1.1569395065307617,
0.6100107431411743,
-0.9557004570960999,
0.16424547135829926,
-1.593811273574829,
-0.23828478157520294,
-0.9731817841529846,
-1.1768690347671509,
0.7110296487808228,
0.21640406548976898,
0.3271210193634033,
-0.5696768164634705,
0.302042156457901,
-2.167097568511963,
-1.3951406478881836,
-0.14818763732910156,
-0.9097998142242432,
0.5572361350059509,
-0.4350057542324066,
0.7081035375595093,
-0.10066398233175278,
0.03317827731370926,
0.33358263969421387,
1.4593173265457153,
3.314955234527588,
0.20762448012828827,
0.37442901730537415,
-0.21760576963424683,
-0.8743564486503601,
1.4286527633666992,
0.9173601865768433,
-0.12056958675384521,
-0.5403820276260376,
-1.0951130390167236,
1.3737280368804932,
1.9176769256591797,
0.9560557007789612,
0.072276771068573,
-0.7527087330818176,
-0.6198309063911438,
-0.009058954194188118,
0.1883106231689453,
0.4999047517776489,
0.9555450677871704,
-0.05134555697441101,
0.06860056519508362,
1.4373835325241089,
1.1952725648880005,
-0.41799795627593994,
0.39800363779067993,
-0.8023954629898071,
-0.5049000978469849,
0.4746153652667999,
0.2050103396177292,
-0.1003536656498909,
0.3454297184944153,
-0.923969566822052,
-0.21793365478515625,
-0.40543174743652344,
-0.9425455927848816,
-0.6649205684661865,
-0.4335230886936188,
-0.3603614270687103,
1.5851761102676392,
0.21765416860580444,
-0.5402624011039734,
-0.11479028314352036,
-0.7227540016174316,
-0.12437835335731506,
-1.0940302610397339,
0.18168430030345917,
-0.04391859471797943,
-0.14927898347377777,
-0.24691694974899292,
1.7061411142349243,
-0.9127051830291748,
-2.1121296882629395,
0.16923882067203522,
0.26808109879493713,
-0.27330532670021057,
0.2483430802822113,
1.7069153785705566,
0.4824684262275696,
1.3843239545822144,
1.3648250102996826,
0.9040746688842773,
-0.5723060965538025,
-1.2445589303970337,
0.6773750185966492,
1.0040647983551025,
-1.3550524711608887,
0.8260266780853271,
-0.04746145009994507,
-0.5017052888870239,
0.7134218811988831,
1.3899540901184082,
0.4596051275730133,
-2.066380023956299,
0.8976198434829712,
-0.9727339744567871,
0.9066459536552429,
0.7011552453041077,
0.6425610184669495,
0.2928640842437744,
0.8670107126235962,
-1.2262862920761108,
-1.1842774152755737,
-0.8620844483375549,
-0.7386109232902527,
2.056989908218384,
-0.2940581738948822,
0.5190359354019165,
-0.1688624620437622,
-1.2646090984344482,
-0.06813202053308487,
0.7307363748550415,
0.3624459207057953,
-0.4516022205352783,
0.8161059021949768,
-0.6992660760879517,
-1.1420286893844604,
-1.3351987600326538,
-0.3830336332321167,
-0.9522832036018372,
-0.8765106201171875,
1.060481071472168,
0.821044385433197,
0.2152349352836609,
1.8996487855911255,
0.6332305073738098,
0.19480937719345093,
-2.588366985321045,
0.8667957186698914,
0.28183457255363464,
-0.09786216914653778,
0.8920198678970337,
0.31867074966430664,
1.0271002054214478,
0.06494270265102386,
0.5394611358642578,
-2.393338680267334,
2.2075612545013428,
-0.2093399316072464,
0.7595908641815186,
-0.05827006697654724,
-0.23427364230155945,
1.1640785932540894,
0.5562854409217834,
0.5372111201286316,
-0.9766245484352112,
0.6362739205360413,
-0.44285282492637634,
1.1649152040481567,
0.9542307257652283,
-0.8346691131591797,
-0.02282385155558586,
1.3422149419784546,
0.3945825397968292,
-0.6102195978164673,
-1.00048828125,
-0.8232513070106506,
0.9975063800811768,
1.788686752319336,
-0.022005178034305573,
0.050980664789676666,
0.7918605208396912,
0.6738959550857544,
-1.234102725982666,
0.15355083346366882,
-0.7171441912651062,
-0.7697434425354004,
1.6512608528137207,
2.081502914428711,
-0.1987309604883194,
-0.1330515295267105,
-0.6046662330627441,
-1.3486568927764893,
0.784953773021698,
-0.09335234761238098,
0.1187860295176506,
0.634032130241394,
-0.5983776450157166,
1.0576670169830322,
0.8611984848976135,
0.8711209297180176,
0.057947561144828796,
0.2825416326522827,
0.4341822862625122,
-0.3961018919944763,
-1.092890739440918,
-0.2891928553581238,
-1.1866239309310913,
-2.405224561691284,
0.4024362862110138,
-0.142598956823349,
-1.3855499029159546,
0.03830207884311676,
-0.972649872303009,
1.0087659358978271,
-0.5465487241744995,
-1.1219173669815063,
-1.4775896072387695,
0.1698705106973648,
-0.02074791118502617,
0.9134581685066223,
-1.6203798055648804,
-0.06880110502243042,
1.1933077573776245,
0.8380269408226013,
-0.6630977988243103,
0.9674119353294373,
0.2680111229419708,
1.0716650485992432,
0.8000614047050476,
-0.4499599039554596,
0.5133657455444336,
0.06291582435369492,
-1.329211711883545,
0.47628894448280334,
1.1664230823516846,
0.1930244415998459,
1.42196524143219,
-0.48027506470680237,
-0.05135129392147064,
0.40500304102897644,
-0.6387816667556763,
-0.38241368532180786,
-0.39441537857055664,
0.6126123070716858,
0.06915990263223648,
-0.8386398553848267,
-0.01786205545067787,
-0.04317715764045715,
-0.372394323348999,
0.14011487364768982,
-1.5653667449951172,
-0.18049587309360504,
-0.45866262912750244,
-0.4201347529888153,
-1.2859407663345337,
-0.11831338703632355,
1.3956098556518555,
-0.6926417350769043,
-0.3231795132160187,
0.5381402969360352,
0.42203235626220703,
0.5318728685379028,
0.6685181260108948,
-0.6995220184326172,
-0.34587761759757996,
-0.19126011431217194,
-0.3394618630409241,
0.1697891652584076,
1.3078385591506958,
-0.09965984523296356,
-0.9394569993019104,
0.6662863492965698,
-0.39972084760665894,
0.018319575116038322,
1.789239525794983,
0.03208722174167633,
-0.7159650921821594,
0.32842156291007996,
-0.7560926079750061,
1.8778756856918335,
1.7382136583328247,
1.2790212631225586,
-0.20774680376052856,
-0.8514597415924072,
0.6665109395980835,
-0.38161641359329224,
-0.38857245445251465,
0.9339898228645325,
0.4984090328216553,
-0.17063510417938232,
-1.450226902961731,
0.6538845300674438,
1.2891945838928223,
-0.8674631118774414,
-0.7585668563842773,
0.1038874089717865,
-0.7878431081771851,
1.1606507301330566,
0.6375872492790222,
0.4159865975379944,
0.22510254383087158,
1.7059993743896484,
0.7618861198425293,
-0.5049548745155334,
0.6589964628219604,
0.5452419519424438,
-0.1859206110239029,
-2.183256149291992,
-1.1987560987472534,
0.2899906635284424,
-0.4298458695411682,
-1.5771982669830322,
1.3240317106246948,
-1.1068710088729858,
-0.9281772375106812,
0.5675097703933716,
0.04630381613969803,
1.3828976154327393,
0.34514206647872925,
1.5481624603271484,
2.1293325424194336,
0.875929594039917,
0.4730478823184967,
1.2519768476486206,
-0.039538756012916565,
-0.39823228120803833,
1.8896710872650146,
-0.3468102216720581,
0.5560648441314697,
1.060080885887146,
-0.34635934233665466,
-1.110249638557434,
-0.7421274781227112,
-1.2464402914047241,
-0.7310864329338074,
1.1176148653030396,
0.06016629934310913,
-1.0922977924346924,
0.23792992532253265,
1.6177574396133423,
0.13943402469158173,
-0.3439050316810608,
0.6098230481147766,
0.3621056377887726,
-0.816413402557373,
-0.08585437387228012,
-0.8911261558532715,
0.45692509412765503,
-0.23897673189640045,
-0.30506494641304016,
0.36691269278526306,
0.4719090759754181,
1.2789376974105835,
-0.0024681929498910904,
0.04373551905155182,
1.1121379137039185,
-1.4507310390472412,
1.4336258172988892,
-0.6955657005310059,
0.3118042051792145,
-2.4455268383026123,
1.4176744222640991,
-0.7144892811775208,
2.0260534286499023,
-2.666715621948242,
0.47614872455596924,
-0.7036026120185852,
-0.4619622826576233,
0.34852370619773865,
-0.24554872512817383,
0.06442245095968246,
-0.08602241426706314,
-1.1017353534698486,
0.07772196829319,
-0.6128091812133789,
0.510974645614624,
1.2101740837097168,
1.336550235748291,
-1.1365429162979126,
-0.2566850781440735,
-1.7443373203277588,
-0.19647018611431122,
-0.7889329195022583,
0.26957619190216064,
-2.0464329719543457,
-0.16341766715049744,
-1.927453875541687,
-2.2154626846313477,
-1.2751734256744385,
-0.8476330041885376,
1.157867670059204,
0.15900525450706482,
-0.9182035326957703,
1.2800893783569336,
-0.3874024748802185,
-1.7265535593032837,
1.032945990562439,
-2.127875328063965
] |
https://github.com/huggingface/datasets/issues/5044 | integrate `load_from_disk` into `load_dataset` | I agree the situation is not ideal and it would be awesome to use `load_dataset` to reload a dataset saved locally !
For context:
- `load_dataset` works in three steps: download the dataset, then prepare it as an arrow dataset, and finally return a memory mapped arrow dataset. In particular it creates a cache directory to store the arrow data and the subsequent cache files for `map`.
- `load_from_disk` directly returns a memory mapped dataset from the arrow file (similar to `Dataset.from_file`). It doesn't create a cache diretory, instead all the subsequent `map` calls write in the same directory as the original data.
If we want to keep the download_and_prepare step for consistency, it would unnecessarily copy the arrow data into the datasets cache. On the other hand if we don't do this step, the cache directory doesn't exist which is inconsistent.
I'm curious, what would you expect to happen in this situation ? | **Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you! | 502 | 154 | integrate `load_from_disk` into `load_dataset`
**Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you!
I agree the situation is not ideal and it would be awesome to use `load_dataset` to reload a dataset saved locally !
For context:
- `load_dataset` works in three steps: download the dataset, then prepare it as an arrow dataset, and finally return a memory mapped arrow dataset. In particular it creates a cache directory to store the arrow data and the subsequent cache files for `map`.
- `load_from_disk` directly returns a memory mapped dataset from the arrow file (similar to `Dataset.from_file`). It doesn't create a cache diretory, instead all the subsequent `map` calls write in the same directory as the original data.
If we want to keep the download_and_prepare step for consistency, it would unnecessarily copy the arrow data into the datasets cache. On the other hand if we don't do this step, the cache directory doesn't exist which is inconsistent.
I'm curious, what would you expect to happen in this situation ? | [
-1.2368111610412598,
-0.9566577076911926,
-0.6736604571342468,
1.4294203519821167,
-0.09253088384866714,
-1.322953701019287,
0.11907912790775299,
-1.0474250316619873,
1.5526111125946045,
-0.7530148029327393,
0.21871532499790192,
-1.6522216796875,
-0.09012339264154434,
-0.468554824590683,
-0.7082620859146118,
-0.8880060911178589,
-0.4406410753726959,
-0.8833104968070984,
1.0627145767211914,
2.445392608642578,
1.3473459482192993,
-1.3577944040298462,
2.7455873489379883,
0.6628885865211487,
-0.21631847321987152,
-1.0362943410873413,
0.4900558292865753,
0.05376153439283371,
-1.1928752660751343,
-0.40062272548675537,
-0.9028421640396118,
-0.02810264751315117,
-0.5376821756362915,
-0.45453131198883057,
0.09722567349672318,
0.5136123895645142,
-0.3182358145713806,
-0.33318400382995605,
-0.6653363108634949,
-0.7159247398376465,
0.5230942964553833,
-0.3078800141811371,
0.9219244122505188,
-0.34657880663871765,
1.739990234375,
-0.6195850968360901,
0.42881321907043457,
0.7447794675827026,
1.263422966003418,
0.16434581577777863,
0.09210231900215149,
0.2464314103126526,
0.3368269205093384,
-0.017151126638054848,
0.6057765483856201,
1.259972095489502,
0.6199043989181519,
0.54071444272995,
0.6957834959030151,
-2.226925849914551,
1.31244695186615,
-0.9129303097724915,
0.2843727171421051,
1.3266980648040771,
-0.8408970236778259,
0.331648051738739,
-1.8569433689117432,
-0.07804972678422928,
0.6257495880126953,
-2.241555690765381,
0.25032609701156616,
-1.2381314039230347,
-0.5423586964607239,
0.8975887894630432,
0.3525848686695099,
-1.1667248010635376,
0.22250297665596008,
-0.49368923902511597,
1.111596703529358,
0.47337549924850464,
1.1213810443878174,
-1.6573283672332764,
0.006261897273361683,
-0.14636534452438354,
0.10993416607379913,
-1.302794098854065,
-1.6617940664291382,
0.5750330090522766,
0.5192688703536987,
0.7027649879455566,
-0.10111607611179352,
0.9686384797096252,
-1.0953726768493652,
0.8477665185928345,
-1.0402253866195679,
-1.5468188524246216,
-1.396148443222046,
-2.4126665592193604,
-2.2963247299194336,
0.8045496940612793,
-0.5414470434188843,
-0.5674599409103394,
2.0167810916900635,
-0.9928927421569824,
-1.7664395570755005,
1.0941548347473145,
0.2802952826023102,
0.11410538107156754,
2.382859230041504,
0.20418637990951538,
-0.7821393609046936,
0.5261449813842773,
-0.723749577999115,
0.8351815342903137,
-0.2847801148891449,
1.2675474882125854,
0.5303447246551514,
-1.0169727802276611,
1.5991222858428955,
-0.47853970527648926,
0.6640898585319519,
-0.616024374961853,
-0.5644786357879639,
-0.7819786071777344,
0.2896217703819275,
1.8909369707107544,
-0.2685542106628418,
1.6144664287567139,
-0.34376299381256104,
-1.554506778717041,
-1.5678215026855469,
0.8347786664962769,
0.49729612469673157,
-0.8328254222869873,
0.04861554130911827,
-0.5057522058486938,
0.18773610889911652,
0.01139479037374258,
1.1417449712753296,
1.2401772737503052,
0.7420031428337097,
-0.35851240158081055,
-0.8232718706130981,
0.18382681906223297,
-0.12842068076133728,
-0.6256245374679565,
-1.8289676904678345,
-0.27315375208854675,
0.21212726831436157,
0.5952417850494385,
-1.2215301990509033,
1.8280231952667236,
0.8900435566902161,
2.0456981658935547,
0.9616069197654724,
-0.32306554913520813,
1.4383821487426758,
0.0023360680788755417,
1.8718191385269165,
-0.46662354469299316,
0.6151379942893982,
-0.3705524504184723,
-1.1423505544662476,
0.8773482441902161,
-0.40759357810020447,
-2.001143455505371,
-0.8316943049430847,
-0.7951195240020752,
-0.1547715961933136,
-0.7267497181892395,
0.854455828666687,
-0.2874913513660431,
-1.5449808835983276,
0.09072376042604446,
-0.6371731758117676,
0.14363056421279907,
-1.2714201211929321,
0.20235750079154968,
0.7501402497291565,
-0.719541072845459,
-0.050510652363300323,
-0.26410791277885437,
-1.2659006118774414,
-0.4928829073905945,
0.37490713596343994,
2.0141334533691406,
-0.605954647064209,
0.8929566144943237,
1.0177044868469238,
-0.7550188302993774,
0.09702945500612259,
0.1697303205728531,
-0.2877553105354309,
0.7151408791542053,
-1.0974140167236328,
-0.4219869375228882,
1.1565159559249878,
-0.2377423346042633,
-0.7405074834823608,
1.4725772142410278,
0.7883156538009644,
-1.0854604244232178,
-0.24955491721630096,
-0.23234951496124268,
-0.9062501788139343,
-0.07507473975419998,
-1.4753082990646362,
-0.18662384152412415,
0.35265108942985535,
-1.4613510370254517,
-0.3707147538661957,
-0.18466924130916595,
1.3298265933990479,
-0.2506585419178009,
1.4489085674285889,
-0.3347262442111969,
-0.158110573887825,
-0.26741117238998413,
-0.4962214231491089,
0.1710558384656906,
-0.20083291828632355,
-0.6243765950202942,
0.15909838676452637,
-0.7970317006111145,
0.2674734890460968,
1.5180437564849854,
0.36394667625427246,
0.09483712911605835,
0.46480822563171387,
1.1005908250808716,
0.4051685631275177,
-0.041469380259513855,
-0.8363662362098694,
-1.5084245204925537,
1.9325515031814575,
-1.4361414909362793,
1.9234730005264282,
0.7226538062095642,
-0.08537127822637558,
-1.7830071449279785,
-1.8301845788955688,
1.2299408912658691,
1.1470897197723389,
2.388245105743408,
0.4844253659248352,
0.37237048149108887,
-0.7878141403198242,
-0.7640656232833862,
0.29581785202026367,
-0.9797528386116028,
-0.6368696093559265,
0.12650704383850098,
2.3382370471954346,
1.814876675605774,
-0.5758905410766602,
-0.276104211807251,
-0.8438786864280701,
1.311774492263794,
-0.25410112738609314,
0.32747918367385864,
2.084606409072876,
-0.3227538466453552,
-0.9503954648971558,
1.3852232694625854,
-2.3913607597351074,
0.27669399976730347,
2.075505495071411,
0.29748284816741943,
0.13231970369815826,
-1.4217106103897095,
-0.5869870781898499,
-0.30662381649017334,
-0.4939582645893097,
-1.2823214530944824,
0.5478883385658264,
-0.3164912462234497,
-0.8439218997955322,
-1.4334864616394043,
0.03319057449698448,
-1.1367592811584473,
-1.7238171100616455,
0.347244530916214,
1.9557124376296997,
2.0507991313934326,
-0.7949667572975159,
1.3673686981201172,
-0.2658732831478119,
0.03483559563755989,
1.328687310218811,
1.3073617219924927,
3.0547096729278564,
1.9140939712524414,
-1.2698349952697754,
0.7275676131248474,
-0.2401629537343979,
-0.5266799330711365,
1.1759086847305298,
-1.150234580039978,
1.087173342704773,
-0.1820487231016159,
-1.1685155630111694,
-1.238223671913147,
1.0681016445159912,
0.5047052502632141,
0.004578244872391224,
-0.5058557987213135,
1.2802214622497559,
0.13793498277664185,
1.3421874046325684,
0.5733792185783386,
-0.47338664531707764,
0.5592487454414368,
-0.39166074991226196,
-0.6210359930992126,
1.635934829711914,
0.1731005609035492,
-1.5703271627426147,
-2.28857159614563,
-0.26316049695014954,
-0.9588292837142944,
-0.043938182294368744,
-0.6089185476303101,
-0.9542418122291565,
1.64696204662323,
0.38252952694892883,
-1.2318572998046875,
-0.23340056836605072,
-0.3134361505508423,
-0.5165207982063293,
2.6683952808380127,
-1.2919135093688965,
-0.1429888755083084,
-0.957486093044281,
-0.5440170168876648,
1.6480376720428467,
-1.2427517175674438,
-0.2922331392765045,
-1.011005163192749,
-0.604053795337677,
-1.2814985513687134,
-0.47215670347213745,
0.010213411413133144,
-0.9622669219970703,
0.7869582772254944,
0.17828920483589172,
-1.1230021715164185,
-0.3115086853504181,
-0.8659565448760986,
1.0321298837661743,
-0.0980345755815506,
0.2547631859779358,
1.907733678817749,
0.2684917747974396,
-0.4577524662017822,
0.7219860553741455,
1.2417802810668945,
0.5793787837028503,
-0.63218092918396,
0.03980468586087227,
-0.6247487664222717,
0.3824189007282257,
-1.3993680477142334,
0.19745168089866638,
-2.9640703201293945,
0.7686999440193176,
-0.15760010480880737,
-0.15399324893951416,
-0.10745379328727722,
-1.3538165092468262,
1.0612051486968994,
2.6074321269989014,
-1.1706963777542114,
0.48625925183296204,
0.47205543518066406,
1.133658528327942,
-1.6099504232406616,
0.287418007850647,
-0.5142414569854736,
2.031412363052368,
0.17101794481277466,
1.2213016748428345,
-0.5430073738098145,
-2.1951377391815186,
0.6227321624755859,
-1.1659969091415405,
-1.056625247001648,
0.7957459092140198,
-0.9314953088760376,
0.3655675947666168,
-1.4219081401824951,
-0.17768527567386627,
-0.9597228169441223,
-1.2236013412475586,
0.6814370155334473,
0.12333683669567108,
0.38872984051704407,
-0.6130935549736023,
0.3722786009311676,
-2.196413040161133,
-1.432246208190918,
-0.21573315560817719,
-1.0074009895324707,
0.5383659601211548,
-0.4353821575641632,
0.5336403846740723,
-0.04506795480847359,
0.145808145403862,
0.24794885516166687,
1.4641740322113037,
3.392477512359619,
0.13999566435813904,
0.16914904117584229,
-0.11410988867282867,
-1.0267817974090576,
1.5546706914901733,
0.8840750455856323,
-0.09530661255121231,
-0.5533612966537476,
-1.030470371246338,
1.279847502708435,
1.9902560710906982,
1.1560871601104736,
0.08039648085832596,
-0.7779106497764587,
-0.7723942399024963,
0.0433344691991806,
0.15254095196723938,
0.5037966966629028,
0.9707068800926208,
-0.026234589517116547,
0.1472465544939041,
1.3580104112625122,
1.184930682182312,
-0.27612635493278503,
0.37635865807533264,
-0.9767671823501587,
-0.41591161489486694,
0.37187156081199646,
0.23891861736774445,
0.05067222937941551,
0.46414655447006226,
-1.0551190376281738,
-0.2776380479335785,
-0.2840326130390167,
-0.8110015988349915,
-0.7286255359649658,
-0.38591527938842773,
-0.42650654911994934,
1.601449728012085,
0.0907512679696083,
-0.5113089680671692,
0.060971036553382874,
-0.706699013710022,
-0.10522135347127914,
-1.1240626573562622,
0.18804283440113068,
-0.07557587325572968,
-0.11374565958976746,
-0.13416777551174164,
1.6331801414489746,
-0.9037314057350159,
-2.122485876083374,
0.20381246507167816,
0.3111806809902191,
-0.33225488662719727,
0.14068444073200226,
1.7116022109985352,
0.48157644271850586,
1.3927967548370361,
1.3381754159927368,
0.966447114944458,
-0.5875483751296997,
-1.2186223268508911,
0.7166739702224731,
0.8738484382629395,
-1.3835837841033936,
0.9487284421920776,
-0.16755038499832153,
-0.4860350489616394,
0.6483235955238342,
1.3283636569976807,
0.45204105973243713,
-2.020250082015991,
0.9078642129898071,
-0.9174640774726868,
0.7658008337020874,
0.7327654957771301,
0.7604188919067383,
0.23586726188659668,
0.8984220027923584,
-1.1571838855743408,
-1.2040343284606934,
-0.7165404558181763,
-0.6836169958114624,
1.8520526885986328,
-0.2877444624900818,
0.6201133131980896,
-0.17964836955070496,
-1.1565055847167969,
-0.10834110528230667,
0.8265041708946228,
0.3915356397628784,
-0.41395899653434753,
0.9022486209869385,
-0.599479079246521,
-0.9834952354431152,
-1.2620172500610352,
-0.3818317651748657,
-1.0662966966629028,
-0.8255437016487122,
0.9971213340759277,
0.8064308166503906,
0.48005327582359314,
1.9332057237625122,
0.6469602584838867,
0.37482109665870667,
-2.660787582397461,
0.8481014370918274,
0.2568887174129486,
-0.019398408010601997,
0.8397889733314514,
0.28512337803840637,
1.146006464958191,
0.003290231339633465,
0.5939971804618835,
-2.3626325130462646,
2.2531654834747314,
-0.20349949598312378,
0.6194139719009399,
0.012005449272692204,
-0.1937282532453537,
1.128371238708496,
0.6251665353775024,
0.5289311408996582,
-1.155427098274231,
0.7494387030601501,
-0.5016531944274902,
1.1256968975067139,
0.912860095500946,
-0.8486778736114502,
0.08737094700336456,
1.46721351146698,
0.4714406728744507,
-0.4785189926624298,
-0.9695469737052917,
-0.8716859221458435,
0.9307190179824829,
1.7007472515106201,
-0.09246991574764252,
-0.0001850603148341179,
0.843869149684906,
0.6579611897468567,
-1.1868221759796143,
0.014184909872710705,
-0.7070519328117371,
-0.6657832264900208,
1.718729019165039,
2.0276565551757812,
-0.11396273970603943,
-0.17741209268569946,
-0.6993914246559143,
-1.296041488647461,
0.768914520740509,
-0.05802198126912117,
0.04879220202565193,
0.6817981600761414,
-0.6841149926185608,
1.0759061574935913,
0.6366366147994995,
1.0088295936584473,
-0.03053666278719902,
0.3324257731437683,
0.38160136342048645,
-0.3339870274066925,
-1.1721421480178833,
-0.31396913528442383,
-1.1035075187683105,
-2.5225446224212646,
0.34296169877052307,
-0.3139747977256775,
-1.4831258058547974,
0.04636179655790329,
-1.039086937904358,
0.8912487626075745,
-0.5891261100769043,
-1.1756796836853027,
-1.4256209135055542,
0.30203527212142944,
-0.07858928292989731,
0.9019178152084351,
-1.675838589668274,
-0.19372312724590302,
1.2091847658157349,
0.8006079792976379,
-0.6298615336418152,
0.9456217288970947,
0.2535480558872223,
0.9435853958129883,
0.7360251545906067,
-0.4179001450538635,
0.6063416004180908,
-0.014734583906829357,
-1.339272141456604,
0.41174960136413574,
1.2505861520767212,
0.1446070671081543,
1.3387415409088135,
-0.4389304220676422,
0.11060859262943268,
0.43081337213516235,
-0.714762806892395,
-0.5289872288703918,
-0.4152678847312927,
0.7504098415374756,
-0.05745687708258629,
-1.0041910409927368,
-0.13103549182415009,
-0.0733933076262474,
-0.33421555161476135,
0.22765380144119263,
-1.438309669494629,
-0.2788470983505249,
-0.3862304389476776,
-0.42642486095428467,
-1.3982861042022705,
0.07357686012983322,
1.3202334642410278,
-0.786359429359436,
-0.1829538494348526,
0.40091630816459656,
0.3915846347808838,
0.5670870542526245,
0.5600022077560425,
-0.7937279939651489,
-0.21903887391090393,
-0.37339839339256287,
-0.2570042014122009,
0.2909316420555115,
1.2499732971191406,
-0.06421593576669693,
-1.014153242111206,
0.6577205061912537,
-0.3111628293991089,
0.127702534198761,
2.023564577102661,
0.014022025279700756,
-0.6382299661636353,
0.3508526086807251,
-0.7327573299407959,
1.6969659328460693,
1.76676607131958,
1.3192230463027954,
-0.10454989224672318,
-0.8074628710746765,
0.5042997598648071,
-0.29565876722335815,
-0.3182642459869385,
0.896192193031311,
0.3882577121257782,
-0.2581180930137634,
-1.4081798791885376,
0.6763820052146912,
1.264582872390747,
-0.7347080111503601,
-0.7380677461624146,
0.10056381672620773,
-0.9111645221710205,
1.2455201148986816,
0.5539799928665161,
0.33618515729904175,
0.3019528388977051,
1.549829125404358,
0.7465805411338806,
-0.4286216199398041,
0.5302892923355103,
0.5942984819412231,
-0.2602745592594147,
-2.150789976119995,
-1.0598487854003906,
0.28756240010261536,
-0.3914940357208252,
-1.5932414531707764,
1.3913499116897583,
-1.1417436599731445,
-1.0601717233657837,
0.5233217477798462,
0.09970254451036453,
1.3288530111312866,
0.3410748243331909,
1.6773431301116943,
2.1803064346313477,
0.9274532794952393,
0.42420080304145813,
1.2161298990249634,
-0.10872869938611984,
-0.48519226908683777,
1.8634175062179565,
-0.41679179668426514,
0.48918595910072327,
1.0245552062988281,
-0.37453949451446533,
-1.1579047441482544,
-0.848176896572113,
-1.1202253103256226,
-0.6354432702064514,
1.1511194705963135,
0.08388150483369827,
-1.0493990182876587,
0.193950816988945,
1.5831869840621948,
0.15490089356899261,
-0.24218279123306274,
0.6392329931259155,
0.38383933901786804,
-0.7435729503631592,
-0.11138055473566055,
-0.8600850701332092,
0.5202860236167908,
-0.18235145509243011,
-0.2860112190246582,
0.22305214405059814,
0.5356884598731995,
1.2696770429611206,
-0.060927923768758774,
0.146917462348938,
1.1325594186782837,
-1.4270869493484497,
1.5384562015533447,
-0.6097989678382874,
0.3589344918727875,
-2.439312219619751,
1.3970352411270142,
-0.7624219059944153,
1.974752426147461,
-2.5650482177734375,
0.4457353353500366,
-0.5082001686096191,
-0.5384224653244019,
0.2895660400390625,
-0.4278545677661896,
0.02544531598687172,
-0.08543381094932556,
-0.9643197655677795,
0.004195867106318474,
-0.7473882436752319,
0.617041289806366,
1.1309973001480103,
1.4402010440826416,
-1.171016812324524,
-0.3408711850643158,
-1.6723884344100952,
-0.19813719391822815,
-0.8378684520721436,
0.3319569528102875,
-1.9903836250305176,
-0.19068178534507751,
-2.008035182952881,
-2.310011625289917,
-1.3336607217788696,
-0.8913440108299255,
1.069360613822937,
0.17361876368522644,
-0.8926003575325012,
1.170094609260559,
-0.3617924451828003,
-1.8817938566207886,
1.2063695192337036,
-2.163064479827881
] |
https://github.com/huggingface/datasets/issues/5044 | integrate `load_from_disk` into `load_dataset` | Thank you for the detailed breakdown, @lhoestq
> I'm curious, what would you expect to happen in this situation ?
1. the simplest solution is to add a flag to the dataset saved by `save_to_disk` and have `load_dataset` check that flag - if it's set simply switch control to `load_from_disk` behind the scenes. So `load_dataset` detects it's a local filesystem, looks inside to see whether it's something it can cache or whether it should use it directly as is and continues accordingly with one of the 2 dataset-type specific APIs.
2. the more evolved solution is to look at a dataset produced by `save_to_disk` as a remote resource like hub. So the first time `load_dataset` sees it, it'll take a fingerprint and create a normal cached dataset. On subsequent uses it'll again discover it as a remote resource, validate that it has it cached via the fingerprint and serve as a normal dataset.
As you said the cons of approach 2 is that if the dataset is huge it'll make 2 copies on the same machine. So it's possible that both approaches can be integrated. Say if `save_to_disc(do_not_cache=True)` is passed it'll use solution 1, otherwise solution 2. or could even symlink the huge arrow files to the cache instead? or perhaps it's more intuitive to use `load_dataset(do_not_cache=True)` instead. So that one can choose whether to make a cached copy or not for the locally saved dataset. i.e. a simple at use point user control.
Surely there are other ways to handle it, this is just one possibility.
| **Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you! | 502 | 257 | integrate `load_from_disk` into `load_dataset`
**Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you!
Thank you for the detailed breakdown, @lhoestq
> I'm curious, what would you expect to happen in this situation ?
1. the simplest solution is to add a flag to the dataset saved by `save_to_disk` and have `load_dataset` check that flag - if it's set simply switch control to `load_from_disk` behind the scenes. So `load_dataset` detects it's a local filesystem, looks inside to see whether it's something it can cache or whether it should use it directly as is and continues accordingly with one of the 2 dataset-type specific APIs.
2. the more evolved solution is to look at a dataset produced by `save_to_disk` as a remote resource like hub. So the first time `load_dataset` sees it, it'll take a fingerprint and create a normal cached dataset. On subsequent uses it'll again discover it as a remote resource, validate that it has it cached via the fingerprint and serve as a normal dataset.
As you said the cons of approach 2 is that if the dataset is huge it'll make 2 copies on the same machine. So it's possible that both approaches can be integrated. Say if `save_to_disc(do_not_cache=True)` is passed it'll use solution 1, otherwise solution 2. or could even symlink the huge arrow files to the cache instead? or perhaps it's more intuitive to use `load_dataset(do_not_cache=True)` instead. So that one can choose whether to make a cached copy or not for the locally saved dataset. i.e. a simple at use point user control.
Surely there are other ways to handle it, this is just one possibility.
| [
-1.2368111610412598,
-0.9566577076911926,
-0.6736604571342468,
1.4294203519821167,
-0.09253088384866714,
-1.322953701019287,
0.11907912790775299,
-1.0474250316619873,
1.5526111125946045,
-0.7530148029327393,
0.21871532499790192,
-1.6522216796875,
-0.09012339264154434,
-0.468554824590683,
-0.7082620859146118,
-0.8880060911178589,
-0.4406410753726959,
-0.8833104968070984,
1.0627145767211914,
2.445392608642578,
1.3473459482192993,
-1.3577944040298462,
2.7455873489379883,
0.6628885865211487,
-0.21631847321987152,
-1.0362943410873413,
0.4900558292865753,
0.05376153439283371,
-1.1928752660751343,
-0.40062272548675537,
-0.9028421640396118,
-0.02810264751315117,
-0.5376821756362915,
-0.45453131198883057,
0.09722567349672318,
0.5136123895645142,
-0.3182358145713806,
-0.33318400382995605,
-0.6653363108634949,
-0.7159247398376465,
0.5230942964553833,
-0.3078800141811371,
0.9219244122505188,
-0.34657880663871765,
1.739990234375,
-0.6195850968360901,
0.42881321907043457,
0.7447794675827026,
1.263422966003418,
0.16434581577777863,
0.09210231900215149,
0.2464314103126526,
0.3368269205093384,
-0.017151126638054848,
0.6057765483856201,
1.259972095489502,
0.6199043989181519,
0.54071444272995,
0.6957834959030151,
-2.226925849914551,
1.31244695186615,
-0.9129303097724915,
0.2843727171421051,
1.3266980648040771,
-0.8408970236778259,
0.331648051738739,
-1.8569433689117432,
-0.07804972678422928,
0.6257495880126953,
-2.241555690765381,
0.25032609701156616,
-1.2381314039230347,
-0.5423586964607239,
0.8975887894630432,
0.3525848686695099,
-1.1667248010635376,
0.22250297665596008,
-0.49368923902511597,
1.111596703529358,
0.47337549924850464,
1.1213810443878174,
-1.6573283672332764,
0.006261897273361683,
-0.14636534452438354,
0.10993416607379913,
-1.302794098854065,
-1.6617940664291382,
0.5750330090522766,
0.5192688703536987,
0.7027649879455566,
-0.10111607611179352,
0.9686384797096252,
-1.0953726768493652,
0.8477665185928345,
-1.0402253866195679,
-1.5468188524246216,
-1.396148443222046,
-2.4126665592193604,
-2.2963247299194336,
0.8045496940612793,
-0.5414470434188843,
-0.5674599409103394,
2.0167810916900635,
-0.9928927421569824,
-1.7664395570755005,
1.0941548347473145,
0.2802952826023102,
0.11410538107156754,
2.382859230041504,
0.20418637990951538,
-0.7821393609046936,
0.5261449813842773,
-0.723749577999115,
0.8351815342903137,
-0.2847801148891449,
1.2675474882125854,
0.5303447246551514,
-1.0169727802276611,
1.5991222858428955,
-0.47853970527648926,
0.6640898585319519,
-0.616024374961853,
-0.5644786357879639,
-0.7819786071777344,
0.2896217703819275,
1.8909369707107544,
-0.2685542106628418,
1.6144664287567139,
-0.34376299381256104,
-1.554506778717041,
-1.5678215026855469,
0.8347786664962769,
0.49729612469673157,
-0.8328254222869873,
0.04861554130911827,
-0.5057522058486938,
0.18773610889911652,
0.01139479037374258,
1.1417449712753296,
1.2401772737503052,
0.7420031428337097,
-0.35851240158081055,
-0.8232718706130981,
0.18382681906223297,
-0.12842068076133728,
-0.6256245374679565,
-1.8289676904678345,
-0.27315375208854675,
0.21212726831436157,
0.5952417850494385,
-1.2215301990509033,
1.8280231952667236,
0.8900435566902161,
2.0456981658935547,
0.9616069197654724,
-0.32306554913520813,
1.4383821487426758,
0.0023360680788755417,
1.8718191385269165,
-0.46662354469299316,
0.6151379942893982,
-0.3705524504184723,
-1.1423505544662476,
0.8773482441902161,
-0.40759357810020447,
-2.001143455505371,
-0.8316943049430847,
-0.7951195240020752,
-0.1547715961933136,
-0.7267497181892395,
0.854455828666687,
-0.2874913513660431,
-1.5449808835983276,
0.09072376042604446,
-0.6371731758117676,
0.14363056421279907,
-1.2714201211929321,
0.20235750079154968,
0.7501402497291565,
-0.719541072845459,
-0.050510652363300323,
-0.26410791277885437,
-1.2659006118774414,
-0.4928829073905945,
0.37490713596343994,
2.0141334533691406,
-0.605954647064209,
0.8929566144943237,
1.0177044868469238,
-0.7550188302993774,
0.09702945500612259,
0.1697303205728531,
-0.2877553105354309,
0.7151408791542053,
-1.0974140167236328,
-0.4219869375228882,
1.1565159559249878,
-0.2377423346042633,
-0.7405074834823608,
1.4725772142410278,
0.7883156538009644,
-1.0854604244232178,
-0.24955491721630096,
-0.23234951496124268,
-0.9062501788139343,
-0.07507473975419998,
-1.4753082990646362,
-0.18662384152412415,
0.35265108942985535,
-1.4613510370254517,
-0.3707147538661957,
-0.18466924130916595,
1.3298265933990479,
-0.2506585419178009,
1.4489085674285889,
-0.3347262442111969,
-0.158110573887825,
-0.26741117238998413,
-0.4962214231491089,
0.1710558384656906,
-0.20083291828632355,
-0.6243765950202942,
0.15909838676452637,
-0.7970317006111145,
0.2674734890460968,
1.5180437564849854,
0.36394667625427246,
0.09483712911605835,
0.46480822563171387,
1.1005908250808716,
0.4051685631275177,
-0.041469380259513855,
-0.8363662362098694,
-1.5084245204925537,
1.9325515031814575,
-1.4361414909362793,
1.9234730005264282,
0.7226538062095642,
-0.08537127822637558,
-1.7830071449279785,
-1.8301845788955688,
1.2299408912658691,
1.1470897197723389,
2.388245105743408,
0.4844253659248352,
0.37237048149108887,
-0.7878141403198242,
-0.7640656232833862,
0.29581785202026367,
-0.9797528386116028,
-0.6368696093559265,
0.12650704383850098,
2.3382370471954346,
1.814876675605774,
-0.5758905410766602,
-0.276104211807251,
-0.8438786864280701,
1.311774492263794,
-0.25410112738609314,
0.32747918367385864,
2.084606409072876,
-0.3227538466453552,
-0.9503954648971558,
1.3852232694625854,
-2.3913607597351074,
0.27669399976730347,
2.075505495071411,
0.29748284816741943,
0.13231970369815826,
-1.4217106103897095,
-0.5869870781898499,
-0.30662381649017334,
-0.4939582645893097,
-1.2823214530944824,
0.5478883385658264,
-0.3164912462234497,
-0.8439218997955322,
-1.4334864616394043,
0.03319057449698448,
-1.1367592811584473,
-1.7238171100616455,
0.347244530916214,
1.9557124376296997,
2.0507991313934326,
-0.7949667572975159,
1.3673686981201172,
-0.2658732831478119,
0.03483559563755989,
1.328687310218811,
1.3073617219924927,
3.0547096729278564,
1.9140939712524414,
-1.2698349952697754,
0.7275676131248474,
-0.2401629537343979,
-0.5266799330711365,
1.1759086847305298,
-1.150234580039978,
1.087173342704773,
-0.1820487231016159,
-1.1685155630111694,
-1.238223671913147,
1.0681016445159912,
0.5047052502632141,
0.004578244872391224,
-0.5058557987213135,
1.2802214622497559,
0.13793498277664185,
1.3421874046325684,
0.5733792185783386,
-0.47338664531707764,
0.5592487454414368,
-0.39166074991226196,
-0.6210359930992126,
1.635934829711914,
0.1731005609035492,
-1.5703271627426147,
-2.28857159614563,
-0.26316049695014954,
-0.9588292837142944,
-0.043938182294368744,
-0.6089185476303101,
-0.9542418122291565,
1.64696204662323,
0.38252952694892883,
-1.2318572998046875,
-0.23340056836605072,
-0.3134361505508423,
-0.5165207982063293,
2.6683952808380127,
-1.2919135093688965,
-0.1429888755083084,
-0.957486093044281,
-0.5440170168876648,
1.6480376720428467,
-1.2427517175674438,
-0.2922331392765045,
-1.011005163192749,
-0.604053795337677,
-1.2814985513687134,
-0.47215670347213745,
0.010213411413133144,
-0.9622669219970703,
0.7869582772254944,
0.17828920483589172,
-1.1230021715164185,
-0.3115086853504181,
-0.8659565448760986,
1.0321298837661743,
-0.0980345755815506,
0.2547631859779358,
1.907733678817749,
0.2684917747974396,
-0.4577524662017822,
0.7219860553741455,
1.2417802810668945,
0.5793787837028503,
-0.63218092918396,
0.03980468586087227,
-0.6247487664222717,
0.3824189007282257,
-1.3993680477142334,
0.19745168089866638,
-2.9640703201293945,
0.7686999440193176,
-0.15760010480880737,
-0.15399324893951416,
-0.10745379328727722,
-1.3538165092468262,
1.0612051486968994,
2.6074321269989014,
-1.1706963777542114,
0.48625925183296204,
0.47205543518066406,
1.133658528327942,
-1.6099504232406616,
0.287418007850647,
-0.5142414569854736,
2.031412363052368,
0.17101794481277466,
1.2213016748428345,
-0.5430073738098145,
-2.1951377391815186,
0.6227321624755859,
-1.1659969091415405,
-1.056625247001648,
0.7957459092140198,
-0.9314953088760376,
0.3655675947666168,
-1.4219081401824951,
-0.17768527567386627,
-0.9597228169441223,
-1.2236013412475586,
0.6814370155334473,
0.12333683669567108,
0.38872984051704407,
-0.6130935549736023,
0.3722786009311676,
-2.196413040161133,
-1.432246208190918,
-0.21573315560817719,
-1.0074009895324707,
0.5383659601211548,
-0.4353821575641632,
0.5336403846740723,
-0.04506795480847359,
0.145808145403862,
0.24794885516166687,
1.4641740322113037,
3.392477512359619,
0.13999566435813904,
0.16914904117584229,
-0.11410988867282867,
-1.0267817974090576,
1.5546706914901733,
0.8840750455856323,
-0.09530661255121231,
-0.5533612966537476,
-1.030470371246338,
1.279847502708435,
1.9902560710906982,
1.1560871601104736,
0.08039648085832596,
-0.7779106497764587,
-0.7723942399024963,
0.0433344691991806,
0.15254095196723938,
0.5037966966629028,
0.9707068800926208,
-0.026234589517116547,
0.1472465544939041,
1.3580104112625122,
1.184930682182312,
-0.27612635493278503,
0.37635865807533264,
-0.9767671823501587,
-0.41591161489486694,
0.37187156081199646,
0.23891861736774445,
0.05067222937941551,
0.46414655447006226,
-1.0551190376281738,
-0.2776380479335785,
-0.2840326130390167,
-0.8110015988349915,
-0.7286255359649658,
-0.38591527938842773,
-0.42650654911994934,
1.601449728012085,
0.0907512679696083,
-0.5113089680671692,
0.060971036553382874,
-0.706699013710022,
-0.10522135347127914,
-1.1240626573562622,
0.18804283440113068,
-0.07557587325572968,
-0.11374565958976746,
-0.13416777551174164,
1.6331801414489746,
-0.9037314057350159,
-2.122485876083374,
0.20381246507167816,
0.3111806809902191,
-0.33225488662719727,
0.14068444073200226,
1.7116022109985352,
0.48157644271850586,
1.3927967548370361,
1.3381754159927368,
0.966447114944458,
-0.5875483751296997,
-1.2186223268508911,
0.7166739702224731,
0.8738484382629395,
-1.3835837841033936,
0.9487284421920776,
-0.16755038499832153,
-0.4860350489616394,
0.6483235955238342,
1.3283636569976807,
0.45204105973243713,
-2.020250082015991,
0.9078642129898071,
-0.9174640774726868,
0.7658008337020874,
0.7327654957771301,
0.7604188919067383,
0.23586726188659668,
0.8984220027923584,
-1.1571838855743408,
-1.2040343284606934,
-0.7165404558181763,
-0.6836169958114624,
1.8520526885986328,
-0.2877444624900818,
0.6201133131980896,
-0.17964836955070496,
-1.1565055847167969,
-0.10834110528230667,
0.8265041708946228,
0.3915356397628784,
-0.41395899653434753,
0.9022486209869385,
-0.599479079246521,
-0.9834952354431152,
-1.2620172500610352,
-0.3818317651748657,
-1.0662966966629028,
-0.8255437016487122,
0.9971213340759277,
0.8064308166503906,
0.48005327582359314,
1.9332057237625122,
0.6469602584838867,
0.37482109665870667,
-2.660787582397461,
0.8481014370918274,
0.2568887174129486,
-0.019398408010601997,
0.8397889733314514,
0.28512337803840637,
1.146006464958191,
0.003290231339633465,
0.5939971804618835,
-2.3626325130462646,
2.2531654834747314,
-0.20349949598312378,
0.6194139719009399,
0.012005449272692204,
-0.1937282532453537,
1.128371238708496,
0.6251665353775024,
0.5289311408996582,
-1.155427098274231,
0.7494387030601501,
-0.5016531944274902,
1.1256968975067139,
0.912860095500946,
-0.8486778736114502,
0.08737094700336456,
1.46721351146698,
0.4714406728744507,
-0.4785189926624298,
-0.9695469737052917,
-0.8716859221458435,
0.9307190179824829,
1.7007472515106201,
-0.09246991574764252,
-0.0001850603148341179,
0.843869149684906,
0.6579611897468567,
-1.1868221759796143,
0.014184909872710705,
-0.7070519328117371,
-0.6657832264900208,
1.718729019165039,
2.0276565551757812,
-0.11396273970603943,
-0.17741209268569946,
-0.6993914246559143,
-1.296041488647461,
0.768914520740509,
-0.05802198126912117,
0.04879220202565193,
0.6817981600761414,
-0.6841149926185608,
1.0759061574935913,
0.6366366147994995,
1.0088295936584473,
-0.03053666278719902,
0.3324257731437683,
0.38160136342048645,
-0.3339870274066925,
-1.1721421480178833,
-0.31396913528442383,
-1.1035075187683105,
-2.5225446224212646,
0.34296169877052307,
-0.3139747977256775,
-1.4831258058547974,
0.04636179655790329,
-1.039086937904358,
0.8912487626075745,
-0.5891261100769043,
-1.1756796836853027,
-1.4256209135055542,
0.30203527212142944,
-0.07858928292989731,
0.9019178152084351,
-1.675838589668274,
-0.19372312724590302,
1.2091847658157349,
0.8006079792976379,
-0.6298615336418152,
0.9456217288970947,
0.2535480558872223,
0.9435853958129883,
0.7360251545906067,
-0.4179001450538635,
0.6063416004180908,
-0.014734583906829357,
-1.339272141456604,
0.41174960136413574,
1.2505861520767212,
0.1446070671081543,
1.3387415409088135,
-0.4389304220676422,
0.11060859262943268,
0.43081337213516235,
-0.714762806892395,
-0.5289872288703918,
-0.4152678847312927,
0.7504098415374756,
-0.05745687708258629,
-1.0041910409927368,
-0.13103549182415009,
-0.0733933076262474,
-0.33421555161476135,
0.22765380144119263,
-1.438309669494629,
-0.2788470983505249,
-0.3862304389476776,
-0.42642486095428467,
-1.3982861042022705,
0.07357686012983322,
1.3202334642410278,
-0.786359429359436,
-0.1829538494348526,
0.40091630816459656,
0.3915846347808838,
0.5670870542526245,
0.5600022077560425,
-0.7937279939651489,
-0.21903887391090393,
-0.37339839339256287,
-0.2570042014122009,
0.2909316420555115,
1.2499732971191406,
-0.06421593576669693,
-1.014153242111206,
0.6577205061912537,
-0.3111628293991089,
0.127702534198761,
2.023564577102661,
0.014022025279700756,
-0.6382299661636353,
0.3508526086807251,
-0.7327573299407959,
1.6969659328460693,
1.76676607131958,
1.3192230463027954,
-0.10454989224672318,
-0.8074628710746765,
0.5042997598648071,
-0.29565876722335815,
-0.3182642459869385,
0.896192193031311,
0.3882577121257782,
-0.2581180930137634,
-1.4081798791885376,
0.6763820052146912,
1.264582872390747,
-0.7347080111503601,
-0.7380677461624146,
0.10056381672620773,
-0.9111645221710205,
1.2455201148986816,
0.5539799928665161,
0.33618515729904175,
0.3019528388977051,
1.549829125404358,
0.7465805411338806,
-0.4286216199398041,
0.5302892923355103,
0.5942984819412231,
-0.2602745592594147,
-2.150789976119995,
-1.0598487854003906,
0.28756240010261536,
-0.3914940357208252,
-1.5932414531707764,
1.3913499116897583,
-1.1417436599731445,
-1.0601717233657837,
0.5233217477798462,
0.09970254451036453,
1.3288530111312866,
0.3410748243331909,
1.6773431301116943,
2.1803064346313477,
0.9274532794952393,
0.42420080304145813,
1.2161298990249634,
-0.10872869938611984,
-0.48519226908683777,
1.8634175062179565,
-0.41679179668426514,
0.48918595910072327,
1.0245552062988281,
-0.37453949451446533,
-1.1579047441482544,
-0.848176896572113,
-1.1202253103256226,
-0.6354432702064514,
1.1511194705963135,
0.08388150483369827,
-1.0493990182876587,
0.193950816988945,
1.5831869840621948,
0.15490089356899261,
-0.24218279123306274,
0.6392329931259155,
0.38383933901786804,
-0.7435729503631592,
-0.11138055473566055,
-0.8600850701332092,
0.5202860236167908,
-0.18235145509243011,
-0.2860112190246582,
0.22305214405059814,
0.5356884598731995,
1.2696770429611206,
-0.060927923768758774,
0.146917462348938,
1.1325594186782837,
-1.4270869493484497,
1.5384562015533447,
-0.6097989678382874,
0.3589344918727875,
-2.439312219619751,
1.3970352411270142,
-0.7624219059944153,
1.974752426147461,
-2.5650482177734375,
0.4457353353500366,
-0.5082001686096191,
-0.5384224653244019,
0.2895660400390625,
-0.4278545677661896,
0.02544531598687172,
-0.08543381094932556,
-0.9643197655677795,
0.004195867106318474,
-0.7473882436752319,
0.617041289806366,
1.1309973001480103,
1.4402010440826416,
-1.171016812324524,
-0.3408711850643158,
-1.6723884344100952,
-0.19813719391822815,
-0.8378684520721436,
0.3319569528102875,
-1.9903836250305176,
-0.19068178534507751,
-2.008035182952881,
-2.310011625289917,
-1.3336607217788696,
-0.8913440108299255,
1.069360613822937,
0.17361876368522644,
-0.8926003575325012,
1.170094609260559,
-0.3617924451828003,
-1.8817938566207886,
1.2063695192337036,
-2.163064479827881
] |
https://github.com/huggingface/datasets/issues/5044 | integrate `load_from_disk` into `load_dataset` | I think the simplest is to always memory map the local file without copy, but still have a cached directory in the cache at `~/.cache/huggingface` instead of saving `map` results next to the original data.
In practice we can even use symlinks if it makes the implementation simpler | **Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you! | 502 | 48 | integrate `load_from_disk` into `load_dataset`
**Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you!
I think the simplest is to always memory map the local file without copy, but still have a cached directory in the cache at `~/.cache/huggingface` instead of saving `map` results next to the original data.
In practice we can even use symlinks if it makes the implementation simpler | [
-1.2368111610412598,
-0.9566577076911926,
-0.6736604571342468,
1.4294203519821167,
-0.09253088384866714,
-1.322953701019287,
0.11907912790775299,
-1.0474250316619873,
1.5526111125946045,
-0.7530148029327393,
0.21871532499790192,
-1.6522216796875,
-0.09012339264154434,
-0.468554824590683,
-0.7082620859146118,
-0.8880060911178589,
-0.4406410753726959,
-0.8833104968070984,
1.0627145767211914,
2.445392608642578,
1.3473459482192993,
-1.3577944040298462,
2.7455873489379883,
0.6628885865211487,
-0.21631847321987152,
-1.0362943410873413,
0.4900558292865753,
0.05376153439283371,
-1.1928752660751343,
-0.40062272548675537,
-0.9028421640396118,
-0.02810264751315117,
-0.5376821756362915,
-0.45453131198883057,
0.09722567349672318,
0.5136123895645142,
-0.3182358145713806,
-0.33318400382995605,
-0.6653363108634949,
-0.7159247398376465,
0.5230942964553833,
-0.3078800141811371,
0.9219244122505188,
-0.34657880663871765,
1.739990234375,
-0.6195850968360901,
0.42881321907043457,
0.7447794675827026,
1.263422966003418,
0.16434581577777863,
0.09210231900215149,
0.2464314103126526,
0.3368269205093384,
-0.017151126638054848,
0.6057765483856201,
1.259972095489502,
0.6199043989181519,
0.54071444272995,
0.6957834959030151,
-2.226925849914551,
1.31244695186615,
-0.9129303097724915,
0.2843727171421051,
1.3266980648040771,
-0.8408970236778259,
0.331648051738739,
-1.8569433689117432,
-0.07804972678422928,
0.6257495880126953,
-2.241555690765381,
0.25032609701156616,
-1.2381314039230347,
-0.5423586964607239,
0.8975887894630432,
0.3525848686695099,
-1.1667248010635376,
0.22250297665596008,
-0.49368923902511597,
1.111596703529358,
0.47337549924850464,
1.1213810443878174,
-1.6573283672332764,
0.006261897273361683,
-0.14636534452438354,
0.10993416607379913,
-1.302794098854065,
-1.6617940664291382,
0.5750330090522766,
0.5192688703536987,
0.7027649879455566,
-0.10111607611179352,
0.9686384797096252,
-1.0953726768493652,
0.8477665185928345,
-1.0402253866195679,
-1.5468188524246216,
-1.396148443222046,
-2.4126665592193604,
-2.2963247299194336,
0.8045496940612793,
-0.5414470434188843,
-0.5674599409103394,
2.0167810916900635,
-0.9928927421569824,
-1.7664395570755005,
1.0941548347473145,
0.2802952826023102,
0.11410538107156754,
2.382859230041504,
0.20418637990951538,
-0.7821393609046936,
0.5261449813842773,
-0.723749577999115,
0.8351815342903137,
-0.2847801148891449,
1.2675474882125854,
0.5303447246551514,
-1.0169727802276611,
1.5991222858428955,
-0.47853970527648926,
0.6640898585319519,
-0.616024374961853,
-0.5644786357879639,
-0.7819786071777344,
0.2896217703819275,
1.8909369707107544,
-0.2685542106628418,
1.6144664287567139,
-0.34376299381256104,
-1.554506778717041,
-1.5678215026855469,
0.8347786664962769,
0.49729612469673157,
-0.8328254222869873,
0.04861554130911827,
-0.5057522058486938,
0.18773610889911652,
0.01139479037374258,
1.1417449712753296,
1.2401772737503052,
0.7420031428337097,
-0.35851240158081055,
-0.8232718706130981,
0.18382681906223297,
-0.12842068076133728,
-0.6256245374679565,
-1.8289676904678345,
-0.27315375208854675,
0.21212726831436157,
0.5952417850494385,
-1.2215301990509033,
1.8280231952667236,
0.8900435566902161,
2.0456981658935547,
0.9616069197654724,
-0.32306554913520813,
1.4383821487426758,
0.0023360680788755417,
1.8718191385269165,
-0.46662354469299316,
0.6151379942893982,
-0.3705524504184723,
-1.1423505544662476,
0.8773482441902161,
-0.40759357810020447,
-2.001143455505371,
-0.8316943049430847,
-0.7951195240020752,
-0.1547715961933136,
-0.7267497181892395,
0.854455828666687,
-0.2874913513660431,
-1.5449808835983276,
0.09072376042604446,
-0.6371731758117676,
0.14363056421279907,
-1.2714201211929321,
0.20235750079154968,
0.7501402497291565,
-0.719541072845459,
-0.050510652363300323,
-0.26410791277885437,
-1.2659006118774414,
-0.4928829073905945,
0.37490713596343994,
2.0141334533691406,
-0.605954647064209,
0.8929566144943237,
1.0177044868469238,
-0.7550188302993774,
0.09702945500612259,
0.1697303205728531,
-0.2877553105354309,
0.7151408791542053,
-1.0974140167236328,
-0.4219869375228882,
1.1565159559249878,
-0.2377423346042633,
-0.7405074834823608,
1.4725772142410278,
0.7883156538009644,
-1.0854604244232178,
-0.24955491721630096,
-0.23234951496124268,
-0.9062501788139343,
-0.07507473975419998,
-1.4753082990646362,
-0.18662384152412415,
0.35265108942985535,
-1.4613510370254517,
-0.3707147538661957,
-0.18466924130916595,
1.3298265933990479,
-0.2506585419178009,
1.4489085674285889,
-0.3347262442111969,
-0.158110573887825,
-0.26741117238998413,
-0.4962214231491089,
0.1710558384656906,
-0.20083291828632355,
-0.6243765950202942,
0.15909838676452637,
-0.7970317006111145,
0.2674734890460968,
1.5180437564849854,
0.36394667625427246,
0.09483712911605835,
0.46480822563171387,
1.1005908250808716,
0.4051685631275177,
-0.041469380259513855,
-0.8363662362098694,
-1.5084245204925537,
1.9325515031814575,
-1.4361414909362793,
1.9234730005264282,
0.7226538062095642,
-0.08537127822637558,
-1.7830071449279785,
-1.8301845788955688,
1.2299408912658691,
1.1470897197723389,
2.388245105743408,
0.4844253659248352,
0.37237048149108887,
-0.7878141403198242,
-0.7640656232833862,
0.29581785202026367,
-0.9797528386116028,
-0.6368696093559265,
0.12650704383850098,
2.3382370471954346,
1.814876675605774,
-0.5758905410766602,
-0.276104211807251,
-0.8438786864280701,
1.311774492263794,
-0.25410112738609314,
0.32747918367385864,
2.084606409072876,
-0.3227538466453552,
-0.9503954648971558,
1.3852232694625854,
-2.3913607597351074,
0.27669399976730347,
2.075505495071411,
0.29748284816741943,
0.13231970369815826,
-1.4217106103897095,
-0.5869870781898499,
-0.30662381649017334,
-0.4939582645893097,
-1.2823214530944824,
0.5478883385658264,
-0.3164912462234497,
-0.8439218997955322,
-1.4334864616394043,
0.03319057449698448,
-1.1367592811584473,
-1.7238171100616455,
0.347244530916214,
1.9557124376296997,
2.0507991313934326,
-0.7949667572975159,
1.3673686981201172,
-0.2658732831478119,
0.03483559563755989,
1.328687310218811,
1.3073617219924927,
3.0547096729278564,
1.9140939712524414,
-1.2698349952697754,
0.7275676131248474,
-0.2401629537343979,
-0.5266799330711365,
1.1759086847305298,
-1.150234580039978,
1.087173342704773,
-0.1820487231016159,
-1.1685155630111694,
-1.238223671913147,
1.0681016445159912,
0.5047052502632141,
0.004578244872391224,
-0.5058557987213135,
1.2802214622497559,
0.13793498277664185,
1.3421874046325684,
0.5733792185783386,
-0.47338664531707764,
0.5592487454414368,
-0.39166074991226196,
-0.6210359930992126,
1.635934829711914,
0.1731005609035492,
-1.5703271627426147,
-2.28857159614563,
-0.26316049695014954,
-0.9588292837142944,
-0.043938182294368744,
-0.6089185476303101,
-0.9542418122291565,
1.64696204662323,
0.38252952694892883,
-1.2318572998046875,
-0.23340056836605072,
-0.3134361505508423,
-0.5165207982063293,
2.6683952808380127,
-1.2919135093688965,
-0.1429888755083084,
-0.957486093044281,
-0.5440170168876648,
1.6480376720428467,
-1.2427517175674438,
-0.2922331392765045,
-1.011005163192749,
-0.604053795337677,
-1.2814985513687134,
-0.47215670347213745,
0.010213411413133144,
-0.9622669219970703,
0.7869582772254944,
0.17828920483589172,
-1.1230021715164185,
-0.3115086853504181,
-0.8659565448760986,
1.0321298837661743,
-0.0980345755815506,
0.2547631859779358,
1.907733678817749,
0.2684917747974396,
-0.4577524662017822,
0.7219860553741455,
1.2417802810668945,
0.5793787837028503,
-0.63218092918396,
0.03980468586087227,
-0.6247487664222717,
0.3824189007282257,
-1.3993680477142334,
0.19745168089866638,
-2.9640703201293945,
0.7686999440193176,
-0.15760010480880737,
-0.15399324893951416,
-0.10745379328727722,
-1.3538165092468262,
1.0612051486968994,
2.6074321269989014,
-1.1706963777542114,
0.48625925183296204,
0.47205543518066406,
1.133658528327942,
-1.6099504232406616,
0.287418007850647,
-0.5142414569854736,
2.031412363052368,
0.17101794481277466,
1.2213016748428345,
-0.5430073738098145,
-2.1951377391815186,
0.6227321624755859,
-1.1659969091415405,
-1.056625247001648,
0.7957459092140198,
-0.9314953088760376,
0.3655675947666168,
-1.4219081401824951,
-0.17768527567386627,
-0.9597228169441223,
-1.2236013412475586,
0.6814370155334473,
0.12333683669567108,
0.38872984051704407,
-0.6130935549736023,
0.3722786009311676,
-2.196413040161133,
-1.432246208190918,
-0.21573315560817719,
-1.0074009895324707,
0.5383659601211548,
-0.4353821575641632,
0.5336403846740723,
-0.04506795480847359,
0.145808145403862,
0.24794885516166687,
1.4641740322113037,
3.392477512359619,
0.13999566435813904,
0.16914904117584229,
-0.11410988867282867,
-1.0267817974090576,
1.5546706914901733,
0.8840750455856323,
-0.09530661255121231,
-0.5533612966537476,
-1.030470371246338,
1.279847502708435,
1.9902560710906982,
1.1560871601104736,
0.08039648085832596,
-0.7779106497764587,
-0.7723942399024963,
0.0433344691991806,
0.15254095196723938,
0.5037966966629028,
0.9707068800926208,
-0.026234589517116547,
0.1472465544939041,
1.3580104112625122,
1.184930682182312,
-0.27612635493278503,
0.37635865807533264,
-0.9767671823501587,
-0.41591161489486694,
0.37187156081199646,
0.23891861736774445,
0.05067222937941551,
0.46414655447006226,
-1.0551190376281738,
-0.2776380479335785,
-0.2840326130390167,
-0.8110015988349915,
-0.7286255359649658,
-0.38591527938842773,
-0.42650654911994934,
1.601449728012085,
0.0907512679696083,
-0.5113089680671692,
0.060971036553382874,
-0.706699013710022,
-0.10522135347127914,
-1.1240626573562622,
0.18804283440113068,
-0.07557587325572968,
-0.11374565958976746,
-0.13416777551174164,
1.6331801414489746,
-0.9037314057350159,
-2.122485876083374,
0.20381246507167816,
0.3111806809902191,
-0.33225488662719727,
0.14068444073200226,
1.7116022109985352,
0.48157644271850586,
1.3927967548370361,
1.3381754159927368,
0.966447114944458,
-0.5875483751296997,
-1.2186223268508911,
0.7166739702224731,
0.8738484382629395,
-1.3835837841033936,
0.9487284421920776,
-0.16755038499832153,
-0.4860350489616394,
0.6483235955238342,
1.3283636569976807,
0.45204105973243713,
-2.020250082015991,
0.9078642129898071,
-0.9174640774726868,
0.7658008337020874,
0.7327654957771301,
0.7604188919067383,
0.23586726188659668,
0.8984220027923584,
-1.1571838855743408,
-1.2040343284606934,
-0.7165404558181763,
-0.6836169958114624,
1.8520526885986328,
-0.2877444624900818,
0.6201133131980896,
-0.17964836955070496,
-1.1565055847167969,
-0.10834110528230667,
0.8265041708946228,
0.3915356397628784,
-0.41395899653434753,
0.9022486209869385,
-0.599479079246521,
-0.9834952354431152,
-1.2620172500610352,
-0.3818317651748657,
-1.0662966966629028,
-0.8255437016487122,
0.9971213340759277,
0.8064308166503906,
0.48005327582359314,
1.9332057237625122,
0.6469602584838867,
0.37482109665870667,
-2.660787582397461,
0.8481014370918274,
0.2568887174129486,
-0.019398408010601997,
0.8397889733314514,
0.28512337803840637,
1.146006464958191,
0.003290231339633465,
0.5939971804618835,
-2.3626325130462646,
2.2531654834747314,
-0.20349949598312378,
0.6194139719009399,
0.012005449272692204,
-0.1937282532453537,
1.128371238708496,
0.6251665353775024,
0.5289311408996582,
-1.155427098274231,
0.7494387030601501,
-0.5016531944274902,
1.1256968975067139,
0.912860095500946,
-0.8486778736114502,
0.08737094700336456,
1.46721351146698,
0.4714406728744507,
-0.4785189926624298,
-0.9695469737052917,
-0.8716859221458435,
0.9307190179824829,
1.7007472515106201,
-0.09246991574764252,
-0.0001850603148341179,
0.843869149684906,
0.6579611897468567,
-1.1868221759796143,
0.014184909872710705,
-0.7070519328117371,
-0.6657832264900208,
1.718729019165039,
2.0276565551757812,
-0.11396273970603943,
-0.17741209268569946,
-0.6993914246559143,
-1.296041488647461,
0.768914520740509,
-0.05802198126912117,
0.04879220202565193,
0.6817981600761414,
-0.6841149926185608,
1.0759061574935913,
0.6366366147994995,
1.0088295936584473,
-0.03053666278719902,
0.3324257731437683,
0.38160136342048645,
-0.3339870274066925,
-1.1721421480178833,
-0.31396913528442383,
-1.1035075187683105,
-2.5225446224212646,
0.34296169877052307,
-0.3139747977256775,
-1.4831258058547974,
0.04636179655790329,
-1.039086937904358,
0.8912487626075745,
-0.5891261100769043,
-1.1756796836853027,
-1.4256209135055542,
0.30203527212142944,
-0.07858928292989731,
0.9019178152084351,
-1.675838589668274,
-0.19372312724590302,
1.2091847658157349,
0.8006079792976379,
-0.6298615336418152,
0.9456217288970947,
0.2535480558872223,
0.9435853958129883,
0.7360251545906067,
-0.4179001450538635,
0.6063416004180908,
-0.014734583906829357,
-1.339272141456604,
0.41174960136413574,
1.2505861520767212,
0.1446070671081543,
1.3387415409088135,
-0.4389304220676422,
0.11060859262943268,
0.43081337213516235,
-0.714762806892395,
-0.5289872288703918,
-0.4152678847312927,
0.7504098415374756,
-0.05745687708258629,
-1.0041910409927368,
-0.13103549182415009,
-0.0733933076262474,
-0.33421555161476135,
0.22765380144119263,
-1.438309669494629,
-0.2788470983505249,
-0.3862304389476776,
-0.42642486095428467,
-1.3982861042022705,
0.07357686012983322,
1.3202334642410278,
-0.786359429359436,
-0.1829538494348526,
0.40091630816459656,
0.3915846347808838,
0.5670870542526245,
0.5600022077560425,
-0.7937279939651489,
-0.21903887391090393,
-0.37339839339256287,
-0.2570042014122009,
0.2909316420555115,
1.2499732971191406,
-0.06421593576669693,
-1.014153242111206,
0.6577205061912537,
-0.3111628293991089,
0.127702534198761,
2.023564577102661,
0.014022025279700756,
-0.6382299661636353,
0.3508526086807251,
-0.7327573299407959,
1.6969659328460693,
1.76676607131958,
1.3192230463027954,
-0.10454989224672318,
-0.8074628710746765,
0.5042997598648071,
-0.29565876722335815,
-0.3182642459869385,
0.896192193031311,
0.3882577121257782,
-0.2581180930137634,
-1.4081798791885376,
0.6763820052146912,
1.264582872390747,
-0.7347080111503601,
-0.7380677461624146,
0.10056381672620773,
-0.9111645221710205,
1.2455201148986816,
0.5539799928665161,
0.33618515729904175,
0.3019528388977051,
1.549829125404358,
0.7465805411338806,
-0.4286216199398041,
0.5302892923355103,
0.5942984819412231,
-0.2602745592594147,
-2.150789976119995,
-1.0598487854003906,
0.28756240010261536,
-0.3914940357208252,
-1.5932414531707764,
1.3913499116897583,
-1.1417436599731445,
-1.0601717233657837,
0.5233217477798462,
0.09970254451036453,
1.3288530111312866,
0.3410748243331909,
1.6773431301116943,
2.1803064346313477,
0.9274532794952393,
0.42420080304145813,
1.2161298990249634,
-0.10872869938611984,
-0.48519226908683777,
1.8634175062179565,
-0.41679179668426514,
0.48918595910072327,
1.0245552062988281,
-0.37453949451446533,
-1.1579047441482544,
-0.848176896572113,
-1.1202253103256226,
-0.6354432702064514,
1.1511194705963135,
0.08388150483369827,
-1.0493990182876587,
0.193950816988945,
1.5831869840621948,
0.15490089356899261,
-0.24218279123306274,
0.6392329931259155,
0.38383933901786804,
-0.7435729503631592,
-0.11138055473566055,
-0.8600850701332092,
0.5202860236167908,
-0.18235145509243011,
-0.2860112190246582,
0.22305214405059814,
0.5356884598731995,
1.2696770429611206,
-0.060927923768758774,
0.146917462348938,
1.1325594186782837,
-1.4270869493484497,
1.5384562015533447,
-0.6097989678382874,
0.3589344918727875,
-2.439312219619751,
1.3970352411270142,
-0.7624219059944153,
1.974752426147461,
-2.5650482177734375,
0.4457353353500366,
-0.5082001686096191,
-0.5384224653244019,
0.2895660400390625,
-0.4278545677661896,
0.02544531598687172,
-0.08543381094932556,
-0.9643197655677795,
0.004195867106318474,
-0.7473882436752319,
0.617041289806366,
1.1309973001480103,
1.4402010440826416,
-1.171016812324524,
-0.3408711850643158,
-1.6723884344100952,
-0.19813719391822815,
-0.8378684520721436,
0.3319569528102875,
-1.9903836250305176,
-0.19068178534507751,
-2.008035182952881,
-2.310011625289917,
-1.3336607217788696,
-0.8913440108299255,
1.069360613822937,
0.17361876368522644,
-0.8926003575325012,
1.170094609260559,
-0.3617924451828003,
-1.8817938566207886,
1.2063695192337036,
-2.163064479827881
] |
https://github.com/huggingface/datasets/issues/5044 | integrate `load_from_disk` into `load_dataset` | Yes, so that you always have the cached entry for any dataset, but the "payload" doesn't have to be physically in the cache if it's already on the local filesystem. As you said a symlink will do. | **Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you! | 502 | 37 | integrate `load_from_disk` into `load_dataset`
**Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you!
Yes, so that you always have the cached entry for any dataset, but the "payload" doesn't have to be physically in the cache if it's already on the local filesystem. As you said a symlink will do. | [
-1.2368111610412598,
-0.9566577076911926,
-0.6736604571342468,
1.4294203519821167,
-0.09253088384866714,
-1.322953701019287,
0.11907912790775299,
-1.0474250316619873,
1.5526111125946045,
-0.7530148029327393,
0.21871532499790192,
-1.6522216796875,
-0.09012339264154434,
-0.468554824590683,
-0.7082620859146118,
-0.8880060911178589,
-0.4406410753726959,
-0.8833104968070984,
1.0627145767211914,
2.445392608642578,
1.3473459482192993,
-1.3577944040298462,
2.7455873489379883,
0.6628885865211487,
-0.21631847321987152,
-1.0362943410873413,
0.4900558292865753,
0.05376153439283371,
-1.1928752660751343,
-0.40062272548675537,
-0.9028421640396118,
-0.02810264751315117,
-0.5376821756362915,
-0.45453131198883057,
0.09722567349672318,
0.5136123895645142,
-0.3182358145713806,
-0.33318400382995605,
-0.6653363108634949,
-0.7159247398376465,
0.5230942964553833,
-0.3078800141811371,
0.9219244122505188,
-0.34657880663871765,
1.739990234375,
-0.6195850968360901,
0.42881321907043457,
0.7447794675827026,
1.263422966003418,
0.16434581577777863,
0.09210231900215149,
0.2464314103126526,
0.3368269205093384,
-0.017151126638054848,
0.6057765483856201,
1.259972095489502,
0.6199043989181519,
0.54071444272995,
0.6957834959030151,
-2.226925849914551,
1.31244695186615,
-0.9129303097724915,
0.2843727171421051,
1.3266980648040771,
-0.8408970236778259,
0.331648051738739,
-1.8569433689117432,
-0.07804972678422928,
0.6257495880126953,
-2.241555690765381,
0.25032609701156616,
-1.2381314039230347,
-0.5423586964607239,
0.8975887894630432,
0.3525848686695099,
-1.1667248010635376,
0.22250297665596008,
-0.49368923902511597,
1.111596703529358,
0.47337549924850464,
1.1213810443878174,
-1.6573283672332764,
0.006261897273361683,
-0.14636534452438354,
0.10993416607379913,
-1.302794098854065,
-1.6617940664291382,
0.5750330090522766,
0.5192688703536987,
0.7027649879455566,
-0.10111607611179352,
0.9686384797096252,
-1.0953726768493652,
0.8477665185928345,
-1.0402253866195679,
-1.5468188524246216,
-1.396148443222046,
-2.4126665592193604,
-2.2963247299194336,
0.8045496940612793,
-0.5414470434188843,
-0.5674599409103394,
2.0167810916900635,
-0.9928927421569824,
-1.7664395570755005,
1.0941548347473145,
0.2802952826023102,
0.11410538107156754,
2.382859230041504,
0.20418637990951538,
-0.7821393609046936,
0.5261449813842773,
-0.723749577999115,
0.8351815342903137,
-0.2847801148891449,
1.2675474882125854,
0.5303447246551514,
-1.0169727802276611,
1.5991222858428955,
-0.47853970527648926,
0.6640898585319519,
-0.616024374961853,
-0.5644786357879639,
-0.7819786071777344,
0.2896217703819275,
1.8909369707107544,
-0.2685542106628418,
1.6144664287567139,
-0.34376299381256104,
-1.554506778717041,
-1.5678215026855469,
0.8347786664962769,
0.49729612469673157,
-0.8328254222869873,
0.04861554130911827,
-0.5057522058486938,
0.18773610889911652,
0.01139479037374258,
1.1417449712753296,
1.2401772737503052,
0.7420031428337097,
-0.35851240158081055,
-0.8232718706130981,
0.18382681906223297,
-0.12842068076133728,
-0.6256245374679565,
-1.8289676904678345,
-0.27315375208854675,
0.21212726831436157,
0.5952417850494385,
-1.2215301990509033,
1.8280231952667236,
0.8900435566902161,
2.0456981658935547,
0.9616069197654724,
-0.32306554913520813,
1.4383821487426758,
0.0023360680788755417,
1.8718191385269165,
-0.46662354469299316,
0.6151379942893982,
-0.3705524504184723,
-1.1423505544662476,
0.8773482441902161,
-0.40759357810020447,
-2.001143455505371,
-0.8316943049430847,
-0.7951195240020752,
-0.1547715961933136,
-0.7267497181892395,
0.854455828666687,
-0.2874913513660431,
-1.5449808835983276,
0.09072376042604446,
-0.6371731758117676,
0.14363056421279907,
-1.2714201211929321,
0.20235750079154968,
0.7501402497291565,
-0.719541072845459,
-0.050510652363300323,
-0.26410791277885437,
-1.2659006118774414,
-0.4928829073905945,
0.37490713596343994,
2.0141334533691406,
-0.605954647064209,
0.8929566144943237,
1.0177044868469238,
-0.7550188302993774,
0.09702945500612259,
0.1697303205728531,
-0.2877553105354309,
0.7151408791542053,
-1.0974140167236328,
-0.4219869375228882,
1.1565159559249878,
-0.2377423346042633,
-0.7405074834823608,
1.4725772142410278,
0.7883156538009644,
-1.0854604244232178,
-0.24955491721630096,
-0.23234951496124268,
-0.9062501788139343,
-0.07507473975419998,
-1.4753082990646362,
-0.18662384152412415,
0.35265108942985535,
-1.4613510370254517,
-0.3707147538661957,
-0.18466924130916595,
1.3298265933990479,
-0.2506585419178009,
1.4489085674285889,
-0.3347262442111969,
-0.158110573887825,
-0.26741117238998413,
-0.4962214231491089,
0.1710558384656906,
-0.20083291828632355,
-0.6243765950202942,
0.15909838676452637,
-0.7970317006111145,
0.2674734890460968,
1.5180437564849854,
0.36394667625427246,
0.09483712911605835,
0.46480822563171387,
1.1005908250808716,
0.4051685631275177,
-0.041469380259513855,
-0.8363662362098694,
-1.5084245204925537,
1.9325515031814575,
-1.4361414909362793,
1.9234730005264282,
0.7226538062095642,
-0.08537127822637558,
-1.7830071449279785,
-1.8301845788955688,
1.2299408912658691,
1.1470897197723389,
2.388245105743408,
0.4844253659248352,
0.37237048149108887,
-0.7878141403198242,
-0.7640656232833862,
0.29581785202026367,
-0.9797528386116028,
-0.6368696093559265,
0.12650704383850098,
2.3382370471954346,
1.814876675605774,
-0.5758905410766602,
-0.276104211807251,
-0.8438786864280701,
1.311774492263794,
-0.25410112738609314,
0.32747918367385864,
2.084606409072876,
-0.3227538466453552,
-0.9503954648971558,
1.3852232694625854,
-2.3913607597351074,
0.27669399976730347,
2.075505495071411,
0.29748284816741943,
0.13231970369815826,
-1.4217106103897095,
-0.5869870781898499,
-0.30662381649017334,
-0.4939582645893097,
-1.2823214530944824,
0.5478883385658264,
-0.3164912462234497,
-0.8439218997955322,
-1.4334864616394043,
0.03319057449698448,
-1.1367592811584473,
-1.7238171100616455,
0.347244530916214,
1.9557124376296997,
2.0507991313934326,
-0.7949667572975159,
1.3673686981201172,
-0.2658732831478119,
0.03483559563755989,
1.328687310218811,
1.3073617219924927,
3.0547096729278564,
1.9140939712524414,
-1.2698349952697754,
0.7275676131248474,
-0.2401629537343979,
-0.5266799330711365,
1.1759086847305298,
-1.150234580039978,
1.087173342704773,
-0.1820487231016159,
-1.1685155630111694,
-1.238223671913147,
1.0681016445159912,
0.5047052502632141,
0.004578244872391224,
-0.5058557987213135,
1.2802214622497559,
0.13793498277664185,
1.3421874046325684,
0.5733792185783386,
-0.47338664531707764,
0.5592487454414368,
-0.39166074991226196,
-0.6210359930992126,
1.635934829711914,
0.1731005609035492,
-1.5703271627426147,
-2.28857159614563,
-0.26316049695014954,
-0.9588292837142944,
-0.043938182294368744,
-0.6089185476303101,
-0.9542418122291565,
1.64696204662323,
0.38252952694892883,
-1.2318572998046875,
-0.23340056836605072,
-0.3134361505508423,
-0.5165207982063293,
2.6683952808380127,
-1.2919135093688965,
-0.1429888755083084,
-0.957486093044281,
-0.5440170168876648,
1.6480376720428467,
-1.2427517175674438,
-0.2922331392765045,
-1.011005163192749,
-0.604053795337677,
-1.2814985513687134,
-0.47215670347213745,
0.010213411413133144,
-0.9622669219970703,
0.7869582772254944,
0.17828920483589172,
-1.1230021715164185,
-0.3115086853504181,
-0.8659565448760986,
1.0321298837661743,
-0.0980345755815506,
0.2547631859779358,
1.907733678817749,
0.2684917747974396,
-0.4577524662017822,
0.7219860553741455,
1.2417802810668945,
0.5793787837028503,
-0.63218092918396,
0.03980468586087227,
-0.6247487664222717,
0.3824189007282257,
-1.3993680477142334,
0.19745168089866638,
-2.9640703201293945,
0.7686999440193176,
-0.15760010480880737,
-0.15399324893951416,
-0.10745379328727722,
-1.3538165092468262,
1.0612051486968994,
2.6074321269989014,
-1.1706963777542114,
0.48625925183296204,
0.47205543518066406,
1.133658528327942,
-1.6099504232406616,
0.287418007850647,
-0.5142414569854736,
2.031412363052368,
0.17101794481277466,
1.2213016748428345,
-0.5430073738098145,
-2.1951377391815186,
0.6227321624755859,
-1.1659969091415405,
-1.056625247001648,
0.7957459092140198,
-0.9314953088760376,
0.3655675947666168,
-1.4219081401824951,
-0.17768527567386627,
-0.9597228169441223,
-1.2236013412475586,
0.6814370155334473,
0.12333683669567108,
0.38872984051704407,
-0.6130935549736023,
0.3722786009311676,
-2.196413040161133,
-1.432246208190918,
-0.21573315560817719,
-1.0074009895324707,
0.5383659601211548,
-0.4353821575641632,
0.5336403846740723,
-0.04506795480847359,
0.145808145403862,
0.24794885516166687,
1.4641740322113037,
3.392477512359619,
0.13999566435813904,
0.16914904117584229,
-0.11410988867282867,
-1.0267817974090576,
1.5546706914901733,
0.8840750455856323,
-0.09530661255121231,
-0.5533612966537476,
-1.030470371246338,
1.279847502708435,
1.9902560710906982,
1.1560871601104736,
0.08039648085832596,
-0.7779106497764587,
-0.7723942399024963,
0.0433344691991806,
0.15254095196723938,
0.5037966966629028,
0.9707068800926208,
-0.026234589517116547,
0.1472465544939041,
1.3580104112625122,
1.184930682182312,
-0.27612635493278503,
0.37635865807533264,
-0.9767671823501587,
-0.41591161489486694,
0.37187156081199646,
0.23891861736774445,
0.05067222937941551,
0.46414655447006226,
-1.0551190376281738,
-0.2776380479335785,
-0.2840326130390167,
-0.8110015988349915,
-0.7286255359649658,
-0.38591527938842773,
-0.42650654911994934,
1.601449728012085,
0.0907512679696083,
-0.5113089680671692,
0.060971036553382874,
-0.706699013710022,
-0.10522135347127914,
-1.1240626573562622,
0.18804283440113068,
-0.07557587325572968,
-0.11374565958976746,
-0.13416777551174164,
1.6331801414489746,
-0.9037314057350159,
-2.122485876083374,
0.20381246507167816,
0.3111806809902191,
-0.33225488662719727,
0.14068444073200226,
1.7116022109985352,
0.48157644271850586,
1.3927967548370361,
1.3381754159927368,
0.966447114944458,
-0.5875483751296997,
-1.2186223268508911,
0.7166739702224731,
0.8738484382629395,
-1.3835837841033936,
0.9487284421920776,
-0.16755038499832153,
-0.4860350489616394,
0.6483235955238342,
1.3283636569976807,
0.45204105973243713,
-2.020250082015991,
0.9078642129898071,
-0.9174640774726868,
0.7658008337020874,
0.7327654957771301,
0.7604188919067383,
0.23586726188659668,
0.8984220027923584,
-1.1571838855743408,
-1.2040343284606934,
-0.7165404558181763,
-0.6836169958114624,
1.8520526885986328,
-0.2877444624900818,
0.6201133131980896,
-0.17964836955070496,
-1.1565055847167969,
-0.10834110528230667,
0.8265041708946228,
0.3915356397628784,
-0.41395899653434753,
0.9022486209869385,
-0.599479079246521,
-0.9834952354431152,
-1.2620172500610352,
-0.3818317651748657,
-1.0662966966629028,
-0.8255437016487122,
0.9971213340759277,
0.8064308166503906,
0.48005327582359314,
1.9332057237625122,
0.6469602584838867,
0.37482109665870667,
-2.660787582397461,
0.8481014370918274,
0.2568887174129486,
-0.019398408010601997,
0.8397889733314514,
0.28512337803840637,
1.146006464958191,
0.003290231339633465,
0.5939971804618835,
-2.3626325130462646,
2.2531654834747314,
-0.20349949598312378,
0.6194139719009399,
0.012005449272692204,
-0.1937282532453537,
1.128371238708496,
0.6251665353775024,
0.5289311408996582,
-1.155427098274231,
0.7494387030601501,
-0.5016531944274902,
1.1256968975067139,
0.912860095500946,
-0.8486778736114502,
0.08737094700336456,
1.46721351146698,
0.4714406728744507,
-0.4785189926624298,
-0.9695469737052917,
-0.8716859221458435,
0.9307190179824829,
1.7007472515106201,
-0.09246991574764252,
-0.0001850603148341179,
0.843869149684906,
0.6579611897468567,
-1.1868221759796143,
0.014184909872710705,
-0.7070519328117371,
-0.6657832264900208,
1.718729019165039,
2.0276565551757812,
-0.11396273970603943,
-0.17741209268569946,
-0.6993914246559143,
-1.296041488647461,
0.768914520740509,
-0.05802198126912117,
0.04879220202565193,
0.6817981600761414,
-0.6841149926185608,
1.0759061574935913,
0.6366366147994995,
1.0088295936584473,
-0.03053666278719902,
0.3324257731437683,
0.38160136342048645,
-0.3339870274066925,
-1.1721421480178833,
-0.31396913528442383,
-1.1035075187683105,
-2.5225446224212646,
0.34296169877052307,
-0.3139747977256775,
-1.4831258058547974,
0.04636179655790329,
-1.039086937904358,
0.8912487626075745,
-0.5891261100769043,
-1.1756796836853027,
-1.4256209135055542,
0.30203527212142944,
-0.07858928292989731,
0.9019178152084351,
-1.675838589668274,
-0.19372312724590302,
1.2091847658157349,
0.8006079792976379,
-0.6298615336418152,
0.9456217288970947,
0.2535480558872223,
0.9435853958129883,
0.7360251545906067,
-0.4179001450538635,
0.6063416004180908,
-0.014734583906829357,
-1.339272141456604,
0.41174960136413574,
1.2505861520767212,
0.1446070671081543,
1.3387415409088135,
-0.4389304220676422,
0.11060859262943268,
0.43081337213516235,
-0.714762806892395,
-0.5289872288703918,
-0.4152678847312927,
0.7504098415374756,
-0.05745687708258629,
-1.0041910409927368,
-0.13103549182415009,
-0.0733933076262474,
-0.33421555161476135,
0.22765380144119263,
-1.438309669494629,
-0.2788470983505249,
-0.3862304389476776,
-0.42642486095428467,
-1.3982861042022705,
0.07357686012983322,
1.3202334642410278,
-0.786359429359436,
-0.1829538494348526,
0.40091630816459656,
0.3915846347808838,
0.5670870542526245,
0.5600022077560425,
-0.7937279939651489,
-0.21903887391090393,
-0.37339839339256287,
-0.2570042014122009,
0.2909316420555115,
1.2499732971191406,
-0.06421593576669693,
-1.014153242111206,
0.6577205061912537,
-0.3111628293991089,
0.127702534198761,
2.023564577102661,
0.014022025279700756,
-0.6382299661636353,
0.3508526086807251,
-0.7327573299407959,
1.6969659328460693,
1.76676607131958,
1.3192230463027954,
-0.10454989224672318,
-0.8074628710746765,
0.5042997598648071,
-0.29565876722335815,
-0.3182642459869385,
0.896192193031311,
0.3882577121257782,
-0.2581180930137634,
-1.4081798791885376,
0.6763820052146912,
1.264582872390747,
-0.7347080111503601,
-0.7380677461624146,
0.10056381672620773,
-0.9111645221710205,
1.2455201148986816,
0.5539799928665161,
0.33618515729904175,
0.3019528388977051,
1.549829125404358,
0.7465805411338806,
-0.4286216199398041,
0.5302892923355103,
0.5942984819412231,
-0.2602745592594147,
-2.150789976119995,
-1.0598487854003906,
0.28756240010261536,
-0.3914940357208252,
-1.5932414531707764,
1.3913499116897583,
-1.1417436599731445,
-1.0601717233657837,
0.5233217477798462,
0.09970254451036453,
1.3288530111312866,
0.3410748243331909,
1.6773431301116943,
2.1803064346313477,
0.9274532794952393,
0.42420080304145813,
1.2161298990249634,
-0.10872869938611984,
-0.48519226908683777,
1.8634175062179565,
-0.41679179668426514,
0.48918595910072327,
1.0245552062988281,
-0.37453949451446533,
-1.1579047441482544,
-0.848176896572113,
-1.1202253103256226,
-0.6354432702064514,
1.1511194705963135,
0.08388150483369827,
-1.0493990182876587,
0.193950816988945,
1.5831869840621948,
0.15490089356899261,
-0.24218279123306274,
0.6392329931259155,
0.38383933901786804,
-0.7435729503631592,
-0.11138055473566055,
-0.8600850701332092,
0.5202860236167908,
-0.18235145509243011,
-0.2860112190246582,
0.22305214405059814,
0.5356884598731995,
1.2696770429611206,
-0.060927923768758774,
0.146917462348938,
1.1325594186782837,
-1.4270869493484497,
1.5384562015533447,
-0.6097989678382874,
0.3589344918727875,
-2.439312219619751,
1.3970352411270142,
-0.7624219059944153,
1.974752426147461,
-2.5650482177734375,
0.4457353353500366,
-0.5082001686096191,
-0.5384224653244019,
0.2895660400390625,
-0.4278545677661896,
0.02544531598687172,
-0.08543381094932556,
-0.9643197655677795,
0.004195867106318474,
-0.7473882436752319,
0.617041289806366,
1.1309973001480103,
1.4402010440826416,
-1.171016812324524,
-0.3408711850643158,
-1.6723884344100952,
-0.19813719391822815,
-0.8378684520721436,
0.3319569528102875,
-1.9903836250305176,
-0.19068178534507751,
-2.008035182952881,
-2.310011625289917,
-1.3336607217788696,
-0.8913440108299255,
1.069360613822937,
0.17361876368522644,
-0.8926003575325012,
1.170094609260559,
-0.3617924451828003,
-1.8817938566207886,
1.2063695192337036,
-2.163064479827881
] |
https://github.com/huggingface/datasets/issues/5044 | integrate `load_from_disk` into `load_dataset` | We haven't had the bandwidth to implement this so far. Let me know if you'd be interested in contributing this feature :) | **Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you! | 502 | 22 | integrate `load_from_disk` into `load_dataset`
**Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you!
We haven't had the bandwidth to implement this so far. Let me know if you'd be interested in contributing this feature :) | [
-1.2368111610412598,
-0.9566577076911926,
-0.6736604571342468,
1.4294203519821167,
-0.09253088384866714,
-1.322953701019287,
0.11907912790775299,
-1.0474250316619873,
1.5526111125946045,
-0.7530148029327393,
0.21871532499790192,
-1.6522216796875,
-0.09012339264154434,
-0.468554824590683,
-0.7082620859146118,
-0.8880060911178589,
-0.4406410753726959,
-0.8833104968070984,
1.0627145767211914,
2.445392608642578,
1.3473459482192993,
-1.3577944040298462,
2.7455873489379883,
0.6628885865211487,
-0.21631847321987152,
-1.0362943410873413,
0.4900558292865753,
0.05376153439283371,
-1.1928752660751343,
-0.40062272548675537,
-0.9028421640396118,
-0.02810264751315117,
-0.5376821756362915,
-0.45453131198883057,
0.09722567349672318,
0.5136123895645142,
-0.3182358145713806,
-0.33318400382995605,
-0.6653363108634949,
-0.7159247398376465,
0.5230942964553833,
-0.3078800141811371,
0.9219244122505188,
-0.34657880663871765,
1.739990234375,
-0.6195850968360901,
0.42881321907043457,
0.7447794675827026,
1.263422966003418,
0.16434581577777863,
0.09210231900215149,
0.2464314103126526,
0.3368269205093384,
-0.017151126638054848,
0.6057765483856201,
1.259972095489502,
0.6199043989181519,
0.54071444272995,
0.6957834959030151,
-2.226925849914551,
1.31244695186615,
-0.9129303097724915,
0.2843727171421051,
1.3266980648040771,
-0.8408970236778259,
0.331648051738739,
-1.8569433689117432,
-0.07804972678422928,
0.6257495880126953,
-2.241555690765381,
0.25032609701156616,
-1.2381314039230347,
-0.5423586964607239,
0.8975887894630432,
0.3525848686695099,
-1.1667248010635376,
0.22250297665596008,
-0.49368923902511597,
1.111596703529358,
0.47337549924850464,
1.1213810443878174,
-1.6573283672332764,
0.006261897273361683,
-0.14636534452438354,
0.10993416607379913,
-1.302794098854065,
-1.6617940664291382,
0.5750330090522766,
0.5192688703536987,
0.7027649879455566,
-0.10111607611179352,
0.9686384797096252,
-1.0953726768493652,
0.8477665185928345,
-1.0402253866195679,
-1.5468188524246216,
-1.396148443222046,
-2.4126665592193604,
-2.2963247299194336,
0.8045496940612793,
-0.5414470434188843,
-0.5674599409103394,
2.0167810916900635,
-0.9928927421569824,
-1.7664395570755005,
1.0941548347473145,
0.2802952826023102,
0.11410538107156754,
2.382859230041504,
0.20418637990951538,
-0.7821393609046936,
0.5261449813842773,
-0.723749577999115,
0.8351815342903137,
-0.2847801148891449,
1.2675474882125854,
0.5303447246551514,
-1.0169727802276611,
1.5991222858428955,
-0.47853970527648926,
0.6640898585319519,
-0.616024374961853,
-0.5644786357879639,
-0.7819786071777344,
0.2896217703819275,
1.8909369707107544,
-0.2685542106628418,
1.6144664287567139,
-0.34376299381256104,
-1.554506778717041,
-1.5678215026855469,
0.8347786664962769,
0.49729612469673157,
-0.8328254222869873,
0.04861554130911827,
-0.5057522058486938,
0.18773610889911652,
0.01139479037374258,
1.1417449712753296,
1.2401772737503052,
0.7420031428337097,
-0.35851240158081055,
-0.8232718706130981,
0.18382681906223297,
-0.12842068076133728,
-0.6256245374679565,
-1.8289676904678345,
-0.27315375208854675,
0.21212726831436157,
0.5952417850494385,
-1.2215301990509033,
1.8280231952667236,
0.8900435566902161,
2.0456981658935547,
0.9616069197654724,
-0.32306554913520813,
1.4383821487426758,
0.0023360680788755417,
1.8718191385269165,
-0.46662354469299316,
0.6151379942893982,
-0.3705524504184723,
-1.1423505544662476,
0.8773482441902161,
-0.40759357810020447,
-2.001143455505371,
-0.8316943049430847,
-0.7951195240020752,
-0.1547715961933136,
-0.7267497181892395,
0.854455828666687,
-0.2874913513660431,
-1.5449808835983276,
0.09072376042604446,
-0.6371731758117676,
0.14363056421279907,
-1.2714201211929321,
0.20235750079154968,
0.7501402497291565,
-0.719541072845459,
-0.050510652363300323,
-0.26410791277885437,
-1.2659006118774414,
-0.4928829073905945,
0.37490713596343994,
2.0141334533691406,
-0.605954647064209,
0.8929566144943237,
1.0177044868469238,
-0.7550188302993774,
0.09702945500612259,
0.1697303205728531,
-0.2877553105354309,
0.7151408791542053,
-1.0974140167236328,
-0.4219869375228882,
1.1565159559249878,
-0.2377423346042633,
-0.7405074834823608,
1.4725772142410278,
0.7883156538009644,
-1.0854604244232178,
-0.24955491721630096,
-0.23234951496124268,
-0.9062501788139343,
-0.07507473975419998,
-1.4753082990646362,
-0.18662384152412415,
0.35265108942985535,
-1.4613510370254517,
-0.3707147538661957,
-0.18466924130916595,
1.3298265933990479,
-0.2506585419178009,
1.4489085674285889,
-0.3347262442111969,
-0.158110573887825,
-0.26741117238998413,
-0.4962214231491089,
0.1710558384656906,
-0.20083291828632355,
-0.6243765950202942,
0.15909838676452637,
-0.7970317006111145,
0.2674734890460968,
1.5180437564849854,
0.36394667625427246,
0.09483712911605835,
0.46480822563171387,
1.1005908250808716,
0.4051685631275177,
-0.041469380259513855,
-0.8363662362098694,
-1.5084245204925537,
1.9325515031814575,
-1.4361414909362793,
1.9234730005264282,
0.7226538062095642,
-0.08537127822637558,
-1.7830071449279785,
-1.8301845788955688,
1.2299408912658691,
1.1470897197723389,
2.388245105743408,
0.4844253659248352,
0.37237048149108887,
-0.7878141403198242,
-0.7640656232833862,
0.29581785202026367,
-0.9797528386116028,
-0.6368696093559265,
0.12650704383850098,
2.3382370471954346,
1.814876675605774,
-0.5758905410766602,
-0.276104211807251,
-0.8438786864280701,
1.311774492263794,
-0.25410112738609314,
0.32747918367385864,
2.084606409072876,
-0.3227538466453552,
-0.9503954648971558,
1.3852232694625854,
-2.3913607597351074,
0.27669399976730347,
2.075505495071411,
0.29748284816741943,
0.13231970369815826,
-1.4217106103897095,
-0.5869870781898499,
-0.30662381649017334,
-0.4939582645893097,
-1.2823214530944824,
0.5478883385658264,
-0.3164912462234497,
-0.8439218997955322,
-1.4334864616394043,
0.03319057449698448,
-1.1367592811584473,
-1.7238171100616455,
0.347244530916214,
1.9557124376296997,
2.0507991313934326,
-0.7949667572975159,
1.3673686981201172,
-0.2658732831478119,
0.03483559563755989,
1.328687310218811,
1.3073617219924927,
3.0547096729278564,
1.9140939712524414,
-1.2698349952697754,
0.7275676131248474,
-0.2401629537343979,
-0.5266799330711365,
1.1759086847305298,
-1.150234580039978,
1.087173342704773,
-0.1820487231016159,
-1.1685155630111694,
-1.238223671913147,
1.0681016445159912,
0.5047052502632141,
0.004578244872391224,
-0.5058557987213135,
1.2802214622497559,
0.13793498277664185,
1.3421874046325684,
0.5733792185783386,
-0.47338664531707764,
0.5592487454414368,
-0.39166074991226196,
-0.6210359930992126,
1.635934829711914,
0.1731005609035492,
-1.5703271627426147,
-2.28857159614563,
-0.26316049695014954,
-0.9588292837142944,
-0.043938182294368744,
-0.6089185476303101,
-0.9542418122291565,
1.64696204662323,
0.38252952694892883,
-1.2318572998046875,
-0.23340056836605072,
-0.3134361505508423,
-0.5165207982063293,
2.6683952808380127,
-1.2919135093688965,
-0.1429888755083084,
-0.957486093044281,
-0.5440170168876648,
1.6480376720428467,
-1.2427517175674438,
-0.2922331392765045,
-1.011005163192749,
-0.604053795337677,
-1.2814985513687134,
-0.47215670347213745,
0.010213411413133144,
-0.9622669219970703,
0.7869582772254944,
0.17828920483589172,
-1.1230021715164185,
-0.3115086853504181,
-0.8659565448760986,
1.0321298837661743,
-0.0980345755815506,
0.2547631859779358,
1.907733678817749,
0.2684917747974396,
-0.4577524662017822,
0.7219860553741455,
1.2417802810668945,
0.5793787837028503,
-0.63218092918396,
0.03980468586087227,
-0.6247487664222717,
0.3824189007282257,
-1.3993680477142334,
0.19745168089866638,
-2.9640703201293945,
0.7686999440193176,
-0.15760010480880737,
-0.15399324893951416,
-0.10745379328727722,
-1.3538165092468262,
1.0612051486968994,
2.6074321269989014,
-1.1706963777542114,
0.48625925183296204,
0.47205543518066406,
1.133658528327942,
-1.6099504232406616,
0.287418007850647,
-0.5142414569854736,
2.031412363052368,
0.17101794481277466,
1.2213016748428345,
-0.5430073738098145,
-2.1951377391815186,
0.6227321624755859,
-1.1659969091415405,
-1.056625247001648,
0.7957459092140198,
-0.9314953088760376,
0.3655675947666168,
-1.4219081401824951,
-0.17768527567386627,
-0.9597228169441223,
-1.2236013412475586,
0.6814370155334473,
0.12333683669567108,
0.38872984051704407,
-0.6130935549736023,
0.3722786009311676,
-2.196413040161133,
-1.432246208190918,
-0.21573315560817719,
-1.0074009895324707,
0.5383659601211548,
-0.4353821575641632,
0.5336403846740723,
-0.04506795480847359,
0.145808145403862,
0.24794885516166687,
1.4641740322113037,
3.392477512359619,
0.13999566435813904,
0.16914904117584229,
-0.11410988867282867,
-1.0267817974090576,
1.5546706914901733,
0.8840750455856323,
-0.09530661255121231,
-0.5533612966537476,
-1.030470371246338,
1.279847502708435,
1.9902560710906982,
1.1560871601104736,
0.08039648085832596,
-0.7779106497764587,
-0.7723942399024963,
0.0433344691991806,
0.15254095196723938,
0.5037966966629028,
0.9707068800926208,
-0.026234589517116547,
0.1472465544939041,
1.3580104112625122,
1.184930682182312,
-0.27612635493278503,
0.37635865807533264,
-0.9767671823501587,
-0.41591161489486694,
0.37187156081199646,
0.23891861736774445,
0.05067222937941551,
0.46414655447006226,
-1.0551190376281738,
-0.2776380479335785,
-0.2840326130390167,
-0.8110015988349915,
-0.7286255359649658,
-0.38591527938842773,
-0.42650654911994934,
1.601449728012085,
0.0907512679696083,
-0.5113089680671692,
0.060971036553382874,
-0.706699013710022,
-0.10522135347127914,
-1.1240626573562622,
0.18804283440113068,
-0.07557587325572968,
-0.11374565958976746,
-0.13416777551174164,
1.6331801414489746,
-0.9037314057350159,
-2.122485876083374,
0.20381246507167816,
0.3111806809902191,
-0.33225488662719727,
0.14068444073200226,
1.7116022109985352,
0.48157644271850586,
1.3927967548370361,
1.3381754159927368,
0.966447114944458,
-0.5875483751296997,
-1.2186223268508911,
0.7166739702224731,
0.8738484382629395,
-1.3835837841033936,
0.9487284421920776,
-0.16755038499832153,
-0.4860350489616394,
0.6483235955238342,
1.3283636569976807,
0.45204105973243713,
-2.020250082015991,
0.9078642129898071,
-0.9174640774726868,
0.7658008337020874,
0.7327654957771301,
0.7604188919067383,
0.23586726188659668,
0.8984220027923584,
-1.1571838855743408,
-1.2040343284606934,
-0.7165404558181763,
-0.6836169958114624,
1.8520526885986328,
-0.2877444624900818,
0.6201133131980896,
-0.17964836955070496,
-1.1565055847167969,
-0.10834110528230667,
0.8265041708946228,
0.3915356397628784,
-0.41395899653434753,
0.9022486209869385,
-0.599479079246521,
-0.9834952354431152,
-1.2620172500610352,
-0.3818317651748657,
-1.0662966966629028,
-0.8255437016487122,
0.9971213340759277,
0.8064308166503906,
0.48005327582359314,
1.9332057237625122,
0.6469602584838867,
0.37482109665870667,
-2.660787582397461,
0.8481014370918274,
0.2568887174129486,
-0.019398408010601997,
0.8397889733314514,
0.28512337803840637,
1.146006464958191,
0.003290231339633465,
0.5939971804618835,
-2.3626325130462646,
2.2531654834747314,
-0.20349949598312378,
0.6194139719009399,
0.012005449272692204,
-0.1937282532453537,
1.128371238708496,
0.6251665353775024,
0.5289311408996582,
-1.155427098274231,
0.7494387030601501,
-0.5016531944274902,
1.1256968975067139,
0.912860095500946,
-0.8486778736114502,
0.08737094700336456,
1.46721351146698,
0.4714406728744507,
-0.4785189926624298,
-0.9695469737052917,
-0.8716859221458435,
0.9307190179824829,
1.7007472515106201,
-0.09246991574764252,
-0.0001850603148341179,
0.843869149684906,
0.6579611897468567,
-1.1868221759796143,
0.014184909872710705,
-0.7070519328117371,
-0.6657832264900208,
1.718729019165039,
2.0276565551757812,
-0.11396273970603943,
-0.17741209268569946,
-0.6993914246559143,
-1.296041488647461,
0.768914520740509,
-0.05802198126912117,
0.04879220202565193,
0.6817981600761414,
-0.6841149926185608,
1.0759061574935913,
0.6366366147994995,
1.0088295936584473,
-0.03053666278719902,
0.3324257731437683,
0.38160136342048645,
-0.3339870274066925,
-1.1721421480178833,
-0.31396913528442383,
-1.1035075187683105,
-2.5225446224212646,
0.34296169877052307,
-0.3139747977256775,
-1.4831258058547974,
0.04636179655790329,
-1.039086937904358,
0.8912487626075745,
-0.5891261100769043,
-1.1756796836853027,
-1.4256209135055542,
0.30203527212142944,
-0.07858928292989731,
0.9019178152084351,
-1.675838589668274,
-0.19372312724590302,
1.2091847658157349,
0.8006079792976379,
-0.6298615336418152,
0.9456217288970947,
0.2535480558872223,
0.9435853958129883,
0.7360251545906067,
-0.4179001450538635,
0.6063416004180908,
-0.014734583906829357,
-1.339272141456604,
0.41174960136413574,
1.2505861520767212,
0.1446070671081543,
1.3387415409088135,
-0.4389304220676422,
0.11060859262943268,
0.43081337213516235,
-0.714762806892395,
-0.5289872288703918,
-0.4152678847312927,
0.7504098415374756,
-0.05745687708258629,
-1.0041910409927368,
-0.13103549182415009,
-0.0733933076262474,
-0.33421555161476135,
0.22765380144119263,
-1.438309669494629,
-0.2788470983505249,
-0.3862304389476776,
-0.42642486095428467,
-1.3982861042022705,
0.07357686012983322,
1.3202334642410278,
-0.786359429359436,
-0.1829538494348526,
0.40091630816459656,
0.3915846347808838,
0.5670870542526245,
0.5600022077560425,
-0.7937279939651489,
-0.21903887391090393,
-0.37339839339256287,
-0.2570042014122009,
0.2909316420555115,
1.2499732971191406,
-0.06421593576669693,
-1.014153242111206,
0.6577205061912537,
-0.3111628293991089,
0.127702534198761,
2.023564577102661,
0.014022025279700756,
-0.6382299661636353,
0.3508526086807251,
-0.7327573299407959,
1.6969659328460693,
1.76676607131958,
1.3192230463027954,
-0.10454989224672318,
-0.8074628710746765,
0.5042997598648071,
-0.29565876722335815,
-0.3182642459869385,
0.896192193031311,
0.3882577121257782,
-0.2581180930137634,
-1.4081798791885376,
0.6763820052146912,
1.264582872390747,
-0.7347080111503601,
-0.7380677461624146,
0.10056381672620773,
-0.9111645221710205,
1.2455201148986816,
0.5539799928665161,
0.33618515729904175,
0.3019528388977051,
1.549829125404358,
0.7465805411338806,
-0.4286216199398041,
0.5302892923355103,
0.5942984819412231,
-0.2602745592594147,
-2.150789976119995,
-1.0598487854003906,
0.28756240010261536,
-0.3914940357208252,
-1.5932414531707764,
1.3913499116897583,
-1.1417436599731445,
-1.0601717233657837,
0.5233217477798462,
0.09970254451036453,
1.3288530111312866,
0.3410748243331909,
1.6773431301116943,
2.1803064346313477,
0.9274532794952393,
0.42420080304145813,
1.2161298990249634,
-0.10872869938611984,
-0.48519226908683777,
1.8634175062179565,
-0.41679179668426514,
0.48918595910072327,
1.0245552062988281,
-0.37453949451446533,
-1.1579047441482544,
-0.848176896572113,
-1.1202253103256226,
-0.6354432702064514,
1.1511194705963135,
0.08388150483369827,
-1.0493990182876587,
0.193950816988945,
1.5831869840621948,
0.15490089356899261,
-0.24218279123306274,
0.6392329931259155,
0.38383933901786804,
-0.7435729503631592,
-0.11138055473566055,
-0.8600850701332092,
0.5202860236167908,
-0.18235145509243011,
-0.2860112190246582,
0.22305214405059814,
0.5356884598731995,
1.2696770429611206,
-0.060927923768758774,
0.146917462348938,
1.1325594186782837,
-1.4270869493484497,
1.5384562015533447,
-0.6097989678382874,
0.3589344918727875,
-2.439312219619751,
1.3970352411270142,
-0.7624219059944153,
1.974752426147461,
-2.5650482177734375,
0.4457353353500366,
-0.5082001686096191,
-0.5384224653244019,
0.2895660400390625,
-0.4278545677661896,
0.02544531598687172,
-0.08543381094932556,
-0.9643197655677795,
0.004195867106318474,
-0.7473882436752319,
0.617041289806366,
1.1309973001480103,
1.4402010440826416,
-1.171016812324524,
-0.3408711850643158,
-1.6723884344100952,
-0.19813719391822815,
-0.8378684520721436,
0.3319569528102875,
-1.9903836250305176,
-0.19068178534507751,
-2.008035182952881,
-2.310011625289917,
-1.3336607217788696,
-0.8913440108299255,
1.069360613822937,
0.17361876368522644,
-0.8926003575325012,
1.170094609260559,
-0.3617924451828003,
-1.8817938566207886,
1.2063695192337036,
-2.163064479827881
] |
https://github.com/huggingface/datasets/issues/5044 | integrate `load_from_disk` into `load_dataset` | @lhoestq I can jump into that. What I don't like is having functions with many parameters input. Even though they are optional, it's always harder to reason about and test such cases.
If there are more features worth to work on, feel free to ping me. It's a lot of fun to help :smile: | **Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you! | 502 | 54 | integrate `load_from_disk` into `load_dataset`
**Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you!
@lhoestq I can jump into that. What I don't like is having functions with many parameters input. Even though they are optional, it's always harder to reason about and test such cases.
If there are more features worth to work on, feel free to ping me. It's a lot of fun to help :smile: | [
-1.2368111610412598,
-0.9566577076911926,
-0.6736604571342468,
1.4294203519821167,
-0.09253088384866714,
-1.322953701019287,
0.11907912790775299,
-1.0474250316619873,
1.5526111125946045,
-0.7530148029327393,
0.21871532499790192,
-1.6522216796875,
-0.09012339264154434,
-0.468554824590683,
-0.7082620859146118,
-0.8880060911178589,
-0.4406410753726959,
-0.8833104968070984,
1.0627145767211914,
2.445392608642578,
1.3473459482192993,
-1.3577944040298462,
2.7455873489379883,
0.6628885865211487,
-0.21631847321987152,
-1.0362943410873413,
0.4900558292865753,
0.05376153439283371,
-1.1928752660751343,
-0.40062272548675537,
-0.9028421640396118,
-0.02810264751315117,
-0.5376821756362915,
-0.45453131198883057,
0.09722567349672318,
0.5136123895645142,
-0.3182358145713806,
-0.33318400382995605,
-0.6653363108634949,
-0.7159247398376465,
0.5230942964553833,
-0.3078800141811371,
0.9219244122505188,
-0.34657880663871765,
1.739990234375,
-0.6195850968360901,
0.42881321907043457,
0.7447794675827026,
1.263422966003418,
0.16434581577777863,
0.09210231900215149,
0.2464314103126526,
0.3368269205093384,
-0.017151126638054848,
0.6057765483856201,
1.259972095489502,
0.6199043989181519,
0.54071444272995,
0.6957834959030151,
-2.226925849914551,
1.31244695186615,
-0.9129303097724915,
0.2843727171421051,
1.3266980648040771,
-0.8408970236778259,
0.331648051738739,
-1.8569433689117432,
-0.07804972678422928,
0.6257495880126953,
-2.241555690765381,
0.25032609701156616,
-1.2381314039230347,
-0.5423586964607239,
0.8975887894630432,
0.3525848686695099,
-1.1667248010635376,
0.22250297665596008,
-0.49368923902511597,
1.111596703529358,
0.47337549924850464,
1.1213810443878174,
-1.6573283672332764,
0.006261897273361683,
-0.14636534452438354,
0.10993416607379913,
-1.302794098854065,
-1.6617940664291382,
0.5750330090522766,
0.5192688703536987,
0.7027649879455566,
-0.10111607611179352,
0.9686384797096252,
-1.0953726768493652,
0.8477665185928345,
-1.0402253866195679,
-1.5468188524246216,
-1.396148443222046,
-2.4126665592193604,
-2.2963247299194336,
0.8045496940612793,
-0.5414470434188843,
-0.5674599409103394,
2.0167810916900635,
-0.9928927421569824,
-1.7664395570755005,
1.0941548347473145,
0.2802952826023102,
0.11410538107156754,
2.382859230041504,
0.20418637990951538,
-0.7821393609046936,
0.5261449813842773,
-0.723749577999115,
0.8351815342903137,
-0.2847801148891449,
1.2675474882125854,
0.5303447246551514,
-1.0169727802276611,
1.5991222858428955,
-0.47853970527648926,
0.6640898585319519,
-0.616024374961853,
-0.5644786357879639,
-0.7819786071777344,
0.2896217703819275,
1.8909369707107544,
-0.2685542106628418,
1.6144664287567139,
-0.34376299381256104,
-1.554506778717041,
-1.5678215026855469,
0.8347786664962769,
0.49729612469673157,
-0.8328254222869873,
0.04861554130911827,
-0.5057522058486938,
0.18773610889911652,
0.01139479037374258,
1.1417449712753296,
1.2401772737503052,
0.7420031428337097,
-0.35851240158081055,
-0.8232718706130981,
0.18382681906223297,
-0.12842068076133728,
-0.6256245374679565,
-1.8289676904678345,
-0.27315375208854675,
0.21212726831436157,
0.5952417850494385,
-1.2215301990509033,
1.8280231952667236,
0.8900435566902161,
2.0456981658935547,
0.9616069197654724,
-0.32306554913520813,
1.4383821487426758,
0.0023360680788755417,
1.8718191385269165,
-0.46662354469299316,
0.6151379942893982,
-0.3705524504184723,
-1.1423505544662476,
0.8773482441902161,
-0.40759357810020447,
-2.001143455505371,
-0.8316943049430847,
-0.7951195240020752,
-0.1547715961933136,
-0.7267497181892395,
0.854455828666687,
-0.2874913513660431,
-1.5449808835983276,
0.09072376042604446,
-0.6371731758117676,
0.14363056421279907,
-1.2714201211929321,
0.20235750079154968,
0.7501402497291565,
-0.719541072845459,
-0.050510652363300323,
-0.26410791277885437,
-1.2659006118774414,
-0.4928829073905945,
0.37490713596343994,
2.0141334533691406,
-0.605954647064209,
0.8929566144943237,
1.0177044868469238,
-0.7550188302993774,
0.09702945500612259,
0.1697303205728531,
-0.2877553105354309,
0.7151408791542053,
-1.0974140167236328,
-0.4219869375228882,
1.1565159559249878,
-0.2377423346042633,
-0.7405074834823608,
1.4725772142410278,
0.7883156538009644,
-1.0854604244232178,
-0.24955491721630096,
-0.23234951496124268,
-0.9062501788139343,
-0.07507473975419998,
-1.4753082990646362,
-0.18662384152412415,
0.35265108942985535,
-1.4613510370254517,
-0.3707147538661957,
-0.18466924130916595,
1.3298265933990479,
-0.2506585419178009,
1.4489085674285889,
-0.3347262442111969,
-0.158110573887825,
-0.26741117238998413,
-0.4962214231491089,
0.1710558384656906,
-0.20083291828632355,
-0.6243765950202942,
0.15909838676452637,
-0.7970317006111145,
0.2674734890460968,
1.5180437564849854,
0.36394667625427246,
0.09483712911605835,
0.46480822563171387,
1.1005908250808716,
0.4051685631275177,
-0.041469380259513855,
-0.8363662362098694,
-1.5084245204925537,
1.9325515031814575,
-1.4361414909362793,
1.9234730005264282,
0.7226538062095642,
-0.08537127822637558,
-1.7830071449279785,
-1.8301845788955688,
1.2299408912658691,
1.1470897197723389,
2.388245105743408,
0.4844253659248352,
0.37237048149108887,
-0.7878141403198242,
-0.7640656232833862,
0.29581785202026367,
-0.9797528386116028,
-0.6368696093559265,
0.12650704383850098,
2.3382370471954346,
1.814876675605774,
-0.5758905410766602,
-0.276104211807251,
-0.8438786864280701,
1.311774492263794,
-0.25410112738609314,
0.32747918367385864,
2.084606409072876,
-0.3227538466453552,
-0.9503954648971558,
1.3852232694625854,
-2.3913607597351074,
0.27669399976730347,
2.075505495071411,
0.29748284816741943,
0.13231970369815826,
-1.4217106103897095,
-0.5869870781898499,
-0.30662381649017334,
-0.4939582645893097,
-1.2823214530944824,
0.5478883385658264,
-0.3164912462234497,
-0.8439218997955322,
-1.4334864616394043,
0.03319057449698448,
-1.1367592811584473,
-1.7238171100616455,
0.347244530916214,
1.9557124376296997,
2.0507991313934326,
-0.7949667572975159,
1.3673686981201172,
-0.2658732831478119,
0.03483559563755989,
1.328687310218811,
1.3073617219924927,
3.0547096729278564,
1.9140939712524414,
-1.2698349952697754,
0.7275676131248474,
-0.2401629537343979,
-0.5266799330711365,
1.1759086847305298,
-1.150234580039978,
1.087173342704773,
-0.1820487231016159,
-1.1685155630111694,
-1.238223671913147,
1.0681016445159912,
0.5047052502632141,
0.004578244872391224,
-0.5058557987213135,
1.2802214622497559,
0.13793498277664185,
1.3421874046325684,
0.5733792185783386,
-0.47338664531707764,
0.5592487454414368,
-0.39166074991226196,
-0.6210359930992126,
1.635934829711914,
0.1731005609035492,
-1.5703271627426147,
-2.28857159614563,
-0.26316049695014954,
-0.9588292837142944,
-0.043938182294368744,
-0.6089185476303101,
-0.9542418122291565,
1.64696204662323,
0.38252952694892883,
-1.2318572998046875,
-0.23340056836605072,
-0.3134361505508423,
-0.5165207982063293,
2.6683952808380127,
-1.2919135093688965,
-0.1429888755083084,
-0.957486093044281,
-0.5440170168876648,
1.6480376720428467,
-1.2427517175674438,
-0.2922331392765045,
-1.011005163192749,
-0.604053795337677,
-1.2814985513687134,
-0.47215670347213745,
0.010213411413133144,
-0.9622669219970703,
0.7869582772254944,
0.17828920483589172,
-1.1230021715164185,
-0.3115086853504181,
-0.8659565448760986,
1.0321298837661743,
-0.0980345755815506,
0.2547631859779358,
1.907733678817749,
0.2684917747974396,
-0.4577524662017822,
0.7219860553741455,
1.2417802810668945,
0.5793787837028503,
-0.63218092918396,
0.03980468586087227,
-0.6247487664222717,
0.3824189007282257,
-1.3993680477142334,
0.19745168089866638,
-2.9640703201293945,
0.7686999440193176,
-0.15760010480880737,
-0.15399324893951416,
-0.10745379328727722,
-1.3538165092468262,
1.0612051486968994,
2.6074321269989014,
-1.1706963777542114,
0.48625925183296204,
0.47205543518066406,
1.133658528327942,
-1.6099504232406616,
0.287418007850647,
-0.5142414569854736,
2.031412363052368,
0.17101794481277466,
1.2213016748428345,
-0.5430073738098145,
-2.1951377391815186,
0.6227321624755859,
-1.1659969091415405,
-1.056625247001648,
0.7957459092140198,
-0.9314953088760376,
0.3655675947666168,
-1.4219081401824951,
-0.17768527567386627,
-0.9597228169441223,
-1.2236013412475586,
0.6814370155334473,
0.12333683669567108,
0.38872984051704407,
-0.6130935549736023,
0.3722786009311676,
-2.196413040161133,
-1.432246208190918,
-0.21573315560817719,
-1.0074009895324707,
0.5383659601211548,
-0.4353821575641632,
0.5336403846740723,
-0.04506795480847359,
0.145808145403862,
0.24794885516166687,
1.4641740322113037,
3.392477512359619,
0.13999566435813904,
0.16914904117584229,
-0.11410988867282867,
-1.0267817974090576,
1.5546706914901733,
0.8840750455856323,
-0.09530661255121231,
-0.5533612966537476,
-1.030470371246338,
1.279847502708435,
1.9902560710906982,
1.1560871601104736,
0.08039648085832596,
-0.7779106497764587,
-0.7723942399024963,
0.0433344691991806,
0.15254095196723938,
0.5037966966629028,
0.9707068800926208,
-0.026234589517116547,
0.1472465544939041,
1.3580104112625122,
1.184930682182312,
-0.27612635493278503,
0.37635865807533264,
-0.9767671823501587,
-0.41591161489486694,
0.37187156081199646,
0.23891861736774445,
0.05067222937941551,
0.46414655447006226,
-1.0551190376281738,
-0.2776380479335785,
-0.2840326130390167,
-0.8110015988349915,
-0.7286255359649658,
-0.38591527938842773,
-0.42650654911994934,
1.601449728012085,
0.0907512679696083,
-0.5113089680671692,
0.060971036553382874,
-0.706699013710022,
-0.10522135347127914,
-1.1240626573562622,
0.18804283440113068,
-0.07557587325572968,
-0.11374565958976746,
-0.13416777551174164,
1.6331801414489746,
-0.9037314057350159,
-2.122485876083374,
0.20381246507167816,
0.3111806809902191,
-0.33225488662719727,
0.14068444073200226,
1.7116022109985352,
0.48157644271850586,
1.3927967548370361,
1.3381754159927368,
0.966447114944458,
-0.5875483751296997,
-1.2186223268508911,
0.7166739702224731,
0.8738484382629395,
-1.3835837841033936,
0.9487284421920776,
-0.16755038499832153,
-0.4860350489616394,
0.6483235955238342,
1.3283636569976807,
0.45204105973243713,
-2.020250082015991,
0.9078642129898071,
-0.9174640774726868,
0.7658008337020874,
0.7327654957771301,
0.7604188919067383,
0.23586726188659668,
0.8984220027923584,
-1.1571838855743408,
-1.2040343284606934,
-0.7165404558181763,
-0.6836169958114624,
1.8520526885986328,
-0.2877444624900818,
0.6201133131980896,
-0.17964836955070496,
-1.1565055847167969,
-0.10834110528230667,
0.8265041708946228,
0.3915356397628784,
-0.41395899653434753,
0.9022486209869385,
-0.599479079246521,
-0.9834952354431152,
-1.2620172500610352,
-0.3818317651748657,
-1.0662966966629028,
-0.8255437016487122,
0.9971213340759277,
0.8064308166503906,
0.48005327582359314,
1.9332057237625122,
0.6469602584838867,
0.37482109665870667,
-2.660787582397461,
0.8481014370918274,
0.2568887174129486,
-0.019398408010601997,
0.8397889733314514,
0.28512337803840637,
1.146006464958191,
0.003290231339633465,
0.5939971804618835,
-2.3626325130462646,
2.2531654834747314,
-0.20349949598312378,
0.6194139719009399,
0.012005449272692204,
-0.1937282532453537,
1.128371238708496,
0.6251665353775024,
0.5289311408996582,
-1.155427098274231,
0.7494387030601501,
-0.5016531944274902,
1.1256968975067139,
0.912860095500946,
-0.8486778736114502,
0.08737094700336456,
1.46721351146698,
0.4714406728744507,
-0.4785189926624298,
-0.9695469737052917,
-0.8716859221458435,
0.9307190179824829,
1.7007472515106201,
-0.09246991574764252,
-0.0001850603148341179,
0.843869149684906,
0.6579611897468567,
-1.1868221759796143,
0.014184909872710705,
-0.7070519328117371,
-0.6657832264900208,
1.718729019165039,
2.0276565551757812,
-0.11396273970603943,
-0.17741209268569946,
-0.6993914246559143,
-1.296041488647461,
0.768914520740509,
-0.05802198126912117,
0.04879220202565193,
0.6817981600761414,
-0.6841149926185608,
1.0759061574935913,
0.6366366147994995,
1.0088295936584473,
-0.03053666278719902,
0.3324257731437683,
0.38160136342048645,
-0.3339870274066925,
-1.1721421480178833,
-0.31396913528442383,
-1.1035075187683105,
-2.5225446224212646,
0.34296169877052307,
-0.3139747977256775,
-1.4831258058547974,
0.04636179655790329,
-1.039086937904358,
0.8912487626075745,
-0.5891261100769043,
-1.1756796836853027,
-1.4256209135055542,
0.30203527212142944,
-0.07858928292989731,
0.9019178152084351,
-1.675838589668274,
-0.19372312724590302,
1.2091847658157349,
0.8006079792976379,
-0.6298615336418152,
0.9456217288970947,
0.2535480558872223,
0.9435853958129883,
0.7360251545906067,
-0.4179001450538635,
0.6063416004180908,
-0.014734583906829357,
-1.339272141456604,
0.41174960136413574,
1.2505861520767212,
0.1446070671081543,
1.3387415409088135,
-0.4389304220676422,
0.11060859262943268,
0.43081337213516235,
-0.714762806892395,
-0.5289872288703918,
-0.4152678847312927,
0.7504098415374756,
-0.05745687708258629,
-1.0041910409927368,
-0.13103549182415009,
-0.0733933076262474,
-0.33421555161476135,
0.22765380144119263,
-1.438309669494629,
-0.2788470983505249,
-0.3862304389476776,
-0.42642486095428467,
-1.3982861042022705,
0.07357686012983322,
1.3202334642410278,
-0.786359429359436,
-0.1829538494348526,
0.40091630816459656,
0.3915846347808838,
0.5670870542526245,
0.5600022077560425,
-0.7937279939651489,
-0.21903887391090393,
-0.37339839339256287,
-0.2570042014122009,
0.2909316420555115,
1.2499732971191406,
-0.06421593576669693,
-1.014153242111206,
0.6577205061912537,
-0.3111628293991089,
0.127702534198761,
2.023564577102661,
0.014022025279700756,
-0.6382299661636353,
0.3508526086807251,
-0.7327573299407959,
1.6969659328460693,
1.76676607131958,
1.3192230463027954,
-0.10454989224672318,
-0.8074628710746765,
0.5042997598648071,
-0.29565876722335815,
-0.3182642459869385,
0.896192193031311,
0.3882577121257782,
-0.2581180930137634,
-1.4081798791885376,
0.6763820052146912,
1.264582872390747,
-0.7347080111503601,
-0.7380677461624146,
0.10056381672620773,
-0.9111645221710205,
1.2455201148986816,
0.5539799928665161,
0.33618515729904175,
0.3019528388977051,
1.549829125404358,
0.7465805411338806,
-0.4286216199398041,
0.5302892923355103,
0.5942984819412231,
-0.2602745592594147,
-2.150789976119995,
-1.0598487854003906,
0.28756240010261536,
-0.3914940357208252,
-1.5932414531707764,
1.3913499116897583,
-1.1417436599731445,
-1.0601717233657837,
0.5233217477798462,
0.09970254451036453,
1.3288530111312866,
0.3410748243331909,
1.6773431301116943,
2.1803064346313477,
0.9274532794952393,
0.42420080304145813,
1.2161298990249634,
-0.10872869938611984,
-0.48519226908683777,
1.8634175062179565,
-0.41679179668426514,
0.48918595910072327,
1.0245552062988281,
-0.37453949451446533,
-1.1579047441482544,
-0.848176896572113,
-1.1202253103256226,
-0.6354432702064514,
1.1511194705963135,
0.08388150483369827,
-1.0493990182876587,
0.193950816988945,
1.5831869840621948,
0.15490089356899261,
-0.24218279123306274,
0.6392329931259155,
0.38383933901786804,
-0.7435729503631592,
-0.11138055473566055,
-0.8600850701332092,
0.5202860236167908,
-0.18235145509243011,
-0.2860112190246582,
0.22305214405059814,
0.5356884598731995,
1.2696770429611206,
-0.060927923768758774,
0.146917462348938,
1.1325594186782837,
-1.4270869493484497,
1.5384562015533447,
-0.6097989678382874,
0.3589344918727875,
-2.439312219619751,
1.3970352411270142,
-0.7624219059944153,
1.974752426147461,
-2.5650482177734375,
0.4457353353500366,
-0.5082001686096191,
-0.5384224653244019,
0.2895660400390625,
-0.4278545677661896,
0.02544531598687172,
-0.08543381094932556,
-0.9643197655677795,
0.004195867106318474,
-0.7473882436752319,
0.617041289806366,
1.1309973001480103,
1.4402010440826416,
-1.171016812324524,
-0.3408711850643158,
-1.6723884344100952,
-0.19813719391822815,
-0.8378684520721436,
0.3319569528102875,
-1.9903836250305176,
-0.19068178534507751,
-2.008035182952881,
-2.310011625289917,
-1.3336607217788696,
-0.8913440108299255,
1.069360613822937,
0.17361876368522644,
-0.8926003575325012,
1.170094609260559,
-0.3617924451828003,
-1.8817938566207886,
1.2063695192337036,
-2.163064479827881
] |
https://github.com/huggingface/datasets/issues/5044 | integrate `load_from_disk` into `load_dataset` | Thanks a lot for your help @mariusz-jachimowicz-83 :)
I think as a first step we could implement an Arrow dataset builder to be able to load and stream Arrow datasets locally or from Hugging Face. Maybe something similar to the Parquet builder at [src/datasets/packaged_modules/parquet/parquet.py](https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/parquet/parquet.py) ?
And we can deal with the disk space optimization as a second step. What do you think ?
(this issue is also related to https://github.com/huggingface/datasets/issues/3035) | **Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you! | 502 | 70 | integrate `load_from_disk` into `load_dataset`
**Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you!
Thanks a lot for your help @mariusz-jachimowicz-83 :)
I think as a first step we could implement an Arrow dataset builder to be able to load and stream Arrow datasets locally or from Hugging Face. Maybe something similar to the Parquet builder at [src/datasets/packaged_modules/parquet/parquet.py](https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/parquet/parquet.py) ?
And we can deal with the disk space optimization as a second step. What do you think ?
(this issue is also related to https://github.com/huggingface/datasets/issues/3035) | [
-1.2368111610412598,
-0.9566577076911926,
-0.6736604571342468,
1.4294203519821167,
-0.09253088384866714,
-1.322953701019287,
0.11907912790775299,
-1.0474250316619873,
1.5526111125946045,
-0.7530148029327393,
0.21871532499790192,
-1.6522216796875,
-0.09012339264154434,
-0.468554824590683,
-0.7082620859146118,
-0.8880060911178589,
-0.4406410753726959,
-0.8833104968070984,
1.0627145767211914,
2.445392608642578,
1.3473459482192993,
-1.3577944040298462,
2.7455873489379883,
0.6628885865211487,
-0.21631847321987152,
-1.0362943410873413,
0.4900558292865753,
0.05376153439283371,
-1.1928752660751343,
-0.40062272548675537,
-0.9028421640396118,
-0.02810264751315117,
-0.5376821756362915,
-0.45453131198883057,
0.09722567349672318,
0.5136123895645142,
-0.3182358145713806,
-0.33318400382995605,
-0.6653363108634949,
-0.7159247398376465,
0.5230942964553833,
-0.3078800141811371,
0.9219244122505188,
-0.34657880663871765,
1.739990234375,
-0.6195850968360901,
0.42881321907043457,
0.7447794675827026,
1.263422966003418,
0.16434581577777863,
0.09210231900215149,
0.2464314103126526,
0.3368269205093384,
-0.017151126638054848,
0.6057765483856201,
1.259972095489502,
0.6199043989181519,
0.54071444272995,
0.6957834959030151,
-2.226925849914551,
1.31244695186615,
-0.9129303097724915,
0.2843727171421051,
1.3266980648040771,
-0.8408970236778259,
0.331648051738739,
-1.8569433689117432,
-0.07804972678422928,
0.6257495880126953,
-2.241555690765381,
0.25032609701156616,
-1.2381314039230347,
-0.5423586964607239,
0.8975887894630432,
0.3525848686695099,
-1.1667248010635376,
0.22250297665596008,
-0.49368923902511597,
1.111596703529358,
0.47337549924850464,
1.1213810443878174,
-1.6573283672332764,
0.006261897273361683,
-0.14636534452438354,
0.10993416607379913,
-1.302794098854065,
-1.6617940664291382,
0.5750330090522766,
0.5192688703536987,
0.7027649879455566,
-0.10111607611179352,
0.9686384797096252,
-1.0953726768493652,
0.8477665185928345,
-1.0402253866195679,
-1.5468188524246216,
-1.396148443222046,
-2.4126665592193604,
-2.2963247299194336,
0.8045496940612793,
-0.5414470434188843,
-0.5674599409103394,
2.0167810916900635,
-0.9928927421569824,
-1.7664395570755005,
1.0941548347473145,
0.2802952826023102,
0.11410538107156754,
2.382859230041504,
0.20418637990951538,
-0.7821393609046936,
0.5261449813842773,
-0.723749577999115,
0.8351815342903137,
-0.2847801148891449,
1.2675474882125854,
0.5303447246551514,
-1.0169727802276611,
1.5991222858428955,
-0.47853970527648926,
0.6640898585319519,
-0.616024374961853,
-0.5644786357879639,
-0.7819786071777344,
0.2896217703819275,
1.8909369707107544,
-0.2685542106628418,
1.6144664287567139,
-0.34376299381256104,
-1.554506778717041,
-1.5678215026855469,
0.8347786664962769,
0.49729612469673157,
-0.8328254222869873,
0.04861554130911827,
-0.5057522058486938,
0.18773610889911652,
0.01139479037374258,
1.1417449712753296,
1.2401772737503052,
0.7420031428337097,
-0.35851240158081055,
-0.8232718706130981,
0.18382681906223297,
-0.12842068076133728,
-0.6256245374679565,
-1.8289676904678345,
-0.27315375208854675,
0.21212726831436157,
0.5952417850494385,
-1.2215301990509033,
1.8280231952667236,
0.8900435566902161,
2.0456981658935547,
0.9616069197654724,
-0.32306554913520813,
1.4383821487426758,
0.0023360680788755417,
1.8718191385269165,
-0.46662354469299316,
0.6151379942893982,
-0.3705524504184723,
-1.1423505544662476,
0.8773482441902161,
-0.40759357810020447,
-2.001143455505371,
-0.8316943049430847,
-0.7951195240020752,
-0.1547715961933136,
-0.7267497181892395,
0.854455828666687,
-0.2874913513660431,
-1.5449808835983276,
0.09072376042604446,
-0.6371731758117676,
0.14363056421279907,
-1.2714201211929321,
0.20235750079154968,
0.7501402497291565,
-0.719541072845459,
-0.050510652363300323,
-0.26410791277885437,
-1.2659006118774414,
-0.4928829073905945,
0.37490713596343994,
2.0141334533691406,
-0.605954647064209,
0.8929566144943237,
1.0177044868469238,
-0.7550188302993774,
0.09702945500612259,
0.1697303205728531,
-0.2877553105354309,
0.7151408791542053,
-1.0974140167236328,
-0.4219869375228882,
1.1565159559249878,
-0.2377423346042633,
-0.7405074834823608,
1.4725772142410278,
0.7883156538009644,
-1.0854604244232178,
-0.24955491721630096,
-0.23234951496124268,
-0.9062501788139343,
-0.07507473975419998,
-1.4753082990646362,
-0.18662384152412415,
0.35265108942985535,
-1.4613510370254517,
-0.3707147538661957,
-0.18466924130916595,
1.3298265933990479,
-0.2506585419178009,
1.4489085674285889,
-0.3347262442111969,
-0.158110573887825,
-0.26741117238998413,
-0.4962214231491089,
0.1710558384656906,
-0.20083291828632355,
-0.6243765950202942,
0.15909838676452637,
-0.7970317006111145,
0.2674734890460968,
1.5180437564849854,
0.36394667625427246,
0.09483712911605835,
0.46480822563171387,
1.1005908250808716,
0.4051685631275177,
-0.041469380259513855,
-0.8363662362098694,
-1.5084245204925537,
1.9325515031814575,
-1.4361414909362793,
1.9234730005264282,
0.7226538062095642,
-0.08537127822637558,
-1.7830071449279785,
-1.8301845788955688,
1.2299408912658691,
1.1470897197723389,
2.388245105743408,
0.4844253659248352,
0.37237048149108887,
-0.7878141403198242,
-0.7640656232833862,
0.29581785202026367,
-0.9797528386116028,
-0.6368696093559265,
0.12650704383850098,
2.3382370471954346,
1.814876675605774,
-0.5758905410766602,
-0.276104211807251,
-0.8438786864280701,
1.311774492263794,
-0.25410112738609314,
0.32747918367385864,
2.084606409072876,
-0.3227538466453552,
-0.9503954648971558,
1.3852232694625854,
-2.3913607597351074,
0.27669399976730347,
2.075505495071411,
0.29748284816741943,
0.13231970369815826,
-1.4217106103897095,
-0.5869870781898499,
-0.30662381649017334,
-0.4939582645893097,
-1.2823214530944824,
0.5478883385658264,
-0.3164912462234497,
-0.8439218997955322,
-1.4334864616394043,
0.03319057449698448,
-1.1367592811584473,
-1.7238171100616455,
0.347244530916214,
1.9557124376296997,
2.0507991313934326,
-0.7949667572975159,
1.3673686981201172,
-0.2658732831478119,
0.03483559563755989,
1.328687310218811,
1.3073617219924927,
3.0547096729278564,
1.9140939712524414,
-1.2698349952697754,
0.7275676131248474,
-0.2401629537343979,
-0.5266799330711365,
1.1759086847305298,
-1.150234580039978,
1.087173342704773,
-0.1820487231016159,
-1.1685155630111694,
-1.238223671913147,
1.0681016445159912,
0.5047052502632141,
0.004578244872391224,
-0.5058557987213135,
1.2802214622497559,
0.13793498277664185,
1.3421874046325684,
0.5733792185783386,
-0.47338664531707764,
0.5592487454414368,
-0.39166074991226196,
-0.6210359930992126,
1.635934829711914,
0.1731005609035492,
-1.5703271627426147,
-2.28857159614563,
-0.26316049695014954,
-0.9588292837142944,
-0.043938182294368744,
-0.6089185476303101,
-0.9542418122291565,
1.64696204662323,
0.38252952694892883,
-1.2318572998046875,
-0.23340056836605072,
-0.3134361505508423,
-0.5165207982063293,
2.6683952808380127,
-1.2919135093688965,
-0.1429888755083084,
-0.957486093044281,
-0.5440170168876648,
1.6480376720428467,
-1.2427517175674438,
-0.2922331392765045,
-1.011005163192749,
-0.604053795337677,
-1.2814985513687134,
-0.47215670347213745,
0.010213411413133144,
-0.9622669219970703,
0.7869582772254944,
0.17828920483589172,
-1.1230021715164185,
-0.3115086853504181,
-0.8659565448760986,
1.0321298837661743,
-0.0980345755815506,
0.2547631859779358,
1.907733678817749,
0.2684917747974396,
-0.4577524662017822,
0.7219860553741455,
1.2417802810668945,
0.5793787837028503,
-0.63218092918396,
0.03980468586087227,
-0.6247487664222717,
0.3824189007282257,
-1.3993680477142334,
0.19745168089866638,
-2.9640703201293945,
0.7686999440193176,
-0.15760010480880737,
-0.15399324893951416,
-0.10745379328727722,
-1.3538165092468262,
1.0612051486968994,
2.6074321269989014,
-1.1706963777542114,
0.48625925183296204,
0.47205543518066406,
1.133658528327942,
-1.6099504232406616,
0.287418007850647,
-0.5142414569854736,
2.031412363052368,
0.17101794481277466,
1.2213016748428345,
-0.5430073738098145,
-2.1951377391815186,
0.6227321624755859,
-1.1659969091415405,
-1.056625247001648,
0.7957459092140198,
-0.9314953088760376,
0.3655675947666168,
-1.4219081401824951,
-0.17768527567386627,
-0.9597228169441223,
-1.2236013412475586,
0.6814370155334473,
0.12333683669567108,
0.38872984051704407,
-0.6130935549736023,
0.3722786009311676,
-2.196413040161133,
-1.432246208190918,
-0.21573315560817719,
-1.0074009895324707,
0.5383659601211548,
-0.4353821575641632,
0.5336403846740723,
-0.04506795480847359,
0.145808145403862,
0.24794885516166687,
1.4641740322113037,
3.392477512359619,
0.13999566435813904,
0.16914904117584229,
-0.11410988867282867,
-1.0267817974090576,
1.5546706914901733,
0.8840750455856323,
-0.09530661255121231,
-0.5533612966537476,
-1.030470371246338,
1.279847502708435,
1.9902560710906982,
1.1560871601104736,
0.08039648085832596,
-0.7779106497764587,
-0.7723942399024963,
0.0433344691991806,
0.15254095196723938,
0.5037966966629028,
0.9707068800926208,
-0.026234589517116547,
0.1472465544939041,
1.3580104112625122,
1.184930682182312,
-0.27612635493278503,
0.37635865807533264,
-0.9767671823501587,
-0.41591161489486694,
0.37187156081199646,
0.23891861736774445,
0.05067222937941551,
0.46414655447006226,
-1.0551190376281738,
-0.2776380479335785,
-0.2840326130390167,
-0.8110015988349915,
-0.7286255359649658,
-0.38591527938842773,
-0.42650654911994934,
1.601449728012085,
0.0907512679696083,
-0.5113089680671692,
0.060971036553382874,
-0.706699013710022,
-0.10522135347127914,
-1.1240626573562622,
0.18804283440113068,
-0.07557587325572968,
-0.11374565958976746,
-0.13416777551174164,
1.6331801414489746,
-0.9037314057350159,
-2.122485876083374,
0.20381246507167816,
0.3111806809902191,
-0.33225488662719727,
0.14068444073200226,
1.7116022109985352,
0.48157644271850586,
1.3927967548370361,
1.3381754159927368,
0.966447114944458,
-0.5875483751296997,
-1.2186223268508911,
0.7166739702224731,
0.8738484382629395,
-1.3835837841033936,
0.9487284421920776,
-0.16755038499832153,
-0.4860350489616394,
0.6483235955238342,
1.3283636569976807,
0.45204105973243713,
-2.020250082015991,
0.9078642129898071,
-0.9174640774726868,
0.7658008337020874,
0.7327654957771301,
0.7604188919067383,
0.23586726188659668,
0.8984220027923584,
-1.1571838855743408,
-1.2040343284606934,
-0.7165404558181763,
-0.6836169958114624,
1.8520526885986328,
-0.2877444624900818,
0.6201133131980896,
-0.17964836955070496,
-1.1565055847167969,
-0.10834110528230667,
0.8265041708946228,
0.3915356397628784,
-0.41395899653434753,
0.9022486209869385,
-0.599479079246521,
-0.9834952354431152,
-1.2620172500610352,
-0.3818317651748657,
-1.0662966966629028,
-0.8255437016487122,
0.9971213340759277,
0.8064308166503906,
0.48005327582359314,
1.9332057237625122,
0.6469602584838867,
0.37482109665870667,
-2.660787582397461,
0.8481014370918274,
0.2568887174129486,
-0.019398408010601997,
0.8397889733314514,
0.28512337803840637,
1.146006464958191,
0.003290231339633465,
0.5939971804618835,
-2.3626325130462646,
2.2531654834747314,
-0.20349949598312378,
0.6194139719009399,
0.012005449272692204,
-0.1937282532453537,
1.128371238708496,
0.6251665353775024,
0.5289311408996582,
-1.155427098274231,
0.7494387030601501,
-0.5016531944274902,
1.1256968975067139,
0.912860095500946,
-0.8486778736114502,
0.08737094700336456,
1.46721351146698,
0.4714406728744507,
-0.4785189926624298,
-0.9695469737052917,
-0.8716859221458435,
0.9307190179824829,
1.7007472515106201,
-0.09246991574764252,
-0.0001850603148341179,
0.843869149684906,
0.6579611897468567,
-1.1868221759796143,
0.014184909872710705,
-0.7070519328117371,
-0.6657832264900208,
1.718729019165039,
2.0276565551757812,
-0.11396273970603943,
-0.17741209268569946,
-0.6993914246559143,
-1.296041488647461,
0.768914520740509,
-0.05802198126912117,
0.04879220202565193,
0.6817981600761414,
-0.6841149926185608,
1.0759061574935913,
0.6366366147994995,
1.0088295936584473,
-0.03053666278719902,
0.3324257731437683,
0.38160136342048645,
-0.3339870274066925,
-1.1721421480178833,
-0.31396913528442383,
-1.1035075187683105,
-2.5225446224212646,
0.34296169877052307,
-0.3139747977256775,
-1.4831258058547974,
0.04636179655790329,
-1.039086937904358,
0.8912487626075745,
-0.5891261100769043,
-1.1756796836853027,
-1.4256209135055542,
0.30203527212142944,
-0.07858928292989731,
0.9019178152084351,
-1.675838589668274,
-0.19372312724590302,
1.2091847658157349,
0.8006079792976379,
-0.6298615336418152,
0.9456217288970947,
0.2535480558872223,
0.9435853958129883,
0.7360251545906067,
-0.4179001450538635,
0.6063416004180908,
-0.014734583906829357,
-1.339272141456604,
0.41174960136413574,
1.2505861520767212,
0.1446070671081543,
1.3387415409088135,
-0.4389304220676422,
0.11060859262943268,
0.43081337213516235,
-0.714762806892395,
-0.5289872288703918,
-0.4152678847312927,
0.7504098415374756,
-0.05745687708258629,
-1.0041910409927368,
-0.13103549182415009,
-0.0733933076262474,
-0.33421555161476135,
0.22765380144119263,
-1.438309669494629,
-0.2788470983505249,
-0.3862304389476776,
-0.42642486095428467,
-1.3982861042022705,
0.07357686012983322,
1.3202334642410278,
-0.786359429359436,
-0.1829538494348526,
0.40091630816459656,
0.3915846347808838,
0.5670870542526245,
0.5600022077560425,
-0.7937279939651489,
-0.21903887391090393,
-0.37339839339256287,
-0.2570042014122009,
0.2909316420555115,
1.2499732971191406,
-0.06421593576669693,
-1.014153242111206,
0.6577205061912537,
-0.3111628293991089,
0.127702534198761,
2.023564577102661,
0.014022025279700756,
-0.6382299661636353,
0.3508526086807251,
-0.7327573299407959,
1.6969659328460693,
1.76676607131958,
1.3192230463027954,
-0.10454989224672318,
-0.8074628710746765,
0.5042997598648071,
-0.29565876722335815,
-0.3182642459869385,
0.896192193031311,
0.3882577121257782,
-0.2581180930137634,
-1.4081798791885376,
0.6763820052146912,
1.264582872390747,
-0.7347080111503601,
-0.7380677461624146,
0.10056381672620773,
-0.9111645221710205,
1.2455201148986816,
0.5539799928665161,
0.33618515729904175,
0.3019528388977051,
1.549829125404358,
0.7465805411338806,
-0.4286216199398041,
0.5302892923355103,
0.5942984819412231,
-0.2602745592594147,
-2.150789976119995,
-1.0598487854003906,
0.28756240010261536,
-0.3914940357208252,
-1.5932414531707764,
1.3913499116897583,
-1.1417436599731445,
-1.0601717233657837,
0.5233217477798462,
0.09970254451036453,
1.3288530111312866,
0.3410748243331909,
1.6773431301116943,
2.1803064346313477,
0.9274532794952393,
0.42420080304145813,
1.2161298990249634,
-0.10872869938611984,
-0.48519226908683777,
1.8634175062179565,
-0.41679179668426514,
0.48918595910072327,
1.0245552062988281,
-0.37453949451446533,
-1.1579047441482544,
-0.848176896572113,
-1.1202253103256226,
-0.6354432702064514,
1.1511194705963135,
0.08388150483369827,
-1.0493990182876587,
0.193950816988945,
1.5831869840621948,
0.15490089356899261,
-0.24218279123306274,
0.6392329931259155,
0.38383933901786804,
-0.7435729503631592,
-0.11138055473566055,
-0.8600850701332092,
0.5202860236167908,
-0.18235145509243011,
-0.2860112190246582,
0.22305214405059814,
0.5356884598731995,
1.2696770429611206,
-0.060927923768758774,
0.146917462348938,
1.1325594186782837,
-1.4270869493484497,
1.5384562015533447,
-0.6097989678382874,
0.3589344918727875,
-2.439312219619751,
1.3970352411270142,
-0.7624219059944153,
1.974752426147461,
-2.5650482177734375,
0.4457353353500366,
-0.5082001686096191,
-0.5384224653244019,
0.2895660400390625,
-0.4278545677661896,
0.02544531598687172,
-0.08543381094932556,
-0.9643197655677795,
0.004195867106318474,
-0.7473882436752319,
0.617041289806366,
1.1309973001480103,
1.4402010440826416,
-1.171016812324524,
-0.3408711850643158,
-1.6723884344100952,
-0.19813719391822815,
-0.8378684520721436,
0.3319569528102875,
-1.9903836250305176,
-0.19068178534507751,
-2.008035182952881,
-2.310011625289917,
-1.3336607217788696,
-0.8913440108299255,
1.069360613822937,
0.17361876368522644,
-0.8926003575325012,
1.170094609260559,
-0.3617924451828003,
-1.8817938566207886,
1.2063695192337036,
-2.163064479827881
] |
https://github.com/huggingface/datasets/issues/5044 | integrate `load_from_disk` into `load_dataset` | @lhoestq Let me know if you have further recommendations or anything that you would like to add but you don't have bandwith for. | **Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you! | 502 | 23 | integrate `load_from_disk` into `load_dataset`
**Is your feature request related to a problem? Please describe.**
Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types?
Currently one has to choose a different loader depending on how the dataset has been created.
e.g. this won't work:
```
$ git clone https://huggingface.co/datasets/severo/test-parquet
$ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \
ds.save_to_disk("my_dataset"); load_dataset("my_dataset")'
[...]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
_data_files: list<item: struct<filename: string>>
child 0, item: struct<filename: string>
child 0, filename: string
```
both times the dataset is being loaded from disk. Why does it fail the second time?
Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`?
e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally.
The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth.
Thank you!
@lhoestq Let me know if you have further recommendations or anything that you would like to add but you don't have bandwith for. | [
-1.2368111610412598,
-0.9566577076911926,
-0.6736604571342468,
1.4294203519821167,
-0.09253088384866714,
-1.322953701019287,
0.11907912790775299,
-1.0474250316619873,
1.5526111125946045,
-0.7530148029327393,
0.21871532499790192,
-1.6522216796875,
-0.09012339264154434,
-0.468554824590683,
-0.7082620859146118,
-0.8880060911178589,
-0.4406410753726959,
-0.8833104968070984,
1.0627145767211914,
2.445392608642578,
1.3473459482192993,
-1.3577944040298462,
2.7455873489379883,
0.6628885865211487,
-0.21631847321987152,
-1.0362943410873413,
0.4900558292865753,
0.05376153439283371,
-1.1928752660751343,
-0.40062272548675537,
-0.9028421640396118,
-0.02810264751315117,
-0.5376821756362915,
-0.45453131198883057,
0.09722567349672318,
0.5136123895645142,
-0.3182358145713806,
-0.33318400382995605,
-0.6653363108634949,
-0.7159247398376465,
0.5230942964553833,
-0.3078800141811371,
0.9219244122505188,
-0.34657880663871765,
1.739990234375,
-0.6195850968360901,
0.42881321907043457,
0.7447794675827026,
1.263422966003418,
0.16434581577777863,
0.09210231900215149,
0.2464314103126526,
0.3368269205093384,
-0.017151126638054848,
0.6057765483856201,
1.259972095489502,
0.6199043989181519,
0.54071444272995,
0.6957834959030151,
-2.226925849914551,
1.31244695186615,
-0.9129303097724915,
0.2843727171421051,
1.3266980648040771,
-0.8408970236778259,
0.331648051738739,
-1.8569433689117432,
-0.07804972678422928,
0.6257495880126953,
-2.241555690765381,
0.25032609701156616,
-1.2381314039230347,
-0.5423586964607239,
0.8975887894630432,
0.3525848686695099,
-1.1667248010635376,
0.22250297665596008,
-0.49368923902511597,
1.111596703529358,
0.47337549924850464,
1.1213810443878174,
-1.6573283672332764,
0.006261897273361683,
-0.14636534452438354,
0.10993416607379913,
-1.302794098854065,
-1.6617940664291382,
0.5750330090522766,
0.5192688703536987,
0.7027649879455566,
-0.10111607611179352,
0.9686384797096252,
-1.0953726768493652,
0.8477665185928345,
-1.0402253866195679,
-1.5468188524246216,
-1.396148443222046,
-2.4126665592193604,
-2.2963247299194336,
0.8045496940612793,
-0.5414470434188843,
-0.5674599409103394,
2.0167810916900635,
-0.9928927421569824,
-1.7664395570755005,
1.0941548347473145,
0.2802952826023102,
0.11410538107156754,
2.382859230041504,
0.20418637990951538,
-0.7821393609046936,
0.5261449813842773,
-0.723749577999115,
0.8351815342903137,
-0.2847801148891449,
1.2675474882125854,
0.5303447246551514,
-1.0169727802276611,
1.5991222858428955,
-0.47853970527648926,
0.6640898585319519,
-0.616024374961853,
-0.5644786357879639,
-0.7819786071777344,
0.2896217703819275,
1.8909369707107544,
-0.2685542106628418,
1.6144664287567139,
-0.34376299381256104,
-1.554506778717041,
-1.5678215026855469,
0.8347786664962769,
0.49729612469673157,
-0.8328254222869873,
0.04861554130911827,
-0.5057522058486938,
0.18773610889911652,
0.01139479037374258,
1.1417449712753296,
1.2401772737503052,
0.7420031428337097,
-0.35851240158081055,
-0.8232718706130981,
0.18382681906223297,
-0.12842068076133728,
-0.6256245374679565,
-1.8289676904678345,
-0.27315375208854675,
0.21212726831436157,
0.5952417850494385,
-1.2215301990509033,
1.8280231952667236,
0.8900435566902161,
2.0456981658935547,
0.9616069197654724,
-0.32306554913520813,
1.4383821487426758,
0.0023360680788755417,
1.8718191385269165,
-0.46662354469299316,
0.6151379942893982,
-0.3705524504184723,
-1.1423505544662476,
0.8773482441902161,
-0.40759357810020447,
-2.001143455505371,
-0.8316943049430847,
-0.7951195240020752,
-0.1547715961933136,
-0.7267497181892395,
0.854455828666687,
-0.2874913513660431,
-1.5449808835983276,
0.09072376042604446,
-0.6371731758117676,
0.14363056421279907,
-1.2714201211929321,
0.20235750079154968,
0.7501402497291565,
-0.719541072845459,
-0.050510652363300323,
-0.26410791277885437,
-1.2659006118774414,
-0.4928829073905945,
0.37490713596343994,
2.0141334533691406,
-0.605954647064209,
0.8929566144943237,
1.0177044868469238,
-0.7550188302993774,
0.09702945500612259,
0.1697303205728531,
-0.2877553105354309,
0.7151408791542053,
-1.0974140167236328,
-0.4219869375228882,
1.1565159559249878,
-0.2377423346042633,
-0.7405074834823608,
1.4725772142410278,
0.7883156538009644,
-1.0854604244232178,
-0.24955491721630096,
-0.23234951496124268,
-0.9062501788139343,
-0.07507473975419998,
-1.4753082990646362,
-0.18662384152412415,
0.35265108942985535,
-1.4613510370254517,
-0.3707147538661957,
-0.18466924130916595,
1.3298265933990479,
-0.2506585419178009,
1.4489085674285889,
-0.3347262442111969,
-0.158110573887825,
-0.26741117238998413,
-0.4962214231491089,
0.1710558384656906,
-0.20083291828632355,
-0.6243765950202942,
0.15909838676452637,
-0.7970317006111145,
0.2674734890460968,
1.5180437564849854,
0.36394667625427246,
0.09483712911605835,
0.46480822563171387,
1.1005908250808716,
0.4051685631275177,
-0.041469380259513855,
-0.8363662362098694,
-1.5084245204925537,
1.9325515031814575,
-1.4361414909362793,
1.9234730005264282,
0.7226538062095642,
-0.08537127822637558,
-1.7830071449279785,
-1.8301845788955688,
1.2299408912658691,
1.1470897197723389,
2.388245105743408,
0.4844253659248352,
0.37237048149108887,
-0.7878141403198242,
-0.7640656232833862,
0.29581785202026367,
-0.9797528386116028,
-0.6368696093559265,
0.12650704383850098,
2.3382370471954346,
1.814876675605774,
-0.5758905410766602,
-0.276104211807251,
-0.8438786864280701,
1.311774492263794,
-0.25410112738609314,
0.32747918367385864,
2.084606409072876,
-0.3227538466453552,
-0.9503954648971558,
1.3852232694625854,
-2.3913607597351074,
0.27669399976730347,
2.075505495071411,
0.29748284816741943,
0.13231970369815826,
-1.4217106103897095,
-0.5869870781898499,
-0.30662381649017334,
-0.4939582645893097,
-1.2823214530944824,
0.5478883385658264,
-0.3164912462234497,
-0.8439218997955322,
-1.4334864616394043,
0.03319057449698448,
-1.1367592811584473,
-1.7238171100616455,
0.347244530916214,
1.9557124376296997,
2.0507991313934326,
-0.7949667572975159,
1.3673686981201172,
-0.2658732831478119,
0.03483559563755989,
1.328687310218811,
1.3073617219924927,
3.0547096729278564,
1.9140939712524414,
-1.2698349952697754,
0.7275676131248474,
-0.2401629537343979,
-0.5266799330711365,
1.1759086847305298,
-1.150234580039978,
1.087173342704773,
-0.1820487231016159,
-1.1685155630111694,
-1.238223671913147,
1.0681016445159912,
0.5047052502632141,
0.004578244872391224,
-0.5058557987213135,
1.2802214622497559,
0.13793498277664185,
1.3421874046325684,
0.5733792185783386,
-0.47338664531707764,
0.5592487454414368,
-0.39166074991226196,
-0.6210359930992126,
1.635934829711914,
0.1731005609035492,
-1.5703271627426147,
-2.28857159614563,
-0.26316049695014954,
-0.9588292837142944,
-0.043938182294368744,
-0.6089185476303101,
-0.9542418122291565,
1.64696204662323,
0.38252952694892883,
-1.2318572998046875,
-0.23340056836605072,
-0.3134361505508423,
-0.5165207982063293,
2.6683952808380127,
-1.2919135093688965,
-0.1429888755083084,
-0.957486093044281,
-0.5440170168876648,
1.6480376720428467,
-1.2427517175674438,
-0.2922331392765045,
-1.011005163192749,
-0.604053795337677,
-1.2814985513687134,
-0.47215670347213745,
0.010213411413133144,
-0.9622669219970703,
0.7869582772254944,
0.17828920483589172,
-1.1230021715164185,
-0.3115086853504181,
-0.8659565448760986,
1.0321298837661743,
-0.0980345755815506,
0.2547631859779358,
1.907733678817749,
0.2684917747974396,
-0.4577524662017822,
0.7219860553741455,
1.2417802810668945,
0.5793787837028503,
-0.63218092918396,
0.03980468586087227,
-0.6247487664222717,
0.3824189007282257,
-1.3993680477142334,
0.19745168089866638,
-2.9640703201293945,
0.7686999440193176,
-0.15760010480880737,
-0.15399324893951416,
-0.10745379328727722,
-1.3538165092468262,
1.0612051486968994,
2.6074321269989014,
-1.1706963777542114,
0.48625925183296204,
0.47205543518066406,
1.133658528327942,
-1.6099504232406616,
0.287418007850647,
-0.5142414569854736,
2.031412363052368,
0.17101794481277466,
1.2213016748428345,
-0.5430073738098145,
-2.1951377391815186,
0.6227321624755859,
-1.1659969091415405,
-1.056625247001648,
0.7957459092140198,
-0.9314953088760376,
0.3655675947666168,
-1.4219081401824951,
-0.17768527567386627,
-0.9597228169441223,
-1.2236013412475586,
0.6814370155334473,
0.12333683669567108,
0.38872984051704407,
-0.6130935549736023,
0.3722786009311676,
-2.196413040161133,
-1.432246208190918,
-0.21573315560817719,
-1.0074009895324707,
0.5383659601211548,
-0.4353821575641632,
0.5336403846740723,
-0.04506795480847359,
0.145808145403862,
0.24794885516166687,
1.4641740322113037,
3.392477512359619,
0.13999566435813904,
0.16914904117584229,
-0.11410988867282867,
-1.0267817974090576,
1.5546706914901733,
0.8840750455856323,
-0.09530661255121231,
-0.5533612966537476,
-1.030470371246338,
1.279847502708435,
1.9902560710906982,
1.1560871601104736,
0.08039648085832596,
-0.7779106497764587,
-0.7723942399024963,
0.0433344691991806,
0.15254095196723938,
0.5037966966629028,
0.9707068800926208,
-0.026234589517116547,
0.1472465544939041,
1.3580104112625122,
1.184930682182312,
-0.27612635493278503,
0.37635865807533264,
-0.9767671823501587,
-0.41591161489486694,
0.37187156081199646,
0.23891861736774445,
0.05067222937941551,
0.46414655447006226,
-1.0551190376281738,
-0.2776380479335785,
-0.2840326130390167,
-0.8110015988349915,
-0.7286255359649658,
-0.38591527938842773,
-0.42650654911994934,
1.601449728012085,
0.0907512679696083,
-0.5113089680671692,
0.060971036553382874,
-0.706699013710022,
-0.10522135347127914,
-1.1240626573562622,
0.18804283440113068,
-0.07557587325572968,
-0.11374565958976746,
-0.13416777551174164,
1.6331801414489746,
-0.9037314057350159,
-2.122485876083374,
0.20381246507167816,
0.3111806809902191,
-0.33225488662719727,
0.14068444073200226,
1.7116022109985352,
0.48157644271850586,
1.3927967548370361,
1.3381754159927368,
0.966447114944458,
-0.5875483751296997,
-1.2186223268508911,
0.7166739702224731,
0.8738484382629395,
-1.3835837841033936,
0.9487284421920776,
-0.16755038499832153,
-0.4860350489616394,
0.6483235955238342,
1.3283636569976807,
0.45204105973243713,
-2.020250082015991,
0.9078642129898071,
-0.9174640774726868,
0.7658008337020874,
0.7327654957771301,
0.7604188919067383,
0.23586726188659668,
0.8984220027923584,
-1.1571838855743408,
-1.2040343284606934,
-0.7165404558181763,
-0.6836169958114624,
1.8520526885986328,
-0.2877444624900818,
0.6201133131980896,
-0.17964836955070496,
-1.1565055847167969,
-0.10834110528230667,
0.8265041708946228,
0.3915356397628784,
-0.41395899653434753,
0.9022486209869385,
-0.599479079246521,
-0.9834952354431152,
-1.2620172500610352,
-0.3818317651748657,
-1.0662966966629028,
-0.8255437016487122,
0.9971213340759277,
0.8064308166503906,
0.48005327582359314,
1.9332057237625122,
0.6469602584838867,
0.37482109665870667,
-2.660787582397461,
0.8481014370918274,
0.2568887174129486,
-0.019398408010601997,
0.8397889733314514,
0.28512337803840637,
1.146006464958191,
0.003290231339633465,
0.5939971804618835,
-2.3626325130462646,
2.2531654834747314,
-0.20349949598312378,
0.6194139719009399,
0.012005449272692204,
-0.1937282532453537,
1.128371238708496,
0.6251665353775024,
0.5289311408996582,
-1.155427098274231,
0.7494387030601501,
-0.5016531944274902,
1.1256968975067139,
0.912860095500946,
-0.8486778736114502,
0.08737094700336456,
1.46721351146698,
0.4714406728744507,
-0.4785189926624298,
-0.9695469737052917,
-0.8716859221458435,
0.9307190179824829,
1.7007472515106201,
-0.09246991574764252,
-0.0001850603148341179,
0.843869149684906,
0.6579611897468567,
-1.1868221759796143,
0.014184909872710705,
-0.7070519328117371,
-0.6657832264900208,
1.718729019165039,
2.0276565551757812,
-0.11396273970603943,
-0.17741209268569946,
-0.6993914246559143,
-1.296041488647461,
0.768914520740509,
-0.05802198126912117,
0.04879220202565193,
0.6817981600761414,
-0.6841149926185608,
1.0759061574935913,
0.6366366147994995,
1.0088295936584473,
-0.03053666278719902,
0.3324257731437683,
0.38160136342048645,
-0.3339870274066925,
-1.1721421480178833,
-0.31396913528442383,
-1.1035075187683105,
-2.5225446224212646,
0.34296169877052307,
-0.3139747977256775,
-1.4831258058547974,
0.04636179655790329,
-1.039086937904358,
0.8912487626075745,
-0.5891261100769043,
-1.1756796836853027,
-1.4256209135055542,
0.30203527212142944,
-0.07858928292989731,
0.9019178152084351,
-1.675838589668274,
-0.19372312724590302,
1.2091847658157349,
0.8006079792976379,
-0.6298615336418152,
0.9456217288970947,
0.2535480558872223,
0.9435853958129883,
0.7360251545906067,
-0.4179001450538635,
0.6063416004180908,
-0.014734583906829357,
-1.339272141456604,
0.41174960136413574,
1.2505861520767212,
0.1446070671081543,
1.3387415409088135,
-0.4389304220676422,
0.11060859262943268,
0.43081337213516235,
-0.714762806892395,
-0.5289872288703918,
-0.4152678847312927,
0.7504098415374756,
-0.05745687708258629,
-1.0041910409927368,
-0.13103549182415009,
-0.0733933076262474,
-0.33421555161476135,
0.22765380144119263,
-1.438309669494629,
-0.2788470983505249,
-0.3862304389476776,
-0.42642486095428467,
-1.3982861042022705,
0.07357686012983322,
1.3202334642410278,
-0.786359429359436,
-0.1829538494348526,
0.40091630816459656,
0.3915846347808838,
0.5670870542526245,
0.5600022077560425,
-0.7937279939651489,
-0.21903887391090393,
-0.37339839339256287,
-0.2570042014122009,
0.2909316420555115,
1.2499732971191406,
-0.06421593576669693,
-1.014153242111206,
0.6577205061912537,
-0.3111628293991089,
0.127702534198761,
2.023564577102661,
0.014022025279700756,
-0.6382299661636353,
0.3508526086807251,
-0.7327573299407959,
1.6969659328460693,
1.76676607131958,
1.3192230463027954,
-0.10454989224672318,
-0.8074628710746765,
0.5042997598648071,
-0.29565876722335815,
-0.3182642459869385,
0.896192193031311,
0.3882577121257782,
-0.2581180930137634,
-1.4081798791885376,
0.6763820052146912,
1.264582872390747,
-0.7347080111503601,
-0.7380677461624146,
0.10056381672620773,
-0.9111645221710205,
1.2455201148986816,
0.5539799928665161,
0.33618515729904175,
0.3019528388977051,
1.549829125404358,
0.7465805411338806,
-0.4286216199398041,
0.5302892923355103,
0.5942984819412231,
-0.2602745592594147,
-2.150789976119995,
-1.0598487854003906,
0.28756240010261536,
-0.3914940357208252,
-1.5932414531707764,
1.3913499116897583,
-1.1417436599731445,
-1.0601717233657837,
0.5233217477798462,
0.09970254451036453,
1.3288530111312866,
0.3410748243331909,
1.6773431301116943,
2.1803064346313477,
0.9274532794952393,
0.42420080304145813,
1.2161298990249634,
-0.10872869938611984,
-0.48519226908683777,
1.8634175062179565,
-0.41679179668426514,
0.48918595910072327,
1.0245552062988281,
-0.37453949451446533,
-1.1579047441482544,
-0.848176896572113,
-1.1202253103256226,
-0.6354432702064514,
1.1511194705963135,
0.08388150483369827,
-1.0493990182876587,
0.193950816988945,
1.5831869840621948,
0.15490089356899261,
-0.24218279123306274,
0.6392329931259155,
0.38383933901786804,
-0.7435729503631592,
-0.11138055473566055,
-0.8600850701332092,
0.5202860236167908,
-0.18235145509243011,
-0.2860112190246582,
0.22305214405059814,
0.5356884598731995,
1.2696770429611206,
-0.060927923768758774,
0.146917462348938,
1.1325594186782837,
-1.4270869493484497,
1.5384562015533447,
-0.6097989678382874,
0.3589344918727875,
-2.439312219619751,
1.3970352411270142,
-0.7624219059944153,
1.974752426147461,
-2.5650482177734375,
0.4457353353500366,
-0.5082001686096191,
-0.5384224653244019,
0.2895660400390625,
-0.4278545677661896,
0.02544531598687172,
-0.08543381094932556,
-0.9643197655677795,
0.004195867106318474,
-0.7473882436752319,
0.617041289806366,
1.1309973001480103,
1.4402010440826416,
-1.171016812324524,
-0.3408711850643158,
-1.6723884344100952,
-0.19813719391822815,
-0.8378684520721436,
0.3319569528102875,
-1.9903836250305176,
-0.19068178534507751,
-2.008035182952881,
-2.310011625289917,
-1.3336607217788696,
-0.8913440108299255,
1.069360613822937,
0.17361876368522644,
-0.8926003575325012,
1.170094609260559,
-0.3617924451828003,
-1.8817938566207886,
1.2063695192337036,
-2.163064479827881
] |
https://github.com/huggingface/datasets/issues/5038 | `Dataset.unique` showing wrong output after filtering | Hi! It seems like `flatten_indices` (called in `unique`) doesn't know how to handle empty indices mappings. I'm working on the fix. | ## Describe the bug
After filtering a dataset, and if no samples remain, `Dataset.unique` will return the unique values of the unfiltered dataset.
## Steps to reproduce the bug
```python
from datasets import Dataset
dataset = Dataset.from_dict({'id': [0]})
dataset = dataset.filter(lambda _: False)
print(dataset.unique('id'))
```
## Expected results
The above code should return an empty list since the dataset is empty.
## Actual results
```bash
[0]
```
## Environment info
- `datasets` version: 2.5.1
- Platform: Linux-5.18.19-100.fc35.x86_64-x86_64-with-glibc2.34
- Python version: 3.9.14
- PyArrow version: 7.0.0
- Pandas version: 1.3.5 | 504 | 21 | `Dataset.unique` showing wrong output after filtering
## Describe the bug
After filtering a dataset, and if no samples remain, `Dataset.unique` will return the unique values of the unfiltered dataset.
## Steps to reproduce the bug
```python
from datasets import Dataset
dataset = Dataset.from_dict({'id': [0]})
dataset = dataset.filter(lambda _: False)
print(dataset.unique('id'))
```
## Expected results
The above code should return an empty list since the dataset is empty.
## Actual results
```bash
[0]
```
## Environment info
- `datasets` version: 2.5.1
- Platform: Linux-5.18.19-100.fc35.x86_64-x86_64-with-glibc2.34
- Python version: 3.9.14
- PyArrow version: 7.0.0
- Pandas version: 1.3.5
Hi! It seems like `flatten_indices` (called in `unique`) doesn't know how to handle empty indices mappings. I'm working on the fix. | [
-1.1624630689620972,
-0.8202643990516663,
-0.7210966944694519,
1.4270153045654297,
-0.1878630369901657,
-1.2767525911331177,
0.20307107269763947,
-1.0123387575149536,
1.7729997634887695,
-0.8759389519691467,
0.2788302004337311,
-1.6923446655273438,
0.02458103373646736,
-0.5736548900604248,
-0.7509582042694092,
-0.91646409034729,
-0.36872828006744385,
-0.5858399868011475,
1.0167661905288696,
2.42631196975708,
1.1132205724716187,
-1.3320726156234741,
2.6677303314208984,
0.7497482895851135,
-0.1583389937877655,
-1.0109140872955322,
0.5782614350318909,
0.06008082628250122,
-1.404300332069397,
-0.31057628989219666,
-0.9486738443374634,
-0.032324016094207764,
-0.5644017457962036,
-0.6772308945655823,
-0.03616595268249512,
0.40280598402023315,
-0.36188820004463196,
-0.5530845522880554,
-0.4056866765022278,
-0.8691179156303406,
0.3807675838470459,
-0.3352622985839844,
0.9285017848014832,
-0.4372865855693817,
1.8100929260253906,
-0.5685986280441284,
0.40803655982017517,
0.7219378352165222,
1.3358553647994995,
0.20417143404483795,
-0.06188616156578064,
0.41184762120246887,
0.4256625771522522,
0.1399669051170349,
0.47228163480758667,
1.0638154745101929,
0.6227068305015564,
0.4148233234882355,
0.7372324466705322,
-2.234478712081909,
1.2880207300186157,
-0.9980663657188416,
0.29580503702163696,
1.2970008850097656,
-1.0550427436828613,
0.2742480933666229,
-1.678269863128662,
-0.04894912615418434,
0.5116437673568726,
-2.263517379760742,
0.2240043729543686,
-1.3615564107894897,
-0.4658886194229126,
1.0246829986572266,
0.4599184989929199,
-1.1651042699813843,
0.011690233834087849,
-0.3765125274658203,
0.9450671076774597,
0.44359317421913147,
1.1525824069976807,
-1.6457586288452148,
-0.07008512318134308,
-0.39320194721221924,
0.09012743830680847,
-1.2877284288406372,
-1.4662715196609497,
0.5033688545227051,
0.780132532119751,
0.610797643661499,
-0.18478091061115265,
0.9162213802337646,
-0.8895025849342346,
0.6390475034713745,
-0.9459743499755859,
-1.909957766532898,
-1.3766686916351318,
-2.20927095413208,
-2.3555502891540527,
0.7504181861877441,
-0.38713979721069336,
-0.4924772381782532,
2.0952200889587402,
-1.0485424995422363,
-1.8977141380310059,
1.1250170469284058,
0.24355517327785492,
-0.05648220703005791,
2.275859832763672,
0.17459452152252197,
-0.7215312123298645,
0.4909358024597168,
-0.7917262315750122,
0.6668895483016968,
-0.40888097882270813,
1.3466849327087402,
0.41483041644096375,
-1.0670069456100464,
1.574806571006775,
-0.3677179217338562,
0.6196240186691284,
-0.7086045145988464,
-0.42544740438461304,
-0.74786376953125,
0.24764998257160187,
1.96151602268219,
-0.29008224606513977,
1.5008726119995117,
-0.3036060035228729,
-1.5547175407409668,
-1.4990736246109009,
0.7787970900535583,
0.5216864347457886,
-0.6542121767997742,
0.14293015003204346,
-0.29559341073036194,
0.14365534484386444,
-0.04777355492115021,
1.1575450897216797,
1.209337592124939,
0.7854049205780029,
-0.32527658343315125,
-0.9357947707176208,
0.2631493806838989,
-0.036429617553949356,
-0.7122673392295837,
-1.8248740434646606,
-0.32231131196022034,
0.09297558665275574,
0.6941788196563721,
-1.1557981967926025,
1.6992744207382202,
0.8051748275756836,
1.8443470001220703,
1.0492242574691772,
-0.3046703338623047,
1.4517662525177002,
0.08975468575954437,
1.9312365055084229,
-0.4350048303604126,
0.7372625470161438,
-0.3902043104171753,
-1.1514495611190796,
0.7884986996650696,
-0.27612045407295227,
-2.0534794330596924,
-0.6728049516677856,
-0.9153667092323303,
-0.07730542868375778,
-0.7384379506111145,
1.015537977218628,
-0.31235799193382263,
-1.4194393157958984,
0.24658994376659393,
-0.760002076625824,
0.16073918342590332,
-1.2957484722137451,
0.2905064523220062,
0.7492058873176575,
-0.5848015546798706,
0.07698206603527069,
-0.34405845403671265,
-1.3638529777526855,
-0.4931335151195526,
0.3347887098789215,
1.7703438997268677,
-0.882081151008606,
1.005663275718689,
0.9695683717727661,
-0.7339282631874084,
-0.0066221123561263084,
0.3825627863407135,
-0.2824825644493103,
0.907071053981781,
-1.0904628038406372,
-0.3892063796520233,
1.2586777210235596,
-0.19229350984096527,
-0.6170688271522522,
1.5096455812454224,
0.7390369772911072,
-0.9119802713394165,
-0.07348383963108063,
-0.17977946996688843,
-0.7995965480804443,
0.03851597011089325,
-1.6949362754821777,
-0.13305146992206573,
0.3489544987678528,
-1.5156710147857666,
-0.516455888748169,
-0.15445154905319214,
1.263817310333252,
-0.08877500146627426,
1.338707685470581,
-0.254987895488739,
-0.28112754225730896,
-0.4772575795650482,
-0.367929071187973,
0.14921829104423523,
-0.19309304654598236,
-0.606741189956665,
0.3010641932487488,
-0.7621546387672424,
0.29869961738586426,
1.3417720794677734,
0.33818694949150085,
0.03007587417960167,
0.6864837408065796,
1.0632076263427734,
0.25018560886383057,
-0.15903669595718384,
-0.848752498626709,
-1.6668740510940552,
2.044778823852539,
-1.382327914237976,
1.9133039712905884,
0.5980205535888672,
-0.012114736251533031,
-1.800872564315796,
-1.953465461730957,
1.4413193464279175,
1.0577905178070068,
2.3167402744293213,
0.624921441078186,
0.41478022933006287,
-0.8505918383598328,
-0.6255641579627991,
0.2758729159832001,
-0.9656403064727783,
-0.783708930015564,
0.1372678577899933,
2.4239044189453125,
1.674420714378357,
-0.4634273052215576,
-0.12354206293821335,
-1.1632014513015747,
1.4525538682937622,
-0.19681355357170105,
0.26664891839027405,
1.960464358329773,
-0.3057916462421417,
-1.054900050163269,
1.2364016771316528,
-2.315114736557007,
0.15207946300506592,
1.9918285608291626,
0.17626383900642395,
0.06960656493902206,
-1.3906155824661255,
-0.7519214153289795,
-0.21755005419254303,
-0.388053834438324,
-1.231236219406128,
0.5325348377227783,
-0.2149241417646408,
-0.7762424349784851,
-1.4188554286956787,
0.21165324747562408,
-1.0056147575378418,
-1.697316288948059,
0.254080206155777,
1.845895528793335,
1.9616332054138184,
-0.6852381825447083,
1.6065551042556763,
-0.2515750527381897,
0.34476083517074585,
1.2983531951904297,
1.093084692955017,
3.178900718688965,
2.0074124336242676,
-1.3298537731170654,
0.8049849271774292,
0.019117701798677444,
-0.413617342710495,
1.3173766136169434,
-1.2239092588424683,
1.249230146408081,
-0.2023927867412567,
-1.2318617105484009,
-1.2999151945114136,
0.8598212599754333,
0.445465624332428,
0.04329071193933487,
-0.4732937812805176,
1.2235462665557861,
-0.06278432160615921,
1.3298286199569702,
0.5578399896621704,
-0.30533090233802795,
0.713083803653717,
-0.4427419602870941,
-0.42422086000442505,
1.5302350521087646,
0.23927970230579376,
-1.3392044305801392,
-2.3152389526367188,
-0.24867822229862213,
-0.7886205911636353,
-0.017051327973604202,
-0.5569109916687012,
-0.9518736600875854,
1.6444425582885742,
0.4410690367221832,
-1.1834510564804077,
-0.2463214099407196,
-0.31829941272735596,
-0.6232408881187439,
2.702631950378418,
-1.4143118858337402,
-0.26289618015289307,
-1.0023419857025146,
-0.6548113822937012,
1.6514679193496704,
-1.2251317501068115,
-0.20678028464317322,
-1.0533087253570557,
-0.541036069393158,
-1.3896743059158325,
-0.5916236042976379,
-0.09083034098148346,
-0.901792585849762,
0.8832085728645325,
0.15049393475055695,
-1.2096458673477173,
-0.313445508480072,
-0.9424676895141602,
0.8325700163841248,
-0.10474643856287003,
0.20837295055389404,
1.876427173614502,
0.5252383947372437,
-0.32535606622695923,
0.6635509729385376,
1.0953032970428467,
0.6646699905395508,
-0.6805828809738159,
0.3796500861644745,
-0.7113566398620605,
0.25475528836250305,
-1.3308149576187134,
0.26985689997673035,
-2.7983546257019043,
0.5903533697128296,
-0.06277003884315491,
-0.026416033506393433,
-0.05755480006337166,
-1.2710466384887695,
1.0667744874954224,
2.551331043243408,
-1.270935297012329,
0.48197296261787415,
0.2162865847349167,
1.1977211236953735,
-1.5418438911437988,
0.31210485100746155,
-0.45757001638412476,
2.1743698120117188,
0.24529777467250824,
1.1977736949920654,
-0.37270885705947876,
-2.2638227939605713,
0.6585380434989929,
-1.2391910552978516,
-1.2134495973587036,
0.7963715195655823,
-0.7945374846458435,
0.07614199817180634,
-1.3620667457580566,
-0.1377047747373581,
-0.7979717254638672,
-1.2315163612365723,
0.7429221868515015,
0.10796176642179489,
0.501856803894043,
-0.619774341583252,
0.34346237778663635,
-2.138974666595459,
-1.266147494316101,
-0.26659277081489563,
-0.9351905584335327,
0.4358297288417816,
-0.22599853575229645,
0.7090542316436768,
-0.21248702704906464,
-0.058832548558712006,
0.37249642610549927,
1.3648300170898438,
3.402695417404175,
0.12922418117523193,
0.3000294268131256,
-0.08824842423200607,
-0.940198540687561,
1.3719803094863892,
0.9795161485671997,
-0.1891394555568695,
-0.5114374160766602,
-1.0647499561309814,
1.2276815176010132,
1.9174226522445679,
1.0182768106460571,
-0.0010784408077597618,
-0.7835491895675659,
-0.7702732682228088,
0.08441627025604248,
0.11035634577274323,
0.48758599162101746,
0.7797154784202576,
0.17080369591712952,
0.07512380927801132,
1.463399887084961,
1.1576063632965088,
-0.3145240247249603,
0.36291491985321045,
-0.9098459482192993,
-0.4944574236869812,
0.62821364402771,
0.4077799320220947,
-0.007755760569125414,
0.2618454694747925,
-1.1030664443969727,
-0.17653340101242065,
-0.3353646397590637,
-0.9093500971794128,
-0.6852908730506897,
-0.463715523481369,
-0.4015333652496338,
1.6456475257873535,
0.03448294475674629,
-0.5476800799369812,
-0.16604091227054596,
-0.7599315047264099,
0.019281592220067978,
-0.9620291590690613,
0.4377879798412323,
-0.23084892332553864,
-0.07423663884401321,
-0.07552545517683029,
1.735639214515686,
-0.9840288758277893,
-2.0669357776641846,
0.341234028339386,
0.1804257482290268,
-0.42031943798065186,
0.18275797367095947,
1.588438868522644,
0.6154956817626953,
1.415250301361084,
1.4514974355697632,
0.9746838808059692,
-0.6480597853660583,
-1.3336533308029175,
0.5831273794174194,
0.899604320526123,
-1.4515098333358765,
0.7377658486366272,
0.11364176124334335,
-0.5903719663619995,
0.6204553246498108,
1.2826834917068481,
0.43533241748809814,
-1.9708106517791748,
0.6820970177650452,
-0.8816250562667847,
0.6817237138748169,
0.7725988030433655,
0.7957937121391296,
0.09810122847557068,
0.8059889078140259,
-1.267325520515442,
-1.0889184474945068,
-0.7952685356140137,
-0.6584653854370117,
1.9337774515151978,
-0.2629029452800751,
0.5004966259002686,
-0.16610372066497803,
-1.3303471803665161,
-0.03929905220866203,
0.5852530002593994,
0.2993036210536957,
-0.5310198068618774,
0.7747665643692017,
-0.5837125778198242,
-1.1615315675735474,
-1.4077850580215454,
-0.49221041798591614,
-1.0732367038726807,
-0.9848580956459045,
0.9825662970542908,
0.8669744729995728,
0.3335857689380646,
1.811042308807373,
0.6622123718261719,
0.10877445340156555,
-2.6480815410614014,
0.8522509336471558,
0.24743588268756866,
0.004267280921339989,
0.7957384586334229,
0.2788163423538208,
0.9854200482368469,
-0.12319179624319077,
0.651995062828064,
-2.3432047367095947,
2.272507429122925,
-0.2887410819530487,
0.6014772057533264,
-0.024800024926662445,
-0.09264268726110458,
1.0304224491119385,
0.5166071057319641,
0.5995765328407288,
-1.0940115451812744,
0.7557249665260315,
-0.6705852746963501,
1.2922704219818115,
0.9005659818649292,
-0.8509304523468018,
-0.115183025598526,
1.334824800491333,
0.4922345280647278,
-0.45460954308509827,
-0.8881036639213562,
-1.0515342950820923,
0.9328436851501465,
1.7592087984085083,
-0.08272833377122879,
-0.043681949377059937,
0.9430921673774719,
0.682356595993042,
-1.3517950773239136,
0.033159609884023666,
-0.7773297429084778,
-0.6284750699996948,
1.6672272682189941,
2.007067918777466,
-0.08137118071317673,
-0.1410457044839859,
-0.8297944068908691,
-1.1928551197052002,
0.7589343786239624,
0.13354378938674927,
-0.029291197657585144,
0.8007311224937439,
-0.6058360934257507,
1.1409441232681274,
0.9300774335861206,
0.9060789942741394,
0.2556363344192505,
0.32414907217025757,
0.25902676582336426,
-0.23003625869750977,
-1.2854759693145752,
-0.25432389974594116,
-0.9643961191177368,
-2.465601682662964,
0.48092910647392273,
-0.2895776331424713,
-1.4415571689605713,
0.054166220128536224,
-1.1037688255310059,
0.9238321185112,
-0.5762438774108887,
-1.1183110475540161,
-1.4837433099746704,
0.1197720468044281,
-0.05180239677429199,
0.8517072796821594,
-1.5635627508163452,
0.058658890426158905,
1.3640683889389038,
0.9210484623908997,
-0.6677061915397644,
1.0721691846847534,
0.2975686192512512,
1.1006087064743042,
0.9313260316848755,
-0.338972806930542,
0.4397488832473755,
0.13664257526397705,
-1.3026131391525269,
0.5301900506019592,
1.1374526023864746,
0.19700367748737335,
1.514509916305542,
-0.6905676126480103,
-0.028940506279468536,
0.4111243784427643,
-0.44848743081092834,
-0.43829479813575745,
-0.6589928269386292,
0.7280415892601013,
0.10208333283662796,
-0.8120059967041016,
0.10016521066427231,
0.028799518942832947,
-0.14874371886253357,
0.25608137249946594,
-1.4858219623565674,
-0.1130170226097107,
-0.2618965804576874,
-0.703374445438385,
-1.136823296546936,
-0.09071754664182663,
1.3869268894195557,
-0.8049131035804749,
-0.10838542133569717,
0.5646518468856812,
0.2529425024986267,
0.5129805207252502,
0.6743704080581665,
-0.6344987750053406,
-0.36217013001441956,
-0.25338661670684814,
-0.40898919105529785,
0.3257213234901428,
1.361256718635559,
-0.0990653708577156,
-1.0153638124465942,
0.7877911925315857,
-0.3350231647491455,
0.04703903943300247,
1.926710605621338,
0.06509704142808914,
-0.9170741438865662,
0.2974979877471924,
-0.7448031306266785,
2.0345590114593506,
1.7288163900375366,
1.3689450025558472,
-0.04412991926074028,
-1.1090188026428223,
0.5179888606071472,
-0.24684223532676697,
-0.4488120675086975,
0.8841776251792908,
0.5248662829399109,
-0.18172213435173035,
-1.2133257389068604,
0.7259370684623718,
1.2693212032318115,
-0.9406066536903381,
-0.872768223285675,
0.15697656571865082,
-0.7607644200325012,
1.0375094413757324,
0.7709013819694519,
0.4005108177661896,
0.2617288827896118,
1.6318490505218506,
0.7240418195724487,
-0.44454437494277954,
0.5027238130569458,
0.5216750502586365,
-0.08935319632291794,
-2.018641710281372,
-1.1179513931274414,
0.3783056139945984,
-0.5277876853942871,
-1.6794294118881226,
1.336835503578186,
-1.1784064769744873,
-0.8340066075325012,
0.5365551114082336,
0.15487706661224365,
1.4937232732772827,
0.3436156213283539,
1.5964148044586182,
2.020308256149292,
0.9138036966323853,
0.3323836922645569,
1.354171633720398,
-0.1769903004169464,
-0.4521055817604065,
1.7058453559875488,
-0.41985970735549927,
0.5774809122085571,
1.1284526586532593,
-0.3289046585559845,
-1.0613027811050415,
-0.7793350219726562,
-1.2177890539169312,
-0.6681100726127625,
1.1508935689926147,
0.10354840010404587,
-1.2066622972488403,
0.26296889781951904,
1.5340198278427124,
0.08691918849945068,
-0.263435423374176,
0.6498218774795532,
0.30960071086883545,
-0.8482142686843872,
-0.04817834123969078,
-1.0263710021972656,
0.5352441072463989,
-0.24617663025856018,
-0.37414437532424927,
0.3167877793312073,
0.3920358121395111,
1.3268661499023438,
0.07197340577840805,
0.1318838894367218,
1.3061715364456177,
-1.3401576280593872,
1.464256763458252,
-0.7995519638061523,
0.27174660563468933,
-2.3598058223724365,
1.4217921495437622,
-0.9084744453430176,
1.8365737199783325,
-2.763478994369507,
0.44756394624710083,
-0.5242511630058289,
-0.42583853006362915,
0.25160616636276245,
-0.3667239844799042,
0.10518422722816467,
-0.14878103137016296,
-1.217972755432129,
-0.10995738953351974,
-0.8119046092033386,
0.5653850436210632,
1.2238447666168213,
1.3744186162948608,
-1.1328133344650269,
-0.3051701784133911,
-1.7893650531768799,
-0.188755065202713,
-0.6096847057342529,
0.47151264548301697,
-1.8989346027374268,
-0.10872296243906021,
-1.8425990343093872,
-2.5850110054016113,
-1.2880154848098755,
-0.8522929549217224,
1.0944294929504395,
0.060788534581661224,
-0.8471850156784058,
1.0753172636032104,
-0.3578603267669678,
-1.8636276721954346,
1.1594820022583008,
-2.2415945529937744
] |
https://github.com/huggingface/datasets/issues/5032 | new dataset type: single-label and multi-label video classification | Hi ! You can in the `features` folder how we implemented the audio and image feature types.
We can have something similar to videos. What we need to decide:
- the video loading library to use
- the output format when a user accesses a video type object
- what parameters a `Video()` feature type needs
also cc @nateraw who also took a look at what we can do for video | **Is your feature request related to a problem? Please describe.**
In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset.
**Describe the solution you'd like**
Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model.
**Describe alternatives you've considered**
Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative.
**Additional context**
I am wiling to open a PR but don't know where to start.
| 505 | 71 | new dataset type: single-label and multi-label video classification
**Is your feature request related to a problem? Please describe.**
In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset.
**Describe the solution you'd like**
Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model.
**Describe alternatives you've considered**
Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative.
**Additional context**
I am wiling to open a PR but don't know where to start.
Hi ! You can in the `features` folder how we implemented the audio and image feature types.
We can have something similar to videos. What we need to decide:
- the video loading library to use
- the output format when a user accesses a video type object
- what parameters a `Video()` feature type needs
also cc @nateraw who also took a look at what we can do for video | [
-1.2606819868087769,
-1.1024000644683838,
-0.8087985515594482,
1.3685153722763062,
-0.25051847100257874,
-1.3124406337738037,
0.12177862226963043,
-1.1149239540100098,
1.6233054399490356,
-0.8180714845657349,
0.2947046458721161,
-1.5646790266036987,
0.15922383964061737,
-0.5837748646736145,
-0.840187668800354,
-0.7658228278160095,
-0.4121929109096527,
-0.7975093126296997,
1.016836404800415,
2.5312724113464355,
1.1128795146942139,
-1.430443286895752,
2.6344425678253174,
0.6481879949569702,
-0.21291926503181458,
-1.0864973068237305,
0.43301230669021606,
0.13863542675971985,
-1.221906304359436,
-0.4369962811470032,
-0.9088883399963379,
-0.014724655076861382,
-0.6255074739456177,
-0.5951228737831116,
0.04942509904503822,
0.32574015855789185,
-0.1726013571023941,
-0.4113936722278595,
-0.5788231492042542,
-0.669065535068512,
0.48902228474617004,
-0.3501492440700531,
0.9641709923744202,
-0.3549329936504364,
1.7715009450912476,
-0.5919845104217529,
0.45722731947898865,
0.6529148817062378,
1.4757716655731201,
0.24695906043052673,
0.037641145288944244,
0.3069778382778168,
0.4664657711982727,
-0.07854601740837097,
0.44179144501686096,
1.1151198148727417,
0.5308085680007935,
0.4956197142601013,
0.7376337051391602,
-2.1670780181884766,
1.3065913915634155,
-1.040170669555664,
0.37735891342163086,
1.3478022813796997,
-0.9639067649841309,
0.39469894766807556,
-1.7428054809570312,
-0.11878819763660431,
0.5439922213554382,
-2.2747583389282227,
0.16876105964183807,
-1.266920804977417,
-0.5592734217643738,
0.9389965534210205,
0.25456395745277405,
-1.2980375289916992,
0.23590153455734253,
-0.4842359125614166,
0.980211079120636,
0.40414783358573914,
1.1232764720916748,
-1.6609503030776978,
-0.04040321335196495,
-0.2518397569656372,
0.18688440322875977,
-1.2299491167068481,
-1.5160109996795654,
0.5596185326576233,
0.6371361017227173,
0.46487048268318176,
-0.12926006317138672,
0.9383124113082886,
-1.0410557985305786,
0.9878922700881958,
-1.017490029335022,
-1.620029091835022,
-1.4560818672180176,
-2.2897000312805176,
-2.27703857421875,
0.8764852285385132,
-0.5145256519317627,
-0.5389840006828308,
2.042750835418701,
-1.0393614768981934,
-1.773187518119812,
1.2320441007614136,
0.2682099938392639,
0.058207836002111435,
2.3368613719940186,
0.14727360010147095,
-0.6849648952484131,
0.5273093581199646,
-0.792863667011261,
0.866644024848938,
-0.4837830364704132,
1.3501149415969849,
0.46595683693885803,
-0.8677236437797546,
1.6012706756591797,
-0.38929083943367004,
0.5321055054664612,
-0.6136558055877686,
-0.49286025762557983,
-0.8690056204795837,
0.46229830384254456,
1.9311999082565308,
-0.20045319199562073,
1.620107889175415,
-0.3607887625694275,
-1.6241346597671509,
-1.5277307033538818,
0.809917151927948,
0.6094809174537659,
-0.8331031799316406,
0.07073312997817993,
-0.3590250611305237,
0.13659581542015076,
0.02116040140390396,
1.0525470972061157,
1.2810479402542114,
0.7223529815673828,
-0.2654587924480438,
-0.9471407532691956,
0.26554253697395325,
-0.14303530752658844,
-0.6937656402587891,
-1.9038318395614624,
-0.4146600365638733,
0.16690734028816223,
0.6563334465026855,
-1.153228521347046,
1.6179839372634888,
0.9768844842910767,
2.0045318603515625,
0.9192754626274109,
-0.3532048463821411,
1.5601636171340942,
0.06100837513804436,
1.8600375652313232,
-0.5110915899276733,
0.7724749445915222,
-0.35324689745903015,
-1.082958459854126,
0.7466688752174377,
-0.4615538716316223,
-2.0139472484588623,
-0.6035817861557007,
-0.9004027247428894,
-0.23209962248802185,
-0.7318118214607239,
0.8676974773406982,
-0.23223906755447388,
-1.4053412675857544,
0.30169034004211426,
-0.5961326360702515,
0.20551031827926636,
-1.1561620235443115,
0.35998761653900146,
0.7709643840789795,
-0.5894641876220703,
0.0009117256850004196,
-0.31017184257507324,
-1.2871352434158325,
-0.5741275548934937,
0.2561716139316559,
1.8431650400161743,
-0.8321027755737305,
0.9547730684280396,
0.8896410465240479,
-0.6091648936271667,
-0.012504462152719498,
0.402136892080307,
-0.2712520956993103,
0.8726759552955627,
-1.1437698602676392,
-0.36874040961265564,
1.0205684900283813,
-0.21464551985263824,
-0.4272572696208954,
1.421303391456604,
0.8164542317390442,
-0.8918056488037109,
-0.1589057445526123,
-0.19356580078601837,
-0.8230944871902466,
-0.032550133764743805,
-1.6296168565750122,
-0.21784496307373047,
0.13759493827819824,
-1.5057827234268188,
-0.5377424359321594,
-0.23709984123706818,
1.1686617136001587,
-0.19167087972164154,
1.3733680248260498,
-0.4700641334056854,
-0.3047923743724823,
-0.4602202773094177,
-0.38059866428375244,
0.23684661090373993,
-0.29020464420318604,
-0.6727624535560608,
0.2636679410934448,
-0.7913329601287842,
0.43640634417533875,
1.4743983745574951,
0.4537973403930664,
0.053735144436359406,
0.4400273561477661,
1.0495095252990723,
0.3167414367198944,
0.005027745850384235,
-0.8594196438789368,
-1.5589382648468018,
2.0335869789123535,
-1.5450305938720703,
2.028082847595215,
0.7809934616088867,
0.025609076023101807,
-1.7602812051773071,
-1.7982326745986938,
1.3198628425598145,
1.2163846492767334,
2.334343910217285,
0.5816242694854736,
0.3172149956226349,
-0.848081648349762,
-0.6552281379699707,
0.26144203543663025,
-1.0564892292022705,
-0.7783421277999878,
-0.05477298051118851,
2.2854654788970947,
1.7564868927001953,
-0.5497890710830688,
-0.18624906241893768,
-1.0332831144332886,
1.411763072013855,
-0.10386279225349426,
0.23778420686721802,
2.01066517829895,
-0.2675705850124359,
-1.0279924869537354,
1.3379793167114258,
-2.252612352371216,
0.12517128884792328,
2.0173137187957764,
0.33026331663131714,
0.14932943880558014,
-1.3512483835220337,
-0.5569503307342529,
-0.2828502058982849,
-0.3546328544616699,
-1.2311064004898071,
0.5221248269081116,
-0.2603273391723633,
-0.7615070939064026,
-1.5592893362045288,
0.05000986158847809,
-1.207675576210022,
-1.6690443754196167,
0.379977822303772,
1.9225348234176636,
1.995803952217102,
-0.6452475190162659,
1.4637993574142456,
-0.25701552629470825,
0.13859184086322784,
1.3095349073410034,
1.2457143068313599,
3.128784418106079,
1.9079804420471191,
-1.2216092348098755,
0.5254926681518555,
-0.19565773010253906,
-0.49440741539001465,
1.1249275207519531,
-0.9794249534606934,
1.2119112014770508,
-0.12012852728366852,
-1.0919487476348877,
-1.140707015991211,
1.004852533340454,
0.45016223192214966,
0.10075852274894714,
-0.5651806592941284,
1.1393229961395264,
0.08958421647548676,
1.2939456701278687,
0.5612560510635376,
-0.3608475923538208,
0.5896796584129333,
-0.4672679305076599,
-0.5795701742172241,
1.6426700353622437,
0.16226401925086975,
-1.5826624631881714,
-2.407482147216797,
-0.2058401256799698,
-0.8325600624084473,
0.04539140686392784,
-0.667879581451416,
-1.0311732292175293,
1.598616361618042,
0.4142526090145111,
-1.303760051727295,
-0.29596757888793945,
-0.3387877643108368,
-0.7162442207336426,
2.675095558166504,
-1.444526195526123,
-0.3365936577320099,
-0.8835334777832031,
-0.5215066075325012,
1.5743292570114136,
-1.2390321493148804,
-0.1510489583015442,
-1.0884162187576294,
-0.6003900170326233,
-1.2756060361862183,
-0.536838710308075,
-0.09762342274188995,
-0.8790082335472107,
0.7347142696380615,
0.10564786195755005,
-1.1394352912902832,
-0.3820969760417938,
-0.9895281791687012,
0.7778600454330444,
-0.09395438432693481,
0.27285030484199524,
1.9289723634719849,
0.3751757740974426,
-0.3737494647502899,
0.6974619626998901,
1.2635152339935303,
0.6213693022727966,
-0.6942319869995117,
0.10809120535850525,
-0.6610594987869263,
0.34716373682022095,
-1.27195405960083,
0.405872106552124,
-2.8240647315979004,
0.7543112635612488,
-0.03874439746141434,
-0.18595845997333527,
-0.00011469423770904541,
-1.4542763233184814,
1.128335952758789,
2.6615631580352783,
-1.1067743301391602,
0.40294700860977173,
0.28346505761146545,
1.2786909341812134,
-1.6546214818954468,
0.45071834325790405,
-0.34107130765914917,
2.1837403774261475,
0.2929789125919342,
1.172251582145691,
-0.5609853863716125,
-2.2951500415802,
0.5152586102485657,
-1.1620231866836548,
-1.1197539567947388,
0.6139737367630005,
-0.8173590302467346,
0.051596272736787796,
-1.4675240516662598,
-0.16432608664035797,
-0.831160843372345,
-1.1025340557098389,
0.7093591094017029,
0.09086091816425323,
0.4274764358997345,
-0.6648290753364563,
0.28927722573280334,
-2.2010912895202637,
-1.4768987894058228,
-0.23232324421405792,
-0.8695592880249023,
0.479172021150589,
-0.39223235845565796,
0.6730932593345642,
-0.062334638088941574,
0.06917263567447662,
0.28979024291038513,
1.473453402519226,
3.328589916229248,
0.2626398205757141,
0.48648056387901306,
-0.1487661600112915,
-0.8211672902107239,
1.4922375679016113,
0.9583074450492859,
0.02035774476826191,
-0.5712184906005859,
-0.9778813123703003,
1.2954283952713013,
1.9490702152252197,
0.9555037021636963,
0.06757816672325134,
-0.7202836871147156,
-0.5948419570922852,
-0.04406031221151352,
0.18398118019104004,
0.47554856538772583,
1.0134986639022827,
0.09664367139339447,
0.17942632734775543,
1.4807498455047607,
1.2967880964279175,
-0.5830194354057312,
0.4588840901851654,
-0.8317009210586548,
-0.4613664448261261,
0.38193175196647644,
0.35974082350730896,
0.011815706267952919,
0.38775718212127686,
-0.8541330099105835,
-0.22401854395866394,
-0.34107136726379395,
-0.9929970502853394,
-0.718299925327301,
-0.47905445098876953,
-0.43677014112472534,
1.7207695245742798,
0.19722449779510498,
-0.5173051953315735,
-0.12886975705623627,
-0.8218340873718262,
0.025649338960647583,
-1.1113349199295044,
0.32618510723114014,
-0.004018614999949932,
-0.09095032513141632,
-0.08280275762081146,
1.8015179634094238,
-0.8789461851119995,
-2.072225332260132,
0.31317976117134094,
0.2354917824268341,
-0.5234580636024475,
0.11684843897819519,
1.635401725769043,
0.47401148080825806,
1.5147674083709717,
1.4437682628631592,
1.0085445642471313,
-0.6649821400642395,
-1.252259612083435,
0.6750152707099915,
0.8510563373565674,
-1.4085376262664795,
0.7387558817863464,
0.1394495815038681,
-0.4987390637397766,
0.7642629742622375,
1.379448652267456,
0.33983904123306274,
-2.0708043575286865,
0.7938655614852905,
-0.9359918236732483,
0.8482189178466797,
0.7322643399238586,
0.6661330461502075,
0.29544731974601746,
0.9370476603507996,
-1.284765362739563,
-1.092882513999939,
-0.875329315662384,
-0.604180097579956,
2.014862537384033,
-0.33362531661987305,
0.5334254503250122,
-0.1585567146539688,
-1.309525728225708,
-0.10375885665416718,
0.6987419724464417,
0.41525447368621826,
-0.3544125556945801,
0.8421452641487122,
-0.6957210302352905,
-1.1114119291305542,
-1.3862899541854858,
-0.44560641050338745,
-0.9019708037376404,
-0.9663501977920532,
0.9984961748123169,
0.8615280389785767,
0.3893683850765228,
1.9214872121810913,
0.591225802898407,
0.1597556471824646,
-2.6270525455474854,
0.9111906290054321,
0.22553804516792297,
-0.07328176498413086,
0.8754068613052368,
0.22883526980876923,
1.1415125131607056,
0.030098412185907364,
0.43390366435050964,
-2.380624294281006,
2.2007622718811035,
-0.2778850495815277,
0.8051104545593262,
0.04021042585372925,
-0.10453876852989197,
1.2102912664413452,
0.5512036681175232,
0.5202469229698181,
-1.068194031715393,
0.6919308304786682,
-0.621192216873169,
1.2249478101730347,
0.882299542427063,
-0.6809848546981812,
0.01059512048959732,
1.2945189476013184,
0.5019912123680115,
-0.5673149824142456,
-0.9865373373031616,
-0.9105690717697144,
0.9194207191467285,
1.7472013235092163,
-0.11269715428352356,
-0.0518106073141098,
0.7478329539299011,
0.7490274906158447,
-1.269450306892395,
0.14561592042446136,
-0.84536212682724,
-0.8036069273948669,
1.577318787574768,
1.998555064201355,
-0.06714341044425964,
-0.21768803894519806,
-0.606444239616394,
-1.2903759479522705,
0.7570511102676392,
0.011415183544158936,
0.20094738900661469,
0.6156666278839111,
-0.5940556526184082,
1.067228078842163,
0.9414951801300049,
0.9048059582710266,
0.08715473115444183,
0.30841970443725586,
0.3054041266441345,
-0.2828940451145172,
-1.0904006958007812,
-0.2368200421333313,
-1.2090054750442505,
-2.428201198577881,
0.5364202260971069,
-0.311553031206131,
-1.4699292182922363,
0.049796827137470245,
-1.0070959329605103,
0.8831464052200317,
-0.610569417476654,
-0.993539035320282,
-1.6967381238937378,
0.15313220024108887,
-0.0766260027885437,
0.8254982233047485,
-1.577420949935913,
-0.09588541090488434,
1.1086335182189941,
0.8050777316093445,
-0.5421558022499084,
1.043368935585022,
0.25736477971076965,
0.9961255788803101,
0.8921487331390381,
-0.46220871806144714,
0.35408633947372437,
0.09257392585277557,
-1.3770418167114258,
0.43770867586135864,
1.198377013206482,
0.24065499007701874,
1.3619972467422485,
-0.5698693990707397,
0.1099960207939148,
0.42052674293518066,
-0.47104063630104065,
-0.4512597918510437,
-0.6044196486473083,
0.7447506785392761,
0.05605139210820198,
-0.9363582134246826,
0.006724963895976543,
-0.08375726640224457,
-0.265356183052063,
0.29798370599746704,
-1.5604792833328247,
-0.21087849140167236,
-0.39901554584503174,
-0.5575754046440125,
-1.2525477409362793,
-0.07086381316184998,
1.4244005680084229,
-0.7825390696525574,
-0.11740440130233765,
0.5356960892677307,
0.557826578617096,
0.5477988123893738,
0.6478477120399475,
-0.6068007946014404,
-0.3857712745666504,
-0.24564462900161743,
-0.26999613642692566,
0.2094092220067978,
1.2136282920837402,
-0.15685336291790009,
-0.9447002410888672,
0.601115345954895,
-0.39984411001205444,
0.05733805522322655,
2.0269081592559814,
0.05664792284369469,
-0.7199866771697998,
0.359375536441803,
-0.7689990997314453,
1.930666446685791,
1.7322301864624023,
1.3170398473739624,
-0.08974945545196533,
-0.9483963251113892,
0.6010092496871948,
-0.29591161012649536,
-0.3563672602176666,
0.936724841594696,
0.4772244691848755,
-0.14231805503368378,
-1.330406904220581,
0.6069103479385376,
1.2771708965301514,
-0.8568006753921509,
-0.8340384364128113,
-0.006283083464950323,
-0.8082188963890076,
1.0706332921981812,
0.629341721534729,
0.41395509243011475,
0.22576479613780975,
1.675113558769226,
0.7273876070976257,
-0.5263676643371582,
0.46411916613578796,
0.5749602913856506,
-0.22383545339107513,
-2.126453399658203,
-1.2219600677490234,
0.15993091464042664,
-0.4096550941467285,
-1.6079634428024292,
1.4215694665908813,
-1.2228471040725708,
-0.8491582870483398,
0.6259781718254089,
0.1881977617740631,
1.4722596406936646,
0.37122297286987305,
1.6414755582809448,
2.056668758392334,
0.85466068983078,
0.4464085102081299,
1.3720062971115112,
-0.07691499590873718,
-0.5347343683242798,
1.791778802871704,
-0.4645180404186249,
0.4411522150039673,
1.0706123113632202,
-0.3559756875038147,
-1.0899628400802612,
-0.8213860988616943,
-1.084161400794983,
-0.694286048412323,
1.1275925636291504,
0.13697561621665955,
-1.2272509336471558,
0.15798130631446838,
1.7274655103683472,
0.026324961334466934,
-0.3811885714530945,
0.5050655007362366,
0.379792720079422,
-0.7284553647041321,
-0.03915153443813324,
-1.072385311126709,
0.43968454003334045,
-0.18479566276073456,
-0.41589412093162537,
0.3981122672557831,
0.4813315272331238,
1.1450080871582031,
-0.007497268263250589,
0.08434745669364929,
1.14203941822052,
-1.4821674823760986,
1.3890557289123535,
-0.6246092915534973,
0.29581642150878906,
-2.421504497528076,
1.558634877204895,
-0.8486217856407166,
1.9937111139297485,
-2.6162686347961426,
0.37449997663497925,
-0.7761127352714539,
-0.5260840654373169,
0.40680253505706787,
-0.3703114986419678,
0.2351835072040558,
-0.042103756219148636,
-1.0964711904525757,
-0.0669642835855484,
-0.7622247338294983,
0.47311848402023315,
1.1884434223175049,
1.26101553440094,
-1.126018762588501,
-0.28248465061187744,
-1.635245442390442,
-0.17920763790607452,
-0.5916752815246582,
0.3474004566669464,
-2.045438766479492,
-0.057822469621896744,
-1.8686672449111938,
-2.1891775131225586,
-1.4397289752960205,
-0.8600784540176392,
1.07658052444458,
0.1363583356142044,
-0.8505085706710815,
1.136537790298462,
-0.36715167760849,
-1.785348653793335,
1.1755181550979614,
-2.157837152481079
] |
https://github.com/huggingface/datasets/issues/5032 | new dataset type: single-label and multi-label video classification | Hi ! I think we just missing which lib we're going to use to decode the videos + which parameters must go in the `Video` type | **Is your feature request related to a problem? Please describe.**
In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset.
**Describe the solution you'd like**
Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model.
**Describe alternatives you've considered**
Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative.
**Additional context**
I am wiling to open a PR but don't know where to start.
| 505 | 26 | new dataset type: single-label and multi-label video classification
**Is your feature request related to a problem? Please describe.**
In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset.
**Describe the solution you'd like**
Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model.
**Describe alternatives you've considered**
Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative.
**Additional context**
I am wiling to open a PR but don't know where to start.
Hi ! I think we just missing which lib we're going to use to decode the videos + which parameters must go in the `Video` type | [
-1.2930433750152588,
-1.1011476516723633,
-0.8134538531303406,
1.3789045810699463,
-0.3230118155479431,
-1.286603569984436,
0.09674212336540222,
-1.0568574666976929,
1.5683763027191162,
-0.852307915687561,
0.2863472104072571,
-1.575071930885315,
0.15188272297382355,
-0.5740571618080139,
-0.8622030019760132,
-0.7843114137649536,
-0.38732847571372986,
-0.808162271976471,
1.0030641555786133,
2.552236557006836,
1.0842885971069336,
-1.4415662288665771,
2.6580352783203125,
0.6134368777275085,
-0.2210424840450287,
-1.097144365310669,
0.5096940398216248,
0.1901344656944275,
-1.1451199054718018,
-0.4692911207675934,
-0.9275476932525635,
-0.017038682475686073,
-0.6137457489967346,
-0.5804946422576904,
0.13071802258491516,
0.3003789782524109,
-0.1420421153306961,
-0.3973681628704071,
-0.5654446482658386,
-0.6496539115905762,
0.5269091725349426,
-0.3761623203754425,
0.9991455078125,
-0.37445545196533203,
1.783794641494751,
-0.6206700205802917,
0.4133733808994293,
0.6703358888626099,
1.4681483507156372,
0.20920275151729584,
0.008929478004574776,
0.2948225736618042,
0.5097817182540894,
-0.025440020486712456,
0.3840479254722595,
1.0780915021896362,
0.5109660625457764,
0.5007061958312988,
0.733206570148468,
-2.1301350593566895,
1.3629205226898193,
-1.0595709085464478,
0.34445658326148987,
1.357420802116394,
-0.9655042290687561,
0.44148772954940796,
-1.7638453245162964,
-0.10824581980705261,
0.504670262336731,
-2.2782516479492188,
0.16290518641471863,
-1.2886265516281128,
-0.5583046674728394,
0.8843241333961487,
0.2218426614999771,
-1.326043963432312,
0.2638043761253357,
-0.5162307024002075,
0.9798747301101685,
0.42281097173690796,
1.0766595602035522,
-1.6556130647659302,
-0.05249057710170746,
-0.25486958026885986,
0.14311161637306213,
-1.2186638116836548,
-1.4892983436584473,
0.5671767592430115,
0.5850492715835571,
0.4400358498096466,
-0.11161862313747406,
0.9445821046829224,
-1.053851842880249,
0.9848179221153259,
-1.005349040031433,
-1.558072566986084,
-1.4416526556015015,
-2.260653018951416,
-2.27394962310791,
0.8966079950332642,
-0.5082291960716248,
-0.5555794835090637,
2.006289005279541,
-1.0517548322677612,
-1.791458249092102,
1.249082088470459,
0.27291053533554077,
0.0978444516658783,
2.295381546020508,
0.14547669887542725,
-0.657161295413971,
0.47525110840797424,
-0.8077580332756042,
0.8792626857757568,
-0.4896870255470276,
1.4129526615142822,
0.48189935088157654,
-0.8320409059524536,
1.6390390396118164,
-0.35201525688171387,
0.5182949304580688,
-0.591262698173523,
-0.5079426765441895,
-0.876572847366333,
0.5073243379592896,
1.972752571105957,
-0.2370782494544983,
1.5981124639511108,
-0.3749930262565613,
-1.627998948097229,
-1.4988622665405273,
0.8733956217765808,
0.6152245998382568,
-0.8667309880256653,
0.05425969138741493,
-0.3535071015357971,
0.12614716589450836,
0.039048805832862854,
1.0723453760147095,
1.2592066526412964,
0.7056934237480164,
-0.253190279006958,
-0.9665300846099854,
0.2888354957103729,
-0.15589384734630585,
-0.6383091807365417,
-1.9540718793869019,
-0.4610627293586731,
0.1808299720287323,
0.7293499112129211,
-1.1760073900222778,
1.5838347673416138,
0.9782478213310242,
1.9848864078521729,
0.9150612354278564,
-0.34875789284706116,
1.541279911994934,
-0.006992329843342304,
1.782710075378418,
-0.5619129538536072,
0.7897403240203857,
-0.34116488695144653,
-1.0693861246109009,
0.7519091367721558,
-0.4650188386440277,
-1.9918252229690552,
-0.6538033485412598,
-0.9227458238601685,
-0.26074936985969543,
-0.7395837306976318,
0.9125403761863708,
-0.2742488980293274,
-1.3708395957946777,
0.2459115833044052,
-0.6126813888549805,
0.22284315526485443,
-1.1454039812088013,
0.33399468660354614,
0.7373470664024353,
-0.5595329403877258,
-0.034002289175987244,
-0.3102928698062897,
-1.280707836151123,
-0.5743041038513184,
0.2369534820318222,
1.8545457124710083,
-0.8706443309783936,
1.0311509370803833,
0.8346168994903564,
-0.6320130825042725,
-0.021860551089048386,
0.39814049005508423,
-0.2963947057723999,
0.8657897114753723,
-1.1286849975585938,
-0.370452880859375,
1.0174405574798584,
-0.2425169199705124,
-0.39353302121162415,
1.4215346574783325,
0.900738537311554,
-0.8891868591308594,
-0.22205615043640137,
-0.23452068865299225,
-0.8145043253898621,
-0.02533222921192646,
-1.6181259155273438,
-0.2989908456802368,
0.09627306461334229,
-1.501033902168274,
-0.5780133008956909,
-0.2722392976284027,
1.1700754165649414,
-0.17048725485801697,
1.3904595375061035,
-0.4390653371810913,
-0.3841181695461273,
-0.42938607931137085,
-0.43625038862228394,
0.24498890340328217,
-0.2607450485229492,
-0.6884780526161194,
0.27939996123313904,
-0.8433114290237427,
0.46797478199005127,
1.4806817770004272,
0.4372727572917938,
0.0055517470464110374,
0.5047992467880249,
1.0086584091186523,
0.3333147168159485,
0.027106083929538727,
-0.9209660291671753,
-1.5673115253448486,
2.00882887840271,
-1.6076855659484863,
2.0078017711639404,
0.7709991931915283,
0.032389022409915924,
-1.7167483568191528,
-1.7624156475067139,
1.3635433912277222,
1.256215214729309,
2.3108925819396973,
0.6099727153778076,
0.2725675106048584,
-0.8321579694747925,
-0.6647519469261169,
0.2377375364303589,
-1.1240386962890625,
-0.7394766807556152,
-0.03257783502340317,
2.269892930984497,
1.7621945142745972,
-0.6031314134597778,
-0.22825676202774048,
-0.9989083409309387,
1.3820635080337524,
-0.1278240829706192,
0.270900160074234,
2.0185048580169678,
-0.29428139328956604,
-1.0168181657791138,
1.3223870992660522,
-2.247519016265869,
0.14572909474372864,
2.010979413986206,
0.3545573949813843,
0.15531225502490997,
-1.4133695363998413,
-0.5759563446044922,
-0.2744152247905731,
-0.34749501943588257,
-1.287480354309082,
0.5443394780158997,
-0.26587119698524475,
-0.8191372156143188,
-1.5622299909591675,
0.08340243995189667,
-1.2217206954956055,
-1.6440709829330444,
0.450138658285141,
1.947533130645752,
2.0352413654327393,
-0.6320237517356873,
1.4597468376159668,
-0.24820077419281006,
0.12018135190010071,
1.2938780784606934,
1.2019788026809692,
3.1210873126983643,
1.9207830429077148,
-1.1555757522583008,
0.5171878933906555,
-0.19107939302921295,
-0.5245091915130615,
1.145103096961975,
-0.943134069442749,
1.1742039918899536,
-0.14858712255954742,
-1.0734878778457642,
-1.0994623899459839,
0.9661440849304199,
0.3990170657634735,
0.06483098864555359,
-0.5364083051681519,
1.187234878540039,
0.060221102088689804,
1.2707340717315674,
0.5634335279464722,
-0.37778332829475403,
0.5945352911949158,
-0.49093353748321533,
-0.5492804646492004,
1.6222872734069824,
0.15966996550559998,
-1.5822535753250122,
-2.397639274597168,
-0.22313819825649261,
-0.798346757888794,
0.026029013097286224,
-0.6305111050605774,
-1.0849549770355225,
1.58580482006073,
0.4291541278362274,
-1.3073923587799072,
-0.2731589078903198,
-0.3616047203540802,
-0.7264016270637512,
2.654705762863159,
-1.4613914489746094,
-0.3458159267902374,
-0.8594374656677246,
-0.4938943684101105,
1.5759308338165283,
-1.2453471422195435,
-0.09996660053730011,
-1.0762449502944946,
-0.5696311593055725,
-1.3491564989089966,
-0.5350238680839539,
-0.08357459306716919,
-0.8879199624061584,
0.7484995126724243,
0.03749467432498932,
-1.0713294744491577,
-0.32735928893089294,
-0.991320788860321,
0.7447044253349304,
-0.07192060351371765,
0.27826523780822754,
1.9388811588287354,
0.35677528381347656,
-0.35864317417144775,
0.7352114319801331,
1.2514375448226929,
0.6487148404121399,
-0.7489015460014343,
0.10662361979484558,
-0.6415845155715942,
0.2821379005908966,
-1.2955657243728638,
0.43021053075790405,
-2.8041443824768066,
0.7615858316421509,
-0.022837243974208832,
-0.24767452478408813,
0.03868255019187927,
-1.4363142251968384,
1.1722159385681152,
2.6375315189361572,
-1.1471258401870728,
0.37325698137283325,
0.26692038774490356,
1.2322452068328857,
-1.6380629539489746,
0.46931928396224976,
-0.2997277081012726,
2.1690895557403564,
0.32415643334388733,
1.1863118410110474,
-0.5853250622749329,
-2.2810122966766357,
0.5769410133361816,
-1.1546059846878052,
-1.1210765838623047,
0.5232788920402527,
-0.7771152853965759,
0.04398040473461151,
-1.5156464576721191,
-0.14100265502929688,
-0.9016002416610718,
-1.154990792274475,
0.7102696299552917,
0.1366826593875885,
0.3654381334781647,
-0.6108328700065613,
0.26294177770614624,
-2.1508212089538574,
-1.4646267890930176,
-0.24149666726589203,
-0.8402047753334045,
0.5122635960578918,
-0.3623434603214264,
0.6573534607887268,
-0.06560108065605164,
0.1008220762014389,
0.27896079421043396,
1.4715631008148193,
3.405069351196289,
0.2504989206790924,
0.46333232522010803,
-0.14063583314418793,
-0.8178843259811401,
1.5226526260375977,
1.0091925859451294,
0.10477907955646515,
-0.5750387907028198,
-0.9466425180435181,
1.2900608777999878,
1.9659744501113892,
0.9536168575286865,
0.04599348083138466,
-0.7429296374320984,
-0.5507704019546509,
-0.04826454818248749,
0.17842212319374084,
0.5091257095336914,
1.0339547395706177,
0.07015527784824371,
0.1524467170238495,
1.4722660779953003,
1.2736577987670898,
-0.5671019554138184,
0.39352869987487793,
-0.8525196313858032,
-0.4232448637485504,
0.3788704574108124,
0.3327364921569824,
0.005242978222668171,
0.35439956188201904,
-0.8478981852531433,
-0.22844620048999786,
-0.32534104585647583,
-1.06358802318573,
-0.7244808673858643,
-0.46796369552612305,
-0.4404798150062561,
1.7321242094039917,
0.212346151471138,
-0.5122211575508118,
-0.15970753133296967,
-0.8114054799079895,
-0.010454456321895123,
-1.0761897563934326,
0.23652207851409912,
0.009067486971616745,
-0.09893149137496948,
-0.07678312063217163,
1.7838129997253418,
-0.8701755404472351,
-2.1000759601593018,
0.29931309819221497,
0.2584008574485779,
-0.5317738652229309,
0.1369388848543167,
1.6017335653305054,
0.46264976263046265,
1.5244332551956177,
1.442183494567871,
1.0009912252426147,
-0.6268407702445984,
-1.2591211795806885,
0.6231113076210022,
0.8652383685112,
-1.4192237854003906,
0.7748821377754211,
0.11824476718902588,
-0.5112160444259644,
0.7723771929740906,
1.397892713546753,
0.388033002614975,
-2.060488224029541,
0.7821849584579468,
-0.8873652815818787,
0.8348298668861389,
0.7058932781219482,
0.6900173425674438,
0.34311172366142273,
0.9507688283920288,
-1.2842745780944824,
-1.0456342697143555,
-0.8975002765655518,
-0.5555848479270935,
2.038591146469116,
-0.33307695388793945,
0.5395174622535706,
-0.18088309466838837,
-1.2159757614135742,
-0.11171598732471466,
0.7063125967979431,
0.42844828963279724,
-0.3257231116294861,
0.8498266339302063,
-0.6822199821472168,
-1.0974680185317993,
-1.3753668069839478,
-0.435367226600647,
-0.8429795503616333,
-0.9836751818656921,
1.001610279083252,
0.8573226928710938,
0.4486905336380005,
1.9450865983963013,
0.5756251215934753,
0.1155036985874176,
-2.634385347366333,
0.9011217355728149,
0.21443763375282288,
-0.055903028696775436,
0.9120364785194397,
0.202768936753273,
1.1609023809432983,
0.019161945208907127,
0.44367995858192444,
-2.3726024627685547,
2.1477363109588623,
-0.26991090178489685,
0.8027406930923462,
0.02938918024301529,
-0.08897800743579865,
1.2526618242263794,
0.5527787804603577,
0.5210437774658203,
-1.0788438320159912,
0.7022234797477722,
-0.6332518458366394,
1.231691837310791,
0.9197823405265808,
-0.6586686968803406,
0.09292121231555939,
1.2962872982025146,
0.5094958543777466,
-0.5579960942268372,
-1.0090346336364746,
-0.8396116495132446,
0.9104811549186707,
1.7506237030029297,
-0.1698397397994995,
-0.09679421782493591,
0.7396391034126282,
0.7305554747581482,
-1.247554063796997,
0.16815562546253204,
-0.7939310669898987,
-0.8031967282295227,
1.5857348442077637,
1.9636963605880737,
-0.06791554391384125,
-0.20782114565372467,
-0.5827609896659851,
-1.2607470750808716,
0.7564162611961365,
0.0680682361125946,
0.18277372419834137,
0.6119076013565063,
-0.5735583901405334,
1.1175577640533447,
0.896681010723114,
0.9027249813079834,
0.035797394812107086,
0.36830106377601624,
0.3298792541027069,
-0.31423676013946533,
-1.0627261400222778,
-0.2940921485424042,
-1.2306797504425049,
-2.501175880432129,
0.5402057766914368,
-0.3645989000797272,
-1.4566268920898438,
0.03421415016055107,
-1.0395569801330566,
0.8908286094665527,
-0.6353641748428345,
-0.9899515509605408,
-1.6948601007461548,
0.1306300014257431,
-0.06976908445358276,
0.8413032293319702,
-1.6311372518539429,
-0.10573887825012207,
1.1523818969726562,
0.7751980423927307,
-0.5259780883789062,
1.065348744392395,
0.25748786330223083,
1.004469871520996,
0.8180414438247681,
-0.43732285499572754,
0.34484079480171204,
0.11217150092124939,
-1.4183933734893799,
0.5155748128890991,
1.2025713920593262,
0.26281046867370605,
1.3391249179840088,
-0.5615561604499817,
0.14542783796787262,
0.42317622900009155,
-0.5102493762969971,
-0.47550854086875916,
-0.5960848927497864,
0.7498317956924438,
0.07083357870578766,
-0.9241355657577515,
0.0041473545134067535,
-0.10266932845115662,
-0.22841954231262207,
0.2857169806957245,
-1.5445244312286377,
-0.29388973116874695,
-0.3907092809677124,
-0.5049097537994385,
-1.2724968194961548,
-0.09176500141620636,
1.395623803138733,
-0.7621279358863831,
-0.12535862624645233,
0.5579190254211426,
0.5691455602645874,
0.5149926543235779,
0.6104884743690491,
-0.6259245276451111,
-0.41834524273872375,
-0.24835430085659027,
-0.2850431501865387,
0.1720113456249237,
1.194303274154663,
-0.16097597777843475,
-0.9683212041854858,
0.5926068425178528,
-0.4016830325126648,
0.029097065329551697,
1.9896529912948608,
-0.0033225631341338158,
-0.7142613530158997,
0.3609371781349182,
-0.7538830041885376,
1.9243128299713135,
1.6476269960403442,
1.3079429864883423,
-0.11102458834648132,
-0.8726950287818909,
0.6098830699920654,
-0.2219160497188568,
-0.37166351079940796,
0.9247078895568848,
0.5263904929161072,
-0.11721837520599365,
-1.337185025215149,
0.6024312973022461,
1.321479320526123,
-0.9034600853919983,
-0.8309651613235474,
0.019688697531819344,
-0.8331611752510071,
1.032863736152649,
0.5871114730834961,
0.41116148233413696,
0.22433550655841827,
1.7165369987487793,
0.6706550121307373,
-0.533564031124115,
0.4471445381641388,
0.5630332231521606,
-0.21119840443134308,
-2.1175425052642822,
-1.225021243095398,
0.17933356761932373,
-0.39628365635871887,
-1.6043148040771484,
1.4217828512191772,
-1.1895750761032104,
-0.8452483415603638,
0.6684930920600891,
0.26813894510269165,
1.470773696899414,
0.3523010313510895,
1.6625319719314575,
2.0480549335479736,
0.8367274403572083,
0.45940524339675903,
1.3673434257507324,
-0.0564020499587059,
-0.5204334855079651,
1.7981250286102295,
-0.4651983380317688,
0.5294010043144226,
1.099963903427124,
-0.32563918828964233,
-1.102537989616394,
-0.8194021582603455,
-1.0662500858306885,
-0.6184892058372498,
1.1670230627059937,
0.17620500922203064,
-1.258158564567566,
0.11144368350505829,
1.7341309785842896,
0.067664235830307,
-0.3806692063808441,
0.4183935225009918,
0.4107944369316101,
-0.7139523029327393,
-0.022621585056185722,
-1.1006956100463867,
0.43195921182632446,
-0.15816912055015564,
-0.37187594175338745,
0.42589259147644043,
0.5430834889411926,
1.1633381843566895,
-0.04977453872561455,
0.09484675526618958,
1.1530652046203613,
-1.4870316982269287,
1.4588828086853027,
-0.5973286032676697,
0.2831224501132965,
-2.44830322265625,
1.563533902168274,
-0.8373425602912903,
1.9762191772460938,
-2.574005603790283,
0.29774534702301025,
-0.7819867730140686,
-0.4930593967437744,
0.3862948715686798,
-0.36558642983436584,
0.20069275796413422,
-0.09652906656265259,
-1.0545998811721802,
-0.006031520664691925,
-0.7812910676002502,
0.5031787157058716,
1.2536360025405884,
1.276919960975647,
-1.1694755554199219,
-0.2528296709060669,
-1.7022184133529663,
-0.2067277729511261,
-0.6383788585662842,
0.3412536382675171,
-2.0918281078338623,
-0.03190207481384277,
-1.8290767669677734,
-2.170365810394287,
-1.4814273118972778,
-0.8708852529525757,
1.0672677755355835,
0.14035794138908386,
-0.8528910279273987,
1.1456379890441895,
-0.31671082973480225,
-1.7666516304016113,
1.1794679164886475,
-2.1349494457244873
] |
https://github.com/huggingface/datasets/issues/5032 | new dataset type: single-label and multi-label video classification | pytorchvideo uses [pyav](https://github.com/PyAV-Org/PyAV) as the default decoder: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/labeled_video_dataset.py#L37
Also it would be great if `optionally` audio can also be decoded from the video as in pytorchvideo: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/labeled_video_dataset.py#L35
Here are the other decoders supported in pytorchvideo: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/encoded_video.py#L17
| **Is your feature request related to a problem? Please describe.**
In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset.
**Describe the solution you'd like**
Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model.
**Describe alternatives you've considered**
Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative.
**Additional context**
I am wiling to open a PR but don't know where to start.
| 505 | 36 | new dataset type: single-label and multi-label video classification
**Is your feature request related to a problem? Please describe.**
In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset.
**Describe the solution you'd like**
Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model.
**Describe alternatives you've considered**
Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative.
**Additional context**
I am wiling to open a PR but don't know where to start.
pytorchvideo uses [pyav](https://github.com/PyAV-Org/PyAV) as the default decoder: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/labeled_video_dataset.py#L37
Also it would be great if `optionally` audio can also be decoded from the video as in pytorchvideo: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/labeled_video_dataset.py#L35
Here are the other decoders supported in pytorchvideo: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/encoded_video.py#L17
| [
-1.2756141424179077,
-0.9782220125198364,
-0.7975229620933533,
1.3591121435165405,
-0.22698044776916504,
-1.2327144145965576,
0.07184381783008575,
-1.0692170858383179,
1.5721795558929443,
-0.7372599840164185,
0.2102522999048233,
-1.5785341262817383,
0.0249869916588068,
-0.5534454584121704,
-0.7341616153717041,
-0.7406385540962219,
-0.3883635699748993,
-0.8732731342315674,
1.0076836347579956,
2.548955202102661,
1.1960216760635376,
-1.4205046892166138,
2.694096088409424,
0.6794677376747131,
-0.2274906188249588,
-1.0538979768753052,
0.5131153464317322,
0.17721977829933167,
-1.2738908529281616,
-0.4789028763771057,
-0.9264000654220581,
0.05715852230787277,
-0.5271146297454834,
-0.5186039805412292,
0.07069794088602066,
0.4217088520526886,
-0.1269979029893875,
-0.38927873969078064,
-0.6117486953735352,
-0.6198009848594666,
0.5217400789260864,
-0.30988600850105286,
0.9786677360534668,
-0.27961140871047974,
1.7245571613311768,
-0.5822493433952332,
0.34040406346321106,
0.703576385974884,
1.4668630361557007,
0.16546419262886047,
-0.0011570015922188759,
0.21747277677059174,
0.46058985590934753,
-0.10337546467781067,
0.4726812541484833,
1.1935676336288452,
0.6843769550323486,
0.43895527720451355,
0.6650041341781616,
-2.1574177742004395,
1.3514106273651123,
-0.9012402892112732,
0.2944062054157257,
1.3925243616104126,
-0.9700071811676025,
0.3611167371273041,
-1.8182600736618042,
-0.08499813824892044,
0.4895849823951721,
-2.210907220840454,
0.16147299110889435,
-1.2564793825149536,
-0.557097852230072,
0.9813400506973267,
0.21612384915351868,
-1.2990120649337769,
0.20692123472690582,
-0.5337313413619995,
1.0169695615768433,
0.4239354133605957,
1.2315438985824585,
-1.6433049440383911,
-0.036733172833919525,
-0.2124744951725006,
0.14028264582157135,
-1.2302674055099487,
-1.6130964756011963,
0.481158584356308,
0.5921598672866821,
0.5276225209236145,
-0.09878289699554443,
0.9310325384140015,
-1.0387201309204102,
0.937750518321991,
-0.9556016325950623,
-1.5593695640563965,
-1.403100609779358,
-2.2014825344085693,
-2.2607829570770264,
0.9157115817070007,
-0.5812051892280579,
-0.5397651791572571,
1.9881644248962402,
-1.1109377145767212,
-1.8680731058120728,
1.079343318939209,
0.3039967715740204,
0.1282309889793396,
2.32283091545105,
0.25666117668151855,
-0.6955623030662537,
0.44793760776519775,
-0.6670375466346741,
0.8797999024391174,
-0.42345836758613586,
1.3770493268966675,
0.4738730192184448,
-0.7960923910140991,
1.6003001928329468,
-0.4208219647407532,
0.6012623310089111,
-0.695973813533783,
-0.4853094220161438,
-0.8163959383964539,
0.5004030466079712,
1.9589654207229614,
-0.3455941677093506,
1.6112816333770752,
-0.42100951075553894,
-1.6244055032730103,
-1.4900611639022827,
0.833716094493866,
0.6278651356697083,
-0.8295031785964966,
0.05994696170091629,
-0.5133556723594666,
0.083099864423275,
-0.003347438760101795,
1.0295213460922241,
1.3311970233917236,
0.759564995765686,
-0.36542466282844543,
-0.9288731217384338,
0.2395397424697876,
-0.1343979388475418,
-0.645460844039917,
-1.8894871473312378,
-0.33234095573425293,
0.1886514574289322,
0.7172971367835999,
-1.2865886688232422,
1.6842243671417236,
0.9325904250144958,
2.0445845127105713,
0.8831196427345276,
-0.46181100606918335,
1.528623104095459,
0.02440022863447666,
1.8277473449707031,
-0.5062206387519836,
0.678885817527771,
-0.3159143328666687,
-1.1177263259887695,
0.8414621353149414,
-0.422039657831192,
-1.9921371936798096,
-0.702216386795044,
-0.8695695996284485,
-0.20984870195388794,
-0.7643424272537231,
0.8877863883972168,
-0.21206329762935638,
-1.4148153066635132,
0.21340888738632202,
-0.5893555283546448,
0.18841049075126648,
-1.1963670253753662,
0.24652284383773804,
0.7947654724121094,
-0.6126396059989929,
-0.08092755824327469,
-0.28074803948402405,
-1.346897006034851,
-0.5285649299621582,
0.262532114982605,
1.8655946254730225,
-0.7847668528556824,
1.006974697113037,
0.9846527576446533,
-0.628717303276062,
0.12503734230995178,
0.3125029504299164,
-0.40222153067588806,
0.8738778829574585,
-1.1710703372955322,
-0.29744189977645874,
1.043768286705017,
-0.18317672610282898,
-0.41801929473876953,
1.4197818040847778,
0.8860430121421814,
-0.9844494462013245,
-0.2800571024417877,
-0.15913452208042145,
-0.7862403392791748,
-0.055306240916252136,
-1.592263102531433,
-0.2430924028158188,
0.10992966592311859,
-1.412718415260315,
-0.4949275553226471,
-0.32857900857925415,
1.2138930559158325,
-0.20754474401474,
1.4525558948516846,
-0.34731149673461914,
-0.2308618724346161,
-0.3886842131614685,
-0.41208451986312866,
0.15850088000297546,
-0.25888878107070923,
-0.6392034292221069,
0.31990373134613037,
-0.8607198596000671,
0.32821154594421387,
1.5002896785736084,
0.4479769170284271,
-0.07172504812479019,
0.4657323956489563,
1.083752155303955,
0.3685101568698883,
0.02034001238644123,
-0.9149150848388672,
-1.529592752456665,
1.9582635164260864,
-1.5642368793487549,
1.9446622133255005,
0.8396193981170654,
-0.0012778593227267265,
-1.7682833671569824,
-1.8174099922180176,
1.370409369468689,
1.2260808944702148,
2.397514820098877,
0.5813139081001282,
0.34697774052619934,
-0.7710636258125305,
-0.687723696231842,
0.3556596636772156,
-0.989406168460846,
-0.6810262203216553,
0.05666346848011017,
2.3584883213043213,
1.7511943578720093,
-0.5824554562568665,
-0.22542251646518707,
-0.8933814167976379,
1.2856577634811401,
-0.13410460948944092,
0.20784235000610352,
2.078420639038086,
-0.1908678561449051,
-0.9677534103393555,
1.3380537033081055,
-2.317164182662964,
0.265120267868042,
1.9723873138427734,
0.3687785565853119,
0.163103386759758,
-1.4051837921142578,
-0.6130004525184631,
-0.2902173101902008,
-0.4488917589187622,
-1.2075097560882568,
0.5992180109024048,
-0.28519484400749207,
-0.8847110271453857,
-1.5984416007995605,
0.08806806802749634,
-1.2343056201934814,
-1.6604535579681396,
0.3977054953575134,
1.9477359056472778,
2.04001522064209,
-0.7654151320457458,
1.418363094329834,
-0.2845420837402344,
0.0014098640531301498,
1.2321012020111084,
1.2452185153961182,
3.1085562705993652,
1.818168044090271,
-1.2798060178756714,
0.647372841835022,
-0.20281732082366943,
-0.5120500922203064,
1.1378679275512695,
-1.0316046476364136,
1.1176702976226807,
-0.1919579952955246,
-1.1530697345733643,
-1.171066164970398,
1.0124949216842651,
0.45148852467536926,
0.12789851427078247,
-0.4843652844429016,
1.1735495328903198,
0.15128964185714722,
1.3313019275665283,
0.6345257759094238,
-0.3513869643211365,
0.6336699724197388,
-0.4397779703140259,
-0.5132141709327698,
1.5804672241210938,
0.08342522382736206,
-1.5347994565963745,
-2.3193023204803467,
-0.2769491970539093,
-0.8488806486129761,
-0.011075221933424473,
-0.6530914306640625,
-1.085013508796692,
1.5642412900924683,
0.5016626715660095,
-1.2927073240280151,
-0.35402727127075195,
-0.3551962375640869,
-0.6245924234390259,
2.5345232486724854,
-1.4276742935180664,
-0.24212095141410828,
-0.90704345703125,
-0.4545053243637085,
1.5975396633148193,
-1.1344374418258667,
-0.1883920431137085,
-1.0642365217208862,
-0.6349153518676758,
-1.3202043771743774,
-0.5494393706321716,
-0.04302685707807541,
-0.849118173122406,
0.7311522960662842,
0.11758606880903244,
-1.0768418312072754,
-0.2676908075809479,
-0.9323005080223083,
0.858478307723999,
-0.12069454044103622,
0.24594688415527344,
1.9168620109558105,
0.3955064117908478,
-0.43345004320144653,
0.7880517840385437,
1.2134617567062378,
0.5194509029388428,
-0.7009843587875366,
0.03671415150165558,
-0.7255992889404297,
0.34057727456092834,
-1.3472707271575928,
0.26814720034599304,
-2.859105348587036,
0.7698441743850708,
-0.04810700565576553,
-0.18399634957313538,
-0.01832694187760353,
-1.414469838142395,
1.2197704315185547,
2.7027952671051025,
-1.150726318359375,
0.43836089968681335,
0.35896068811416626,
1.2002872228622437,
-1.6154800653457642,
0.3688832223415375,
-0.38070493936538696,
2.0979979038238525,
0.21840202808380127,
1.2649798393249512,
-0.6029826402664185,
-2.2361297607421875,
0.5920675992965698,
-1.1827178001403809,
-1.0864357948303223,
0.6847777962684631,
-0.798184335231781,
0.10329951345920563,
-1.5608526468276978,
-0.18471603095531464,
-0.905348539352417,
-1.1961486339569092,
0.6579811573028564,
0.0724194198846817,
0.36812514066696167,
-0.6458636522293091,
0.3084086775779724,
-2.1641011238098145,
-1.4270727634429932,
-0.19910581409931183,
-0.917567253112793,
0.4885362982749939,
-0.42372244596481323,
0.63078773021698,
0.020548557862639427,
0.009154394268989563,
0.2634214162826538,
1.3644765615463257,
3.4215331077575684,
0.23414477705955505,
0.35705432295799255,
-0.1626485288143158,
-0.8869121670722961,
1.5086708068847656,
1.0249028205871582,
-0.02347295917570591,
-0.599606990814209,
-0.9574378728866577,
1.2381943464279175,
1.9430723190307617,
1.0288491249084473,
-0.007036964409053326,
-0.8071177005767822,
-0.6893771886825562,
-0.03659699857234955,
0.15633006393909454,
0.45393863320350647,
1.0895472764968872,
0.0006767064332962036,
0.15952441096305847,
1.497434139251709,
1.2492624521255493,
-0.5145547986030579,
0.4251898229122162,
-0.8668689727783203,
-0.36049798130989075,
0.3496810495853424,
0.28534188866615295,
0.09226880967617035,
0.38487327098846436,
-0.9787660241127014,
-0.32087138295173645,
-0.2819952070713043,
-1.0333622694015503,
-0.7351095080375671,
-0.3867866098880768,
-0.36312201619148254,
1.6832826137542725,
0.16682210564613342,
-0.50994473695755,
-0.09961745887994766,
-0.8248845934867859,
-0.07020057737827301,
-1.0933735370635986,
0.31203535199165344,
-0.058442361652851105,
-0.05042101442813873,
-0.09920201450586319,
1.762037992477417,
-0.9398178458213806,
-2.0750701427459717,
0.32339149713516235,
0.3293319642543793,
-0.49170565605163574,
0.21254341304302216,
1.6842375993728638,
0.5683279037475586,
1.399796962738037,
1.3497816324234009,
1.0685607194900513,
-0.6353464722633362,
-1.2040225267410278,
0.6373457908630371,
0.8720309734344482,
-1.4075157642364502,
0.7432180643081665,
-0.010075807571411133,
-0.5363109111785889,
0.7134546041488647,
1.4918153285980225,
0.3867374360561371,
-2.0598673820495605,
0.8323598504066467,
-0.8276259303092957,
0.7495750784873962,
0.6497470140457153,
0.7334491610527039,
0.2342597246170044,
0.8996030688285828,
-1.301425576210022,
-1.0974291563034058,
-0.8586030602455139,
-0.5899524688720703,
2.029219150543213,
-0.27994418144226074,
0.534464955329895,
-0.14874182641506195,
-1.3019704818725586,
-0.10179118812084198,
0.7645267248153687,
0.33565133810043335,
-0.35973435640335083,
0.8560205698013306,
-0.6100935935974121,
-1.0674532651901245,
-1.2682337760925293,
-0.43070656061172485,
-0.8651999235153198,
-0.9346226453781128,
0.9880849123001099,
0.7750756144523621,
0.4385495185852051,
1.9294019937515259,
0.5845171213150024,
0.22137092053890228,
-2.634514331817627,
0.9664664268493652,
0.30646902322769165,
-0.06275001913309097,
0.9895354509353638,
0.20896591246128082,
1.1394000053405762,
0.03807470202445984,
0.5406171083450317,
-2.400728464126587,
2.2191762924194336,
-0.28160515427589417,
0.7551879286766052,
-0.005096453242003918,
-0.2169220745563507,
1.2225691080093384,
0.6187204718589783,
0.5530727505683899,
-1.2096160650253296,
0.7625301480293274,
-0.6108796000480652,
1.1453146934509277,
0.8724662065505981,
-0.7472937107086182,
0.09272520244121552,
1.322194218635559,
0.4280361831188202,
-0.4818896949291229,
-0.9715179204940796,
-0.8620792031288147,
0.9819338917732239,
1.761461615562439,
-0.1284901350736618,
0.036187030375003815,
0.7187314033508301,
0.6921457648277283,
-1.257392168045044,
0.06993959844112396,
-0.7899612784385681,
-0.7435243129730225,
1.6465739011764526,
1.9576048851013184,
-0.03749461472034454,
-0.2523309588432312,
-0.5987047553062439,
-1.2417811155319214,
0.7474973797798157,
0.02875603921711445,
0.2024611532688141,
0.6217753887176514,
-0.6858121156692505,
1.185951590538025,
0.7643712759017944,
0.9806397557258606,
-0.12271535396575928,
0.3349866569042206,
0.34270691871643066,
-0.3121606707572937,
-1.0956523418426514,
-0.2941434979438782,
-1.18931245803833,
-2.451624631881714,
0.446106880903244,
-0.28391554951667786,
-1.4719212055206299,
-0.011252902448177338,
-1.0374923944473267,
0.8998835682868958,
-0.637962818145752,
-1.1201775074005127,
-1.61411714553833,
0.21689294278621674,
-0.14809377491474152,
0.8569740056991577,
-1.6290591955184937,
-0.1878814846277237,
1.203595519065857,
0.8521865606307983,
-0.5293242335319519,
1.056753158569336,
0.22221018373966217,
0.9605897068977356,
0.8030805587768555,
-0.3673672676086426,
0.35448431968688965,
0.0938505008816719,
-1.3468812704086304,
0.4652165472507477,
1.2583783864974976,
0.23071198165416718,
1.3756479024887085,
-0.4920444190502167,
0.09533962607383728,
0.44036543369293213,
-0.557988703250885,
-0.5479961037635803,
-0.4911629557609558,
0.7571685314178467,
0.12416885048151016,
-1.0029692649841309,
-0.0007577580399811268,
-0.16629549860954285,
-0.18658554553985596,
0.21694792807102203,
-1.498143196105957,
-0.2888975441455841,
-0.3882185220718384,
-0.43918395042419434,
-1.252060055732727,
0.04336532950401306,
1.3634661436080933,
-0.8629159927368164,
-0.15466514229774475,
0.48910704255104065,
0.47058606147766113,
0.5224202871322632,
0.5626590251922607,
-0.6609712839126587,
-0.4460071325302124,
-0.22342722117900848,
-0.3157816529273987,
0.16850002110004425,
1.1683874130249023,
-0.030639512464404106,
-0.9436187148094177,
0.6106937527656555,
-0.4549969732761383,
0.08597541600465775,
1.9582676887512207,
-0.027203930541872978,
-0.6999844312667847,
0.3641414940357208,
-0.6946314573287964,
1.8232887983322144,
1.6659561395645142,
1.379860520362854,
-0.0942893996834755,
-0.8380065560340881,
0.6227104067802429,
-0.27525466680526733,
-0.33932748436927795,
0.9564263820648193,
0.491455078125,
-0.20030800998210907,
-1.4389915466308594,
0.5182724595069885,
1.2680853605270386,
-0.8793640732765198,
-0.7099810838699341,
-0.0054501937702298164,
-0.8109942078590393,
1.1121906042099,
0.6254498958587646,
0.32246971130371094,
0.20643185079097748,
1.6524790525436401,
0.6406737565994263,
-0.5006541013717651,
0.4808028042316437,
0.5289806127548218,
-0.21738404035568237,
-2.150930404663086,
-1.1162022352218628,
0.19404734671115875,
-0.291066974401474,
-1.552005648612976,
1.4057409763336182,
-1.181978464126587,
-0.9143446087837219,
0.5162615776062012,
0.19219717383384705,
1.4328259229660034,
0.3519296944141388,
1.6476221084594727,
2.14839243888855,
0.8932942152023315,
0.3771115243434906,
1.2407214641571045,
-0.068604975938797,
-0.4891853630542755,
1.8524532318115234,
-0.5013970732688904,
0.49147698283195496,
1.038015365600586,
-0.39697015285491943,
-1.131582260131836,
-0.8172693848609924,
-1.1565419435501099,
-0.6317576766014099,
1.2430047988891602,
0.11891990154981613,
-1.2004811763763428,
0.17484302818775177,
1.7007834911346436,
0.09869211167097092,
-0.35017818212509155,
0.572544276714325,
0.4807615578174591,
-0.770720899105072,
-0.09224623441696167,
-0.9769506454467773,
0.4453849792480469,
-0.12516555190086365,
-0.30637291073799133,
0.3216860592365265,
0.5789533853530884,
1.2647970914840698,
-0.003947562072426081,
0.03310086578130722,
1.1332752704620361,
-1.4983415603637695,
1.5751579999923706,
-0.6622170209884644,
0.2521047294139862,
-2.4317729473114014,
1.5225642919540405,
-0.8107647895812988,
1.9562405347824097,
-2.615961790084839,
0.3261019289493561,
-0.6998580694198608,
-0.48486730456352234,
0.3083789348602295,
-0.38203856348991394,
0.15553341805934906,
-0.12390506267547607,
-0.9562111496925354,
-0.09505657106637955,
-0.7261195182800293,
0.5451517701148987,
1.2132248878479004,
1.311712622642517,
-1.20875084400177,
-0.24039345979690552,
-1.6881918907165527,
-0.2055455446243286,
-0.6584930419921875,
0.3339979946613312,
-2.0348708629608154,
-0.08922377228736877,
-1.980704665184021,
-2.181889295578003,
-1.4362157583236694,
-0.8524811863899231,
1.0525254011154175,
0.15123935043811798,
-0.914689302444458,
1.1669508218765259,
-0.3561253249645233,
-1.7831547260284424,
1.152644395828247,
-2.171292543411255
] |
https://github.com/huggingface/datasets/issues/5032 | new dataset type: single-label and multi-label video classification | @sayakpaul I did do quite a bit of work on [this PR](https://github.com/huggingface/datasets/pull/4532) a while back to add a video feature. It's outdated, but uses my `encoded_video` [package](https://github.com/nateraw/encoded-video) under the hood, which is basically a wrapper around PyAV stolen from [pytorchvideo](https://github.com/facebookresearch/pytorchvideo/) that gets rid of the `torch` dependency.
would be really great to get something like this in...it's just a really tricky and time consuming feature to add. | **Is your feature request related to a problem? Please describe.**
In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset.
**Describe the solution you'd like**
Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model.
**Describe alternatives you've considered**
Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative.
**Additional context**
I am wiling to open a PR but don't know where to start.
| 505 | 67 | new dataset type: single-label and multi-label video classification
**Is your feature request related to a problem? Please describe.**
In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset.
**Describe the solution you'd like**
Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model.
**Describe alternatives you've considered**
Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative.
**Additional context**
I am wiling to open a PR but don't know where to start.
@sayakpaul I did do quite a bit of work on [this PR](https://github.com/huggingface/datasets/pull/4532) a while back to add a video feature. It's outdated, but uses my `encoded_video` [package](https://github.com/nateraw/encoded-video) under the hood, which is basically a wrapper around PyAV stolen from [pytorchvideo](https://github.com/facebookresearch/pytorchvideo/) that gets rid of the `torch` dependency.
would be really great to get something like this in...it's just a really tricky and time consuming feature to add. | [
-1.274389624595642,
-1.0882052183151245,
-0.8139017820358276,
1.4330267906188965,
-0.20799000561237335,
-1.2409993410110474,
0.08690682053565979,
-1.0074124336242676,
1.6284829378128052,
-0.7543582916259766,
0.28401821851730347,
-1.60226309299469,
0.1198655515909195,
-0.5548564791679382,
-0.8262999057769775,
-0.7728625535964966,
-0.38951584696769714,
-0.8437962532043457,
1.035523772239685,
2.5333971977233887,
1.128374457359314,
-1.4592500925064087,
2.692124605178833,
0.665550172328949,
-0.1987331509590149,
-1.0622082948684692,
0.44891682267189026,
0.17972174286842346,
-1.267566442489624,
-0.465099573135376,
-0.9241880774497986,
0.015669047832489014,
-0.6022623181343079,
-0.5829081535339355,
0.06529267132282257,
0.3689531087875366,
-0.17507195472717285,
-0.42030957341194153,
-0.6229618191719055,
-0.6777932047843933,
0.4539647102355957,
-0.33701518177986145,
0.9573723673820496,
-0.2772631049156189,
1.7621417045593262,
-0.5834076404571533,
0.40686318278312683,
0.6443638205528259,
1.3945335149765015,
0.2436695247888565,
0.03340362012386322,
0.2717640995979309,
0.5204342603683472,
-0.07353387027978897,
0.4346372187137604,
1.1893224716186523,
0.6513651013374329,
0.4908754825592041,
0.7459325194358826,
-2.1879329681396484,
1.3776988983154297,
-1.0185033082962036,
0.37405890226364136,
1.34822678565979,
-0.9653892517089844,
0.4091718792915344,
-1.755518913269043,
-0.10838630795478821,
0.5572529435157776,
-2.240247964859009,
0.1748901754617691,
-1.2751985788345337,
-0.5635273456573486,
0.9286229610443115,
0.2541499733924866,
-1.2848018407821655,
0.2026054859161377,
-0.500005304813385,
0.9829024076461792,
0.3821465075016022,
1.1961119174957275,
-1.6473159790039062,
-0.04747200384736061,
-0.21622025966644287,
0.1827661693096161,
-1.1810696125030518,
-1.5518969297409058,
0.5353317260742188,
0.599551260471344,
0.5200871825218201,
-0.16210922598838806,
0.9587103128433228,
-1.0490028858184814,
0.9168168902397156,
-0.977039635181427,
-1.6117982864379883,
-1.4237256050109863,
-2.277081251144409,
-2.3084516525268555,
0.8986911773681641,
-0.4896319806575775,
-0.5546039342880249,
2.0129082202911377,
-1.016104817390442,
-1.8098077774047852,
1.1446141004562378,
0.3334534466266632,
0.08660552650690079,
2.3546924591064453,
0.1655033528804779,
-0.7388878464698792,
0.49590572714805603,
-0.7554143667221069,
0.8903065323829651,
-0.45524680614471436,
1.4087982177734375,
0.5178351402282715,
-0.8677533864974976,
1.584201693534851,
-0.3614429831504822,
0.5216659307479858,
-0.6439008116722107,
-0.4571438431739807,
-0.8073744177818298,
0.4589137136936188,
1.9099860191345215,
-0.2637300491333008,
1.6223113536834717,
-0.3676939904689789,
-1.634874701499939,
-1.5357187986373901,
0.8577116131782532,
0.5803257822990417,
-0.8570831418037415,
0.07184765487909317,
-0.41821250319480896,
0.11425568908452988,
0.025094177573919296,
1.1149988174438477,
1.3054535388946533,
0.7223715782165527,
-0.3332248032093048,
-0.9574905633926392,
0.21381708979606628,
-0.1534881740808487,
-0.65230792760849,
-1.8706988096237183,
-0.38025572896003723,
0.21480043232440948,
0.66505366563797,
-1.2326781749725342,
1.6470541954040527,
0.9491163492202759,
2.027277708053589,
0.962791919708252,
-0.43442273139953613,
1.5354353189468384,
0.023241691291332245,
1.8274768590927124,
-0.5783571004867554,
0.7412391901016235,
-0.36200323700904846,
-1.0818673372268677,
0.7874987125396729,
-0.4201767146587372,
-1.9843859672546387,
-0.6540958881378174,
-0.8751785159111023,
-0.19563500583171844,
-0.7407228350639343,
0.8903341293334961,
-0.21350815892219543,
-1.4118688106536865,
0.2549147605895996,
-0.661558985710144,
0.16414614021778107,
-1.1513792276382446,
0.23858749866485596,
0.7706463932991028,
-0.609321117401123,
0.009190120734274387,
-0.2910629212856293,
-1.3410435914993286,
-0.5766655802726746,
0.3043065667152405,
1.8513121604919434,
-0.7916063070297241,
0.9940682053565979,
0.9563429951667786,
-0.6477476358413696,
0.06615115702152252,
0.39705997705459595,
-0.3001880645751953,
0.8722452521324158,
-1.1389946937561035,
-0.37271741032600403,
1.0685765743255615,
-0.20222578942775726,
-0.44863438606262207,
1.4237101078033447,
0.8379077911376953,
-0.9075575470924377,
-0.22094708681106567,
-0.12823833525180817,
-0.8004022836685181,
-0.008573377504944801,
-1.5605329275131226,
-0.22934846580028534,
0.1694328635931015,
-1.4973838329315186,
-0.5103504657745361,
-0.3152614235877991,
1.2007099390029907,
-0.19268955290317535,
1.3901208639144897,
-0.3578544855117798,
-0.31572404503822327,
-0.441597580909729,
-0.40303516387939453,
0.1687205582857132,
-0.30778244137763977,
-0.6548425555229187,
0.31716760993003845,
-0.8184946179389954,
0.43771928548812866,
1.4909307956695557,
0.4212563633918762,
0.012186083011329174,
0.4622308909893036,
1.0788532495498657,
0.37046360969543457,
0.006809833459556103,
-0.8919361233711243,
-1.5462024211883545,
2.0027916431427,
-1.5301530361175537,
1.9715009927749634,
0.8136075139045715,
-0.007995306514203548,
-1.7286165952682495,
-1.8099876642227173,
1.3547803163528442,
1.2155460119247437,
2.4302797317504883,
0.6314841508865356,
0.31093165278434753,
-0.7907868027687073,
-0.6425444483757019,
0.2924601137638092,
-1.0745108127593994,
-0.7689880132675171,
0.0476461686193943,
2.3299973011016846,
1.7578822374343872,
-0.5417313575744629,
-0.21467651426792145,
-1.0148786306381226,
1.3887819051742554,
-0.1329420506954193,
0.20548498630523682,
2.0410754680633545,
-0.23938463628292084,
-1.0323364734649658,
1.3174675703048706,
-2.2756967544555664,
0.1958877444267273,
2.0334973335266113,
0.3810223937034607,
0.12900611758232117,
-1.4117687940597534,
-0.6044418811798096,
-0.27065032720565796,
-0.38971540331840515,
-1.23797607421875,
0.5589609146118164,
-0.2747516930103302,
-0.8366422057151794,
-1.589275598526001,
0.07420258969068527,
-1.177122712135315,
-1.68318510055542,
0.37106671929359436,
1.9028047323226929,
2.0452654361724854,
-0.7089654207229614,
1.4399425983428955,
-0.21682512760162354,
0.05505366995930672,
1.233306884765625,
1.2167936563491821,
3.104321241378784,
1.9318662881851196,
-1.203413963317871,
0.5841190218925476,
-0.2137714922428131,
-0.48965945839881897,
1.122981071472168,
-1.0623576641082764,
1.1534262895584106,
-0.13899704813957214,
-1.1247408390045166,
-1.1726322174072266,
1.0429660081863403,
0.4683329463005066,
0.0672706589102745,
-0.52967768907547,
1.1479260921478271,
0.09626512974500656,
1.2675681114196777,
0.5415871739387512,
-0.3295891284942627,
0.6238381862640381,
-0.45345011353492737,
-0.5557390451431274,
1.6008737087249756,
0.15337149798870087,
-1.5332456827163696,
-2.3075478076934814,
-0.19933567941188812,
-0.8441509008407593,
0.005512954667210579,
-0.6758257150650024,
-1.0515110492706299,
1.6189963817596436,
0.4626956284046173,
-1.3123493194580078,
-0.2592071294784546,
-0.3861537277698517,
-0.7214727401733398,
2.637211799621582,
-1.4032769203186035,
-0.3233312666416168,
-0.9412570595741272,
-0.49154046177864075,
1.5684906244277954,
-1.169089913368225,
-0.15774086117744446,
-1.0749495029449463,
-0.6148077845573425,
-1.2849912643432617,
-0.5375989675521851,
-0.07649167627096176,
-0.8078370094299316,
0.7199809551239014,
0.07390341907739639,
-1.110853672027588,
-0.3236417770385742,
-0.9219315648078918,
0.7820755243301392,
-0.08883830159902573,
0.2484205812215805,
1.967317819595337,
0.37364834547042847,
-0.3900030851364136,
0.7301952838897705,
1.2316322326660156,
0.6080063581466675,
-0.6890401840209961,
0.13066133856773376,
-0.6357188820838928,
0.31275975704193115,
-1.3188480138778687,
0.3651407063007355,
-2.826279640197754,
0.7802766561508179,
-0.026983145624399185,
-0.19827023148536682,
0.020590126514434814,
-1.389967918395996,
1.187650203704834,
2.6487953662872314,
-1.1442115306854248,
0.42755404114723206,
0.3057965338230133,
1.1808648109436035,
-1.6336454153060913,
0.420555979013443,
-0.37307238578796387,
2.1493074893951416,
0.28220441937446594,
1.1525113582611084,
-0.591123104095459,
-2.2543368339538574,
0.5685287117958069,
-1.1689716577529907,
-1.0347589254379272,
0.6207857131958008,
-0.8113587498664856,
0.04797065258026123,
-1.487315058708191,
-0.17058920860290527,
-0.847769021987915,
-1.1892720460891724,
0.6957129240036011,
0.0855855792760849,
0.4009830951690674,
-0.6539823412895203,
0.3379017114639282,
-2.188589334487915,
-1.4281361103057861,
-0.2574683427810669,
-0.9029253125190735,
0.5156913995742798,
-0.39717400074005127,
0.6369306445121765,
-0.08106619864702225,
0.04644978418946266,
0.2629694640636444,
1.4447587728500366,
3.4039809703826904,
0.25901395082473755,
0.4394758343696594,
-0.13228780031204224,
-0.8844550848007202,
1.441798448562622,
1.017394781112671,
-0.015208862721920013,
-0.5817536115646362,
-1.0041736364364624,
1.334545612335205,
1.9585570096969604,
0.9994955658912659,
0.07916282117366791,
-0.8177973628044128,
-0.6918877363204956,
0.00856264028698206,
0.19148725271224976,
0.45771101117134094,
1.0137933492660522,
0.055624742060899734,
0.1581757515668869,
1.486326813697815,
1.2770743370056152,
-0.5104197263717651,
0.42451226711273193,
-0.8533729910850525,
-0.3950778841972351,
0.37506839632987976,
0.3378903567790985,
0.03834114596247673,
0.3888867199420929,
-0.9611491560935974,
-0.24233469367027283,
-0.33429738879203796,
-1.0429044961929321,
-0.7651851773262024,
-0.42584511637687683,
-0.38689765334129333,
1.7420895099639893,
0.18408741056919098,
-0.5639165639877319,
-0.0833948403596878,
-0.8127526640892029,
-0.034586742520332336,
-1.0755207538604736,
0.2790074050426483,
-0.01961958035826683,
-0.06507600098848343,
-0.09273920953273773,
1.7932881116867065,
-0.8994647860527039,
-2.108476400375366,
0.28123927116394043,
0.26104897260665894,
-0.5100893378257751,
0.17228178679943085,
1.6305222511291504,
0.5158185362815857,
1.4651483297348022,
1.36509370803833,
1.0487682819366455,
-0.618125319480896,
-1.2880945205688477,
0.6155113577842712,
0.8743836283683777,
-1.3730934858322144,
0.7701777815818787,
0.030729256570339203,
-0.4727829396724701,
0.726681113243103,
1.4181146621704102,
0.3732786476612091,
-2.0568270683288574,
0.7735211849212646,
-0.8860216736793518,
0.8441233038902283,
0.6414328217506409,
0.6712005734443665,
0.2058291882276535,
0.8622745275497437,
-1.3224573135375977,
-1.0847876071929932,
-0.8416111469268799,
-0.6166286468505859,
1.9925177097320557,
-0.2769302427768707,
0.55293208360672,
-0.1753118932247162,
-1.3152772188186646,
-0.11760527640581131,
0.7286335229873657,
0.4004795551300049,
-0.40673214197158813,
0.8381626009941101,
-0.6504527926445007,
-1.0854618549346924,
-1.3470444679260254,
-0.45545944571495056,
-0.875384509563446,
-0.9403825998306274,
0.999958336353302,
0.7921983599662781,
0.41264960169792175,
1.9448490142822266,
0.5892748832702637,
0.1722199022769928,
-2.659726142883301,
0.8926254510879517,
0.3004584312438965,
-0.0438213013112545,
0.9137136936187744,
0.2318311631679535,
1.1084362268447876,
-0.01197151467204094,
0.5107488632202148,
-2.364959239959717,
2.217869281768799,
-0.23147369921207428,
0.7594462633132935,
0.04308230057358742,
-0.142754927277565,
1.207566499710083,
0.5700995326042175,
0.5612144470214844,
-1.1234592199325562,
0.6987236142158508,
-0.609521746635437,
1.2017651796340942,
0.8372386693954468,
-0.7023698687553406,
0.026022471487522125,
1.3051402568817139,
0.4735237658023834,
-0.49959033727645874,
-0.9691245555877686,
-0.9126258492469788,
0.9306811690330505,
1.7518280744552612,
-0.12603119015693665,
0.005217093043029308,
0.763518750667572,
0.6696938872337341,
-1.279152512550354,
0.11108756065368652,
-0.8039175271987915,
-0.7518823742866516,
1.6390016078948975,
2.0026779174804688,
-0.06250179558992386,
-0.23408107459545135,
-0.5900344848632812,
-1.2992701530456543,
0.7244038581848145,
0.04398353397846222,
0.16266785562038422,
0.6685047745704651,
-0.6074845790863037,
1.1195240020751953,
0.8541203737258911,
0.9298031330108643,
0.012591090984642506,
0.3478512465953827,
0.33308011293411255,
-0.35440531373023987,
-1.1460859775543213,
-0.2935001850128174,
-1.1767427921295166,
-2.4467077255249023,
0.4577223062515259,
-0.23659056425094604,
-1.4684804677963257,
0.0031122900545597076,
-1.0433400869369507,
0.8634708523750305,
-0.5987573862075806,
-1.0540515184402466,
-1.5864319801330566,
0.1794789731502533,
-0.11105263978242874,
0.8631675839424133,
-1.5886375904083252,
-0.13806916773319244,
1.1256400346755981,
0.8524895310401917,
-0.6064003705978394,
1.0510722398757935,
0.20812831819057465,
1.005918264389038,
0.8619094491004944,
-0.38776305317878723,
0.34470969438552856,
0.09123403578996658,
-1.3659814596176147,
0.46706855297088623,
1.1674023866653442,
0.25411882996559143,
1.3711230754852295,
-0.5710349082946777,
0.11635401099920273,
0.4569452106952667,
-0.5259666442871094,
-0.4715138375759125,
-0.5311926603317261,
0.7136656045913696,
0.04827108979225159,
-0.9703308343887329,
0.021475158631801605,
-0.09443830698728561,
-0.21311993896961212,
0.2459694892168045,
-1.5077614784240723,
-0.2536581754684448,
-0.3847803771495819,
-0.5096670389175415,
-1.233394980430603,
-0.01296938769519329,
1.375009536743164,
-0.8365698456764221,
-0.15823538601398468,
0.5234572887420654,
0.49570783972740173,
0.49867579340934753,
0.601790726184845,
-0.6166219711303711,
-0.4173678755760193,
-0.19930487871170044,
-0.2936103641986847,
0.21182751655578613,
1.2097183465957642,
-0.10496007651090622,
-0.9456313252449036,
0.6522907614707947,
-0.45324087142944336,
0.06670030951499939,
1.918265461921692,
-0.005505942739546299,
-0.7609670162200928,
0.35138484835624695,
-0.7203946113586426,
1.89129638671875,
1.706070899963379,
1.323929786682129,
-0.09991486370563507,
-0.9025893211364746,
0.6072239875793457,
-0.26192212104797363,
-0.41048434376716614,
0.9124575257301331,
0.408825159072876,
-0.1625407487154007,
-1.3568875789642334,
0.5631634593009949,
1.2976562976837158,
-0.8969069719314575,
-0.8178102970123291,
0.040279537439346313,
-0.8594474196434021,
1.0709244012832642,
0.5861340761184692,
0.3774643838405609,
0.2353304773569107,
1.6771448850631714,
0.7080112099647522,
-0.47423046827316284,
0.49743667244911194,
0.5330109596252441,
-0.19417700171470642,
-2.1399190425872803,
-1.1870917081832886,
0.14122384786605835,
-0.40469062328338623,
-1.5714448690414429,
1.3470747470855713,
-1.220694899559021,
-0.9097005724906921,
0.5990460515022278,
0.1703563630580902,
1.4440439939498901,
0.3149784207344055,
1.6319199800491333,
2.1259381771087646,
0.84792160987854,
0.40522634983062744,
1.3019133806228638,
-0.07251862436532974,
-0.5131608247756958,
1.8226428031921387,
-0.48070821166038513,
0.5365144610404968,
1.0578420162200928,
-0.36458876729011536,
-1.1255806684494019,
-0.774604856967926,
-1.1248975992202759,
-0.6514067649841309,
1.1538439989089966,
0.1653362214565277,
-1.2009031772613525,
0.1983957588672638,
1.6766185760498047,
0.09290551394224167,
-0.335487425327301,
0.4894677400588989,
0.45275670289993286,
-0.7667967677116394,
-0.010141173377633095,
-0.9918432831764221,
0.4654902517795563,
-0.14006373286247253,
-0.3476294279098511,
0.3925352394580841,
0.5107194185256958,
1.1848766803741455,
-0.0018845684826374054,
0.06946942955255508,
1.128552794456482,
-1.4705928564071655,
1.5674642324447632,
-0.5971678495407104,
0.30176618695259094,
-2.417340040206909,
1.520034909248352,
-0.8289903402328491,
1.9468262195587158,
-2.641765594482422,
0.3545316755771637,
-0.711373507976532,
-0.5442597270011902,
0.38671064376831055,
-0.3837044835090637,
0.1787375956773758,
-0.11569695174694061,
-1.070896863937378,
-0.04558638483285904,
-0.7571355700492859,
0.46933332085609436,
1.2322707176208496,
1.309895396232605,
-1.1495795249938965,
-0.2840774357318878,
-1.715214490890503,
-0.1798437386751175,
-0.6343460083007812,
0.3537263870239258,
-2.0142624378204346,
-0.09878487884998322,
-1.8677637577056885,
-2.2063584327697754,
-1.4482672214508057,
-0.8535820245742798,
1.0209734439849854,
0.09952923655509949,
-0.8704380393028259,
1.1433674097061157,
-0.3710660934448242,
-1.8098719120025635,
1.1413639783859253,
-2.173886299133301
] |
https://github.com/huggingface/datasets/issues/5028 | passing parameters to the method passed to Dataset.from_generator() | Hi! Yes, you can either use the `gen_kwargs` param in `Dataset.from_generator` (`ds = Dataset.from_generator(gen, gen_kwargs={"param1": val})`) or wrap the generator function with `functools.partial`
(`ds = Dataset.from_generator(functools.partial(gen, param1="val"))`) to pass custom parameters to it.
| Big thanks for providing dataset creation via a generator.
I want to ask whether there is any way that parameters can be passed to the method Dataset.from_generator() method, like as follows.
```
from datasets import Dataset
def gen(param1):
for idx in len(custom_dataset):
yield custom_dataset[idx] + param1
ds = Dataset.from_generator(gen(param1))
```
| 506 | 33 | passing parameters to the method passed to Dataset.from_generator()
Big thanks for providing dataset creation via a generator.
I want to ask whether there is any way that parameters can be passed to the method Dataset.from_generator() method, like as follows.
```
from datasets import Dataset
def gen(param1):
for idx in len(custom_dataset):
yield custom_dataset[idx] + param1
ds = Dataset.from_generator(gen(param1))
```
Hi! Yes, you can either use the `gen_kwargs` param in `Dataset.from_generator` (`ds = Dataset.from_generator(gen, gen_kwargs={"param1": val})`) or wrap the generator function with `functools.partial`
(`ds = Dataset.from_generator(functools.partial(gen, param1="val"))`) to pass custom parameters to it.
| [
-1.2368030548095703,
-0.9834827184677124,
-0.766083300113678,
1.5457831621170044,
-0.18394212424755096,
-1.3111870288848877,
0.2394191175699234,
-1.145699143409729,
1.7140769958496094,
-0.8740176558494568,
0.5033470988273621,
-1.7543408870697021,
0.09348218888044357,
-0.5692538619041443,
-0.8877478241920471,
-0.9006010890007019,
-0.48415109515190125,
-0.714225709438324,
1.0763118267059326,
2.427738666534424,
1.1766983270645142,
-1.1918853521347046,
2.662386655807495,
0.6423359513282776,
-0.25945499539375305,
-1.0706369876861572,
0.5108326077461243,
0.04222600907087326,
-1.2186356782913208,
-0.4296373724937439,
-1.0712618827819824,
-0.09796279668807983,
-0.5699626803398132,
-0.599466860294342,
0.04684264212846756,
0.4497414231300354,
-0.3653523623943329,
-0.42296162247657776,
-0.4855565130710602,
-0.9054842591285706,
0.5407819151878357,
-0.40178367495536804,
0.9339195489883423,
-0.4472426176071167,
1.8468424081802368,
-0.6242342591285706,
0.5694979429244995,
0.6761147975921631,
1.3858343362808228,
0.16189917922019958,
-0.14482519030570984,
0.47798678278923035,
0.28632861375808716,
0.088639035820961,
0.4460226893424988,
1.1023861169815063,
0.5323106646537781,
0.5623112916946411,
0.7548250555992126,
-2.097827196121216,
1.2852082252502441,
-1.0744047164916992,
0.31070950627326965,
1.4260553121566772,
-1.0544930696487427,
0.27738139033317566,
-1.7191671133041382,
-0.11487825214862823,
0.49610528349876404,
-2.1867523193359375,
0.23981942236423492,
-1.3173152208328247,
-0.4241468906402588,
1.1211270093917847,
0.5293398499488831,
-1.1536377668380737,
0.0296992938965559,
-0.37859591841697693,
0.9114948511123657,
0.4105944335460663,
0.9815011024475098,
-1.589952826499939,
0.07581164687871933,
-0.4505116045475006,
0.09087070822715759,
-1.3388081789016724,
-1.421478271484375,
0.6479318737983704,
0.6425142288208008,
0.4863761067390442,
-0.20351609587669373,
1.1363720893859863,
-0.8272114992141724,
0.7317366600036621,
-0.9128087162971497,
-1.5997024774551392,
-1.3943710327148438,
-2.280154228210449,
-2.244337797164917,
0.8497524857521057,
-0.3830094635486603,
-0.6029396057128906,
1.9892393350601196,
-1.1393134593963623,
-1.7640247344970703,
1.1704412698745728,
0.12978757917881012,
-0.03578012436628342,
2.2719459533691406,
0.2012360692024231,
-0.6304658055305481,
0.4545016884803772,
-0.6607852578163147,
0.7871713042259216,
-0.24084007740020752,
1.5412520170211792,
0.5481063723564148,
-1.1463545560836792,
1.6078016757965088,
-0.21825562417507172,
0.4918365180492401,
-0.5719456672668457,
-0.5345626473426819,
-0.8380095958709717,
0.30513617396354675,
1.9305487871170044,
-0.2769293487071991,
1.5925644636154175,
-0.36901628971099854,
-1.5176178216934204,
-1.6040133237838745,
0.9133569002151489,
0.49315908551216125,
-0.72344970703125,
0.19299568235874176,
-0.4474741220474243,
0.04571489989757538,
0.014015324413776398,
1.261003851890564,
1.2969242334365845,
0.7037878632545471,
-0.3709048330783844,
-0.8068669438362122,
0.13339966535568237,
-0.0034254607744514942,
-0.789147675037384,
-1.7407746315002441,
-0.5005989074707031,
0.09089601039886475,
0.5700032114982605,
-1.1776947975158691,
1.7210273742675781,
0.9301633834838867,
1.818415641784668,
1.0812824964523315,
-0.2528364062309265,
1.4398874044418335,
-0.030239876359701157,
1.9619182348251343,
-0.523569643497467,
0.7032110095024109,
-0.2309635877609253,
-1.1830635070800781,
0.7976301312446594,
-0.2734381854534149,
-2.13663649559021,
-0.9299717545509338,
-0.9026520848274231,
-0.09938182681798935,
-0.798966646194458,
0.9214844107627869,
-0.45390865206718445,
-1.441957712173462,
0.27607089281082153,
-0.789073646068573,
0.18747426569461823,
-1.2234110832214355,
0.3535262942314148,
0.5785014629364014,
-0.6936637759208679,
0.08039509505033493,
-0.19316820800304413,
-1.1854356527328491,
-0.4659525752067566,
0.2575370669364929,
1.8446818590164185,
-0.7696740031242371,
0.9522807002067566,
1.0295765399932861,
-0.7620324492454529,
-0.07733426243066788,
0.2930591404438019,
-0.3726452887058258,
0.9425101280212402,
-0.9730263352394104,
-0.5160104632377625,
1.3367023468017578,
-0.10528939962387085,
-0.6497002840042114,
1.6430286169052124,
0.760552704334259,
-0.9069961309432983,
-0.15657323598861694,
-0.28484711050987244,
-0.8497103452682495,
-0.03351015970110893,
-1.6924517154693604,
-0.08895841985940933,
0.4508863687515259,
-1.5226044654846191,
-0.474752813577652,
-0.10162407159805298,
1.325968861579895,
-0.18191485106945038,
1.3965929746627808,
-0.34855639934539795,
-0.34941649436950684,
-0.2273949682712555,
-0.2464466691017151,
0.12265457212924957,
-0.061668962240219116,
-0.6879711151123047,
0.24931024014949799,
-0.7586270570755005,
0.5305560231208801,
1.4023023843765259,
0.4106244742870331,
0.09540262818336487,
0.6812276244163513,
1.1197491884231567,
0.299765944480896,
-0.09029679745435715,
-0.7923654317855835,
-1.6218165159225464,
1.988571286201477,
-1.339221477508545,
1.92024564743042,
0.6266103982925415,
-0.03701566904783249,
-1.7250699996948242,
-1.7408981323242188,
1.3374251127243042,
1.3131771087646484,
2.1457631587982178,
0.6062895655632019,
0.34225842356681824,
-0.8311423659324646,
-0.7142159342765808,
0.35726746916770935,
-1.1144546270370483,
-0.7275581359863281,
0.18735386431217194,
2.328491687774658,
1.8163371086120605,
-0.3994205594062805,
-0.2177157700061798,
-1.1089684963226318,
1.2767456769943237,
-0.3619070053100586,
0.18269576132297516,
1.9699269533157349,
-0.2621053159236908,
-1.2189053297042847,
1.314323902130127,
-2.2573721408843994,
0.009438017383217812,
1.9251184463500977,
0.2412690669298172,
0.020755857229232788,
-1.461991310119629,
-0.6124855279922485,
-0.2445651739835739,
-0.32004687190055847,
-1.3066058158874512,
0.4714672267436981,
-0.3318062722682953,
-0.7960816621780396,
-1.3363978862762451,
0.15312662720680237,
-1.1064542531967163,
-1.6696866750717163,
0.29490402340888977,
1.7360923290252686,
1.9426349401474,
-0.5795175433158875,
1.4682058095932007,
-0.28833478689193726,
0.2597147226333618,
1.2698657512664795,
1.2448734045028687,
3.134963035583496,
1.8828444480895996,
-1.3573901653289795,
0.6903977394104004,
-0.1225452646613121,
-0.6381440758705139,
1.3432310819625854,
-1.1915444135665894,
1.2804690599441528,
-0.1845390647649765,
-1.237665057182312,
-1.2398428916931152,
0.9769840836524963,
0.4304826855659485,
0.04131045937538147,
-0.48814284801483154,
1.2384061813354492,
-0.018651500344276428,
1.3409579992294312,
0.5513752698898315,
-0.4023835062980652,
0.6432840824127197,
-0.4217332899570465,
-0.47420734167099,
1.4819512367248535,
0.23029619455337524,
-1.3533903360366821,
-2.264875650405884,
-0.26699098944664,
-0.8085549473762512,
-0.018436703830957413,
-0.5126333236694336,
-0.9412497878074646,
1.6318237781524658,
0.35312238335609436,
-1.3250188827514648,
-0.2411831021308899,
-0.3153645694255829,
-0.5706066489219666,
2.7378413677215576,
-1.2348206043243408,
-0.26307275891304016,
-1.0107195377349854,
-0.7050020694732666,
1.7514491081237793,
-1.2314460277557373,
-0.29848429560661316,
-1.0948586463928223,
-0.49896109104156494,
-1.3629229068756104,
-0.6244789361953735,
0.044459909200668335,
-1.0622451305389404,
0.8200538158416748,
0.08978446573019028,
-1.0496339797973633,
-0.41140568256378174,
-0.7470372319221497,
0.9570422768592834,
-0.16922955214977264,
0.20040999352931976,
1.8586217164993286,
0.5682565569877625,
-0.45349815487861633,
0.6755955219268799,
1.1029876470565796,
0.6990970969200134,
-0.5791817903518677,
0.35751768946647644,
-0.7163828015327454,
0.2311314046382904,
-1.3804742097854614,
0.32475048303604126,
-2.8706164360046387,
0.6527031064033508,
-0.08720143139362335,
-0.03386087343096733,
-0.15024326741695404,
-1.4249497652053833,
1.0380769968032837,
2.597947359085083,
-1.231640338897705,
0.484186589717865,
0.2317122519016266,
1.0237458944320679,
-1.5746610164642334,
0.3407741189002991,
-0.3952013850212097,
2.0863990783691406,
0.2528079152107239,
1.3074805736541748,
-0.40276801586151123,
-2.12666654586792,
0.7224734425544739,
-1.2797855138778687,
-1.295302391052246,
0.7469428777694702,
-0.8259493112564087,
0.13376498222351074,
-1.380052924156189,
-0.23196996748447418,
-0.8021456003189087,
-1.1358232498168945,
0.7206143140792847,
0.19479288160800934,
0.4836432635784149,
-0.50539231300354,
0.3626639246940613,
-2.1881985664367676,
-1.4465852975845337,
-0.13358980417251587,
-0.962867021560669,
0.553699791431427,
-0.31846365332603455,
0.6174955368041992,
-0.20686115324497223,
-0.02322060987353325,
0.4957963526248932,
1.5757369995117188,
3.4147157669067383,
0.17740100622177124,
0.2178574502468109,
-0.09526747465133667,
-0.8763623237609863,
1.4943211078643799,
0.8128711581230164,
-0.11392435431480408,
-0.5799710154533386,
-0.9977242350578308,
1.1829813718795776,
1.8326009511947632,
0.9741995334625244,
0.04084455221891403,
-0.7568286061286926,
-0.6961989998817444,
-0.10250051319599152,
0.1368410736322403,
0.4444939196109772,
0.8801713585853577,
0.16218030452728271,
0.15073983371257782,
1.3792229890823364,
1.1528747081756592,
-0.5178579688072205,
0.3951272964477539,
-0.7400552034378052,
-0.5592504739761353,
0.5094886422157288,
0.2621786892414093,
-0.12519243359565735,
0.4327486753463745,
-0.9068138599395752,
-0.23654869198799133,
-0.3494429886341095,
-0.9909688830375671,
-0.8156333565711975,
-0.4206884205341339,
-0.47240743041038513,
1.538321852684021,
-0.057016097009181976,
-0.5768979787826538,
-0.20358014106750488,
-0.7565236687660217,
-0.14511296153068542,
-1.1180083751678467,
0.2011735439300537,
-0.06786394864320755,
-0.1987338662147522,
-0.13019675016403198,
1.6266955137252808,
-0.9058961868286133,
-2.063452959060669,
0.27586257457733154,
0.24613551795482635,
-0.4030543565750122,
0.2604067623615265,
1.625963807106018,
0.4902721345424652,
1.4400789737701416,
1.379728078842163,
0.8605818152427673,
-0.6018380522727966,
-1.254557728767395,
0.7219530940055847,
0.8246009945869446,
-1.423404574394226,
0.8103774785995483,
0.047670044004917145,
-0.3790755271911621,
0.5854647755622864,
1.1386253833770752,
0.6894134879112244,
-2.008629083633423,
0.7512124180793762,
-0.9284215569496155,
0.8398807644844055,
0.8025115728378296,
0.7619772553443909,
0.2031693309545517,
0.9301910996437073,
-1.2335739135742188,
-1.1800453662872314,
-0.7491817474365234,
-0.7528746724128723,
2.0381667613983154,
-0.2698565125465393,
0.5643611550331116,
-0.3219367265701294,
-1.2612841129302979,
-0.10380179435014725,
0.7279924750328064,
0.38030558824539185,
-0.6297606229782104,
0.7132131457328796,
-0.6659778356552124,
-1.1163331270217896,
-1.4328012466430664,
-0.4591919183731079,
-1.0638954639434814,
-0.8188652992248535,
1.0723755359649658,
0.7644997239112854,
0.15128237009048462,
1.8145064115524292,
0.6553491353988647,
0.21623294055461884,
-2.6073336601257324,
0.9070871472358704,
0.17773251235485077,
0.04132630676031113,
0.8232054114341736,
0.30902332067489624,
0.9952247142791748,
-0.11090867966413498,
0.548611581325531,
-2.268679141998291,
2.2026472091674805,
-0.13245931267738342,
0.5505825281143188,
-0.13373906910419464,
-0.2272784560918808,
1.1282223463058472,
0.6679735779762268,
0.5784727334976196,
-0.9990720152854919,
0.6808203458786011,
-0.6129742860794067,
1.2549501657485962,
0.9500057101249695,
-0.8583934903144836,
-0.002806750126183033,
1.4921410083770752,
0.5230537056922913,
-0.5147818326950073,
-0.9569269418716431,
-0.8879920840263367,
0.9260153770446777,
1.6355705261230469,
-0.14933589100837708,
-0.045227788388729095,
0.8713676929473877,
0.6858450174331665,
-1.3424322605133057,
0.10624443739652634,
-0.7004246115684509,
-0.6708556413650513,
1.7377426624298096,
2.11889910697937,
-0.27605319023132324,
-0.26232144236564636,
-0.846468985080719,
-1.076609492301941,
0.9017395973205566,
-0.04438819736242294,
0.03769269585609436,
0.5898215770721436,
-0.5940518975257874,
1.1824480295181274,
1.0405638217926025,
0.9441114664077759,
0.2784210741519928,
0.30246129631996155,
0.3106215298175812,
-0.19252800941467285,
-1.167238712310791,
-0.16430038213729858,
-1.1562763452529907,
-2.690368175506592,
0.6291195154190063,
-0.46217337250709534,
-1.4404268264770508,
0.042563363909721375,
-1.0636789798736572,
1.006061315536499,
-0.669563889503479,
-1.0910882949829102,
-1.5554587841033936,
0.17263320088386536,
0.03682125359773636,
0.9379756450653076,
-1.627212405204773,
0.13500988483428955,
1.175655484199524,
0.8860145211219788,
-0.6765735149383545,
0.8665311932563782,
0.25886738300323486,
1.124106764793396,
0.8871708512306213,
-0.35230791568756104,
0.6273766756057739,
-0.01451181247830391,
-1.3587172031402588,
0.5192831754684448,
1.010724663734436,
0.09461095929145813,
1.5683192014694214,
-0.45594796538352966,
0.0509931817650795,
0.472968727350235,
-0.5580845475196838,
-0.44494083523750305,
-0.5296739339828491,
0.7142085433006287,
0.017218155786395073,
-0.8885149359703064,
0.056433066725730896,
0.04133155941963196,
-0.2955184578895569,
0.13500164449214935,
-1.5130572319030762,
-0.16624215245246887,
-0.368908554315567,
-0.6879700422286987,
-1.3106622695922852,
-0.23662768304347992,
1.3084852695465088,
-0.8179348111152649,
-0.11006857454776764,
0.43370985984802246,
0.2720813453197479,
0.6653175354003906,
0.653449296951294,
-0.7165982127189636,
-0.35295259952545166,
-0.269715279340744,
-0.33013203740119934,
0.26722925901412964,
1.3508530855178833,
-0.06798845529556274,
-0.9904844164848328,
0.7535747289657593,
-0.25443655252456665,
-0.0258142352104187,
1.8644133806228638,
0.07362345606088638,
-0.7387563586235046,
0.27026304602622986,
-0.6593385934829712,
1.9192414283752441,
1.7428280115127563,
1.275930404663086,
-0.13346071541309357,
-1.020036220550537,
0.5307518243789673,
-0.3611750900745392,
-0.33080875873565674,
0.8733431100845337,
0.4382428228855133,
-0.04788763076066971,
-1.2386170625686646,
0.8862972259521484,
1.3623037338256836,
-0.8968836069107056,
-0.910116970539093,
0.11327823251485825,
-0.78035968542099,
1.0992103815078735,
0.6621702313423157,
0.32825663685798645,
0.30334895849227905,
1.569555640220642,
0.6318023204803467,
-0.4273475706577301,
0.5788437724113464,
0.45346054434776306,
-0.11995723843574524,
-2.0785489082336426,
-1.1405737400054932,
0.40461888909339905,
-0.5631449222564697,
-1.5790356397628784,
1.336383581161499,
-1.1249727010726929,
-0.8317081928253174,
0.6335711479187012,
0.10335222631692886,
1.646152138710022,
0.3147992193698883,
1.6213788986206055,
2.061586618423462,
0.8658132553100586,
0.3011441230773926,
1.3825725317001343,
-0.007895894348621368,
-0.36302974820137024,
1.7634351253509521,
-0.4339260160923004,
0.5577124357223511,
1.0720449686050415,
-0.21242249011993408,
-1.0781315565109253,
-0.7910850644111633,
-1.2617872953414917,
-0.8123390674591064,
1.211915373802185,
0.1822824329137802,
-1.1632976531982422,
0.18674537539482117,
1.6002612113952637,
0.16326294839382172,
-0.20782360434532166,
0.5575280785560608,
0.3875582814216614,
-0.8302362561225891,
-0.06057973951101303,
-1.0338221788406372,
0.5037865042686462,
-0.2988168001174927,
-0.2667188048362732,
0.3814195692539215,
0.4494306147098541,
1.3145711421966553,
-0.10474500060081482,
0.10024890303611755,
1.1541013717651367,
-1.4451606273651123,
1.46310293674469,
-0.6388777494430542,
0.31298330426216125,
-2.3674323558807373,
1.3630844354629517,
-0.8405606746673584,
1.89390230178833,
-2.7327210903167725,
0.47674164175987244,
-0.6759798526763916,
-0.5204934477806091,
0.2172442376613617,
-0.41771194338798523,
0.12305645644664764,
-0.11862825602293015,
-1.1445494890213013,
0.06833105534315109,
-0.6815866231918335,
0.6336014866828918,
1.2244199514389038,
1.36506187915802,
-1.1215829849243164,
-0.36713528633117676,
-1.7754396200180054,
-0.12410478293895721,
-0.6409937143325806,
0.45471590757369995,
-1.9834721088409424,
-0.12941351532936096,
-1.9210171699523926,
-2.422370433807373,
-1.1666150093078613,
-0.7637083530426025,
1.1876652240753174,
0.09263311326503754,
-0.7687361836433411,
0.9557955265045166,
-0.36522072553634644,
-1.829257845878601,
1.1216217279434204,
-2.1757500171661377
] |
https://github.com/huggingface/datasets/issues/5025 | Custom Json Dataset Throwing Error when batch is False | Hi! Our processors are meant to be used in `batched` mode, so if `batched` is `False`, you need to drop the batch dimension (the error message warns you that the array has an extra dimension meaning it's 4D instead of 3D) to avoid the error:
```python
def prepare_examples(examples):
#Some preporcessing for each image and text as all my data saved in cloud
#For this reason I couldn't set the batch to True.
encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
truncation=True, padding="max_length", return_tensors="np")
# drop extra dim
for k in encoding.items():
encoding[k]=encoding[k][0]
return encoding
``` | ## Describe the bug
A clear and concise description of what the bug is.
I tried to create my custom dataset using below code
```
from datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D
from torchvision import transforms
from transformers import AutoProcessor
# we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes,
# based on the checkpoint we provide from the hub
from datasets import load_dataset
def prepare_examples(examples):
#Some preporcessing for each image and text as all my data saved in cloud
#For this reason I couldn't set the batch to True.
encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
truncation=True, padding="max_length")
# encoding['pixel_values']=np.array(encoding['pixel_values'])
return encoding
dataset = load_dataset("json", data_files='issues.jsonl')
processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False)
features = dataset["train"].features
column_names = dataset["train"].column_names
# we need to define custom features for `set_format` (used later on) to work properly
features = Features({
'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)),
'input_ids': Sequence(feature=Value(dtype='int64')),
'attention_mask': Sequence(Value(dtype='int64')),
'bbox': Array2D(dtype="int64", shape=(512, 4)),
'labels': Sequence(feature=Value(dtype='int64')),
})
train_dataset = dataset["train"].map(
prepare_examples,
batched=False,
remove_columns=column_names,
features=features
)
```
It throws below error.
```
/opt/conda/lib/python3.7/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type)
172 storage = to_pyarrow_listarray(data, pa_type)
--> 173 return pa.ExtensionArray.from_storage(pa_type, storage)
174
/opt/conda/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.ExtensionArray.from_storage()
TypeError: Incompatible storage type list<item: list<item: list<item: list<item: float>>>> for extension type extension<arrow.py_extension_type<Array3DExtensionType>>
```
## Steps to reproduce the bug
```python
# Sample code to reproduce the bug
```
rom datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D
from torchvision import transforms
from transformers import AutoProcessor
# we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes,
# based on the checkpoint we provide from the hub
from datasets import load_dataset
def prepare_examples(examples):
#Some preporcessing for each image and text as all my data saved in cloud
encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
truncation=True, padding="max_length")
# encoding['pixel_values']=np.array(encoding['pixel_values'])
return encoding
dataset = load_dataset("json", data_files='issues.jsonl')
processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False)
features = dataset["train"].features
column_names = dataset["train"].column_names
# we need to define custom features for `set_format` (used later on) to work properly
features = Features({
'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)),
'input_ids': Sequence(feature=Value(dtype='int64')),
'attention_mask': Sequence(Value(dtype='int64')),
'bbox': Array2D(dtype="int64", shape=(512, 4)),
'labels': Sequence(feature=Value(dtype='int64')),
})
train_dataset = dataset["train"].map(
prepare_examples,
batched=False,
remove_columns=column_names,
features=features
)
## Expected results
A clear and concise description of the expected results.
Expected would be similar to all the otherdatasets with no error.
## Actual results
Specify the actual results or traceback.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Unix
- Python version: 3.9
- PyArrow version: 9.0.0
| 507 | 93 | Custom Json Dataset Throwing Error when batch is False
## Describe the bug
A clear and concise description of what the bug is.
I tried to create my custom dataset using below code
```
from datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D
from torchvision import transforms
from transformers import AutoProcessor
# we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes,
# based on the checkpoint we provide from the hub
from datasets import load_dataset
def prepare_examples(examples):
#Some preporcessing for each image and text as all my data saved in cloud
#For this reason I couldn't set the batch to True.
encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
truncation=True, padding="max_length")
# encoding['pixel_values']=np.array(encoding['pixel_values'])
return encoding
dataset = load_dataset("json", data_files='issues.jsonl')
processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False)
features = dataset["train"].features
column_names = dataset["train"].column_names
# we need to define custom features for `set_format` (used later on) to work properly
features = Features({
'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)),
'input_ids': Sequence(feature=Value(dtype='int64')),
'attention_mask': Sequence(Value(dtype='int64')),
'bbox': Array2D(dtype="int64", shape=(512, 4)),
'labels': Sequence(feature=Value(dtype='int64')),
})
train_dataset = dataset["train"].map(
prepare_examples,
batched=False,
remove_columns=column_names,
features=features
)
```
It throws below error.
```
/opt/conda/lib/python3.7/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type)
172 storage = to_pyarrow_listarray(data, pa_type)
--> 173 return pa.ExtensionArray.from_storage(pa_type, storage)
174
/opt/conda/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.ExtensionArray.from_storage()
TypeError: Incompatible storage type list<item: list<item: list<item: list<item: float>>>> for extension type extension<arrow.py_extension_type<Array3DExtensionType>>
```
## Steps to reproduce the bug
```python
# Sample code to reproduce the bug
```
rom datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D
from torchvision import transforms
from transformers import AutoProcessor
# we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes,
# based on the checkpoint we provide from the hub
from datasets import load_dataset
def prepare_examples(examples):
#Some preporcessing for each image and text as all my data saved in cloud
encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
truncation=True, padding="max_length")
# encoding['pixel_values']=np.array(encoding['pixel_values'])
return encoding
dataset = load_dataset("json", data_files='issues.jsonl')
processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False)
features = dataset["train"].features
column_names = dataset["train"].column_names
# we need to define custom features for `set_format` (used later on) to work properly
features = Features({
'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)),
'input_ids': Sequence(feature=Value(dtype='int64')),
'attention_mask': Sequence(Value(dtype='int64')),
'bbox': Array2D(dtype="int64", shape=(512, 4)),
'labels': Sequence(feature=Value(dtype='int64')),
})
train_dataset = dataset["train"].map(
prepare_examples,
batched=False,
remove_columns=column_names,
features=features
)
## Expected results
A clear and concise description of the expected results.
Expected would be similar to all the otherdatasets with no error.
## Actual results
Specify the actual results or traceback.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Unix
- Python version: 3.9
- PyArrow version: 9.0.0
Hi! Our processors are meant to be used in `batched` mode, so if `batched` is `False`, you need to drop the batch dimension (the error message warns you that the array has an extra dimension meaning it's 4D instead of 3D) to avoid the error:
```python
def prepare_examples(examples):
#Some preporcessing for each image and text as all my data saved in cloud
#For this reason I couldn't set the batch to True.
encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
truncation=True, padding="max_length", return_tensors="np")
# drop extra dim
for k in encoding.items():
encoding[k]=encoding[k][0]
return encoding
``` | [
-1.3385146856307983,
-1.0382217168807983,
-0.6617593169212341,
1.649436354637146,
-0.23616673052310944,
-1.1046905517578125,
0.14961199462413788,
-1.053428053855896,
1.578969955444336,
-0.8107315897941589,
0.2963232100009918,
-1.6368200778961182,
-0.02644883282482624,
-0.6181401014328003,
-0.687764585018158,
-0.8656947612762451,
-0.391405314207077,
-0.7266128659248352,
1.1610413789749146,
2.3926842212677,
1.3004984855651855,
-1.4275903701782227,
2.7939951419830322,
0.8191783428192139,
-0.20176169276237488,
-1.054922342300415,
0.540201723575592,
-0.020138775929808617,
-1.2138378620147705,
-0.5104343295097351,
-0.970399022102356,
-0.13540203869342804,
-0.541273832321167,
-0.48414552211761475,
-0.06848767399787903,
0.46039795875549316,
-0.2910930812358856,
-0.4549992084503174,
-0.5243546962738037,
-0.7248919606208801,
0.5127175450325012,
-0.3996005058288574,
0.8594062924385071,
-0.22555388510227203,
1.8284822702407837,
-0.5045316219329834,
0.41068461537361145,
0.6675760746002197,
1.3525898456573486,
0.21401239931583405,
0.025845643132925034,
0.4118252694606781,
0.4107668697834015,
-0.07019588351249695,
0.6318200826644897,
1.2493950128555298,
0.714917778968811,
0.5231993794441223,
0.8401756286621094,
-2.2083165645599365,
1.2734209299087524,
-1.1043078899383545,
0.359502375125885,
1.3948992490768433,
-0.9495947957038879,
0.45354801416397095,
-1.7221758365631104,
-0.054415442049503326,
0.5499011278152466,
-2.1987476348876953,
0.3532080054283142,
-1.3173673152923584,
-0.5422624945640564,
0.9705323576927185,
0.3902994990348816,
-1.2631349563598633,
0.1153402030467987,
-0.4460400938987732,
1.0979104042053223,
0.4400322735309601,
1.0074876546859741,
-1.6769460439682007,
-0.00854193139821291,
-0.2818528413772583,
0.13687334954738617,
-1.272590160369873,
-1.5976555347442627,
0.5190339088439941,
0.5503853559494019,
0.6674327254295349,
-0.1416451632976532,
1.1574838161468506,
-1.1305651664733887,
0.7204753160476685,
-1.0299129486083984,
-1.6119089126586914,
-1.423799753189087,
-2.317373275756836,
-2.210768222808838,
0.6800109148025513,
-0.46460703015327454,
-0.6538916230201721,
2.0750837326049805,
-0.9260544180870056,
-1.730704426765442,
1.2385826110839844,
0.2825378477573395,
0.045314669609069824,
2.4464237689971924,
0.1901812106370926,
-0.7389734387397766,
0.4791892170906067,
-0.8021999597549438,
0.8081885576248169,
-0.3325001895427704,
1.3994072675704956,
0.39003440737724304,
-0.9740495681762695,
1.6757851839065552,
-0.335550993680954,
0.5572950839996338,
-0.6292042136192322,
-0.4738759696483612,
-0.7492241263389587,
0.2661956250667572,
1.9480191469192505,
-0.23828035593032837,
1.4608455896377563,
-0.3825260400772095,
-1.5341897010803223,
-1.6925376653671265,
0.9522883892059326,
0.4025837481021881,
-0.7723273634910583,
0.12972114980220795,
-0.3862428665161133,
0.12758338451385498,
-0.05470389500260353,
1.1821751594543457,
1.2802990674972534,
0.6564631462097168,
-0.362760066986084,
-0.8028962016105652,
0.11799989640712738,
-0.18080352246761322,
-0.7148225903511047,
-1.74545156955719,
-0.36325448751449585,
0.07403229176998138,
0.6541125178337097,
-1.2514081001281738,
1.6903725862503052,
0.8975065350532532,
1.8369697332382202,
1.0412956476211548,
-0.44855421781539917,
1.5061582326889038,
0.11251614987850189,
1.7802878618240356,
-0.6312169432640076,
0.6526154279708862,
-0.4184601902961731,
-1.1611484289169312,
0.8307457566261292,
-0.2711026966571808,
-2.0299623012542725,
-0.824586033821106,
-0.7796757817268372,
-0.18573610484600067,
-0.8143079876899719,
0.9046036005020142,
-0.4073954224586487,
-1.4710993766784668,
0.19072365760803223,
-0.7627265453338623,
0.23008063435554504,
-1.179533839225769,
0.38322409987449646,
0.6828657984733582,
-0.6229149699211121,
0.09633418917655945,
-0.28891393542289734,
-1.2604870796203613,
-0.5021474361419678,
0.35246652364730835,
1.897478461265564,
-0.7644455432891846,
0.8162424564361572,
1.012681245803833,
-0.7603581547737122,
0.006621444597840309,
0.23455621302127838,
-0.22023729979991913,
0.8628504872322083,
-1.0522596836090088,
-0.5947901010513306,
1.1845154762268066,
-0.18816497921943665,
-0.6051823496818542,
1.4703924655914307,
0.8090543150901794,
-0.971878707408905,
-0.2709912955760956,
-0.12203489243984222,
-0.8263500332832336,
-0.01070097554475069,
-1.4364858865737915,
-0.1919262558221817,
0.549962043762207,
-1.5307607650756836,
-0.4698151648044586,
-0.2117103934288025,
1.2845946550369263,
-0.2225038856267929,
1.4843919277191162,
-0.37728044390678406,
-0.15039236843585968,
-0.23988758027553558,
-0.3427419662475586,
0.19715584814548492,
-0.21053645014762878,
-0.5845461487770081,
0.06735751032829285,
-0.8424540162086487,
0.3443056344985962,
1.4687790870666504,
0.3875200152397156,
0.01925923489034176,
0.4900183379650116,
1.207919955253601,
0.48610159754753113,
-0.008470050059258938,
-0.906792938709259,
-1.488613486289978,
1.89650297164917,
-1.5289267301559448,
2.0065884590148926,
0.7396988868713379,
-0.007273443043231964,
-1.7483561038970947,
-1.8208153247833252,
1.3448957204818726,
1.2230985164642334,
2.3224761486053467,
0.4997612237930298,
0.3626866340637207,
-0.8893662095069885,
-0.6931512355804443,
0.23481984436511993,
-1.040700078010559,
-0.723906397819519,
0.1861378699541092,
2.3746590614318848,
1.8590353727340698,
-0.3923183083534241,
-0.18072202801704407,
-0.9530543684959412,
1.4576544761657715,
-0.2575989067554474,
0.27969783544540405,
1.9280530214309692,
-0.22646361589431763,
-1.0706428289413452,
1.3082287311553955,
-2.4380252361297607,
0.15805897116661072,
2.0295166969299316,
0.3446270227432251,
0.10451292991638184,
-1.3373736143112183,
-0.6731299757957458,
-0.23690830171108246,
-0.4961851239204407,
-1.312765121459961,
0.4680779278278351,
-0.29246872663497925,
-0.6926575303077698,
-1.422858476638794,
0.1761188507080078,
-1.1151998043060303,
-1.5961180925369263,
0.22248932719230652,
1.9589234590530396,
2.0946297645568848,
-0.7674537897109985,
1.6334118843078613,
-0.22790096700191498,
0.19847328960895538,
1.2551254034042358,
1.271804690361023,
2.985422134399414,
1.8924312591552734,
-1.2524409294128418,
0.5271793007850647,
-0.1304050087928772,
-0.4971083402633667,
1.1335523128509521,
-1.1914844512939453,
1.2707942724227905,
-0.049521930515766144,
-1.2033536434173584,
-1.215579628944397,
0.9290804862976074,
0.4504096806049347,
0.033204250037670135,
-0.4849201738834381,
1.1554149389266968,
0.027566134929656982,
1.3207411766052246,
0.6581510901451111,
-0.3009431064128876,
0.5640978217124939,
-0.3814948797225952,
-0.5730567574501038,
1.5203570127487183,
0.1267460584640503,
-1.4191921949386597,
-2.143712043762207,
-0.14535516500473022,
-0.7686417102813721,
0.06884442269802094,
-0.6229543685913086,
-1.0177717208862305,
1.6705238819122314,
0.3029157221317291,
-1.1977438926696777,
-0.26310068368911743,
-0.3217902183532715,
-0.5535181760787964,
2.7248547077178955,
-1.2983410358428955,
-0.31816011667251587,
-0.991848349571228,
-0.7167797684669495,
1.6360238790512085,
-1.1426106691360474,
-0.17075400054454803,
-1.0294699668884277,
-0.5927103757858276,
-1.3277608156204224,
-0.49636226892471313,
0.022476300597190857,
-0.9617850184440613,
0.8431784510612488,
0.25800055265426636,
-1.1762909889221191,
-0.3803876042366028,
-0.8651298880577087,
0.9569466710090637,
-0.18380945920944214,
0.23076003789901733,
1.8636724948883057,
0.31567779183387756,
-0.38197043538093567,
0.8459693193435669,
1.1848459243774414,
0.6571129560470581,
-0.5978564620018005,
0.18400712311267853,
-0.6122124791145325,
0.37996605038642883,
-1.3269671201705933,
0.3068035840988159,
-2.9065961837768555,
0.5969055891036987,
-0.026553666219115257,
-0.1553931087255478,
-0.0009117396548390388,
-1.359835147857666,
1.1070626974105835,
2.526921272277832,
-1.1874605417251587,
0.4670089781284332,
0.35960692167282104,
1.2851080894470215,
-1.6526330709457397,
0.3215020000934601,
-0.4577661454677582,
2.071171283721924,
0.22988413274288177,
1.269775152206421,
-0.4828244745731354,
-2.4153354167938232,
0.5609960556030273,
-1.2878844738006592,
-1.1471689939498901,
0.650214672088623,
-0.9715999364852905,
0.23464933037757874,
-1.4968005418777466,
-0.30098551511764526,
-0.8910506963729858,
-1.127297043800354,
0.6911792755126953,
0.19393230974674225,
0.2603929042816162,
-0.5468069314956665,
0.4036673307418823,
-2.1512246131896973,
-1.3968709707260132,
-0.17707222700119019,
-0.9052914977073669,
0.5428480505943298,
-0.4590678811073303,
0.6579557061195374,
-0.18815194070339203,
-0.025159083306789398,
0.34647518396377563,
1.5718798637390137,
3.3167724609375,
0.20737554132938385,
0.3839196264743805,
-0.21155625581741333,
-0.9150663018226624,
1.5444390773773193,
0.9093047976493835,
-0.12995968759059906,
-0.4739115536212921,
-1.1285802125930786,
1.3575475215911865,
1.8589730262756348,
0.9542986750602722,
0.02594109997153282,
-0.7671841979026794,
-0.727895200252533,
-0.05516143888235092,
0.18171431124210358,
0.40839412808418274,
0.9173679351806641,
0.10514883697032928,
0.05756883695721626,
1.4378269910812378,
1.179064393043518,
-0.5126193165779114,
0.28279945254325867,
-0.8762311339378357,
-0.5130643248558044,
0.4184139668941498,
0.18896953761577606,
-0.12781168520450592,
0.3268406391143799,
-0.9656273722648621,
-0.2599230110645294,
-0.4409521222114563,
-0.8623230457305908,
-0.6872442960739136,
-0.3467554450035095,
-0.3944239914417267,
1.5949909687042236,
0.22193790972232819,
-0.6677632927894592,
-0.06521914899349213,
-0.7645336985588074,
-0.1702040284872055,
-1.1437698602676392,
0.22760874032974243,
-0.1412433534860611,
-0.19711917638778687,
-0.17571693658828735,
1.7472196817398071,
-0.8903800845146179,
-2.1171388626098633,
0.1185186356306076,
0.224260151386261,
-0.12680663168430328,
0.24928493797779083,
1.672472357749939,
0.4849632978439331,
1.46619713306427,
1.248201608657837,
0.9369930028915405,
-0.6403656601905823,
-1.3100073337554932,
0.7332972884178162,
1.0209077596664429,
-1.3644541501998901,
0.7929123044013977,
-0.04712116718292236,
-0.5593064427375793,
0.5672089457511902,
1.2770707607269287,
0.5115440487861633,
-1.9880176782608032,
0.8359063267707825,
-1.0682711601257324,
0.8651535511016846,
0.730338990688324,
0.6263940334320068,
0.2994575798511505,
0.8356561660766602,
-1.2008999586105347,
-1.1489683389663696,
-0.7317141890525818,
-0.7160066962242126,
1.9884366989135742,
-0.40385156869888306,
0.6589733958244324,
-0.25545671582221985,
-1.2838103771209717,
-0.07075634598731995,
0.6494144201278687,
0.30786213278770447,
-0.5262385606765747,
0.8627496957778931,
-0.7186071872711182,
-1.0775840282440186,
-1.3709315061569214,
-0.4381445348262787,
-1.0226057767868042,
-0.9631592035293579,
1.0711960792541504,
0.7758949398994446,
0.17601677775382996,
1.8498551845550537,
0.6539661288261414,
0.2612457275390625,
-2.551564931869507,
0.9213805794715881,
0.21898025274276733,
-0.07690934836864471,
0.7473468780517578,
0.3740687668323517,
0.9948185086250305,
0.03678674250841141,
0.48574098944664,
-2.4652163982391357,
2.3507535457611084,
-0.16648973524570465,
0.7290992736816406,
-0.08192780613899231,
-0.12605531513690948,
1.2305920124053955,
0.5836281776428223,
0.5139062404632568,
-0.9514943957328796,
0.550194263458252,
-0.5033624768257141,
1.2724746465682983,
0.9012064933776855,
-0.8060969114303589,
-0.05348966643214226,
1.4069501161575317,
0.46527764201164246,
-0.6599758863449097,
-1.0095398426055908,
-0.9600541591644287,
0.9284679293632507,
1.6466869115829468,
0.0008171042427420616,
-0.05366818606853485,
0.7665473222732544,
0.6284427046775818,
-1.204198956489563,
0.1274215430021286,
-0.593838632106781,
-0.7242856621742249,
1.6881248950958252,
2.112461805343628,
-0.3401688039302826,
-0.19298899173736572,
-0.5617130398750305,
-1.3172893524169922,
0.8007530570030212,
-0.11711736023426056,
0.17597901821136475,
0.6580117344856262,
-0.6505817770957947,
0.9780697822570801,
0.8653855323791504,
0.8652311563491821,
0.21605265140533447,
0.30788400769233704,
0.42511460185050964,
-0.42842137813568115,
-1.194467306137085,
-0.12427003681659698,
-1.1035574674606323,
-2.562892198562622,
0.2971978783607483,
-0.12752051651477814,
-1.3027502298355103,
0.15395218133926392,
-1.059329867362976,
1.0187255144119263,
-0.5683932304382324,
-1.1220868825912476,
-1.4781217575073242,
0.1849517822265625,
0.028930451720952988,
0.9553750157356262,
-1.6072840690612793,
-0.15061481297016144,
1.2061058282852173,
0.9019179940223694,
-0.6796368956565857,
1.0040762424468994,
0.24642722308635712,
1.100175380706787,
0.8044102191925049,
-0.35863572359085083,
0.5262374877929688,
-0.09329888224601746,
-1.3529796600341797,
0.48019689321517944,
1.1422754526138306,
0.18764403462409973,
1.5013810396194458,
-0.458182692527771,
-0.04031705483794212,
0.43639513850212097,
-0.6674794554710388,
-0.4454813599586487,
-0.33908936381340027,
0.5390961170196533,
-0.008984223008155823,
-0.8561920523643494,
-0.09942333400249481,
-0.00025913678109645844,
-0.31722256541252136,
0.11940626800060272,
-1.5257008075714111,
-0.11424393951892853,
-0.4676663279533386,
-0.6178375482559204,
-1.2462265491485596,
-0.05285082384943962,
1.3423142433166504,
-0.741115391254425,
-0.2916223406791687,
0.47552022337913513,
0.3526064157485962,
0.5081285834312439,
0.6130766272544861,
-0.7665027379989624,
-0.2818700075149536,
-0.1296837329864502,
-0.34715864062309265,
0.3015978932380676,
1.3622610569000244,
-0.20497123897075653,
-0.939717710018158,
0.6057364344596863,
-0.283334881067276,
0.06765119731426239,
1.8365799188613892,
0.002333246171474457,
-0.7716214656829834,
0.23492808640003204,
-0.7762987613677979,
1.9364638328552246,
1.7055286169052124,
1.3701062202453613,
-0.2596457898616791,
-0.8128880858421326,
0.612387478351593,
-0.3937109410762787,
-0.35507339239120483,
0.8642337322235107,
0.4009956121444702,
-0.18836741149425507,
-1.4537694454193115,
0.8197954297065735,
1.2456004619598389,
-0.8381057977676392,
-0.7605085372924805,
0.160631000995636,
-0.7251960635185242,
1.1256862878799438,
0.5339533090591431,
0.32050082087516785,
0.2947750687599182,
1.6436842679977417,
0.8328311443328857,
-0.4391399919986725,
0.5471090078353882,
0.6186623573303223,
-0.18594078719615936,
-2.1865413188934326,
-1.1887503862380981,
0.2666403651237488,
-0.6257262229919434,
-1.6251975297927856,
1.3188855648040771,
-1.1033825874328613,
-0.9571123123168945,
0.6322653889656067,
0.11216779053211212,
1.4262250661849976,
0.45137420296669006,
1.4806674718856812,
2.010561466217041,
0.7470700740814209,
0.4400091767311096,
1.1857123374938965,
-0.1430293470621109,
-0.4594115614891052,
1.7972290515899658,
-0.4605787694454193,
0.4435839056968689,
1.0849380493164062,
-0.215250626206398,
-1.142417550086975,
-0.7116186022758484,
-1.346322774887085,
-0.7244693636894226,
1.147971272468567,
0.12236155569553375,
-1.0422797203063965,
0.24764670431613922,
1.4959821701049805,
0.09314951300621033,
-0.36961308121681213,
0.654017448425293,
0.4435780942440033,
-0.7810289859771729,
-0.05037643015384674,
-0.8240925669670105,
0.5719380378723145,
-0.2145291566848755,
-0.31987911462783813,
0.3509138226509094,
0.4106355905532837,
1.384475588798523,
-0.02246839553117752,
0.17891015112400055,
1.052859902381897,
-1.4374014139175415,
1.5117206573486328,
-0.7049247622489929,
0.31820806860923767,
-2.3671202659606934,
1.4139248132705688,
-0.7174819111824036,
2.0149693489074707,
-2.693336009979248,
0.5471906065940857,
-0.6503348350524902,
-0.5091069340705872,
0.32971951365470886,
-0.36350953578948975,
0.061969827860593796,
-0.0942259281873703,
-1.103518009185791,
0.013747937977313995,
-0.5644333362579346,
0.5681927800178528,
1.1553781032562256,
1.336837887763977,
-1.1153286695480347,
-0.22437788546085358,
-1.7286080121994019,
-0.1473982036113739,
-0.7951021194458008,
0.29956555366516113,
-2.050711154937744,
-0.2544211149215698,
-1.8431756496429443,
-2.311758279800415,
-1.160912275314331,
-0.7751949429512024,
1.1432148218154907,
0.1345089077949524,
-0.8436574935913086,
1.4544095993041992,
-0.35018467903137207,
-1.7937426567077637,
1.0507909059524536,
-2.1263186931610107
] |
https://github.com/huggingface/datasets/issues/5025 | Custom Json Dataset Throwing Error when batch is False | > Hi! Our processors are meant to be used in `batched` mode, so if `batched` is `False`, you need to drop the batch dimension (the error message warns you that the array has an extra dimension meaning it's 4D instead of 3D) to avoid the error:
>
> ```python
> def prepare_examples(examples):
> #Some preporcessing for each image and text as all my data saved in cloud
> #For this reason I couldn't set the batch to True.
> encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
> truncation=True, padding="max_length", return_tensors="np")
> # drop extra dim
> for k in encoding.items():
> encoding[k]=encoding[k][0]
> return encoding
> ```
Thank you it did work
```
for k,v in encoding.items():
encoding[k]=encoding[k][0]
``` | ## Describe the bug
A clear and concise description of what the bug is.
I tried to create my custom dataset using below code
```
from datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D
from torchvision import transforms
from transformers import AutoProcessor
# we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes,
# based on the checkpoint we provide from the hub
from datasets import load_dataset
def prepare_examples(examples):
#Some preporcessing for each image and text as all my data saved in cloud
#For this reason I couldn't set the batch to True.
encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
truncation=True, padding="max_length")
# encoding['pixel_values']=np.array(encoding['pixel_values'])
return encoding
dataset = load_dataset("json", data_files='issues.jsonl')
processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False)
features = dataset["train"].features
column_names = dataset["train"].column_names
# we need to define custom features for `set_format` (used later on) to work properly
features = Features({
'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)),
'input_ids': Sequence(feature=Value(dtype='int64')),
'attention_mask': Sequence(Value(dtype='int64')),
'bbox': Array2D(dtype="int64", shape=(512, 4)),
'labels': Sequence(feature=Value(dtype='int64')),
})
train_dataset = dataset["train"].map(
prepare_examples,
batched=False,
remove_columns=column_names,
features=features
)
```
It throws below error.
```
/opt/conda/lib/python3.7/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type)
172 storage = to_pyarrow_listarray(data, pa_type)
--> 173 return pa.ExtensionArray.from_storage(pa_type, storage)
174
/opt/conda/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.ExtensionArray.from_storage()
TypeError: Incompatible storage type list<item: list<item: list<item: list<item: float>>>> for extension type extension<arrow.py_extension_type<Array3DExtensionType>>
```
## Steps to reproduce the bug
```python
# Sample code to reproduce the bug
```
rom datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D
from torchvision import transforms
from transformers import AutoProcessor
# we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes,
# based on the checkpoint we provide from the hub
from datasets import load_dataset
def prepare_examples(examples):
#Some preporcessing for each image and text as all my data saved in cloud
encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
truncation=True, padding="max_length")
# encoding['pixel_values']=np.array(encoding['pixel_values'])
return encoding
dataset = load_dataset("json", data_files='issues.jsonl')
processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False)
features = dataset["train"].features
column_names = dataset["train"].column_names
# we need to define custom features for `set_format` (used later on) to work properly
features = Features({
'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)),
'input_ids': Sequence(feature=Value(dtype='int64')),
'attention_mask': Sequence(Value(dtype='int64')),
'bbox': Array2D(dtype="int64", shape=(512, 4)),
'labels': Sequence(feature=Value(dtype='int64')),
})
train_dataset = dataset["train"].map(
prepare_examples,
batched=False,
remove_columns=column_names,
features=features
)
## Expected results
A clear and concise description of the expected results.
Expected would be similar to all the otherdatasets with no error.
## Actual results
Specify the actual results or traceback.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Unix
- Python version: 3.9
- PyArrow version: 9.0.0
| 507 | 118 | Custom Json Dataset Throwing Error when batch is False
## Describe the bug
A clear and concise description of what the bug is.
I tried to create my custom dataset using below code
```
from datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D
from torchvision import transforms
from transformers import AutoProcessor
# we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes,
# based on the checkpoint we provide from the hub
from datasets import load_dataset
def prepare_examples(examples):
#Some preporcessing for each image and text as all my data saved in cloud
#For this reason I couldn't set the batch to True.
encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
truncation=True, padding="max_length")
# encoding['pixel_values']=np.array(encoding['pixel_values'])
return encoding
dataset = load_dataset("json", data_files='issues.jsonl')
processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False)
features = dataset["train"].features
column_names = dataset["train"].column_names
# we need to define custom features for `set_format` (used later on) to work properly
features = Features({
'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)),
'input_ids': Sequence(feature=Value(dtype='int64')),
'attention_mask': Sequence(Value(dtype='int64')),
'bbox': Array2D(dtype="int64", shape=(512, 4)),
'labels': Sequence(feature=Value(dtype='int64')),
})
train_dataset = dataset["train"].map(
prepare_examples,
batched=False,
remove_columns=column_names,
features=features
)
```
It throws below error.
```
/opt/conda/lib/python3.7/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type)
172 storage = to_pyarrow_listarray(data, pa_type)
--> 173 return pa.ExtensionArray.from_storage(pa_type, storage)
174
/opt/conda/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.ExtensionArray.from_storage()
TypeError: Incompatible storage type list<item: list<item: list<item: list<item: float>>>> for extension type extension<arrow.py_extension_type<Array3DExtensionType>>
```
## Steps to reproduce the bug
```python
# Sample code to reproduce the bug
```
rom datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D
from torchvision import transforms
from transformers import AutoProcessor
# we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes,
# based on the checkpoint we provide from the hub
from datasets import load_dataset
def prepare_examples(examples):
#Some preporcessing for each image and text as all my data saved in cloud
encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
truncation=True, padding="max_length")
# encoding['pixel_values']=np.array(encoding['pixel_values'])
return encoding
dataset = load_dataset("json", data_files='issues.jsonl')
processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False)
features = dataset["train"].features
column_names = dataset["train"].column_names
# we need to define custom features for `set_format` (used later on) to work properly
features = Features({
'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)),
'input_ids': Sequence(feature=Value(dtype='int64')),
'attention_mask': Sequence(Value(dtype='int64')),
'bbox': Array2D(dtype="int64", shape=(512, 4)),
'labels': Sequence(feature=Value(dtype='int64')),
})
train_dataset = dataset["train"].map(
prepare_examples,
batched=False,
remove_columns=column_names,
features=features
)
## Expected results
A clear and concise description of the expected results.
Expected would be similar to all the otherdatasets with no error.
## Actual results
Specify the actual results or traceback.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Unix
- Python version: 3.9
- PyArrow version: 9.0.0
> Hi! Our processors are meant to be used in `batched` mode, so if `batched` is `False`, you need to drop the batch dimension (the error message warns you that the array has an extra dimension meaning it's 4D instead of 3D) to avoid the error:
>
> ```python
> def prepare_examples(examples):
> #Some preporcessing for each image and text as all my data saved in cloud
> #For this reason I couldn't set the batch to True.
> encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels,
> truncation=True, padding="max_length", return_tensors="np")
> # drop extra dim
> for k in encoding.items():
> encoding[k]=encoding[k][0]
> return encoding
> ```
Thank you it did work
```
for k,v in encoding.items():
encoding[k]=encoding[k][0]
``` | [
-1.3385146856307983,
-1.0382217168807983,
-0.6617593169212341,
1.649436354637146,
-0.23616673052310944,
-1.1046905517578125,
0.14961199462413788,
-1.053428053855896,
1.578969955444336,
-0.8107315897941589,
0.2963232100009918,
-1.6368200778961182,
-0.02644883282482624,
-0.6181401014328003,
-0.687764585018158,
-0.8656947612762451,
-0.391405314207077,
-0.7266128659248352,
1.1610413789749146,
2.3926842212677,
1.3004984855651855,
-1.4275903701782227,
2.7939951419830322,
0.8191783428192139,
-0.20176169276237488,
-1.054922342300415,
0.540201723575592,
-0.020138775929808617,
-1.2138378620147705,
-0.5104343295097351,
-0.970399022102356,
-0.13540203869342804,
-0.541273832321167,
-0.48414552211761475,
-0.06848767399787903,
0.46039795875549316,
-0.2910930812358856,
-0.4549992084503174,
-0.5243546962738037,
-0.7248919606208801,
0.5127175450325012,
-0.3996005058288574,
0.8594062924385071,
-0.22555388510227203,
1.8284822702407837,
-0.5045316219329834,
0.41068461537361145,
0.6675760746002197,
1.3525898456573486,
0.21401239931583405,
0.025845643132925034,
0.4118252694606781,
0.4107668697834015,
-0.07019588351249695,
0.6318200826644897,
1.2493950128555298,
0.714917778968811,
0.5231993794441223,
0.8401756286621094,
-2.2083165645599365,
1.2734209299087524,
-1.1043078899383545,
0.359502375125885,
1.3948992490768433,
-0.9495947957038879,
0.45354801416397095,
-1.7221758365631104,
-0.054415442049503326,
0.5499011278152466,
-2.1987476348876953,
0.3532080054283142,
-1.3173673152923584,
-0.5422624945640564,
0.9705323576927185,
0.3902994990348816,
-1.2631349563598633,
0.1153402030467987,
-0.4460400938987732,
1.0979104042053223,
0.4400322735309601,
1.0074876546859741,
-1.6769460439682007,
-0.00854193139821291,
-0.2818528413772583,
0.13687334954738617,
-1.272590160369873,
-1.5976555347442627,
0.5190339088439941,
0.5503853559494019,
0.6674327254295349,
-0.1416451632976532,
1.1574838161468506,
-1.1305651664733887,
0.7204753160476685,
-1.0299129486083984,
-1.6119089126586914,
-1.423799753189087,
-2.317373275756836,
-2.210768222808838,
0.6800109148025513,
-0.46460703015327454,
-0.6538916230201721,
2.0750837326049805,
-0.9260544180870056,
-1.730704426765442,
1.2385826110839844,
0.2825378477573395,
0.045314669609069824,
2.4464237689971924,
0.1901812106370926,
-0.7389734387397766,
0.4791892170906067,
-0.8021999597549438,
0.8081885576248169,
-0.3325001895427704,
1.3994072675704956,
0.39003440737724304,
-0.9740495681762695,
1.6757851839065552,
-0.335550993680954,
0.5572950839996338,
-0.6292042136192322,
-0.4738759696483612,
-0.7492241263389587,
0.2661956250667572,
1.9480191469192505,
-0.23828035593032837,
1.4608455896377563,
-0.3825260400772095,
-1.5341897010803223,
-1.6925376653671265,
0.9522883892059326,
0.4025837481021881,
-0.7723273634910583,
0.12972114980220795,
-0.3862428665161133,
0.12758338451385498,
-0.05470389500260353,
1.1821751594543457,
1.2802990674972534,
0.6564631462097168,
-0.362760066986084,
-0.8028962016105652,
0.11799989640712738,
-0.18080352246761322,
-0.7148225903511047,
-1.74545156955719,
-0.36325448751449585,
0.07403229176998138,
0.6541125178337097,
-1.2514081001281738,
1.6903725862503052,
0.8975065350532532,
1.8369697332382202,
1.0412956476211548,
-0.44855421781539917,
1.5061582326889038,
0.11251614987850189,
1.7802878618240356,
-0.6312169432640076,
0.6526154279708862,
-0.4184601902961731,
-1.1611484289169312,
0.8307457566261292,
-0.2711026966571808,
-2.0299623012542725,
-0.824586033821106,
-0.7796757817268372,
-0.18573610484600067,
-0.8143079876899719,
0.9046036005020142,
-0.4073954224586487,
-1.4710993766784668,
0.19072365760803223,
-0.7627265453338623,
0.23008063435554504,
-1.179533839225769,
0.38322409987449646,
0.6828657984733582,
-0.6229149699211121,
0.09633418917655945,
-0.28891393542289734,
-1.2604870796203613,
-0.5021474361419678,
0.35246652364730835,
1.897478461265564,
-0.7644455432891846,
0.8162424564361572,
1.012681245803833,
-0.7603581547737122,
0.006621444597840309,
0.23455621302127838,
-0.22023729979991913,
0.8628504872322083,
-1.0522596836090088,
-0.5947901010513306,
1.1845154762268066,
-0.18816497921943665,
-0.6051823496818542,
1.4703924655914307,
0.8090543150901794,
-0.971878707408905,
-0.2709912955760956,
-0.12203489243984222,
-0.8263500332832336,
-0.01070097554475069,
-1.4364858865737915,
-0.1919262558221817,
0.549962043762207,
-1.5307607650756836,
-0.4698151648044586,
-0.2117103934288025,
1.2845946550369263,
-0.2225038856267929,
1.4843919277191162,
-0.37728044390678406,
-0.15039236843585968,
-0.23988758027553558,
-0.3427419662475586,
0.19715584814548492,
-0.21053645014762878,
-0.5845461487770081,
0.06735751032829285,
-0.8424540162086487,
0.3443056344985962,
1.4687790870666504,
0.3875200152397156,
0.01925923489034176,
0.4900183379650116,
1.207919955253601,
0.48610159754753113,
-0.008470050059258938,
-0.906792938709259,
-1.488613486289978,
1.89650297164917,
-1.5289267301559448,
2.0065884590148926,
0.7396988868713379,
-0.007273443043231964,
-1.7483561038970947,
-1.8208153247833252,
1.3448957204818726,
1.2230985164642334,
2.3224761486053467,
0.4997612237930298,
0.3626866340637207,
-0.8893662095069885,
-0.6931512355804443,
0.23481984436511993,
-1.040700078010559,
-0.723906397819519,
0.1861378699541092,
2.3746590614318848,
1.8590353727340698,
-0.3923183083534241,
-0.18072202801704407,
-0.9530543684959412,
1.4576544761657715,
-0.2575989067554474,
0.27969783544540405,
1.9280530214309692,
-0.22646361589431763,
-1.0706428289413452,
1.3082287311553955,
-2.4380252361297607,
0.15805897116661072,
2.0295166969299316,
0.3446270227432251,
0.10451292991638184,
-1.3373736143112183,
-0.6731299757957458,
-0.23690830171108246,
-0.4961851239204407,
-1.312765121459961,
0.4680779278278351,
-0.29246872663497925,
-0.6926575303077698,
-1.422858476638794,
0.1761188507080078,
-1.1151998043060303,
-1.5961180925369263,
0.22248932719230652,
1.9589234590530396,
2.0946297645568848,
-0.7674537897109985,
1.6334118843078613,
-0.22790096700191498,
0.19847328960895538,
1.2551254034042358,
1.271804690361023,
2.985422134399414,
1.8924312591552734,
-1.2524409294128418,
0.5271793007850647,
-0.1304050087928772,
-0.4971083402633667,
1.1335523128509521,
-1.1914844512939453,
1.2707942724227905,
-0.049521930515766144,
-1.2033536434173584,
-1.215579628944397,
0.9290804862976074,
0.4504096806049347,
0.033204250037670135,
-0.4849201738834381,
1.1554149389266968,
0.027566134929656982,
1.3207411766052246,
0.6581510901451111,
-0.3009431064128876,
0.5640978217124939,
-0.3814948797225952,
-0.5730567574501038,
1.5203570127487183,
0.1267460584640503,
-1.4191921949386597,
-2.143712043762207,
-0.14535516500473022,
-0.7686417102813721,
0.06884442269802094,
-0.6229543685913086,
-1.0177717208862305,
1.6705238819122314,
0.3029157221317291,
-1.1977438926696777,
-0.26310068368911743,
-0.3217902183532715,
-0.5535181760787964,
2.7248547077178955,
-1.2983410358428955,
-0.31816011667251587,
-0.991848349571228,
-0.7167797684669495,
1.6360238790512085,
-1.1426106691360474,
-0.17075400054454803,
-1.0294699668884277,
-0.5927103757858276,
-1.3277608156204224,
-0.49636226892471313,
0.022476300597190857,
-0.9617850184440613,
0.8431784510612488,
0.25800055265426636,
-1.1762909889221191,
-0.3803876042366028,
-0.8651298880577087,
0.9569466710090637,
-0.18380945920944214,
0.23076003789901733,
1.8636724948883057,
0.31567779183387756,
-0.38197043538093567,
0.8459693193435669,
1.1848459243774414,
0.6571129560470581,
-0.5978564620018005,
0.18400712311267853,
-0.6122124791145325,
0.37996605038642883,
-1.3269671201705933,
0.3068035840988159,
-2.9065961837768555,
0.5969055891036987,
-0.026553666219115257,
-0.1553931087255478,
-0.0009117396548390388,
-1.359835147857666,
1.1070626974105835,
2.526921272277832,
-1.1874605417251587,
0.4670089781284332,
0.35960692167282104,
1.2851080894470215,
-1.6526330709457397,
0.3215020000934601,
-0.4577661454677582,
2.071171283721924,
0.22988413274288177,
1.269775152206421,
-0.4828244745731354,
-2.4153354167938232,
0.5609960556030273,
-1.2878844738006592,
-1.1471689939498901,
0.650214672088623,
-0.9715999364852905,
0.23464933037757874,
-1.4968005418777466,
-0.30098551511764526,
-0.8910506963729858,
-1.127297043800354,
0.6911792755126953,
0.19393230974674225,
0.2603929042816162,
-0.5468069314956665,
0.4036673307418823,
-2.1512246131896973,
-1.3968709707260132,
-0.17707222700119019,
-0.9052914977073669,
0.5428480505943298,
-0.4590678811073303,
0.6579557061195374,
-0.18815194070339203,
-0.025159083306789398,
0.34647518396377563,
1.5718798637390137,
3.3167724609375,
0.20737554132938385,
0.3839196264743805,
-0.21155625581741333,
-0.9150663018226624,
1.5444390773773193,
0.9093047976493835,
-0.12995968759059906,
-0.4739115536212921,
-1.1285802125930786,
1.3575475215911865,
1.8589730262756348,
0.9542986750602722,
0.02594109997153282,
-0.7671841979026794,
-0.727895200252533,
-0.05516143888235092,
0.18171431124210358,
0.40839412808418274,
0.9173679351806641,
0.10514883697032928,
0.05756883695721626,
1.4378269910812378,
1.179064393043518,
-0.5126193165779114,
0.28279945254325867,
-0.8762311339378357,
-0.5130643248558044,
0.4184139668941498,
0.18896953761577606,
-0.12781168520450592,
0.3268406391143799,
-0.9656273722648621,
-0.2599230110645294,
-0.4409521222114563,
-0.8623230457305908,
-0.6872442960739136,
-0.3467554450035095,
-0.3944239914417267,
1.5949909687042236,
0.22193790972232819,
-0.6677632927894592,
-0.06521914899349213,
-0.7645336985588074,
-0.1702040284872055,
-1.1437698602676392,
0.22760874032974243,
-0.1412433534860611,
-0.19711917638778687,
-0.17571693658828735,
1.7472196817398071,
-0.8903800845146179,
-2.1171388626098633,
0.1185186356306076,
0.224260151386261,
-0.12680663168430328,
0.24928493797779083,
1.672472357749939,
0.4849632978439331,
1.46619713306427,
1.248201608657837,
0.9369930028915405,
-0.6403656601905823,
-1.3100073337554932,
0.7332972884178162,
1.0209077596664429,
-1.3644541501998901,
0.7929123044013977,
-0.04712116718292236,
-0.5593064427375793,
0.5672089457511902,
1.2770707607269287,
0.5115440487861633,
-1.9880176782608032,
0.8359063267707825,
-1.0682711601257324,
0.8651535511016846,
0.730338990688324,
0.6263940334320068,
0.2994575798511505,
0.8356561660766602,
-1.2008999586105347,
-1.1489683389663696,
-0.7317141890525818,
-0.7160066962242126,
1.9884366989135742,
-0.40385156869888306,
0.6589733958244324,
-0.25545671582221985,
-1.2838103771209717,
-0.07075634598731995,
0.6494144201278687,
0.30786213278770447,
-0.5262385606765747,
0.8627496957778931,
-0.7186071872711182,
-1.0775840282440186,
-1.3709315061569214,
-0.4381445348262787,
-1.0226057767868042,
-0.9631592035293579,
1.0711960792541504,
0.7758949398994446,
0.17601677775382996,
1.8498551845550537,
0.6539661288261414,
0.2612457275390625,
-2.551564931869507,
0.9213805794715881,
0.21898025274276733,
-0.07690934836864471,
0.7473468780517578,
0.3740687668323517,
0.9948185086250305,
0.03678674250841141,
0.48574098944664,
-2.4652163982391357,
2.3507535457611084,
-0.16648973524570465,
0.7290992736816406,
-0.08192780613899231,
-0.12605531513690948,
1.2305920124053955,
0.5836281776428223,
0.5139062404632568,
-0.9514943957328796,
0.550194263458252,
-0.5033624768257141,
1.2724746465682983,
0.9012064933776855,
-0.8060969114303589,
-0.05348966643214226,
1.4069501161575317,
0.46527764201164246,
-0.6599758863449097,
-1.0095398426055908,
-0.9600541591644287,
0.9284679293632507,
1.6466869115829468,
0.0008171042427420616,
-0.05366818606853485,
0.7665473222732544,
0.6284427046775818,
-1.204198956489563,
0.1274215430021286,
-0.593838632106781,
-0.7242856621742249,
1.6881248950958252,
2.112461805343628,
-0.3401688039302826,
-0.19298899173736572,
-0.5617130398750305,
-1.3172893524169922,
0.8007530570030212,
-0.11711736023426056,
0.17597901821136475,
0.6580117344856262,
-0.6505817770957947,
0.9780697822570801,
0.8653855323791504,
0.8652311563491821,
0.21605265140533447,
0.30788400769233704,
0.42511460185050964,
-0.42842137813568115,
-1.194467306137085,
-0.12427003681659698,
-1.1035574674606323,
-2.562892198562622,
0.2971978783607483,
-0.12752051651477814,
-1.3027502298355103,
0.15395218133926392,
-1.059329867362976,
1.0187255144119263,
-0.5683932304382324,
-1.1220868825912476,
-1.4781217575073242,
0.1849517822265625,
0.028930451720952988,
0.9553750157356262,
-1.6072840690612793,
-0.15061481297016144,
1.2061058282852173,
0.9019179940223694,
-0.6796368956565857,
1.0040762424468994,
0.24642722308635712,
1.100175380706787,
0.8044102191925049,
-0.35863572359085083,
0.5262374877929688,
-0.09329888224601746,
-1.3529796600341797,
0.48019689321517944,
1.1422754526138306,
0.18764403462409973,
1.5013810396194458,
-0.458182692527771,
-0.04031705483794212,
0.43639513850212097,
-0.6674794554710388,
-0.4454813599586487,
-0.33908936381340027,
0.5390961170196533,
-0.008984223008155823,
-0.8561920523643494,
-0.09942333400249481,
-0.00025913678109645844,
-0.31722256541252136,
0.11940626800060272,
-1.5257008075714111,
-0.11424393951892853,
-0.4676663279533386,
-0.6178375482559204,
-1.2462265491485596,
-0.05285082384943962,
1.3423142433166504,
-0.741115391254425,
-0.2916223406791687,
0.47552022337913513,
0.3526064157485962,
0.5081285834312439,
0.6130766272544861,
-0.7665027379989624,
-0.2818700075149536,
-0.1296837329864502,
-0.34715864062309265,
0.3015978932380676,
1.3622610569000244,
-0.20497123897075653,
-0.939717710018158,
0.6057364344596863,
-0.283334881067276,
0.06765119731426239,
1.8365799188613892,
0.002333246171474457,
-0.7716214656829834,
0.23492808640003204,
-0.7762987613677979,
1.9364638328552246,
1.7055286169052124,
1.3701062202453613,
-0.2596457898616791,
-0.8128880858421326,
0.612387478351593,
-0.3937109410762787,
-0.35507339239120483,
0.8642337322235107,
0.4009956121444702,
-0.18836741149425507,
-1.4537694454193115,
0.8197954297065735,
1.2456004619598389,
-0.8381057977676392,
-0.7605085372924805,
0.160631000995636,
-0.7251960635185242,
1.1256862878799438,
0.5339533090591431,
0.32050082087516785,
0.2947750687599182,
1.6436842679977417,
0.8328311443328857,
-0.4391399919986725,
0.5471090078353882,
0.6186623573303223,
-0.18594078719615936,
-2.1865413188934326,
-1.1887503862380981,
0.2666403651237488,
-0.6257262229919434,
-1.6251975297927856,
1.3188855648040771,
-1.1033825874328613,
-0.9571123123168945,
0.6322653889656067,
0.11216779053211212,
1.4262250661849976,
0.45137420296669006,
1.4806674718856812,
2.010561466217041,
0.7470700740814209,
0.4400091767311096,
1.1857123374938965,
-0.1430293470621109,
-0.4594115614891052,
1.7972290515899658,
-0.4605787694454193,
0.4435839056968689,
1.0849380493164062,
-0.215250626206398,
-1.142417550086975,
-0.7116186022758484,
-1.346322774887085,
-0.7244693636894226,
1.147971272468567,
0.12236155569553375,
-1.0422797203063965,
0.24764670431613922,
1.4959821701049805,
0.09314951300621033,
-0.36961308121681213,
0.654017448425293,
0.4435780942440033,
-0.7810289859771729,
-0.05037643015384674,
-0.8240925669670105,
0.5719380378723145,
-0.2145291566848755,
-0.31987911462783813,
0.3509138226509094,
0.4106355905532837,
1.384475588798523,
-0.02246839553117752,
0.17891015112400055,
1.052859902381897,
-1.4374014139175415,
1.5117206573486328,
-0.7049247622489929,
0.31820806860923767,
-2.3671202659606934,
1.4139248132705688,
-0.7174819111824036,
2.0149693489074707,
-2.693336009979248,
0.5471906065940857,
-0.6503348350524902,
-0.5091069340705872,
0.32971951365470886,
-0.36350953578948975,
0.061969827860593796,
-0.0942259281873703,
-1.103518009185791,
0.013747937977313995,
-0.5644333362579346,
0.5681927800178528,
1.1553781032562256,
1.336837887763977,
-1.1153286695480347,
-0.22437788546085358,
-1.7286080121994019,
-0.1473982036113739,
-0.7951021194458008,
0.29956555366516113,
-2.050711154937744,
-0.2544211149215698,
-1.8431756496429443,
-2.311758279800415,
-1.160912275314331,
-0.7751949429512024,
1.1432148218154907,
0.1345089077949524,
-0.8436574935913086,
1.4544095993041992,
-0.35018467903137207,
-1.7937426567077637,
1.0507909059524536,
-2.1263186931610107
] |
https://github.com/huggingface/datasets/issues/5021 | Split is inferred from filename and overrides metadata.jsonl | Hi! What's the structure of your image folder? `datasets` by default tries to infer to what split each file belongs based on directory/file names. If it's OK to load all the images inside the `dataset` folder in the `train` split, you can do the following:
```python
dataset = load_dataset("imagefolder", data_files="dataset/**")
``` | ## Describe the bug
Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files.
This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder
## Steps to reproduce the bug
`metadata.jsonl`
```json
{"file_name": "photo of a cat.jpg", "text": "a photo of a cat"}
{"file_name": "photo of a dog.jpg", "text": "a photo of a dog"}
{"file_name": "photo of a train.jpg", "text": "a photo of a train"}
{"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"}
```
`bug.py`
```python
from datasets import load_dataset
dataset = load_dataset("dataset")
print(dataset)
# DatasetDict({
# train: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# test: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# })
for split in dataset:
for n in dataset[split]:
print(n['text'])
# a photo of a train
# a photo of test tubes
```
## Expected results
One single dataset with all four images / a warning for unused files / documentation of this behavior
## Actual results
Only the images with "test" or "train" in the name are loaded
## Environment info
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.10.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.0 | 508 | 51 | Split is inferred from filename and overrides metadata.jsonl
## Describe the bug
Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files.
This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder
## Steps to reproduce the bug
`metadata.jsonl`
```json
{"file_name": "photo of a cat.jpg", "text": "a photo of a cat"}
{"file_name": "photo of a dog.jpg", "text": "a photo of a dog"}
{"file_name": "photo of a train.jpg", "text": "a photo of a train"}
{"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"}
```
`bug.py`
```python
from datasets import load_dataset
dataset = load_dataset("dataset")
print(dataset)
# DatasetDict({
# train: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# test: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# })
for split in dataset:
for n in dataset[split]:
print(n['text'])
# a photo of a train
# a photo of test tubes
```
## Expected results
One single dataset with all four images / a warning for unused files / documentation of this behavior
## Actual results
Only the images with "test" or "train" in the name are loaded
## Environment info
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.10.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Hi! What's the structure of your image folder? `datasets` by default tries to infer to what split each file belongs based on directory/file names. If it's OK to load all the images inside the `dataset` folder in the `train` split, you can do the following:
```python
dataset = load_dataset("imagefolder", data_files="dataset/**")
``` | [
-1.1220695972442627,
-0.932190477848053,
-0.8354353308677673,
1.4796626567840576,
-0.2113896906375885,
-1.2664783000946045,
0.09603168815374374,
-1.0960744619369507,
1.7267967462539673,
-0.7259175777435303,
0.27372652292251587,
-1.706350564956665,
0.014844968914985657,
-0.6536315083503723,
-0.6591095328330994,
-0.9277092814445496,
-0.4852674603462219,
-0.6703879833221436,
1.0418238639831543,
2.5251169204711914,
1.2077029943466187,
-1.383661150932312,
2.6250481605529785,
0.7948921322822571,
-0.15519702434539795,
-0.8700981140136719,
0.5800911784172058,
0.04350541532039642,
-1.3131378889083862,
-0.2996778190135956,
-0.9096911549568176,
-0.09057026356458664,
-0.49750176072120667,
-0.5699455142021179,
-0.11276651918888092,
0.48536399006843567,
-0.358398973941803,
-0.573859453201294,
-0.6546902656555176,
-0.8686460256576538,
0.32340574264526367,
-0.41918572783470154,
0.9905025362968445,
-0.42423999309539795,
1.726378321647644,
-0.5281835198402405,
0.42008379101753235,
0.6979573369026184,
1.2766492366790771,
0.25869208574295044,
0.15016600489616394,
0.3522099256515503,
0.4629131853580475,
-0.1437567174434662,
0.5012925863265991,
1.2105799913406372,
0.6177838444709778,
0.45314258337020874,
0.8515066504478455,
-2.214200496673584,
1.218152403831482,
-0.9587615132331848,
0.25662365555763245,
1.3725898265838623,
-0.8680866956710815,
0.42484599351882935,
-1.7575539350509644,
0.00445530004799366,
0.6189810633659363,
-2.1388204097747803,
0.3647063076496124,
-1.27032470703125,
-0.5549482107162476,
1.0051980018615723,
0.334840327501297,
-1.0230916738510132,
0.07970838248729706,
-0.4499472975730896,
0.9712133407592773,
0.4167903959751129,
1.1795179843902588,
-1.6740037202835083,
-0.1006208062171936,
-0.28765541315078735,
0.02450840175151825,
-1.2712758779525757,
-1.5083260536193848,
0.5703340172767639,
0.6520478129386902,
0.6248619556427002,
-0.08145304024219513,
0.987044632434845,
-1.0249484777450562,
0.6910719275474548,
-1.0089281797409058,
-1.7825524806976318,
-1.426538348197937,
-2.2585742473602295,
-2.235319137573242,
0.785491406917572,
-0.4914277493953705,
-0.5154507756233215,
1.9809112548828125,
-0.8770781755447388,
-1.7130035161972046,
1.1631847620010376,
0.37230151891708374,
-0.029421044513583183,
2.4158506393432617,
0.26973840594291687,
-0.7910933494567871,
0.5145239233970642,
-0.7656270265579224,
0.6786247491836548,
-0.458086222410202,
1.3198672533035278,
0.3182791769504547,
-0.9806212782859802,
1.5872511863708496,
-0.48157748579978943,
0.75379878282547,
-0.6479169726371765,
-0.5021933317184448,
-0.6562151908874512,
0.37062868475914,
1.8393487930297852,
-0.34137752652168274,
1.477761149406433,
-0.2728153169155121,
-1.5778900384902954,
-1.6655607223510742,
0.8458969593048096,
0.43268609046936035,
-0.7048386335372925,
0.10293234139680862,
-0.29751312732696533,
0.13793852925300598,
-0.19515755772590637,
1.1056973934173584,
1.2599674463272095,
0.7969189286231995,
-0.3670896589756012,
-0.870857298374176,
0.21251222491264343,
-0.00976101029664278,
-0.8397074937820435,
-1.6706572771072388,
-0.2697918117046356,
0.22215574979782104,
0.5134643316268921,
-1.2227379083633423,
1.740606427192688,
0.8702059388160706,
1.944743037223816,
0.928837239742279,
-0.36778560280799866,
1.4947201013565063,
0.14319881796836853,
1.7878878116607666,
-0.4720250964164734,
0.6236699223518372,
-0.3490491211414337,
-1.1543409824371338,
0.8380429744720459,
-0.33148106932640076,
-2.0559329986572266,
-0.7326909899711609,
-0.8258386254310608,
-0.1463855803012848,
-0.737932562828064,
0.8817865252494812,
-0.2519536018371582,
-1.3829586505889893,
0.23205560445785522,
-0.7753108143806458,
0.03153688460588455,
-1.2368685007095337,
0.22480064630508423,
0.6429814696311951,
-0.6159044504165649,
0.14166247844696045,
-0.12834563851356506,
-1.2944591045379639,
-0.46059271693229675,
0.32013174891471863,
1.8593740463256836,
-0.8540384769439697,
0.8617502450942993,
1.106154203414917,
-0.7262899279594421,
0.06203130632638931,
0.2805158495903015,
-0.280720055103302,
0.8544686436653137,
-1.1013396978378296,
-0.43759724497795105,
1.2422962188720703,
-0.16677036881446838,
-0.6472914218902588,
1.4780220985412598,
0.6553173065185547,
-1.0412770509719849,
-0.1783183217048645,
-0.123282290995121,
-0.8638668060302734,
0.01413126103579998,
-1.5742005109786987,
-0.014881745912134647,
0.3408169448375702,
-1.4562121629714966,
-0.4730626344680786,
-0.25468695163726807,
1.2412419319152832,
-0.1417328119277954,
1.329842209815979,
-0.39603370428085327,
-0.22449401021003723,
-0.4091870188713074,
-0.37564507126808167,
0.057741738855838776,
-0.3833972215652466,
-0.5832214951515198,
0.13326865434646606,
-0.8158565163612366,
0.2692541778087616,
1.4289867877960205,
0.38297250866889954,
0.07650688290596008,
0.518982470035553,
1.076718807220459,
0.3896278738975525,
-0.06958435475826263,
-0.863874077796936,
-1.3866209983825684,
1.9769562482833862,
-1.4125880002975464,
1.971436858177185,
0.7069730758666992,
-0.050703998655080795,
-1.8241801261901855,
-2.061347723007202,
1.330394983291626,
1.173238754272461,
2.324479103088379,
0.5504924654960632,
0.45119374990463257,
-0.8655232191085815,
-0.7110630869865417,
0.2441851794719696,
-0.993198037147522,
-0.6563127040863037,
0.2273348569869995,
2.3409266471862793,
1.7952854633331299,
-0.4742209017276764,
-0.1740318238735199,
-1.0961921215057373,
1.5340772867202759,
-0.10195861011743546,
0.19056272506713867,
2.012279987335205,
-0.3131480813026428,
-0.9095405340194702,
1.2942675352096558,
-2.2824389934539795,
0.058779098093509674,
1.931100845336914,
0.22747951745986938,
0.14894798398017883,
-1.3070429563522339,
-0.7722564339637756,
-0.34901508688926697,
-0.3755761981010437,
-1.1728992462158203,
0.5514324903488159,
-0.25822803378105164,
-0.695443332195282,
-1.4742077589035034,
0.21393996477127075,
-1.0939480066299438,
-1.6200491189956665,
0.14457830786705017,
1.8655693531036377,
2.04135799407959,
-0.910599946975708,
1.552438735961914,
-0.25809305906295776,
0.09238181263208389,
1.3076649904251099,
1.267404317855835,
3.1335372924804688,
1.9232211112976074,
-1.2791705131530762,
0.6440739631652832,
-0.08431490510702133,
-0.3015952408313751,
1.0786123275756836,
-1.327042818069458,
1.2820014953613281,
-0.09075583517551422,
-1.1039643287658691,
-1.1642932891845703,
0.8323742747306824,
0.4990353584289551,
0.09947225451469421,
-0.5054475665092468,
1.0805755853652954,
-0.004414187744259834,
1.3588660955429077,
0.56467604637146,
-0.36132949590682983,
0.6864469051361084,
-0.3378702402114868,
-0.4503864347934723,
1.5554550886154175,
0.19386380910873413,
-1.4367526769638062,
-2.2737390995025635,
-0.2701072692871094,
-0.8820536732673645,
-0.02524242177605629,
-0.5563374161720276,
-1.0929462909698486,
1.7757251262664795,
0.3697081208229065,
-1.2421035766601562,
-0.32411035895347595,
-0.28803640604019165,
-0.5711604356765747,
2.848665237426758,
-1.4258545637130737,
-0.27311113476753235,
-1.0192930698394775,
-0.591782808303833,
1.7273452281951904,
-1.0893806219100952,
-0.23646217584609985,
-1.0813933610916138,
-0.4919948875904083,
-1.3743906021118164,
-0.5938025712966919,
0.04964981600642204,
-0.8732365965843201,
1.0676488876342773,
0.22041118144989014,
-1.242303490638733,
-0.30902567505836487,
-0.9380314350128174,
0.8878940343856812,
-0.19956094026565552,
0.2345236837863922,
2.0072295665740967,
0.42114344239234924,
-0.2501361072063446,
0.6219593286514282,
1.1917365789413452,
0.6246651411056519,
-0.6972993016242981,
0.17539474368095398,
-0.6852998733520508,
0.3616015315055847,
-1.3538379669189453,
0.2266198992729187,
-2.7925987243652344,
0.6000722646713257,
-0.07133364677429199,
-0.09090792387723923,
0.05574952811002731,
-1.2739640474319458,
1.0986725091934204,
2.597506284713745,
-1.1869471073150635,
0.4417286515235901,
0.2883093059062958,
1.173362135887146,
-1.6251657009124756,
0.2448117733001709,
-0.35084953904151917,
2.0480852127075195,
0.05002778023481369,
1.157395839691162,
-0.4710208773612976,
-2.2974812984466553,
0.641510546207428,
-1.2851037979125977,
-1.1565582752227783,
0.7447002530097961,
-0.8837394118309021,
0.12247543781995773,
-1.5209181308746338,
-0.20384150743484497,
-0.8358845114707947,
-1.1938762664794922,
0.6813189387321472,
0.09215079993009567,
0.4442666172981262,
-0.6029176115989685,
0.3808077871799469,
-2.2688989639282227,
-1.4186934232711792,
-0.34456536173820496,
-0.8599002361297607,
0.48854848742485046,
-0.3797536790370941,
0.8014415502548218,
-0.20424196124076843,
-0.05264807492494583,
0.35957011580467224,
1.3884291648864746,
3.496368885040283,
0.17699339985847473,
0.2440873384475708,
-0.1083819642663002,
-0.9511646032333374,
1.394614338874817,
0.8837878108024597,
-0.09255601465702057,
-0.49565601348876953,
-1.1271690130233765,
1.2488877773284912,
2.007558584213257,
1.0990015268325806,
-0.03887797147035599,
-0.8528915047645569,
-0.7270684242248535,
-0.05491545796394348,
0.12783405184745789,
0.4393775463104248,
0.8423147201538086,
0.04147554934024811,
0.03191133961081505,
1.5518864393234253,
1.1730139255523682,
-0.30581986904144287,
0.2708287239074707,
-0.8148833513259888,
-0.5490070581436157,
0.5668094754219055,
0.26725953817367554,
0.1264439821243286,
0.31820398569107056,
-1.0884730815887451,
-0.32537856698036194,
-0.4858299791812897,
-0.8728359341621399,
-0.6427866220474243,
-0.4668847322463989,
-0.28742700815200806,
1.6023324728012085,
0.15620160102844238,
-0.6148011088371277,
-0.0651034265756607,
-0.7895897030830383,
-0.11698251217603683,
-1.019635796546936,
0.3448537290096283,
-0.22600844502449036,
-0.10999803990125656,
-0.17158636450767517,
1.7547979354858398,
-1.0016056299209595,
-2.0286197662353516,
0.2244097888469696,
0.2707594633102417,
-0.3141201138496399,
0.20645436644554138,
1.6244326829910278,
0.6399062871932983,
1.413292407989502,
1.2766543626785278,
0.8816328048706055,
-0.7729922533035278,
-1.2909529209136963,
0.5711206197738647,
1.010125994682312,
-1.426574468612671,
0.8013965487480164,
-0.02914607711136341,
-0.559328019618988,
0.5789619088172913,
1.3244370222091675,
0.47251710295677185,
-1.951939344406128,
0.7285348176956177,
-0.9303768277168274,
0.7901930809020996,
0.7762723565101624,
0.6864129304885864,
0.12053244560956955,
0.6508705019950867,
-1.212665319442749,
-1.1172000169754028,
-0.7683318853378296,
-0.6777637004852295,
1.8685939311981201,
-0.31749841570854187,
0.6356132626533508,
-0.27235621213912964,
-1.3178246021270752,
-0.02747097797691822,
0.7355157732963562,
0.43856605887413025,
-0.5027726888656616,
0.7541519403457642,
-0.5998703241348267,
-1.0428334474563599,
-1.3352622985839844,
-0.40137794613838196,
-1.0835559368133545,
-1.023769736289978,
1.0411617755889893,
0.8594850301742554,
0.39102447032928467,
1.8793187141418457,
0.8769924640655518,
0.26698288321495056,
-2.4996607303619385,
0.918185830116272,
0.2765296399593353,
-0.015821700915694237,
0.8465797901153564,
0.2999020516872406,
0.9018949270248413,
-0.09859990328550339,
0.5798298120498657,
-2.371159076690674,
2.278855800628662,
-0.22329914569854736,
0.6515279412269592,
-0.11068693548440933,
-0.16915038228034973,
1.0008225440979004,
0.4761999547481537,
0.43772491812705994,
-1.0343279838562012,
0.615195631980896,
-0.42621031403541565,
1.185896396636963,
0.8028552532196045,
-0.7609362006187439,
0.033251624554395676,
1.3401691913604736,
0.5638686418533325,
-0.5209270715713501,
-0.9685332775115967,
-0.8653351664543152,
1.0407801866531372,
1.724689245223999,
-0.037545301020145416,
0.05885419249534607,
0.9442005157470703,
0.5565569400787354,
-1.304727554321289,
0.04291538521647453,
-0.7443596720695496,
-0.5055163502693176,
1.746159315109253,
2.0584983825683594,
-0.10821976512670517,
-0.16462168097496033,
-0.7523619532585144,
-1.3060628175735474,
0.8000270128250122,
0.03442935273051262,
0.09129013121128082,
0.6751642823219299,
-0.7233949899673462,
1.0610129833221436,
0.8845676779747009,
0.9191946983337402,
0.24614912271499634,
0.28150588274002075,
0.4726523756980896,
-0.4101766049861908,
-1.184902548789978,
-0.22622239589691162,
-1.0480581521987915,
-2.3636116981506348,
0.4862857460975647,
-0.11505642533302307,
-1.4013466835021973,
-0.08904027193784714,
-0.9929804801940918,
1.1042696237564087,
-0.5003430247306824,
-0.9589869976043701,
-1.5030888319015503,
0.2280571162700653,
-0.02159806154668331,
0.9812081456184387,
-1.48577880859375,
-0.25446662306785583,
1.2780444622039795,
0.9698953032493591,
-0.8289046883583069,
0.8824710845947266,
0.14122316241264343,
1.081286907196045,
0.8269143104553223,
-0.34796395897865295,
0.45793747901916504,
-0.08382324874401093,
-1.359115719795227,
0.4415242373943329,
1.1977595090866089,
0.16998165845870972,
1.534724473953247,
-0.6069612503051758,
0.0014492068439722061,
0.3483978509902954,
-0.37832140922546387,
-0.4486131966114044,
-0.4976470470428467,
0.5708213448524475,
0.09461046755313873,
-0.8990288376808167,
-0.01664593629539013,
0.05828450620174408,
-0.21735116839408875,
0.19593128561973572,
-1.4125782251358032,
-0.07027687132358551,
-0.3482774794101715,
-0.6358332633972168,
-1.1219197511672974,
-0.02981032058596611,
1.373030424118042,
-0.7940820455551147,
-0.23664405941963196,
0.5430997014045715,
0.2501504123210907,
0.46987658739089966,
0.6150738596916199,
-0.6775836944580078,
-0.23164182901382446,
-0.20276451110839844,
-0.2925889194011688,
0.30273929238319397,
1.3850338459014893,
-0.05012783408164978,
-0.9697878956794739,
0.7673786282539368,
-0.41573214530944824,
0.05908701568841934,
1.9770128726959229,
0.10422457754611969,
-0.8259661793708801,
0.28837335109710693,
-0.7116596698760986,
1.990288496017456,
1.8308134078979492,
1.3759305477142334,
-0.10215308517217636,
-0.971281886100769,
0.6435056328773499,
-0.32022935152053833,
-0.44885364174842834,
0.9258604645729065,
0.3235222399234772,
-0.2629226744174957,
-1.49003005027771,
0.70421302318573,
1.2338095903396606,
-0.9457528591156006,
-0.7803409695625305,
0.26430976390838623,
-0.8408188819885254,
0.9878054261207581,
0.7674873471260071,
0.4232215881347656,
0.3641873896121979,
1.6770075559616089,
0.8917883634567261,
-0.37197166681289673,
0.4512936472892761,
0.6332991123199463,
-0.09948193281888962,
-2.0398242473602295,
-1.2295104265213013,
0.3347967565059662,
-0.5587323904037476,
-1.5975230932235718,
1.3793679475784302,
-1.197399377822876,
-0.9731828570365906,
0.5713660717010498,
0.06147952377796173,
1.4402501583099365,
0.3863358795642853,
1.47664475440979,
2.0711631774902344,
0.9415199756622314,
0.3349907696247101,
1.2178393602371216,
-0.20134681463241577,
-0.4596211016178131,
1.8321373462677002,
-0.43577271699905396,
0.4727296233177185,
1.0574426651000977,
-0.3876363933086395,
-1.2184375524520874,
-0.7058249711990356,
-1.2555774450302124,
-0.735172688961029,
1.2240145206451416,
0.032257162034511566,
-1.1109590530395508,
0.23174992203712463,
1.566220998764038,
0.029650840908288956,
-0.46530619263648987,
0.6690321564674377,
0.4081714451313019,
-1.0233720541000366,
-0.001226622611284256,
-0.8557401895523071,
0.6173449754714966,
-0.09992969036102295,
-0.37621065974235535,
0.3013281226158142,
0.4657224714756012,
1.5049406290054321,
0.004398133605718613,
0.1592249870300293,
1.1251742839813232,
-1.3902877569198608,
1.5303537845611572,
-0.8091336488723755,
0.14464548230171204,
-2.3603007793426514,
1.365230679512024,
-0.7734035849571228,
1.9517115354537964,
-2.683385133743286,
0.5032143592834473,
-0.5464195013046265,
-0.4419671297073364,
0.2077341079711914,
-0.44218313694000244,
0.16978657245635986,
0.00606000330299139,
-1.1857328414916992,
-0.050990667194128036,
-0.6178986430168152,
0.651585578918457,
1.1500990390777588,
1.4757351875305176,
-1.1563191413879395,
-0.34698447585105896,
-1.7066638469696045,
-0.19766893982887268,
-0.8298012614250183,
0.3013167679309845,
-1.922104835510254,
-0.17451855540275574,
-1.7251439094543457,
-2.4172117710113525,
-1.3853461742401123,
-0.855272114276886,
1.0696372985839844,
0.09832479804754257,
-1.059584140777588,
1.2544896602630615,
-0.46217435598373413,
-1.9290708303451538,
1.2395879030227661,
-2.221302032470703
] |
https://github.com/huggingface/datasets/issues/5021 | Split is inferred from filename and overrides metadata.jsonl | Thanks! Specifying `data_files` worked for that case.
I'm new to the library, so let me try rephrasing the issue. If there's no actual bug here, sorry for the trouble.
I've uploaded an example [here](https://files.catbox.moe/nfj2pd.zip) with the following files:
```
.
├── bug.py
└── imagefolder
├── test
│ ├── metadata.jsonl
│ ├── dog.jpg
│ └── personal trainer.jpg
└── train
├── metadata.jsonl
├── cat.jpg
└── testing center.jpg
```
`bug.py`
```
from datasets import load_dataset
dataset = load_dataset("imagefolder")
print(dataset)
# DatasetDict({
# test: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# })
for split in dataset:
print("Split:", split)
for n in dataset[split]:
print(n['text'])
# Split: test
# testing center
```
As far as I can tell, this conforms with the example given here: https://huggingface.co/docs/datasets/image_dataset#imagefolder. It appears to me that, even though `metadata.jsonl` is present, the inferred labels from the path are taking precedent. Does this sound like a bug/undocumented behavior? | ## Describe the bug
Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files.
This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder
## Steps to reproduce the bug
`metadata.jsonl`
```json
{"file_name": "photo of a cat.jpg", "text": "a photo of a cat"}
{"file_name": "photo of a dog.jpg", "text": "a photo of a dog"}
{"file_name": "photo of a train.jpg", "text": "a photo of a train"}
{"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"}
```
`bug.py`
```python
from datasets import load_dataset
dataset = load_dataset("dataset")
print(dataset)
# DatasetDict({
# train: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# test: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# })
for split in dataset:
for n in dataset[split]:
print(n['text'])
# a photo of a train
# a photo of test tubes
```
## Expected results
One single dataset with all four images / a warning for unused files / documentation of this behavior
## Actual results
Only the images with "test" or "train" in the name are loaded
## Environment info
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.10.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.0 | 508 | 150 | Split is inferred from filename and overrides metadata.jsonl
## Describe the bug
Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files.
This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder
## Steps to reproduce the bug
`metadata.jsonl`
```json
{"file_name": "photo of a cat.jpg", "text": "a photo of a cat"}
{"file_name": "photo of a dog.jpg", "text": "a photo of a dog"}
{"file_name": "photo of a train.jpg", "text": "a photo of a train"}
{"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"}
```
`bug.py`
```python
from datasets import load_dataset
dataset = load_dataset("dataset")
print(dataset)
# DatasetDict({
# train: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# test: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# })
for split in dataset:
for n in dataset[split]:
print(n['text'])
# a photo of a train
# a photo of test tubes
```
## Expected results
One single dataset with all four images / a warning for unused files / documentation of this behavior
## Actual results
Only the images with "test" or "train" in the name are loaded
## Environment info
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.10.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Thanks! Specifying `data_files` worked for that case.
I'm new to the library, so let me try rephrasing the issue. If there's no actual bug here, sorry for the trouble.
I've uploaded an example [here](https://files.catbox.moe/nfj2pd.zip) with the following files:
```
.
├── bug.py
└── imagefolder
├── test
│ ├── metadata.jsonl
│ ├── dog.jpg
│ └── personal trainer.jpg
└── train
├── metadata.jsonl
├── cat.jpg
└── testing center.jpg
```
`bug.py`
```
from datasets import load_dataset
dataset = load_dataset("imagefolder")
print(dataset)
# DatasetDict({
# test: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# })
for split in dataset:
print("Split:", split)
for n in dataset[split]:
print(n['text'])
# Split: test
# testing center
```
As far as I can tell, this conforms with the example given here: https://huggingface.co/docs/datasets/image_dataset#imagefolder. It appears to me that, even though `metadata.jsonl` is present, the inferred labels from the path are taking precedent. Does this sound like a bug/undocumented behavior? | [
-1.1307748556137085,
-0.9348824620246887,
-0.8234125971794128,
1.4859087467193604,
-0.20957550406455994,
-1.2656850814819336,
0.10545340925455093,
-1.0962896347045898,
1.7155016660690308,
-0.7263500690460205,
0.2838917374610901,
-1.704062581062317,
0.02791241556406021,
-0.651332437992096,
-0.6614623069763184,
-0.9387280344963074,
-0.48200955986976624,
-0.6717208623886108,
1.0367679595947266,
2.512087106704712,
1.2006921768188477,
-1.3812693357467651,
2.614173650741577,
0.7991726994514465,
-0.15408523380756378,
-0.883700430393219,
0.5903186202049255,
0.04494453966617584,
-1.3093762397766113,
-0.3004666566848755,
-0.9156854152679443,
-0.10712069272994995,
-0.510464608669281,
-0.5609105825424194,
-0.11498455703258514,
0.48586198687553406,
-0.35376083850860596,
-0.5691726207733154,
-0.6594082713127136,
-0.8532349467277527,
0.3353123664855957,
-0.4208019971847534,
0.9830825924873352,
-0.4254911243915558,
1.7372535467147827,
-0.5343819260597229,
0.43987783789634705,
0.6966099739074707,
1.2731298208236694,
0.2617286443710327,
0.13619230687618256,
0.3374618887901306,
0.4684692323207855,
-0.13158023357391357,
0.5008580684661865,
1.1982934474945068,
0.6221807599067688,
0.463178426027298,
0.8459138870239258,
-2.1954843997955322,
1.2164475917816162,
-0.9667586088180542,
0.24997225403785706,
1.3782079219818115,
-0.8690871000289917,
0.4358004629611969,
-1.7552826404571533,
0.011608530767261982,
0.6093595623970032,
-2.128187656402588,
0.36091744899749756,
-1.2802340984344482,
-0.5545827746391296,
1.00596022605896,
0.3427014648914337,
-1.0332860946655273,
0.0729585662484169,
-0.43954721093177795,
0.9679825305938721,
0.41392749547958374,
1.1773186922073364,
-1.6640483140945435,
-0.09833000600337982,
-0.2972653806209564,
0.020125199109315872,
-1.2593954801559448,
-1.509725570678711,
0.5734975934028625,
0.6510574817657471,
0.6235793232917786,
-0.08171406388282776,
0.9900086522102356,
-1.0356966257095337,
0.6964426636695862,
-1.007538080215454,
-1.7761709690093994,
-1.416801929473877,
-2.2632851600646973,
-2.231630563735962,
0.7870438098907471,
-0.4923076331615448,
-0.5156151056289673,
1.9874926805496216,
-0.8893589973449707,
-1.7090564966201782,
1.1622250080108643,
0.36167919635772705,
-0.025182846933603287,
2.4251835346221924,
0.2666151225566864,
-0.7767372131347656,
0.5156159400939941,
-0.77073073387146,
0.6691625714302063,
-0.4543236792087555,
1.3209532499313354,
0.3201490640640259,
-0.972592830657959,
1.5838069915771484,
-0.4738284647464752,
0.7461232542991638,
-0.6396898627281189,
-0.5027766823768616,
-0.6463354229927063,
0.3809123635292053,
1.8513352870941162,
-0.3485117554664612,
1.4820277690887451,
-0.2605283260345459,
-1.563186526298523,
-1.664254069328308,
0.8441964983940125,
0.4280226230621338,
-0.7067674398422241,
0.10684968531131744,
-0.28734737634658813,
0.13317029178142548,
-0.19880487024784088,
1.111782431602478,
1.2623908519744873,
0.8046376705169678,
-0.3791539967060089,
-0.8639313578605652,
0.21442367136478424,
-0.014160800725221634,
-0.8407872319221497,
-1.6657774448394775,
-0.2768561840057373,
0.210618257522583,
0.5255043506622314,
-1.222015380859375,
1.7426820993423462,
0.8796654939651489,
1.9347732067108154,
0.9390925765037537,
-0.3805752098560333,
1.4847238063812256,
0.1298402100801468,
1.796869158744812,
-0.47501635551452637,
0.6328719258308411,
-0.35020682215690613,
-1.1611366271972656,
0.827189564704895,
-0.3345488905906677,
-2.0511364936828613,
-0.7372267842292786,
-0.8251204490661621,
-0.14689147472381592,
-0.7332924008369446,
0.8888942003250122,
-0.2597200870513916,
-1.3831583261489868,
0.2288333624601364,
-0.7666334509849548,
0.0419580303132534,
-1.239793300628662,
0.23423132300376892,
0.6423564553260803,
-0.614507794380188,
0.1373455673456192,
-0.13584770262241364,
-1.285225510597229,
-0.45825329422950745,
0.32957983016967773,
1.850045919418335,
-0.8452626466751099,
0.8678547143936157,
1.1033576726913452,
-0.7242287397384644,
0.06154175102710724,
0.28071925044059753,
-0.2837751507759094,
0.8581206798553467,
-1.100220799446106,
-0.455435186624527,
1.2445862293243408,
-0.18069986999034882,
-0.6469408869743347,
1.4771714210510254,
0.6624721884727478,
-1.0386741161346436,
-0.17561735212802887,
-0.12975452840328217,
-0.8438661694526672,
0.02121368795633316,
-1.5792292356491089,
-0.020752646028995514,
0.35241928696632385,
-1.4592134952545166,
-0.48053428530693054,
-0.25219446420669556,
1.2394137382507324,
-0.1319582760334015,
1.3227498531341553,
-0.3886408507823944,
-0.22419309616088867,
-0.4114047884941101,
-0.38357049226760864,
0.06729191541671753,
-0.3759286403656006,
-0.5610020160675049,
0.1273219883441925,
-0.8182089924812317,
0.27868711948394775,
1.4213262796401978,
0.36835864186286926,
0.08101847022771835,
0.5201232433319092,
1.0724520683288574,
0.40196385979652405,
-0.0858926996588707,
-0.8803727626800537,
-1.3884023427963257,
1.9765409231185913,
-1.4173541069030762,
1.9813140630722046,
0.7008867859840393,
-0.05455411598086357,
-1.8256409168243408,
-2.051119804382324,
1.3320492506027222,
1.1676284074783325,
2.3241446018218994,
0.5505027174949646,
0.4419202506542206,
-0.8727850317955017,
-0.7088198661804199,
0.2523047924041748,
-0.996785581111908,
-0.6482324004173279,
0.22530372440814972,
2.34088397026062,
1.8008928298950195,
-0.47133132815361023,
-0.18201382458209991,
-1.0908174514770508,
1.5158766508102417,
-0.10042940080165863,
0.19028183817863464,
2.0204436779022217,
-0.3153505325317383,
-0.9102033376693726,
1.2984501123428345,
-2.2858498096466064,
0.05632256716489792,
1.9306665658950806,
0.23200902342796326,
0.1448475420475006,
-1.3252898454666138,
-0.7703849077224731,
-0.34406498074531555,
-0.36777910590171814,
-1.1767330169677734,
0.5463945269584656,
-0.25787433981895447,
-0.7060588002204895,
-1.4747304916381836,
0.2143576294183731,
-1.1042777299880981,
-1.6301169395446777,
0.15923574566841125,
1.8587148189544678,
2.03183650970459,
-0.9022520780563354,
1.556414246559143,
-0.25423663854599,
0.0817553773522377,
1.3033709526062012,
1.257327675819397,
3.134866952896118,
1.9262691736221313,
-1.2787631750106812,
0.6410454511642456,
-0.08694251626729965,
-0.3076552450656891,
1.0786192417144775,
-1.3177577257156372,
1.2816622257232666,
-0.1066199541091919,
-1.103205680847168,
-1.162253499031067,
0.8418239951133728,
0.47884371876716614,
0.10363674908876419,
-0.5091119408607483,
1.094122052192688,
0.011227198876440525,
1.3568227291107178,
0.5691186785697937,
-0.362419068813324,
0.6923394799232483,
-0.3437080681324005,
-0.4446663558483124,
1.5515902042388916,
0.19436649978160858,
-1.4316591024398804,
-2.2672441005706787,
-0.27555617690086365,
-0.8921788930892944,
-0.024896744638681412,
-0.5561839938163757,
-1.0965420007705688,
1.7769193649291992,
0.37416619062423706,
-1.249157190322876,
-0.32043400406837463,
-0.2967439889907837,
-0.5711921453475952,
2.854992151260376,
-1.4211015701293945,
-0.264414519071579,
-1.0230296850204468,
-0.5971413850784302,
1.727064609527588,
-1.0866799354553223,
-0.23597101867198944,
-1.0866481065750122,
-0.4951116740703583,
-1.379518747329712,
-0.5789245367050171,
0.06214059889316559,
-0.8840884566307068,
1.0654480457305908,
0.21959374845027924,
-1.239993691444397,
-0.3102209270000458,
-0.9285836815834045,
0.8839413523674011,
-0.18787550926208496,
0.23331232368946075,
2.0110220909118652,
0.42172083258628845,
-0.24799737334251404,
0.6361501216888428,
1.183776617050171,
0.6385790109634399,
-0.7118420600891113,
0.1862187683582306,
-0.6696838140487671,
0.35896578431129456,
-1.3597198724746704,
0.22400422394275665,
-2.78359055519104,
0.5961968898773193,
-0.08179555088281631,
-0.09311109781265259,
0.04719846695661545,
-1.279233694076538,
1.0936321020126343,
2.603569269180298,
-1.1830180883407593,
0.4375782310962677,
0.29484498500823975,
1.1778850555419922,
-1.619963526725769,
0.25833582878112793,
-0.3542253375053406,
2.05409836769104,
0.056174732744693756,
1.1512175798416138,
-0.48252058029174805,
-2.3041892051696777,
0.6487162709236145,
-1.2828688621520996,
-1.1539396047592163,
0.7466263175010681,
-0.879913330078125,
0.11582234501838684,
-1.5134351253509521,
-0.1978340744972229,
-0.8424740433692932,
-1.1969736814498901,
0.6698319911956787,
0.09408972412347794,
0.4425275921821594,
-0.6058943271636963,
0.3766612112522125,
-2.274841070175171,
-1.415610432624817,
-0.33684709668159485,
-0.8521662950515747,
0.48194801807403564,
-0.38190850615501404,
0.798646867275238,
-0.20150186121463776,
-0.04959985241293907,
0.3601229786872864,
1.3933720588684082,
3.4957380294799805,
0.1796177476644516,
0.24493160843849182,
-0.10799512267112732,
-0.9619799852371216,
1.3984485864639282,
0.8754406571388245,
-0.08841948211193085,
-0.5090499520301819,
-1.1132005453109741,
1.237669587135315,
2.0077576637268066,
1.092260479927063,
-0.041608430445194244,
-0.8440880179405212,
-0.7310668230056763,
-0.04825776070356369,
0.12374293804168701,
0.44417116045951843,
0.8496101498603821,
0.03937815502285957,
0.0275660939514637,
1.5560859441757202,
1.1617729663848877,
-0.3106682598590851,
0.26026245951652527,
-0.8178644180297852,
-0.5416468977928162,
0.5707190036773682,
0.2707382142543793,
0.13377594947814941,
0.31053656339645386,
-1.090854287147522,
-0.33495059609413147,
-0.48887452483177185,
-0.8781214356422424,
-0.6404451727867126,
-0.46100443601608276,
-0.2980281710624695,
1.5990400314331055,
0.1634371429681778,
-0.6184520721435547,
-0.06328454613685608,
-0.7931989431381226,
-0.11620227992534637,
-1.0235875844955444,
0.3366219699382782,
-0.2220250964164734,
-0.11639685928821564,
-0.1654518097639084,
1.757367491722107,
-1.0048847198486328,
-2.027174949645996,
0.22625161707401276,
0.24905511736869812,
-0.32027631998062134,
0.20936208963394165,
1.6260651350021362,
0.6382542252540588,
1.4186898469924927,
1.2700871229171753,
0.8845347762107849,
-0.7739291191101074,
-1.2933067083358765,
0.5825549960136414,
1.0083398818969727,
-1.4305522441864014,
0.8041071891784668,
-0.02227816730737686,
-0.5484404563903809,
0.5702741146087646,
1.326024055480957,
0.4706076979637146,
-1.956234335899353,
0.7150931358337402,
-0.9312116503715515,
0.7935539484024048,
0.7802327871322632,
0.6749386191368103,
0.11594803631305695,
0.6400078535079956,
-1.2153505086898804,
-1.110100269317627,
-0.7562125325202942,
-0.6792454719543457,
1.884993553161621,
-0.3152507245540619,
0.6510562300682068,
-0.2613010108470917,
-1.3104329109191895,
-0.023641549050807953,
0.7361488342285156,
0.4358014166355133,
-0.5004374384880066,
0.7635196447372437,
-0.596702516078949,
-1.0339614152908325,
-1.3375332355499268,
-0.40546509623527527,
-1.0812044143676758,
-1.017613410949707,
1.0433927774429321,
0.8486611843109131,
0.39501532912254333,
1.8767950534820557,
0.8762162923812866,
0.27719777822494507,
-2.510222911834717,
0.9257377982139587,
0.2721565365791321,
-0.013420986011624336,
0.8449645042419434,
0.29893383383750916,
0.8976033329963684,
-0.09777228534221649,
0.5812723636627197,
-2.368039846420288,
2.2839043140411377,
-0.2228638231754303,
0.6516326665878296,
-0.10377203673124313,
-0.17125023901462555,
1.0054514408111572,
0.4815892279148102,
0.44529151916503906,
-1.0396887063980103,
0.6044803857803345,
-0.43745720386505127,
1.1927498579025269,
0.8130240440368652,
-0.7617422938346863,
0.03259012848138809,
1.3414525985717773,
0.5721580982208252,
-0.5212458372116089,
-0.9843471646308899,
-0.8742581009864807,
1.034616231918335,
1.722295880317688,
-0.04331924766302109,
0.04476882144808769,
0.9408249855041504,
0.5551292300224304,
-1.3035662174224854,
0.042235102504491806,
-0.7482314109802246,
-0.5124744772911072,
1.7469749450683594,
2.05255126953125,
-0.10656943172216415,
-0.16594263911247253,
-0.7607041597366333,
-1.3107562065124512,
0.7975960969924927,
0.031140878796577454,
0.08985411375761032,
0.6695321202278137,
-0.7173592448234558,
1.062044620513916,
0.8762623071670532,
0.9277568459510803,
0.24614548683166504,
0.2838490605354309,
0.4724430441856384,
-0.4216702878475189,
-1.189191222190857,
-0.2169044464826584,
-1.0494662523269653,
-2.3771491050720215,
0.48525071144104004,
-0.12511605024337769,
-1.4131901264190674,
-0.08749134093523026,
-0.9946482181549072,
1.1044806241989136,
-0.5119903087615967,
-0.9574041962623596,
-1.5007065534591675,
0.23457814753055573,
-0.02780214324593544,
0.9843292236328125,
-1.4936609268188477,
-0.24343784153461456,
1.2711071968078613,
0.9678676128387451,
-0.8130148649215698,
0.8802008032798767,
0.1423715054988861,
1.0905961990356445,
0.8149363994598389,
-0.34321263432502747,
0.4623846709728241,
-0.08119422197341919,
-1.3593660593032837,
0.4406307637691498,
1.1881682872772217,
0.17467531561851501,
1.5289033651351929,
-0.6040246486663818,
0.007472570054233074,
0.34950849413871765,
-0.40829190611839294,
-0.44409453868865967,
-0.4988871216773987,
0.5747790336608887,
0.08197177201509476,
-0.9003169536590576,
-0.020496763288974762,
0.055014029145240784,
-0.21420146524906158,
0.19360792636871338,
-1.4150029420852661,
-0.08442698419094086,
-0.3516172766685486,
-0.637282133102417,
-1.1264272928237915,
-0.04262278228998184,
1.377774953842163,
-0.7771894335746765,
-0.23543202877044678,
0.5427975058555603,
0.24345150589942932,
0.4563755691051483,
0.6099616289138794,
-0.6835106611251831,
-0.2360968291759491,
-0.1916595995426178,
-0.2932133674621582,
0.3085213899612427,
1.3964062929153442,
-0.05550000071525574,
-0.9707804322242737,
0.7618322372436523,
-0.41369202733039856,
0.06745480746030807,
1.9756017923355103,
0.11040294915437698,
-0.8212829828262329,
0.2940315306186676,
-0.7132490277290344,
1.9852575063705444,
1.8231632709503174,
1.3664517402648926,
-0.10991167277097702,
-0.9577279686927795,
0.6497899293899536,
-0.32571741938591003,
-0.4381202161312103,
0.9229822754859924,
0.3219468891620636,
-0.25964757800102234,
-1.4894970655441284,
0.700305700302124,
1.2388956546783447,
-0.949944257736206,
-0.7752478718757629,
0.26183053851127625,
-0.8379276990890503,
0.9994412064552307,
0.7624854445457458,
0.43171778321266174,
0.3691413104534149,
1.6834403276443481,
0.8920549750328064,
-0.3641344904899597,
0.4447338879108429,
0.6199218034744263,
-0.1080564633011818,
-2.0502448081970215,
-1.2256731986999512,
0.32802119851112366,
-0.5796442627906799,
-1.6092740297317505,
1.3850202560424805,
-1.2003787755966187,
-0.9632776975631714,
0.5681328773498535,
0.06350383907556534,
1.4393434524536133,
0.399855375289917,
1.480063796043396,
2.064077377319336,
0.9400646090507507,
0.3388257920742035,
1.2240948677062988,
-0.190037339925766,
-0.46026912331581116,
1.8250683546066284,
-0.4417388439178467,
0.47545355558395386,
1.0713831186294556,
-0.36930423974990845,
-1.2192926406860352,
-0.7145209908485413,
-1.250814437866211,
-0.7357512712478638,
1.223495602607727,
0.03410787880420685,
-1.1186665296554565,
0.23637108504772186,
1.5681562423706055,
0.03063848242163658,
-0.46399587392807007,
0.6618393063545227,
0.40036168694496155,
-1.006215214729309,
-0.0014461008831858635,
-0.8461666703224182,
0.6134305596351624,
-0.10495909303426743,
-0.36874499917030334,
0.2985365688800812,
0.45965638756752014,
1.5036405324935913,
-0.0016575572080910206,
0.1631193459033966,
1.1288684606552124,
-1.401856780052185,
1.547998309135437,
-0.8020687103271484,
0.14776641130447388,
-2.36003041267395,
1.3647043704986572,
-0.7706711292266846,
1.9457207918167114,
-2.682565689086914,
0.5012509226799011,
-0.539120078086853,
-0.4477905333042145,
0.21006479859352112,
-0.45683369040489197,
0.16012714803218842,
0.005482116714119911,
-1.188154697418213,
-0.036503590643405914,
-0.6287438869476318,
0.6512332558631897,
1.1606389284133911,
1.4693046808242798,
-1.1543939113616943,
-0.33496952056884766,
-1.7113564014434814,
-0.19391147792339325,
-0.8317422866821289,
0.30952271819114685,
-1.9273639917373657,
-0.16150423884391785,
-1.7256025075912476,
-2.4228875637054443,
-1.3804066181182861,
-0.8522369265556335,
1.0704554319381714,
0.09905629605054855,
-1.0397990942001343,
1.2463806867599487,
-0.4516100585460663,
-1.928090214729309,
1.2361494302749634,
-2.2260618209838867
] |
https://github.com/huggingface/datasets/issues/5021 | Split is inferred from filename and overrides metadata.jsonl | This looks like a duplicate of https://github.com/huggingface/datasets/issues/4895 (the problem is explained in this comment: https://github.com/huggingface/datasets/issues/4895#issuecomment-1248269550).
In the meantime, you can do the following to fetch all the splits:
```python
dataset = load_dataset("imagefolder", data_files={"train": "imagefolder/train/**", "test": "imagefolder/test/**"})
```
| ## Describe the bug
Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files.
This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder
## Steps to reproduce the bug
`metadata.jsonl`
```json
{"file_name": "photo of a cat.jpg", "text": "a photo of a cat"}
{"file_name": "photo of a dog.jpg", "text": "a photo of a dog"}
{"file_name": "photo of a train.jpg", "text": "a photo of a train"}
{"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"}
```
`bug.py`
```python
from datasets import load_dataset
dataset = load_dataset("dataset")
print(dataset)
# DatasetDict({
# train: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# test: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# })
for split in dataset:
for n in dataset[split]:
print(n['text'])
# a photo of a train
# a photo of test tubes
```
## Expected results
One single dataset with all four images / a warning for unused files / documentation of this behavior
## Actual results
Only the images with "test" or "train" in the name are loaded
## Environment info
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.10.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.0 | 508 | 37 | Split is inferred from filename and overrides metadata.jsonl
## Describe the bug
Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files.
This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder
## Steps to reproduce the bug
`metadata.jsonl`
```json
{"file_name": "photo of a cat.jpg", "text": "a photo of a cat"}
{"file_name": "photo of a dog.jpg", "text": "a photo of a dog"}
{"file_name": "photo of a train.jpg", "text": "a photo of a train"}
{"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"}
```
`bug.py`
```python
from datasets import load_dataset
dataset = load_dataset("dataset")
print(dataset)
# DatasetDict({
# train: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# test: Dataset({
# features: ['image', 'text'],
# num_rows: 1
# })
# })
for split in dataset:
for n in dataset[split]:
print(n['text'])
# a photo of a train
# a photo of test tubes
```
## Expected results
One single dataset with all four images / a warning for unused files / documentation of this behavior
## Actual results
Only the images with "test" or "train" in the name are loaded
## Environment info
- `datasets` version: 2.5.1
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.10.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
This looks like a duplicate of https://github.com/huggingface/datasets/issues/4895 (the problem is explained in this comment: https://github.com/huggingface/datasets/issues/4895#issuecomment-1248269550).
In the meantime, you can do the following to fetch all the splits:
```python
dataset = load_dataset("imagefolder", data_files={"train": "imagefolder/train/**", "test": "imagefolder/test/**"})
```
| [
-1.1185181140899658,
-0.9465793967247009,
-0.8280634880065918,
1.4833663702011108,
-0.20052088797092438,
-1.2703036069869995,
0.0934162512421608,
-1.075398564338684,
1.7171945571899414,
-0.71174156665802,
0.27949851751327515,
-1.7173900604248047,
0.005205436609685421,
-0.6517769694328308,
-0.6598945260047913,
-0.932567298412323,
-0.47301149368286133,
-0.6711276173591614,
1.0314569473266602,
2.5293784141540527,
1.2082515954971313,
-1.382860779762268,
2.634636402130127,
0.7928584814071655,
-0.15638668835163116,
-0.8807582259178162,
0.5899750590324402,
0.04591987282037735,
-1.3090687990188599,
-0.3028397560119629,
-0.9052299857139587,
-0.08583566546440125,
-0.49175840616226196,
-0.5648523569107056,
-0.11113347858190536,
0.4941278398036957,
-0.3542942404747009,
-0.560696542263031,
-0.6620928049087524,
-0.8606387376785278,
0.3324529230594635,
-0.41539594531059265,
0.9725745320320129,
-0.4290187358856201,
1.734381079673767,
-0.5408911108970642,
0.41652345657348633,
0.6906206607818604,
1.2706681489944458,
0.26147475838661194,
0.15245716273784637,
0.33786851167678833,
0.4658285081386566,
-0.12913815677165985,
0.4988044798374176,
1.2188494205474854,
0.619109034538269,
0.44437548518180847,
0.8428314328193665,
-2.1976916790008545,
1.2258155345916748,
-0.9444658756256104,
0.2521222233772278,
1.3694463968276978,
-0.8670109510421753,
0.4315377473831177,
-1.7559505701065063,
0.0016977069899439812,
0.6118406057357788,
-2.1389992237091064,
0.3521077632904053,
-1.2790552377700806,
-0.5591093301773071,
0.9983477592468262,
0.3359900414943695,
-1.0331993103027344,
0.07976178824901581,
-0.46057745814323425,
0.9629426598548889,
0.418429970741272,
1.1873927116394043,
-1.6629563570022583,
-0.10569855570793152,
-0.2808549106121063,
0.02044900320470333,
-1.2644418478012085,
-1.5088363885879517,
0.5702617168426514,
0.653475821018219,
0.6388039588928223,
-0.08538828790187836,
0.9797626733779907,
-1.0266460180282593,
0.6996676325798035,
-1.001150369644165,
-1.7849323749542236,
-1.4343963861465454,
-2.2726852893829346,
-2.238239049911499,
0.7963312268257141,
-0.4957878291606903,
-0.5103806853294373,
1.9678089618682861,
-0.8805516958236694,
-1.716045618057251,
1.1532572507858276,
0.3690608739852905,
-0.02408495545387268,
2.4221646785736084,
0.2760767340660095,
-0.7968543171882629,
0.5168705582618713,
-0.7622997164726257,
0.6674262285232544,
-0.4546422064304352,
1.3238438367843628,
0.33441027998924255,
-0.9773421287536621,
1.579355239868164,
-0.4898286759853363,
0.7349582314491272,
-0.6477169394493103,
-0.497932493686676,
-0.6417761445045471,
0.37049153447151184,
1.833413004875183,
-0.34963592886924744,
1.4849982261657715,
-0.26107919216156006,
-1.5711215734481812,
-1.6560550928115845,
0.8342722058296204,
0.42990943789482117,
-0.7096286416053772,
0.09949906170368195,
-0.3079363703727722,
0.12768128514289856,
-0.18826715648174286,
1.1057188510894775,
1.253090262413025,
0.7954411506652832,
-0.3791567385196686,
-0.8597586154937744,
0.21571235358715057,
-0.005531999748200178,
-0.8286405801773071,
-1.6760672330856323,
-0.26859936118125916,
0.2414080798625946,
0.5100422501564026,
-1.235633373260498,
1.7353248596191406,
0.875446617603302,
1.9572583436965942,
0.937398374080658,
-0.373420387506485,
1.4818212985992432,
0.11639028787612915,
1.7932533025741577,
-0.47849041223526,
0.6233545541763306,
-0.33830124139785767,
-1.165403127670288,
0.8295952677726746,
-0.3411462604999542,
-2.0548484325408936,
-0.7411789894104004,
-0.8236792087554932,
-0.1412443220615387,
-0.744617223739624,
0.8908864855766296,
-0.252640038728714,
-1.3896408081054688,
0.22563712298870087,
-0.7829849123954773,
0.03225608915090561,
-1.2416706085205078,
0.20370244979858398,
0.6424402594566345,
-0.613811194896698,
0.13273164629936218,
-0.11916358023881912,
-1.284606695175171,
-0.45051896572113037,
0.3294278085231781,
1.8536012172698975,
-0.8441110849380493,
0.8746407628059387,
1.106850028038025,
-0.7184005379676819,
0.08116133511066437,
0.28395187854766846,
-0.2839822471141815,
0.8658051490783691,
-1.0959868431091309,
-0.4390092194080353,
1.242890477180481,
-0.16713228821754456,
-0.6474851965904236,
1.487375259399414,
0.6654349565505981,
-1.0346405506134033,
-0.18841294944286346,
-0.11652567982673645,
-0.8552941679954529,
0.006531335413455963,
-1.5669965744018555,
-0.018986769020557404,
0.33032163977622986,
-1.4496991634368896,
-0.47320398688316345,
-0.25749462842941284,
1.2453371286392212,
-0.13581427931785583,
1.31923508644104,
-0.3917006552219391,
-0.22136440873146057,
-0.4162929356098175,
-0.3880000710487366,
0.05728127062320709,
-0.3904416859149933,
-0.5729713439941406,
0.14382816851139069,
-0.8244863748550415,
0.26772192120552063,
1.4274998903274536,
0.39042410254478455,
0.08877155929803848,
0.5237268209457397,
1.0834519863128662,
0.39749452471733093,
-0.08963220566511154,
-0.8712685704231262,
-1.394968032836914,
1.9835659265518188,
-1.4109907150268555,
1.9795687198638916,
0.7168205380439758,
-0.057065971195697784,
-1.8222562074661255,
-2.0542714595794678,
1.3145599365234375,
1.1717727184295654,
2.3418662548065186,
0.5455272197723389,
0.4416503608226776,
-0.8701327443122864,
-0.7168155908584595,
0.23563933372497559,
-1.0049751996994019,
-0.6538585424423218,
0.22504498064517975,
2.341923713684082,
1.8129239082336426,
-0.47156432271003723,
-0.18147096037864685,
-1.1060274839401245,
1.5178890228271484,
-0.10153818130493164,
0.1808352768421173,
2.023141384124756,
-0.30791160464286804,
-0.9066163897514343,
1.3002265691757202,
-2.2837414741516113,
0.060067906975746155,
1.9319425821304321,
0.23617836833000183,
0.1450694054365158,
-1.319327473640442,
-0.7752600312232971,
-0.36291518807411194,
-0.37480035424232483,
-1.1700433492660522,
0.5584758520126343,
-0.26704269647598267,
-0.7215356230735779,
-1.4779999256134033,
0.20071065425872803,
-1.0949946641921997,
-1.6432503461837769,
0.16280701756477356,
1.8574731349945068,
2.038642168045044,
-0.9102804064750671,
1.5468692779541016,
-0.25018900632858276,
0.07281415909528732,
1.3092765808105469,
1.27069890499115,
3.13671875,
1.9200632572174072,
-1.2825862169265747,
0.6533770561218262,
-0.09144242852926254,
-0.3035310208797455,
1.0809552669525146,
-1.3332619667053223,
1.2745968103408813,
-0.11074884980916977,
-1.1116811037063599,
-1.1613361835479736,
0.8473629355430603,
0.4935384690761566,
0.10092542320489883,
-0.5168620347976685,
1.0898030996322632,
0.004167746752500534,
1.3622257709503174,
0.5792897939682007,
-0.3562575876712799,
0.6847320199012756,
-0.3330130875110626,
-0.44806742668151855,
1.54616117477417,
0.19486811757087708,
-1.4463825225830078,
-2.2769548892974854,
-0.2657761871814728,
-0.8929502964019775,
-0.04912702739238739,
-0.5614804029464722,
-1.0994277000427246,
1.7805653810501099,
0.3763081729412079,
-1.2507758140563965,
-0.3223140239715576,
-0.2935902774333954,
-0.5636845231056213,
2.854367733001709,
-1.4207708835601807,
-0.2605851888656616,
-1.0272438526153564,
-0.581976056098938,
1.7320775985717773,
-1.0823657512664795,
-0.22960081696510315,
-1.0837490558624268,
-0.5028359293937683,
-1.382205843925476,
-0.5863941311836243,
0.055716678500175476,
-0.8699862360954285,
1.0477936267852783,
0.19939379394054413,
-1.2355231046676636,
-0.3036753833293915,
-0.933758556842804,
0.8983123898506165,
-0.1925681084394455,
0.23574776947498322,
2.0205986499786377,
0.42444273829460144,
-0.2433365285396576,
0.625616192817688,
1.1875001192092896,
0.6224682331085205,
-0.7034562826156616,
0.17103660106658936,
-0.6780592799186707,
0.36086031794548035,
-1.3697938919067383,
0.22089141607284546,
-2.791194200515747,
0.6018933057785034,
-0.07699277997016907,
-0.09912535548210144,
0.049003034830093384,
-1.2637006044387817,
1.11361825466156,
2.5919783115386963,
-1.191567063331604,
0.43655672669410706,
0.30162298679351807,
1.1623594760894775,
-1.6256967782974243,
0.25927144289016724,
-0.3569144606590271,
2.044283628463745,
0.04975154995918274,
1.1567888259887695,
-0.47471287846565247,
-2.2762584686279297,
0.6462498307228088,
-1.2869322299957275,
-1.1344527006149292,
0.7552552223205566,
-0.8749366402626038,
0.12837949395179749,
-1.5207412242889404,
-0.1866140514612198,
-0.8426500558853149,
-1.198287010192871,
0.6749398112297058,
0.09077473729848862,
0.4378751814365387,
-0.5978939533233643,
0.39173147082328796,
-2.2801382541656494,
-1.4204401969909668,
-0.33930256962776184,
-0.8647080063819885,
0.4918869435787201,
-0.3800047039985657,
0.791342556476593,
-0.19627155363559723,
-0.06182043254375458,
0.35673123598098755,
1.3763206005096436,
3.4957213401794434,
0.18330147862434387,
0.23419111967086792,
-0.08801570534706116,
-0.971804678440094,
1.4072449207305908,
0.8770893812179565,
-0.09569547325372696,
-0.5040466785430908,
-1.1046653985977173,
1.261527180671692,
2.010472059249878,
1.1250395774841309,
-0.03710193186998367,
-0.8600499629974365,
-0.7422094941139221,
-0.0420423299074173,
0.13569189608097076,
0.4432294964790344,
0.855298638343811,
0.0223256666213274,
0.023302210494875908,
1.571582555770874,
1.1748896837234497,
-0.30144670605659485,
0.2780483365058899,
-0.8276832699775696,
-0.5382424592971802,
0.5580705404281616,
0.2668697237968445,
0.14539755880832672,
0.33431199193000793,
-1.1103754043579102,
-0.33141830563545227,
-0.48533332347869873,
-0.8772487044334412,
-0.6469221115112305,
-0.4723183810710907,
-0.30243566632270813,
1.5938193798065186,
0.1512664556503296,
-0.6062647104263306,
-0.04924369603395462,
-0.7942598462104797,
-0.12533089518547058,
-1.0224065780639648,
0.3554711639881134,
-0.21234217286109924,
-0.09736966341733932,
-0.18274952471256256,
1.7506709098815918,
-1.0029473304748535,
-2.0447287559509277,
0.23260290920734406,
0.26806098222732544,
-0.32785558700561523,
0.19719713926315308,
1.6243947744369507,
0.6401060223579407,
1.4051415920257568,
1.2613780498504639,
0.8826534748077393,
-0.7640966176986694,
-1.2854785919189453,
0.5789824724197388,
1.019292950630188,
-1.4254810810089111,
0.8186949491500854,
-0.05335123836994171,
-0.5571141839027405,
0.5788009166717529,
1.3324458599090576,
0.46254226565361023,
-1.9478346109390259,
0.718532383441925,
-0.9135563969612122,
0.7899935841560364,
0.7648158073425293,
0.6889091730117798,
0.11035802960395813,
0.6374354958534241,
-1.234567403793335,
-1.1116161346435547,
-0.7669289708137512,
-0.6727766990661621,
1.8709266185760498,
-0.29468676447868347,
0.646762490272522,
-0.26864874362945557,
-1.3039965629577637,
-0.02286912500858307,
0.7318360209465027,
0.43230265378952026,
-0.506494402885437,
0.766575038433075,
-0.5869544148445129,
-1.0403964519500732,
-1.3252854347229004,
-0.39551106095314026,
-1.0704560279846191,
-1.0178278684616089,
1.0329712629318237,
0.8480564951896667,
0.40217554569244385,
1.8774172067642212,
0.8691731691360474,
0.27048224210739136,
-2.5071640014648438,
0.9220365881919861,
0.2698090672492981,
-0.001461206004023552,
0.850273072719574,
0.28504493832588196,
0.9002149701118469,
-0.08575465530157089,
0.5871219038963318,
-2.368513584136963,
2.2610414028167725,
-0.2129359394311905,
0.6450371146202087,
-0.107154980301857,
-0.17758159339427948,
1.0016934871673584,
0.47831058502197266,
0.43958213925361633,
-1.041964054107666,
0.6169330477714539,
-0.4237353205680847,
1.1762944459915161,
0.8056805729866028,
-0.7654397487640381,
0.04014670103788376,
1.3358724117279053,
0.5640485882759094,
-0.49729296565055847,
-0.9826285243034363,
-0.8516530394554138,
1.0379468202590942,
1.7206107378005981,
-0.02894134633243084,
0.058166369795799255,
0.9448280334472656,
0.5443730354309082,
-1.3008613586425781,
0.03334993124008179,
-0.742753267288208,
-0.4997105598449707,
1.7491328716278076,
2.058885097503662,
-0.10205241292715073,
-0.16451458632946014,
-0.7509163022041321,
-1.2976291179656982,
0.7873576283454895,
0.031787365674972534,
0.09690464287996292,
0.6990919709205627,
-0.7196750640869141,
1.0608354806900024,
0.8537075519561768,
0.9333866238594055,
0.23661254346370697,
0.27535778284072876,
0.4705013930797577,
-0.41035351157188416,
-1.2017576694488525,
-0.24191538989543915,
-1.052537441253662,
-2.3568432331085205,
0.4814718961715698,
-0.12203366309404373,
-1.4107120037078857,
-0.07644417136907578,
-1.0041230916976929,
1.1050516366958618,
-0.5153852701187134,
-0.949141263961792,
-1.4891726970672607,
0.23916830122470856,
-0.03905932605266571,
0.9755519032478333,
-1.4918054342269897,
-0.25139495730400085,
1.2818591594696045,
0.9641591906547546,
-0.8085338473320007,
0.8787738680839539,
0.13655687868595123,
1.087885856628418,
0.8175461292266846,
-0.3337996006011963,
0.460040807723999,
-0.061720430850982666,
-1.3642919063568115,
0.435732901096344,
1.1984268426895142,
0.17484118044376373,
1.5374754667282104,
-0.6004319787025452,
0.019892998039722443,
0.3569372296333313,
-0.4017047882080078,
-0.45218777656555176,
-0.49438273906707764,
0.5787960886955261,
0.0997602716088295,
-0.9172244668006897,
-0.013897089287638664,
0.04835306853055954,
-0.2089584469795227,
0.20328199863433838,
-1.4029443264007568,
-0.08875051885843277,
-0.3421492278575897,
-0.6291755437850952,
-1.122712254524231,
-0.03039039671421051,
1.3684628009796143,
-0.8037800788879395,
-0.23292502760887146,
0.5471684336662292,
0.24480807781219482,
0.4718070924282074,
0.614824652671814,
-0.6826142072677612,
-0.23146313428878784,
-0.19611428678035736,
-0.2823829650878906,
0.3055219352245331,
1.3799738883972168,
-0.04401450604200363,
-0.9770070314407349,
0.7690032124519348,
-0.43239104747772217,
0.0722731500864029,
1.9833717346191406,
0.10106389224529266,
-0.8208067417144775,
0.2968365550041199,
-0.700721800327301,
1.9851100444793701,
1.8054462671279907,
1.372517466545105,
-0.10284701734781265,
-0.9527269601821899,
0.6403982043266296,
-0.3040383756160736,
-0.4469757676124573,
0.9187938570976257,
0.318973571062088,
-0.26037973165512085,
-1.4907851219177246,
0.6934583187103271,
1.2386281490325928,
-0.9653922319412231,
-0.7690461277961731,
0.2537660002708435,
-0.8562138080596924,
1.0015499591827393,
0.766264021396637,
0.41898128390312195,
0.3692287504673004,
1.672564148902893,
0.8835873007774353,
-0.35904523730278015,
0.42920032143592834,
0.6174705624580383,
-0.10880763828754425,
-2.0438973903656006,
-1.2067950963974,
0.329149454832077,
-0.5641260147094727,
-1.5794744491577148,
1.368927001953125,
-1.211686611175537,
-0.9739240407943726,
0.570764422416687,
0.06609056144952774,
1.4271862506866455,
0.3889712989330292,
1.4852700233459473,
2.073669195175171,
0.9431884288787842,
0.3170386552810669,
1.2214326858520508,
-0.19401346147060394,
-0.4601118266582489,
1.812746524810791,
-0.4202284514904022,
0.49036094546318054,
1.0438541173934937,
-0.388908326625824,
-1.230054259300232,
-0.7102612853050232,
-1.251585602760315,
-0.7262916564941406,
1.2349393367767334,
0.03982250392436981,
-1.1091771125793457,
0.23309428989887238,
1.564481258392334,
0.033281631767749786,
-0.45483148097991943,
0.6643498539924622,
0.4074051082134247,
-1.0060616731643677,
0.008118707686662674,
-0.846494734287262,
0.6096685528755188,
-0.09033777564764023,
-0.3683936595916748,
0.28536537289619446,
0.46694058179855347,
1.4955934286117554,
0.008542915806174278,
0.16988615691661835,
1.1325864791870117,
-1.3849424123764038,
1.5530720949172974,
-0.7974557876586914,
0.1416143923997879,
-2.3683955669403076,
1.3685749769210815,
-0.7805643677711487,
1.9380855560302734,
-2.680298089981079,
0.513901948928833,
-0.5348599553108215,
-0.45770442485809326,
0.19898316264152527,
-0.46084752678871155,
0.16834846138954163,
0.008458670228719711,
-1.1721168756484985,
-0.04887139052152634,
-0.6245776414871216,
0.6370883584022522,
1.1569515466690063,
1.4783093929290771,
-1.161779761314392,
-0.34355753660202026,
-1.7207080125808716,
-0.20580138266086578,
-0.8532252907752991,
0.29915785789489746,
-1.9172428846359253,
-0.15573947131633759,
-1.7187058925628662,
-2.421576499938965,
-1.3860435485839844,
-0.8691339492797852,
1.0677869319915771,
0.11165197193622589,
-1.0565154552459717,
1.2390409708023071,
-0.46418341994285583,
-1.9183003902435303,
1.2397551536560059,
-2.2360026836395264
] |
https://github.com/huggingface/datasets/issues/5014 | I need to read the custom dataset in conll format | Hi! We don't currently have a builder for parsing custom `conll` datasets, but I guess we could add one as a packaged module (similarly to what [TFDS](https://github.com/tensorflow/datasets/blob/master/tensorflow_datasets/core/dataset_builders/conll/conll_dataset_builder.py) did). @lhoestq @albertvillanova WDYT?
In the meantime, you can use `Dataset.from_generator` to create a dataset as follows:
```python
from datasets import Dataset
# 2009 version
INPUT_COLUMNS = "ID FORM LEMMA PLEMMA POS PPOS FEAT PFEAT HEAD PHEAD DEPREL PDEPREL".split()
def read_conll(file):
example = {col: [] for col in INPUT_COLUMNS}
idx = 0
with open(file) as f:
for line in f:
if line.startswith("-DOCSTART-") or line == "\n" or not line:
if example[next(iter(example))]:
yield idx, example
idx += 1
example = {col: [] for col in INPUT_COLUMNS}
else:
row_cols = line.split()
for i, col in enumerate(example):
example[col] = row_cols[i].rstrip()
# (optional) pass custom features with `features=Features(...)`
dset = Dataset.from_generator(read_conll, gen_kwargs={"file": "path/to/conll/file"})
``` | I need to read the custom dataset in conll format
| 511 | 137 | I need to read the custom dataset in conll format
I need to read the custom dataset in conll format
Hi! We don't currently have a builder for parsing custom `conll` datasets, but I guess we could add one as a packaged module (similarly to what [TFDS](https://github.com/tensorflow/datasets/blob/master/tensorflow_datasets/core/dataset_builders/conll/conll_dataset_builder.py) did). @lhoestq @albertvillanova WDYT?
In the meantime, you can use `Dataset.from_generator` to create a dataset as follows:
```python
from datasets import Dataset
# 2009 version
INPUT_COLUMNS = "ID FORM LEMMA PLEMMA POS PPOS FEAT PFEAT HEAD PHEAD DEPREL PDEPREL".split()
def read_conll(file):
example = {col: [] for col in INPUT_COLUMNS}
idx = 0
with open(file) as f:
for line in f:
if line.startswith("-DOCSTART-") or line == "\n" or not line:
if example[next(iter(example))]:
yield idx, example
idx += 1
example = {col: [] for col in INPUT_COLUMNS}
else:
row_cols = line.split()
for i, col in enumerate(example):
example[col] = row_cols[i].rstrip()
# (optional) pass custom features with `features=Features(...)`
dset = Dataset.from_generator(read_conll, gen_kwargs={"file": "path/to/conll/file"})
``` | [
-1.288826823234558,
-0.8851115703582764,
-0.8101705312728882,
1.56167471408844,
-0.13303624093532562,
-1.2193567752838135,
0.12567099928855896,
-1.1416196823120117,
1.6243482828140259,
-0.7559645175933838,
0.3231317400932312,
-1.729400634765625,
0.05985404923558235,
-0.6263439655303955,
-0.7269970774650574,
-0.9396461248397827,
-0.4394037425518036,
-0.7730389833450317,
1.1585956811904907,
2.4825849533081055,
1.26902437210083,
-1.3824889659881592,
2.722904920578003,
0.7437167763710022,
-0.25653430819511414,
-1.0404771566390991,
0.5556309223175049,
0.058830518275499344,
-1.2115918397903442,
-0.5062906742095947,
-0.9846559166908264,
-0.07244852185249329,
-0.5512167811393738,
-0.4850389361381531,
-0.010041186586022377,
0.33429598808288574,
-0.3860664963722229,
-0.38024839758872986,
-0.5480518341064453,
-0.7986940145492554,
0.46978089213371277,
-0.3298928439617157,
0.8954504132270813,
-0.3669925630092621,
1.83311927318573,
-0.5892141461372375,
0.3636418879032135,
0.6862561106681824,
1.310656189918518,
0.16211193799972534,
-0.03665061667561531,
0.39510565996170044,
0.3850487768650055,
-0.13440608978271484,
0.547356903553009,
1.2706631422042847,
0.6053549647331238,
0.49346402287483215,
0.6936231255531311,
-2.1247575283050537,
1.271775245666504,
-1.0528160333633423,
0.30054783821105957,
1.3282629251480103,
-0.9194367527961731,
0.4146623909473419,
-1.6726762056350708,
-0.11996256560087204,
0.6023397445678711,
-2.281527519226074,
0.24372485280036926,
-1.2875559329986572,
-0.5182283520698547,
1.0509612560272217,
0.36187252402305603,
-1.156887173652649,
0.19487053155899048,
-0.44941145181655884,
1.12001633644104,
0.38905638456344604,
1.1623114347457886,
-1.6582415103912354,
0.0620524100959301,
-0.2956773638725281,
0.0760938972234726,
-1.2805577516555786,
-1.4731608629226685,
0.558464765548706,
0.6780173182487488,
0.5536922812461853,
-0.1268441379070282,
1.1078287363052368,
-0.9581184387207031,
0.7970868349075317,
-0.9413509964942932,
-1.5776734352111816,
-1.5202935934066772,
-2.32568359375,
-2.224923610687256,
0.8236525654792786,
-0.5171509981155396,
-0.5806300044059753,
2.0421295166015625,
-0.9671138525009155,
-1.7887712717056274,
1.0860332250595093,
0.3394583761692047,
0.0424845851957798,
2.4071736335754395,
0.21163904666900635,
-0.7514863014221191,
0.5038080215454102,
-0.7324767112731934,
0.7709108591079712,
-0.2633742392063141,
1.4401739835739136,
0.5170657634735107,
-1.0750083923339844,
1.5991318225860596,
-0.4341169595718384,
0.5436043739318848,
-0.6342756152153015,
-0.4888819754123688,
-0.7700597047805786,
0.35883596539497375,
1.9114415645599365,
-0.33024489879608154,
1.593483805656433,
-0.2602863013744354,
-1.5534597635269165,
-1.5771400928497314,
0.8228699564933777,
0.4994741380214691,
-0.779198169708252,
0.17864017188549042,
-0.38951849937438965,
0.11236487329006195,
0.06584381312131882,
1.120609164237976,
1.238874077796936,
0.6543087959289551,
-0.35334834456443787,
-0.8187985420227051,
0.2444056272506714,
-0.03879273682832718,
-0.6961725950241089,
-1.7693856954574585,
-0.37799516320228577,
0.11069950461387634,
0.56199049949646,
-1.2329702377319336,
1.7008235454559326,
0.9273894429206848,
1.829403042793274,
1.018798828125,
-0.27956241369247437,
1.6112817525863647,
-0.017546987161040306,
1.8701257705688477,
-0.4207710027694702,
0.7275162935256958,
-0.23668172955513,
-1.2562435865402222,
0.849250316619873,
-0.32594597339630127,
-2.078411340713501,
-0.8704608082771301,
-0.711780309677124,
-0.12145493924617767,
-0.8621484041213989,
0.8686457872390747,
-0.32430508732795715,
-1.3807599544525146,
0.2633390426635742,
-0.7392723560333252,
0.23152735829353333,
-1.2679311037063599,
0.31825488805770874,
0.6711400747299194,
-0.6783450245857239,
-0.0026988377794623375,
-0.20430026948451996,
-1.21927809715271,
-0.41209322214126587,
0.16519670188426971,
1.9154318571090698,
-0.7297323942184448,
0.90640789270401,
1.1197998523712158,
-0.7057979702949524,
0.019386816769838333,
0.31760159134864807,
-0.3076721727848053,
0.9250676035881042,
-1.09408700466156,
-0.5048190951347351,
1.234351634979248,
-0.15139804780483246,
-0.6776294112205505,
1.4388171434402466,
0.7514928579330444,
-0.9678928256034851,
-0.23653441667556763,
-0.17499399185180664,
-0.8701318502426147,
0.04900752753019333,
-1.5319511890411377,
-0.17438346147537231,
0.3688611686229706,
-1.5053040981292725,
-0.43658366799354553,
-0.16978666186332703,
1.3572171926498413,
-0.28636202216148376,
1.5549503564834595,
-0.4725774824619293,
-0.17044247686862946,
-0.3265659511089325,
-0.3749713897705078,
0.15715204179286957,
-0.17393669486045837,
-0.6994359493255615,
0.1865530014038086,
-0.7736383080482483,
0.31090596318244934,
1.3803781270980835,
0.47493600845336914,
0.07008736580610275,
0.50514817237854,
1.1366395950317383,
0.35918453335762024,
-0.06739724427461624,
-0.8676314353942871,
-1.5279265642166138,
1.9979841709136963,
-1.3324191570281982,
1.9967272281646729,
0.7644180059432983,
-0.010241363197565079,
-1.7757574319839478,
-1.80162513256073,
1.370275616645813,
1.304056167602539,
2.310187578201294,
0.5655733346939087,
0.3537164330482483,
-0.8091626167297363,
-0.7255098223686218,
0.28812143206596375,
-1.0757766962051392,
-0.6771640181541443,
0.19378328323364258,
2.411228895187378,
1.8184128999710083,
-0.4668024480342865,
-0.2352285236120224,
-0.9658022522926331,
1.3210206031799316,
-0.2315315306186676,
0.1299872100353241,
2.0056097507476807,
-0.23113317787647247,
-1.1085619926452637,
1.2417187690734863,
-2.3794853687286377,
0.09085279703140259,
2.0085809230804443,
0.3438948392868042,
0.12272173166275024,
-1.4525471925735474,
-0.5668621063232422,
-0.2656078636646271,
-0.46737611293792725,
-1.2932143211364746,
0.5411259531974792,
-0.2530462443828583,
-0.7656230330467224,
-1.4132007360458374,
0.13920453190803528,
-1.1860558986663818,
-1.7013477087020874,
0.3012474477291107,
1.804745078086853,
2.0405492782592773,
-0.8208025097846985,
1.531639575958252,
-0.30985933542251587,
0.1834113895893097,
1.2305762767791748,
1.3271653652191162,
3.111149549484253,
1.8673734664916992,
-1.332768440246582,
0.6269968152046204,
-0.2103358507156372,
-0.48699307441711426,
1.228183627128601,
-1.2225980758666992,
1.312597393989563,
-0.19400426745414734,
-1.3218976259231567,
-1.2558681964874268,
0.9716053009033203,
0.5257347822189331,
0.007764005102217197,
-0.5452997088432312,
1.186414122581482,
-0.0004211748018860817,
1.3099830150604248,
0.48097771406173706,
-0.31974437832832336,
0.5611507296562195,
-0.3549460172653198,
-0.4767970144748688,
1.545184850692749,
0.05722157284617424,
-1.4243817329406738,
-2.2716894149780273,
-0.22890940308570862,
-0.8215513825416565,
0.01670730486512184,
-0.6646867394447327,
-1.0242295265197754,
1.6515862941741943,
0.34095534682273865,
-1.297231912612915,
-0.2716045081615448,
-0.34660714864730835,
-0.5700435042381287,
2.66080904006958,
-1.3952453136444092,
-0.180129736661911,
-0.9452837109565735,
-0.6262001991271973,
1.6624189615249634,
-1.0716849565505981,
-0.2263818085193634,
-0.9649838209152222,
-0.6052277684211731,
-1.3272305727005005,
-0.5771970748901367,
-0.008845926262438297,
-0.9478139281272888,
0.7694240212440491,
0.13514794409275055,
-1.1508022546768188,
-0.36919277906417847,
-0.809625506401062,
0.939997673034668,
-0.1453407108783722,
0.20063801109790802,
1.9058866500854492,
0.298503041267395,
-0.4133760631084442,
0.717341959476471,
1.172579050064087,
0.5961936712265015,
-0.6170569062232971,
0.2360336035490036,
-0.7260981202125549,
0.27175986766815186,
-1.370205044746399,
0.19285915791988373,
-2.8754360675811768,
0.687667965888977,
-0.042657721787691116,
-0.037392500787973404,
-0.02155754342675209,
-1.2692291736602783,
1.0925096273422241,
2.6712048053741455,
-1.1760849952697754,
0.47526174783706665,
0.3229368031024933,
1.0879172086715698,
-1.60562002658844,
0.2593647241592407,
-0.3458526134490967,
2.1002144813537598,
0.24187955260276794,
1.3280878067016602,
-0.4072760343551636,
-2.265411853790283,
0.6505153775215149,
-1.2651437520980835,
-1.1339913606643677,
0.7958053350448608,
-0.8606047630310059,
0.1450902670621872,
-1.35174560546875,
-0.23449905216693878,
-0.8683388829231262,
-1.1601448059082031,
0.7383724451065063,
0.1711554080247879,
0.4611300230026245,
-0.6168832778930664,
0.35520458221435547,
-2.2079601287841797,
-1.355398416519165,
-0.20492900907993317,
-1.0099225044250488,
0.4647025465965271,
-0.33045148849487305,
0.6110994815826416,
-0.14688095450401306,
0.02292407676577568,
0.3948977589607239,
1.4730651378631592,
3.436840295791626,
0.29887664318084717,
0.27827441692352295,
-0.09248124808073044,
-0.9260413646697998,
1.4615896940231323,
0.7930677533149719,
-0.2137623131275177,
-0.48438963294029236,
-1.037859320640564,
1.2865747213363647,
1.821329951286316,
1.0498864650726318,
0.04779798537492752,
-0.9336004853248596,
-0.7091176509857178,
-0.09389282763004303,
0.15217427909374237,
0.5005221366882324,
0.9012457132339478,
-0.04958876222372055,
0.06337402760982513,
1.3876510858535767,
1.1505682468414307,
-0.48530933260917664,
0.38276126980781555,
-0.870675265789032,
-0.48263663053512573,
0.4644636809825897,
0.20918841660022736,
0.018010642379522324,
0.43847188353538513,
-0.9384450316429138,
-0.30288028717041016,
-0.35987401008605957,
-0.8943330645561218,
-0.7563363313674927,
-0.4397708773612976,
-0.3830541968345642,
1.5546690225601196,
0.07332544028759003,
-0.552394688129425,
-0.04887846112251282,
-0.8271374702453613,
-0.1632978469133377,
-1.0926135778427124,
0.13566401600837708,
-0.02142563834786415,
-0.11541379988193512,
-0.1536351442337036,
1.7156133651733398,
-0.8887329697608948,
-2.0791823863983154,
0.18538373708724976,
0.2498590648174286,
-0.30249619483947754,
0.2565218210220337,
1.7804152965545654,
0.514854907989502,
1.4137612581253052,
1.297190546989441,
0.9552808403968811,
-0.6279391050338745,
-1.3088637590408325,
0.6562922596931458,
0.9683248996734619,
-1.362168312072754,
0.8537553548812866,
-0.07077090442180634,
-0.4259182810783386,
0.6098085641860962,
1.3136783838272095,
0.544113278388977,
-2.036862373352051,
0.8610142469406128,
-0.9492060542106628,
0.8135184049606323,
0.6726764440536499,
0.6620226502418518,
0.18485428392887115,
0.7583854794502258,
-1.2254372835159302,
-1.0983439683914185,
-0.7787701487541199,
-0.6263558268547058,
1.9152512550354004,
-0.2477463185787201,
0.6228441596031189,
-0.2542457580566406,
-1.3040140867233276,
-0.050809621810913086,
0.7763436436653137,
0.2934021055698395,
-0.47011029720306396,
0.8503007292747498,
-0.7048386931419373,
-1.0291571617126465,
-1.3844330310821533,
-0.36413758993148804,
-1.0122407674789429,
-0.8504032492637634,
1.020437240600586,
0.7514467835426331,
0.2417972981929779,
1.832980751991272,
0.6844730973243713,
0.19411475956439972,
-2.5834784507751465,
0.9522736072540283,
0.19905228912830353,
-0.06268518418073654,
0.8380377888679504,
0.2619970738887787,
0.9432953596115112,
0.04151370748877525,
0.5086601376533508,
-2.377438545227051,
2.219341993331909,
-0.15304820239543915,
0.6195169687271118,
0.0017979387193918228,
-0.2198391705751419,
1.073880910873413,
0.5873071551322937,
0.5727620720863342,
-1.0936938524246216,
0.6109987497329712,
-0.5820006728172302,
1.2205458879470825,
0.9617534279823303,
-0.782838761806488,
-0.009653927758336067,
1.4019297361373901,
0.3942924439907074,
-0.4341149926185608,
-0.9270941615104675,
-0.8370198607444763,
1.058100938796997,
1.6761572360992432,
-0.019184570759534836,
0.006472335197031498,
0.8276762962341309,
0.6602246165275574,
-1.3077186346054077,
0.1327158659696579,
-0.7516677379608154,
-0.6980586647987366,
1.6473280191421509,
2.081983804702759,
-0.16558821499347687,
-0.2386818528175354,
-0.6903070211410522,
-1.2753936052322388,
0.8949910402297974,
-0.07533267885446548,
0.12868186831474304,
0.6391819715499878,
-0.6737506985664368,
1.1408435106277466,
0.8954542279243469,
0.8781286478042603,
0.199492946267128,
0.21880453824996948,
0.4137289822101593,
-0.23360468447208405,
-1.1317957639694214,
-0.20181775093078613,
-1.0319701433181763,
-2.6191680431365967,
0.39301320910453796,
-0.2467782348394394,
-1.3165538311004639,
-0.020076792687177658,
-1.0119197368621826,
0.9349563121795654,
-0.5521268844604492,
-1.030996561050415,
-1.5331636667251587,
0.22201740741729736,
-0.10996803641319275,
0.9274471998214722,
-1.5504820346832275,
-0.11629019677639008,
1.2924894094467163,
0.9340797066688538,
-0.7158229351043701,
0.9786726832389832,
0.18548817932605743,
1.0429179668426514,
0.883593738079071,
-0.3692896366119385,
0.6252793669700623,
-0.01517573930323124,
-1.3229238986968994,
0.45295464992523193,
1.1805548667907715,
0.1984817385673523,
1.532125473022461,
-0.5006148219108582,
-0.046919286251068115,
0.3753627836704254,
-0.6440809369087219,
-0.518798828125,
-0.5015907883644104,
0.6537134051322937,
0.049797408282756805,
-0.9698245525360107,
-0.0032484852708876133,
-0.006511104293167591,
-0.30529773235321045,
0.20294803380966187,
-1.478788137435913,
-0.18119095265865326,
-0.32230499386787415,
-0.5673703551292419,
-1.2548370361328125,
-0.02254137396812439,
1.3385299444198608,
-0.8229907155036926,
-0.21304748952388763,
0.46880078315734863,
0.3065015971660614,
0.5498365163803101,
0.5544290542602539,
-0.7093515992164612,
-0.2859042286872864,
-0.2958138585090637,
-0.2395397126674652,
0.30490562319755554,
1.2725406885147095,
-0.11630996316671371,
-0.9497956037521362,
0.7103974223136902,
-0.34661993384361267,
0.0520019605755806,
1.9162472486495972,
0.08835657685995102,
-0.7201077938079834,
0.29800260066986084,
-0.6937277913093567,
1.9114208221435547,
1.7495564222335815,
1.3371556997299194,
-0.16818377375602722,
-0.9414927363395691,
0.6762885451316833,
-0.3960249423980713,
-0.37419211864471436,
0.8388644456863403,
0.36243197321891785,
-0.1686977595090866,
-1.5054270029067993,
0.6398496031761169,
1.337435007095337,
-0.8026878833770752,
-0.7805746793746948,
0.048084158450365067,
-0.853738009929657,
1.0839972496032715,
0.6071001887321472,
0.3109663724899292,
0.3132634460926056,
1.5916444063186646,
0.7597271203994751,
-0.43567726016044617,
0.4427630305290222,
0.5103245973587036,
-0.14245381951332092,
-2.1252312660217285,
-1.128142237663269,
0.3581276535987854,
-0.488090455532074,
-1.574265956878662,
1.348435640335083,
-1.20168936252594,
-0.9736635684967041,
0.6282063126564026,
0.04148402065038681,
1.4105620384216309,
0.23459331691265106,
1.6617059707641602,
2.031647205352783,
0.9209624528884888,
0.31524887681007385,
1.2045894861221313,
-0.10221931338310242,
-0.3860538601875305,
1.7698509693145752,
-0.3771688640117645,
0.46340009570121765,
1.0253950357437134,
-0.2721010446548462,
-1.0897873640060425,
-0.8054840564727783,
-1.273489236831665,
-0.7527478337287903,
1.1581614017486572,
0.13585621118545532,
-1.0696988105773926,
0.204637348651886,
1.596035361289978,
0.12510466575622559,
-0.3661334216594696,
0.6510019302368164,
0.4983883202075958,
-0.7961550354957581,
-0.009092668071389198,
-0.9237339496612549,
0.4765550494194031,
-0.13677531480789185,
-0.36382389068603516,
0.2979176640510559,
0.42047879099845886,
1.3459663391113281,
0.007500271312892437,
0.1171678900718689,
1.1062836647033691,
-1.4609735012054443,
1.5199787616729736,
-0.6941099762916565,
0.29818832874298096,
-2.4466702938079834,
1.3786027431488037,
-0.8406428694725037,
1.9478657245635986,
-2.6414222717285156,
0.5505903363227844,
-0.6020209193229675,
-0.42833465337753296,
0.34640026092529297,
-0.42336124181747437,
0.1901583969593048,
-0.1231488510966301,
-1.10652756690979,
-0.07308337092399597,
-0.6997049450874329,
0.6103258728981018,
1.145033597946167,
1.3515558242797852,
-1.1495389938354492,
-0.31781455874443054,
-1.721676230430603,
-0.15560288727283478,
-0.6370804309844971,
0.2955605387687683,
-1.9527322053909302,
-0.15357887744903564,
-1.9721306562423706,
-2.4032742977142334,
-1.2756989002227783,
-0.7682442665100098,
1.1349108219146729,
0.17254716157913208,
-0.926493763923645,
1.2123751640319824,
-0.47134074568748474,
-1.8358701467514038,
1.167412519454956,
-2.174405813217163
] |
https://github.com/huggingface/datasets/issues/5014 | I need to read the custom dataset in conll format | I think we could add a dedicated builder if you think this format is general enough. | I need to read the custom dataset in conll format
| 511 | 16 | I need to read the custom dataset in conll format
I need to read the custom dataset in conll format
I think we could add a dedicated builder if you think this format is general enough. | [
-1.5477467775344849,
-0.8982294201850891,
-0.7703202366828918,
1.233289361000061,
-0.20359104871749878,
-1.4228105545043945,
0.30787739157676697,
-1.1699934005737305,
1.82343327999115,
-0.8429305553436279,
0.42298582196235657,
-1.8629733324050903,
0.14100612699985504,
-0.3884987533092499,
-0.8367587327957153,
-0.8950615525245667,
-0.5952696204185486,
-0.7000851035118103,
1.238444447517395,
2.3262221813201904,
1.0585665702819824,
-1.597228765487671,
2.9739532470703125,
0.5154888033866882,
-0.05434952676296234,
-1.1853886842727661,
0.571526288986206,
0.07838822901248932,
-1.124973177909851,
-0.7374200820922852,
-1.1444207429885864,
-0.026242267340421677,
-0.49614471197128296,
-0.3209686577320099,
-0.1813686341047287,
0.201809823513031,
-0.12474450469017029,
-0.5985288023948669,
-0.16920185089111328,
-0.7456010580062866,
0.5570569634437561,
-0.45221132040023804,
0.9295569658279419,
-0.3812507390975952,
1.846879243850708,
-0.2707703113555908,
0.44850414991378784,
1.0125706195831299,
1.2579200267791748,
0.006167692597955465,
0.008898891508579254,
0.31499961018562317,
0.6876324415206909,
-0.23458129167556763,
0.4847851097583771,
1.1926398277282715,
0.48856058716773987,
0.5521346926689148,
0.5377649068832397,
-1.8727338314056396,
1.4375488758087158,
-1.1007171869277954,
0.2151593565940857,
1.4435032606124878,
-1.0914419889450073,
0.5551202893257141,
-1.7743360996246338,
-0.10113991796970367,
0.41317859292030334,
-2.139761447906494,
0.4933943748474121,
-1.4411516189575195,
-0.626573920249939,
0.9087320566177368,
0.30900490283966064,
-1.2468171119689941,
0.09218495339155197,
-0.203056201338768,
0.9411720037460327,
0.5694981217384338,
1.5061323642730713,
-1.532639741897583,
0.3637273907661438,
-0.49937281012535095,
0.15886995196342468,
-1.0870082378387451,
-1.3408918380737305,
0.5767619609832764,
0.6186643242835999,
0.5109150409698486,
-0.043610863387584686,
0.998361349105835,
-0.9921154975891113,
0.8964470624923706,
-0.8057157397270203,
-1.3657790422439575,
-1.549634575843811,
-2.383115291595459,
-2.286165952682495,
0.8898620009422302,
-0.6122358441352844,
-0.5845072269439697,
2.056119680404663,
-1.2754602432250977,
-1.74802565574646,
1.1317497491836548,
0.13828614354133606,
0.20471471548080444,
2.4584009647369385,
0.25791797041893005,
-0.6243996620178223,
0.7047219276428223,
-0.7756704092025757,
0.6328385472297668,
-0.46818768978118896,
1.3535277843475342,
0.5811782479286194,
-0.8810418844223022,
1.6184101104736328,
-0.44445157051086426,
0.5953683853149414,
-0.7686089277267456,
-0.6442185044288635,
-0.7799662351608276,
0.2583763599395752,
1.6736838817596436,
-0.15445971488952637,
1.5275764465332031,
-0.4821208715438843,
-1.770890235900879,
-1.7263339757919312,
1.0881367921829224,
0.3784349262714386,
-0.8733267784118652,
0.3162138760089874,
-0.3491637110710144,
0.08199527114629745,
0.10770619660615921,
0.9073607325553894,
1.2577556371688843,
0.67448490858078,
-0.14346222579479218,
-0.7628898620605469,
0.3221110701560974,
0.06424331665039062,
-0.8500893115997314,
-1.7507985830307007,
-0.15192168951034546,
0.010192284360527992,
0.6541900634765625,
-1.1203701496124268,
1.6494576930999756,
1.0118674039840698,
1.6207994222640991,
1.1544804573059082,
-0.12720437347888947,
1.5484431982040405,
-0.005152466706931591,
2.045964002609253,
-0.46583953499794006,
0.7266796827316284,
-0.08875790238380432,
-1.1466748714447021,
0.9152997136116028,
-0.36737892031669617,
-1.9988056421279907,
-1.0153906345367432,
-0.7355412840843201,
-0.3228960633277893,
-0.7812964916229248,
1.1279549598693848,
-0.34540849924087524,
-1.1649746894836426,
0.3724655210971832,
-0.21649840474128723,
0.5070549249649048,
-1.0462340116500854,
0.504479706287384,
0.4565146267414093,
-0.7685783505439758,
0.09046533703804016,
-0.24246148765087128,
-1.4255632162094116,
-0.31729188561439514,
0.2522048056125641,
1.7100417613983154,
-0.7487586736679077,
0.884596049785614,
0.8884627819061279,
-0.5195729732513428,
-0.45472562313079834,
0.36802348494529724,
0.02755581960082054,
0.8628730177879333,
-1.236558198928833,
-0.4372948706150055,
1.094190001487732,
-0.235440194606781,
-0.5348215699195862,
1.3986009359359741,
0.6313912868499756,
-0.9762778878211975,
-0.07455600798130035,
-0.30255457758903503,
-1.114075779914856,
-0.26592910289764404,
-1.4856986999511719,
-0.34579136967658997,
0.17487840354442596,
-1.6586270332336426,
-0.637407660484314,
-0.2102116346359253,
1.134885549545288,
-0.06826262176036835,
1.666929006576538,
-0.38321757316589355,
0.00801141932606697,
-0.4494670629501343,
-0.17607206106185913,
0.4474002420902252,
-0.05981619283556938,
-0.5574268102645874,
-0.01722315326333046,
-0.716620922088623,
0.21265336871147156,
1.3234620094299316,
0.6300166845321655,
0.08680422604084015,
0.4443238079547882,
1.0995371341705322,
0.23977014422416687,
0.004248871933668852,
-0.7078603506088257,
-1.4357496500015259,
2.0103747844696045,
-1.4471065998077393,
1.928175449371338,
0.7411786317825317,
0.027698557823896408,
-1.614487648010254,
-1.770822286605835,
1.4119813442230225,
1.3314708471298218,
2.164447546005249,
0.3636683523654938,
0.2249787151813507,
-0.6907960772514343,
-0.6824465394020081,
0.2572505474090576,
-1.1625025272369385,
-0.7911862730979919,
0.3275805711746216,
2.4206812381744385,
1.5537148714065552,
-0.6010081768035889,
-0.16658878326416016,
-1.014999270439148,
1.2113209962844849,
-0.12169580906629562,
0.20219922065734863,
2.1236939430236816,
-0.5436962246894836,
-1.1348528861999512,
0.9623976349830627,
-2.350175380706787,
-0.08052124083042145,
1.8707162141799927,
0.25200337171554565,
0.10818056017160416,
-1.3024815320968628,
-0.5140307545661926,
-0.060688961297273636,
-0.8677754998207092,
-1.240666151046753,
0.725048840045929,
-0.3123221695423126,
-0.6187117099761963,
-1.2774410247802734,
0.2430809587240219,
-1.1246557235717773,
-1.5949547290802002,
0.435556024312973,
1.838779091835022,
1.9921990633010864,
-0.9297153353691101,
1.4870595932006836,
-0.2843366861343384,
0.1982220858335495,
1.1418588161468506,
0.9997535943984985,
3.178856372833252,
1.9475222826004028,
-1.16073739528656,
0.5664210915565491,
-0.14149776101112366,
-0.642894446849823,
1.022123098373413,
-1.0262575149536133,
1.3165698051452637,
-0.34849104285240173,
-1.4169114828109741,
-1.0723384618759155,
0.896774172782898,
0.3569813668727875,
0.16381950676441193,
-0.43635380268096924,
1.5152997970581055,
-0.05897853150963783,
1.4467551708221436,
0.4227373003959656,
-0.21310485899448395,
0.7918304204940796,
-0.5616025328636169,
-0.3336126506328583,
1.4847221374511719,
0.0033807489089667797,
-1.46536386013031,
-2.2220098972320557,
-0.10280798375606537,
-0.6216657161712646,
-0.0233493410050869,
-0.4748691916465759,
-0.8928614258766174,
1.4016666412353516,
0.3183758556842804,
-1.2723095417022705,
-0.47177618741989136,
-0.4238407015800476,
-0.671524703502655,
2.580662727355957,
-1.4620492458343506,
-0.3671371638774872,
-0.6946160793304443,
-0.7052432894706726,
1.8319963216781616,
-1.1943498849868774,
-0.10560280084609985,
-0.9100492000579834,
-0.5516746044158936,
-1.4588305950164795,
-0.45194873213768005,
-0.0923859179019928,
-0.9537581205368042,
0.874211311340332,
0.2705698609352112,
-1.0436347723007202,
-0.3173391819000244,
-0.8947598338127136,
0.6395623087882996,
-0.19783112406730652,
0.6344327926635742,
1.7177834510803223,
0.33190810680389404,
-0.4893479347229004,
0.5720334649085999,
1.0345147848129272,
0.4410865008831024,
-0.5322794318199158,
0.21553491055965424,
-0.8498107194900513,
0.4947628378868103,
-1.1403400897979736,
0.05464314669370651,
-2.842402696609497,
0.684106707572937,
-0.06373937427997589,
-0.022642511874437332,
-0.14315111935138702,
-1.479251503944397,
0.8994163870811462,
2.2807750701904297,
-1.216133713722229,
0.5129973292350769,
0.4219249188899994,
1.2719287872314453,
-1.3863804340362549,
0.2657434046268463,
-0.5791571736335754,
2.129340648651123,
0.2530789077281952,
1.2199809551239014,
-0.1411101222038269,
-2.340367078781128,
0.5452887415885925,
-1.0864520072937012,
-1.4945330619812012,
0.743322491645813,
-0.9393084049224854,
-0.16614121198654175,
-1.261649489402771,
-0.09663242846727371,
-0.9549185633659363,
-0.92061448097229,
1.1068753004074097,
0.5471124649047852,
0.5402773022651672,
-0.9976240992546082,
0.2633835971355438,
-2.2468132972717285,
-1.141618013381958,
-0.08581668138504028,
-0.6872456073760986,
0.39450737833976746,
-0.2721847593784332,
0.4898061156272888,
-0.03910302370786667,
0.03169136494398117,
0.34955134987831116,
1.3198267221450806,
3.4636549949645996,
0.2831556499004364,
0.4411907494068146,
-0.13996952772140503,
-1.022386908531189,
1.7028915882110596,
0.7036564350128174,
-0.30038943886756897,
-0.615003764629364,
-1.2341200113296509,
1.2161943912506104,
1.6816685199737549,
0.5989212989807129,
0.04515605792403221,
-0.7870000004768372,
-0.30357450246810913,
-0.12577009201049805,
0.0715581476688385,
0.5482735633850098,
1.1012510061264038,
-0.22243671119213104,
-0.1553138941526413,
1.4028257131576538,
1.202942967414856,
-0.620647132396698,
0.600691556930542,
-0.8048073649406433,
-0.647750973701477,
0.38610604405403137,
0.32715946435928345,
0.052578430622816086,
0.27137598395347595,
-0.5911864042282104,
-0.30222654342651367,
-0.2095513939857483,
-1.0907987356185913,
-0.8526425957679749,
-0.2395351231098175,
-0.3681239187717438,
1.5413353443145752,
0.21413715183734894,
-0.7394022345542908,
0.14505815505981445,
-0.7293443083763123,
-0.24441741406917572,
-0.9737133979797363,
0.01696201041340828,
-0.12202904373407364,
-0.0599103607237339,
0.0015943222679197788,
1.552176594734192,
-1.071375846862793,
-2.08878493309021,
0.3301424980163574,
0.2711157500743866,
-0.05058557540178299,
0.1481490582227707,
1.59217369556427,
0.38997986912727356,
1.6223872900009155,
1.3582433462142944,
0.8201025724411011,
-0.6090167164802551,
-1.2995953559875488,
0.6667171120643616,
0.7790828347206116,
-1.357506513595581,
0.7697245478630066,
0.11559702455997467,
-0.7651972770690918,
0.7401995658874512,
0.9580568671226501,
0.40341702103614807,
-2.186382532119751,
0.9337751269340515,
-0.9551972150802612,
0.9307359457015991,
0.48641437292099,
0.9232392311096191,
0.4470227062702179,
1.1427985429763794,
-1.0351992845535278,
-1.132938027381897,
-0.88234943151474,
-0.880909264087677,
2.0381014347076416,
-0.40801969170570374,
0.7767595648765564,
-0.11096836626529694,
-1.1289907693862915,
-0.08255225419998169,
0.7488624453544617,
0.05501927435398102,
-0.352876216173172,
0.4393220841884613,
-0.9104651212692261,
-1.1534781455993652,
-1.6838717460632324,
-0.33639293909072876,
-1.0942286252975464,
-0.6595290899276733,
1.0234631299972534,
0.8549542427062988,
0.12692727148532867,
1.7569818496704102,
0.4842083752155304,
0.0729190856218338,
-2.682140588760376,
0.6766228675842285,
0.2532421052455902,
0.013874752447009087,
0.9280819296836853,
0.36562618613243103,
0.6774221658706665,
0.09678734093904495,
0.4231545031070709,
-2.325561046600342,
2.224087953567505,
-0.5192294120788574,
0.7974581718444824,
-0.15537694096565247,
-0.13230472803115845,
1.066083550453186,
0.4689942002296448,
0.7152945399284363,
-1.2496311664581299,
0.6268350481987,
-0.45197799801826477,
1.3030604124069214,
1.2420586347579956,
-0.6468029022216797,
-0.061831582337617874,
1.3943089246749878,
0.44403785467147827,
-0.44505175948143005,
-1.0010716915130615,
-0.8171539306640625,
0.8580951690673828,
1.8641674518585205,
-0.14219161868095398,
0.08287997543811798,
0.650696873664856,
0.6147012114524841,
-1.3059513568878174,
0.031392186880111694,
-0.9333210587501526,
-0.9033633470535278,
1.5914347171783447,
2.2345104217529297,
-0.2240206003189087,
-0.17429254949092865,
-0.7527402639389038,
-1.333781123161316,
0.9877547025680542,
0.13191546499729156,
0.1651492416858673,
0.6759784817695618,
-0.9085594415664673,
1.167936086654663,
0.7172813415527344,
0.7770258188247681,
0.28656327724456787,
0.24043159186840057,
0.36729419231414795,
0.2331763207912445,
-0.9133111238479614,
-0.1184648796916008,
-1.1846929788589478,
-2.537574529647827,
0.19921483099460602,
-0.40994665026664734,
-1.2867891788482666,
-0.0623709112405777,
-0.895675778388977,
0.8519026041030884,
-0.25760573148727417,
-1.061561107635498,
-1.511139154434204,
0.07070039212703705,
0.10987994074821472,
0.8123749494552612,
-1.6023436784744263,
-0.04697486385703087,
1.3753923177719116,
0.9919836521148682,
-0.8463273048400879,
0.9873003959655762,
0.3807128369808197,
1.0576057434082031,
0.8812766671180725,
-0.5547192096710205,
0.6184203624725342,
-0.1539040207862854,
-1.3907278776168823,
0.6944494247436523,
1.1990958452224731,
0.08206778019666672,
1.6161447763442993,
-0.5957130193710327,
-0.06434523314237595,
0.602999746799469,
-0.5352603197097778,
-0.4776826500892639,
-0.4781297445297241,
0.8172385692596436,
-0.09408900141716003,
-0.9062625765800476,
0.058871231973171234,
-0.16362625360488892,
-0.24302032589912415,
0.21114344894886017,
-1.21970534324646,
-0.3897065818309784,
-0.3480154573917389,
-0.524537205696106,
-1.3580678701400757,
-0.007969134487211704,
1.3899747133255005,
-0.7101342678070068,
-0.2673107385635376,
0.6060253381729126,
0.44074979424476624,
0.3700942099094391,
0.358235239982605,
-0.7582806348800659,
-0.267898827791214,
-0.37603023648262024,
-0.07624512910842896,
0.189955934882164,
1.3575520515441895,
-0.42894721031188965,
-0.9886552691459656,
0.7278034090995789,
-0.20791667699813843,
-0.08653488755226135,
1.862756371498108,
-0.01897570677101612,
-0.6320279836654663,
0.3635745644569397,
-0.9583619832992554,
1.9893112182617188,
1.583228588104248,
1.4690159559249878,
0.04326231777667999,
-1.0508732795715332,
0.5546791553497314,
-0.4681183099746704,
-0.34219348430633545,
0.8028206825256348,
0.39502382278442383,
-0.18515150249004364,
-1.4919404983520508,
0.5714607238769531,
1.0211044549942017,
-0.6976416707038879,
-0.7974903583526611,
-0.30177369713783264,
-0.7407804131507874,
1.2342599630355835,
0.7170576453208923,
0.6668029427528381,
0.12112732976675034,
1.5333915948867798,
0.8034370541572571,
-0.6892050504684448,
0.5709581971168518,
0.6819534301757812,
0.16415521502494812,
-2.3451719284057617,
-1.1311302185058594,
0.29573121666908264,
-0.2523324489593506,
-1.4062434434890747,
1.3412483930587769,
-1.2018096446990967,
-1.2830791473388672,
0.6070000529289246,
-0.1691010296344757,
1.4247522354125977,
0.12882158160209656,
1.5704962015151978,
2.085157632827759,
1.2990052700042725,
0.37181374430656433,
1.596806287765503,
-0.4699641168117523,
-0.23575358092784882,
1.8747336864471436,
-0.23352061212062836,
0.004153988789767027,
0.9290356040000916,
-0.32025760412216187,
-0.8578379154205322,
-0.760206401348114,
-1.105984091758728,
-0.6609019041061401,
1.1146738529205322,
0.031032074242830276,
-0.8730242252349854,
0.18649610877037048,
1.5043929815292358,
0.07562881708145142,
-0.5818332433700562,
0.5295928716659546,
0.7788718938827515,
-0.5515552759170532,
-0.1718074083328247,
-1.0423630475997925,
0.5606576204299927,
-0.37560224533081055,
-0.5342570543289185,
0.4878574311733246,
0.34223440289497375,
1.3405050039291382,
-0.002377317752689123,
0.18277372419834137,
1.3315563201904297,
-1.4615520238876343,
1.3039504289627075,
-0.7351981401443481,
0.03505830094218254,
-2.294248104095459,
1.4814121723175049,
-0.9057315587997437,
2.107699155807495,
-2.832444667816162,
0.588386058807373,
-0.7749590277671814,
-0.49501413106918335,
0.4659411311149597,
-0.2517366111278534,
0.08879658579826355,
-0.21840384602546692,
-0.9433565735816956,
-0.06935273855924606,
-0.672448992729187,
0.700377881526947,
0.9109392762184143,
1.1751185655593872,
-0.8685266375541687,
-0.07280774414539337,
-1.4680871963500977,
-0.07011163979768753,
-0.7585315704345703,
0.25290408730506897,
-2.135505437850952,
0.21366676688194275,
-2.077043294906616,
-2.3605010509490967,
-1.3302198648452759,
-0.7233794927597046,
1.2051665782928467,
0.36330491304397583,
-0.8408393859863281,
1.1321239471435547,
-0.42398491501808167,
-1.7244993448257446,
1.4107766151428223,
-1.929284691810608
] |
https://github.com/huggingface/datasets/issues/5014 | I need to read the custom dataset in conll format |
> I think we could add a dedicated builder if you think this format is general enough.
I think its functions are incomplete. It should have to_ Conll and from_ There are two methods of conll. | I need to read the custom dataset in conll format
| 511 | 36 | I need to read the custom dataset in conll format
I need to read the custom dataset in conll format
> I think we could add a dedicated builder if you think this format is general enough.
I think its functions are incomplete. It should have to_ Conll and from_ There are two methods of conll. | [
-1.4716049432754517,
-0.9372068643569946,
-0.7354738116264343,
1.4566715955734253,
-0.20397613942623138,
-1.4418262243270874,
0.18863987922668457,
-1.1039652824401855,
1.8360157012939453,
-0.8902963399887085,
0.3018270432949066,
-1.710463285446167,
0.08338936418294907,
-0.4527367353439331,
-0.7510058879852295,
-0.9130936861038208,
-0.619615912437439,
-0.7287852764129639,
1.168815016746521,
2.42868971824646,
1.1032427549362183,
-1.6220531463623047,
2.803988218307495,
0.5797404050827026,
-0.11485324800014496,
-1.1242917776107788,
0.5894937515258789,
0.13416127860546112,
-1.1442902088165283,
-0.6513403654098511,
-1.1752275228500366,
-0.025658220052719116,
-0.5866451859474182,
-0.3684754967689514,
-0.2032267153263092,
0.12432429194450378,
-0.2775071859359741,
-0.48169517517089844,
-0.32343462109565735,
-0.710705578327179,
0.5716506242752075,
-0.3226407766342163,
0.953042209148407,
-0.3342258036136627,
1.7885230779647827,
-0.2516118586063385,
0.4745297431945801,
1.0611252784729004,
1.2378429174423218,
-0.0018055140972137451,
0.009377763606607914,
0.250767320394516,
0.6389710903167725,
-0.21450087428092957,
0.4507365822792053,
1.2068722248077393,
0.49226251244544983,
0.48747867345809937,
0.6264552474021912,
-1.9077523946762085,
1.480040431022644,
-1.15547513961792,
0.32968905568122864,
1.3263602256774902,
-1.0852415561676025,
0.5925782322883606,
-1.7716871500015259,
-0.09708013385534286,
0.5989048480987549,
-2.2148916721343994,
0.45244359970092773,
-1.3908671140670776,
-0.5904566049575806,
0.9209346175193787,
0.3531535863876343,
-1.2509230375289917,
0.09290476888418198,
-0.3436475694179535,
0.9250690340995789,
0.6804233193397522,
1.3358100652694702,
-1.6534579992294312,
0.2572996914386749,
-0.3633092939853668,
0.1967073380947113,
-1.116431474685669,
-1.2705252170562744,
0.5765783786773682,
0.5497661828994751,
0.5471615195274353,
-0.11184714734554291,
0.9340338110923767,
-0.9967556595802307,
0.8793697357177734,
-0.794618546962738,
-1.3586246967315674,
-1.4955846071243286,
-2.419593334197998,
-2.337179183959961,
0.8257692456245422,
-0.49983763694763184,
-0.5647045373916626,
1.9887638092041016,
-1.2713711261749268,
-1.693649172782898,
1.1704603433609009,
0.040796443819999695,
0.26566100120544434,
2.409111261367798,
0.24017702043056488,
-0.6140548586845398,
0.6847890019416809,
-0.8081769943237305,
0.7715853452682495,
-0.4522099494934082,
1.3117164373397827,
0.555971086025238,
-0.9445425271987915,
1.6118298768997192,
-0.46590009331703186,
0.5967402458190918,
-0.6969994902610779,
-0.6807248592376709,
-0.7810750007629395,
0.3601061999797821,
1.8335658311843872,
-0.21364828944206238,
1.5333667993545532,
-0.3640972673892975,
-1.7312535047531128,
-1.7878230810165405,
1.0954036712646484,
0.38025906682014465,
-0.8163328170776367,
0.30599984526634216,
-0.44102922081947327,
-0.10244568437337875,
0.2217414826154709,
0.9149279594421387,
1.3968477249145508,
0.7933232188224792,
-0.1766681671142578,
-0.8010892868041992,
0.24090677499771118,
-0.08105473965406418,
-0.8811065554618835,
-1.8302217721939087,
-0.36114487051963806,
-0.07948485761880875,
0.7180431485176086,
-1.052895426750183,
1.6172993183135986,
1.1334753036499023,
1.6974461078643799,
1.0410102605819702,
-0.1283816397190094,
1.5180445909500122,
-0.046915195882320404,
2.025501012802124,
-0.2748216390609741,
0.7269744277000427,
-0.1667022407054901,
-1.1652472019195557,
0.8649882674217224,
-0.42663612961769104,
-2.0401430130004883,
-0.9246537089347839,
-0.8131616115570068,
-0.21486428380012512,
-0.8064557909965515,
0.9634119868278503,
-0.1848340630531311,
-1.2457102537155151,
0.3999794125556946,
-0.35928162932395935,
0.3758973777294159,
-1.1541177034378052,
0.5044925212860107,
0.5151866674423218,
-0.7667120099067688,
0.057274337857961655,
-0.2721613943576813,
-1.4614042043685913,
-0.405398428440094,
0.1838032752275467,
1.7323048114776611,
-0.7537063956260681,
0.8375769853591919,
0.888204038143158,
-0.684613823890686,
-0.2118411809206009,
0.43022385239601135,
-0.08970966190099716,
0.631482720375061,
-1.262206792831421,
-0.3785088360309601,
1.2175265550613403,
-0.23652410507202148,
-0.47298863530158997,
1.5060467720031738,
0.6796904802322388,
-0.9033232927322388,
0.06172321364283562,
-0.29123860597610474,
-0.9902081489562988,
-0.14151506125926971,
-1.4322738647460938,
-0.321014940738678,
0.17745620012283325,
-1.4361952543258667,
-0.6607516407966614,
-0.22764767706394196,
1.2321850061416626,
0.035362355411052704,
1.514003038406372,
-0.4792341887950897,
-0.08566891402006149,
-0.3760680556297302,
-0.37728822231292725,
0.42109423875808716,
-0.07850024849176407,
-0.47896307706832886,
0.06239369139075279,
-0.735432505607605,
0.24601274728775024,
1.4480406045913696,
0.5071702599525452,
0.0031430302187800407,
0.4688742458820343,
1.0459805727005005,
0.21908994019031525,
-0.04692766070365906,
-0.7921904921531677,
-1.4641581773757935,
1.9977257251739502,
-1.4281208515167236,
2.0504543781280518,
0.6395154595375061,
-0.017851606011390686,
-1.7076377868652344,
-1.7845377922058105,
1.2542575597763062,
1.2424218654632568,
2.222691297531128,
0.3989817202091217,
0.19067451357841492,
-0.8931300044059753,
-0.7044156193733215,
0.3723253905773163,
-1.1292617321014404,
-0.8027709126472473,
0.1540450006723404,
2.377786636352539,
1.6827876567840576,
-0.5888616442680359,
-0.09351664781570435,
-1.0188124179840088,
1.3130806684494019,
0.032413989305496216,
0.09342009574174881,
2.023636817932129,
-0.40283212065696716,
-1.2444393634796143,
1.1667866706848145,
-2.2545735836029053,
0.05850086733698845,
1.9782471656799316,
0.3291456401348114,
0.13872365653514862,
-1.4594206809997559,
-0.5491110682487488,
-0.012903973460197449,
-0.7653430104255676,
-1.1824138164520264,
0.7044357061386108,
-0.49952778220176697,
-0.7366710901260376,
-1.3344736099243164,
0.2446502149105072,
-1.0682443380355835,
-1.5773229598999023,
0.4465523362159729,
1.7493736743927002,
2.1053686141967773,
-0.8518370389938354,
1.5913466215133667,
-0.22776736319065094,
0.14116796851158142,
1.136206030845642,
1.0111026763916016,
3.164904832839966,
2.0528018474578857,
-1.2164647579193115,
0.5864300727844238,
-0.2259363979101181,
-0.572071373462677,
0.987741231918335,
-1.098481297492981,
1.4384180307388306,
-0.44453945755958557,
-1.2642802000045776,
-1.1326193809509277,
0.9048601984977722,
0.42580482363700867,
0.1590796858072281,
-0.4233311414718628,
1.3849152326583862,
-0.16385823488235474,
1.3075777292251587,
0.48295778036117554,
-0.2964687943458557,
0.7471634745597839,
-0.6165620684623718,
-0.3951193690299988,
1.5643726587295532,
0.1539425104856491,
-1.5005508661270142,
-2.124906063079834,
-0.2259395271539688,
-0.7253735065460205,
-0.035123880952596664,
-0.5044335722923279,
-0.8867200613021851,
1.496396541595459,
0.31929799914360046,
-1.3075616359710693,
-0.4536409080028534,
-0.39622482657432556,
-0.6998040080070496,
2.5039072036743164,
-1.3435040712356567,
-0.3537982106208801,
-0.6553201675415039,
-0.7183394432067871,
1.692733645439148,
-1.2721126079559326,
-0.11454722285270691,
-0.9533434510231018,
-0.6032623052597046,
-1.3528084754943848,
-0.3977874517440796,
-0.024664878845214844,
-0.997168242931366,
0.7648866176605225,
0.1994706243276596,
-1.037667989730835,
-0.30104148387908936,
-0.8250643014907837,
0.6605643033981323,
-0.011428997851908207,
0.5003331303596497,
1.7828412055969238,
0.15794304013252258,
-0.41283050179481506,
0.6562088131904602,
1.089733600616455,
0.5167885422706604,
-0.662985622882843,
0.10782967507839203,
-0.8483788967132568,
0.4721825122833252,
-1.1307475566864014,
0.1409066915512085,
-2.9190175533294678,
0.726669430732727,
-0.1556260883808136,
-0.09576867520809174,
-0.09483625739812851,
-1.4001649618148804,
1.021153450012207,
2.5125839710235596,
-1.134035587310791,
0.4905790388584137,
0.2749969959259033,
1.2467535734176636,
-1.3877835273742676,
0.25225043296813965,
-0.41647812724113464,
2.247060775756836,
0.3128652572631836,
1.327407956123352,
-0.2304038405418396,
-2.3675127029418945,
0.6998544335365295,
-1.0864970684051514,
-1.399605631828308,
0.6179243326187134,
-0.8446036577224731,
-0.20081429183483124,
-1.2640165090560913,
-0.14256305992603302,
-0.944849967956543,
-1.066279649734497,
0.8932309150695801,
0.5817210674285889,
0.5670777559280396,
-0.7946240901947021,
0.28681111335754395,
-2.3618929386138916,
-1.2441792488098145,
-0.14652323722839355,
-0.9459570646286011,
0.5140438675880432,
-0.2238777130842209,
0.5633587837219238,
-0.16994339227676392,
0.057045456022024155,
0.3660620450973511,
1.397128701210022,
3.4068145751953125,
0.1244754046201706,
0.4750039279460907,
-0.22767537832260132,
-0.8636083602905273,
1.6010065078735352,
0.8149729371070862,
-0.2818969786167145,
-0.6367542147636414,
-1.105696678161621,
1.2573570013046265,
1.8826144933700562,
0.7149488925933838,
-0.022618450224399567,
-0.8586973547935486,
-0.2435988336801529,
-0.12887921929359436,
-0.0017389641143381596,
0.5592740774154663,
1.115290880203247,
-0.18245889246463776,
-0.06842968612909317,
1.3943248987197876,
1.3576616048812866,
-0.5002259016036987,
0.4476120173931122,
-0.664688766002655,
-0.403877854347229,
0.4299842417240143,
0.46215006709098816,
-0.04680803418159485,
0.28106340765953064,
-0.8231755495071411,
-0.21647204458713531,
-0.3054797351360321,
-1.0695300102233887,
-0.8712409734725952,
-0.3683205544948578,
-0.3870738744735718,
1.5984281301498413,
0.22081401944160461,
-0.8004836440086365,
0.11680136620998383,
-0.7603833675384521,
-0.19050584733486176,
-1.0228744745254517,
0.0003414079546928406,
-0.15863002836704254,
-0.015471700578927994,
-0.09887530654668808,
1.7223050594329834,
-1.0542224645614624,
-2.0665996074676514,
0.31262579560279846,
0.1413550078868866,
-0.06902401894330978,
0.27710509300231934,
1.5181736946105957,
0.4890921115875244,
1.623944878578186,
1.3220374584197998,
0.9240190386772156,
-0.623389482498169,
-1.193742036819458,
0.6528676152229309,
0.8302996158599854,
-1.44337797164917,
0.6506742238998413,
0.041877441108226776,
-0.680669903755188,
0.8168068528175354,
0.9911258220672607,
0.44259363412857056,
-2.082167625427246,
0.9101756811141968,
-0.9623605012893677,
0.8711437582969666,
0.47323310375213623,
0.7725884318351746,
0.4134967029094696,
0.9915813207626343,
-0.9841518998146057,
-1.0582250356674194,
-0.8056105971336365,
-0.9263187646865845,
2.0705389976501465,
-0.34726133942604065,
0.7548942565917969,
-0.19050423800945282,
-1.065699815750122,
-0.0038170181214809418,
0.7510784268379211,
0.19318418204784393,
-0.2776176631450653,
0.45930469036102295,
-0.8006714582443237,
-1.2075564861297607,
-1.5811711549758911,
-0.38618847727775574,
-1.1387237310409546,
-0.7120488286018372,
1.0597994327545166,
0.7244946360588074,
0.17886857688426971,
1.8469116687774658,
0.4991944134235382,
0.22582228481769562,
-2.753692388534546,
0.766227662563324,
0.2025792896747589,
0.09270120412111282,
0.9453912973403931,
0.4007057845592499,
0.7857413291931152,
0.047553058713674545,
0.45437246561050415,
-2.291923761367798,
2.2396020889282227,
-0.4315173327922821,
0.7564935684204102,
-0.07143578678369522,
-0.11253020912408829,
1.0505932569503784,
0.5963155627250671,
0.6512789726257324,
-1.248490810394287,
0.6269314289093018,
-0.48510196805000305,
1.317314624786377,
1.097460389137268,
-0.6598801016807556,
-0.0642680823802948,
1.4095557928085327,
0.3330615162849426,
-0.4266560971736908,
-0.9160619974136353,
-0.9525410532951355,
0.8298975825309753,
1.7278530597686768,
-0.1834545135498047,
0.08880752325057983,
0.5950726270675659,
0.5803995728492737,
-1.357601284980774,
-0.10335545241832733,
-0.9344891309738159,
-0.8711794018745422,
1.48859703540802,
2.1556122303009033,
-0.06906577199697495,
-0.07178144156932831,
-0.8613319396972656,
-1.369677186012268,
0.9620435833930969,
0.16989220678806305,
0.2149001508951187,
0.5202451944351196,
-0.7075436115264893,
1.152336835861206,
0.7135812044143677,
0.7768322229385376,
0.3177192509174347,
0.2832256257534027,
0.5398002862930298,
0.030130453407764435,
-0.8916156888008118,
-0.20796656608581543,
-1.1692767143249512,
-2.5866141319274902,
0.36509543657302856,
-0.39552515745162964,
-1.4264814853668213,
-0.10946526378393173,
-0.8419275283813477,
0.807288646697998,
-0.28585106134414673,
-1.035151481628418,
-1.4662864208221436,
0.0032071880996227264,
-0.017566826194524765,
0.8822972178459167,
-1.641650676727295,
-0.08370978385210037,
1.337893009185791,
1.03183114528656,
-0.7588510513305664,
1.1483278274536133,
0.2892925441265106,
0.9167990684509277,
0.8342423439025879,
-0.6137276887893677,
0.5186172127723694,
-0.02638372778892517,
-1.385793685913086,
0.5620230436325073,
1.2309075593948364,
0.1810690313577652,
1.5300147533416748,
-0.6574870944023132,
-0.13025423884391785,
0.50248783826828,
-0.6312070488929749,
-0.5345173478126526,
-0.4214591681957245,
0.8525250554084778,
-0.0911816954612732,
-0.859900176525116,
-0.003070428501814604,
-0.1917731910943985,
-0.23974637687206268,
0.1280837506055832,
-1.273110270500183,
-0.3011098802089691,
-0.40807396173477173,
-0.3582726716995239,
-1.240852952003479,
0.02537393569946289,
1.40060293674469,
-0.7632176876068115,
-0.14765878021717072,
0.46569061279296875,
0.5708029270172119,
0.42564505338668823,
0.4940071403980255,
-0.6939100027084351,
-0.2550264000892639,
-0.40207338333129883,
-0.13545002043247223,
0.2929822504520416,
1.3899545669555664,
-0.3567350208759308,
-1.0510371923446655,
0.7445789575576782,
-0.26650577783584595,
-0.02265094965696335,
1.9362363815307617,
0.16092737019062042,
-0.6023266911506653,
0.4520185589790344,
-0.9124196171760559,
2.0085206031799316,
1.581093192100525,
1.4074114561080933,
-0.04763924330472946,
-0.9453181028366089,
0.6461061835289001,
-0.3786284923553467,
-0.17141033709049225,
0.7651562690734863,
0.388536274433136,
-0.21639396250247955,
-1.5610090494155884,
0.5351855158805847,
1.086452841758728,
-0.749117374420166,
-0.7256762981414795,
-0.3965078890323639,
-0.6614516377449036,
1.1043604612350464,
0.6893408894538879,
0.6948694586753845,
0.14647994935512543,
1.6520572900772095,
0.7561225891113281,
-0.6139956712722778,
0.6346248388290405,
0.6305369138717651,
0.06323399394750595,
-2.2643990516662598,
-1.1514663696289062,
0.34517648816108704,
-0.4304187595844269,
-1.4230499267578125,
1.26292085647583,
-1.1714833974838257,
-1.1817967891693115,
0.5458519458770752,
-0.012993146665394306,
1.4492552280426025,
0.22087430953979492,
1.6371674537658691,
2.010040044784546,
1.220117211341858,
0.3755565285682678,
1.385284423828125,
-0.4170358180999756,
-0.40403133630752563,
1.8637698888778687,
-0.3888565003871918,
0.1668749749660492,
1.1125946044921875,
-0.3443031907081604,
-0.9075967073440552,
-0.7731572389602661,
-1.0678293704986572,
-0.6607617139816284,
1.1025519371032715,
-0.0022546369582414627,
-0.9112381935119629,
0.07413645833730698,
1.6194007396697998,
0.10433278977870941,
-0.5001479387283325,
0.4885636568069458,
0.586650550365448,
-0.6030281186103821,
-0.049613066017627716,
-1.055076241493225,
0.5199601054191589,
-0.39726316928863525,
-0.5894037485122681,
0.4589354395866394,
0.3694986402988434,
1.2251338958740234,
-0.1331646740436554,
0.1891912817955017,
1.2189918756484985,
-1.4777237176895142,
1.3593322038650513,
-0.7910188436508179,
0.08623892813920975,
-2.1936235427856445,
1.4331644773483276,
-0.8929965496063232,
2.0692570209503174,
-2.8571243286132812,
0.48229753971099854,
-0.6185166239738464,
-0.5656250715255737,
0.46437785029411316,
-0.19186729192733765,
0.12130610644817352,
-0.2444484829902649,
-0.8706717491149902,
0.005884319543838501,
-0.6188586354255676,
0.6242045164108276,
0.9746798276901245,
1.1782788038253784,
-0.9704828858375549,
-0.15386390686035156,
-1.510313630104065,
-0.23375535011291504,
-0.728456974029541,
0.355266809463501,
-2.082876443862915,
0.028738707304000854,
-2.0248851776123047,
-2.431443214416504,
-1.3809343576431274,
-0.8112974762916565,
1.2796448469161987,
0.3166426420211792,
-0.8495196104049683,
1.1887763738632202,
-0.3119201064109802,
-1.6996601819992065,
1.3094003200531006,
-1.9740527868270874
] |
https://github.com/huggingface/datasets/issues/5013 | would huggingface like publish cpp binding for datasets package ? | Hi ! Can you share more information about your use case ? How could it help you to have cpp bindings versus using the python libraries ? | HI:
I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it.
thanks | 512 | 27 | would huggingface like publish cpp binding for datasets package ?
HI:
I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it.
thanks
Hi ! Can you share more information about your use case ? How could it help you to have cpp bindings versus using the python libraries ? | [
-1.1956117153167725,
-1.0558528900146484,
-0.8468963503837585,
1.4266806840896606,
-0.25841110944747925,
-1.2395105361938477,
-0.05450672656297684,
-1.0081895589828491,
1.5889410972595215,
-0.8541719913482666,
0.413929283618927,
-1.6831215620040894,
0.034095872193574905,
-0.42651063203811646,
-0.7256264090538025,
-0.9836132526397705,
-0.4757784903049469,
-0.6845421195030212,
1.0587137937545776,
2.643516778945923,
0.9670785069465637,
-1.4256227016448975,
2.618509531021118,
0.672242283821106,
-0.22283856570720673,
-1.080843210220337,
0.546638548374176,
-0.03736215829849243,
-1.1636261940002441,
-0.392647385597229,
-1.230800747871399,
-0.04041404277086258,
-0.8475475907325745,
-0.5318729877471924,
-0.10712704807519913,
0.2961843013763428,
-0.01944226585328579,
-0.41616109013557434,
-0.3410894572734833,
-0.5724918842315674,
0.5338637828826904,
-0.4181314706802368,
1.0611029863357544,
-0.47529324889183044,
1.749372959136963,
-0.4518059492111206,
0.5095675587654114,
0.8912543654441833,
1.297218680381775,
0.2999943792819977,
-0.14517229795455933,
0.1648685187101364,
0.5925236940383911,
-0.3232975900173187,
0.3944087028503418,
0.9763108491897583,
0.38997209072113037,
0.6360920071601868,
0.581147313117981,
-2.1140353679656982,
1.3567743301391602,
-1.2052682638168335,
0.30053821206092834,
1.3368767499923706,
-1.091291069984436,
0.38649821281433105,
-1.7017924785614014,
-0.11500999331474304,
0.568484902381897,
-2.0277721881866455,
0.2625325322151184,
-1.1564830541610718,
-0.6164693832397461,
0.965693473815918,
0.33589261770248413,
-1.5129235982894897,
0.08921726793050766,
-0.23187731206417084,
0.9804631471633911,
0.49258896708488464,
1.2376006841659546,
-1.657930850982666,
0.27043187618255615,
-0.5173482298851013,
0.07415519654750824,
-1.1124768257141113,
-1.4036002159118652,
0.625899612903595,
0.5106567144393921,
0.4480021893978119,
0.029972176998853683,
1.0523018836975098,
-0.9449528455734253,
1.046102523803711,
-0.8307594060897827,
-1.4773633480072021,
-1.3586370944976807,
-2.423600196838379,
-2.3265740871429443,
0.7629502415657043,
-0.5451856851577759,
-0.3923019766807556,
1.9375684261322021,
-1.3938273191452026,
-1.8572643995285034,
1.294089913368225,
0.22074611485004425,
-0.09761658310890198,
2.3206684589385986,
0.3100399672985077,
-0.4482280910015106,
0.36186039447784424,
-0.8928347229957581,
0.8776487112045288,
-0.518421471118927,
1.4557198286056519,
0.6012630462646484,
-0.98677659034729,
1.5562058687210083,
-0.6479130983352661,
0.5842588543891907,
-0.3996085822582245,
-0.6823021769523621,
-0.9178489446640015,
0.3855140209197998,
1.835790753364563,
-0.3454458713531494,
1.571885585784912,
-0.5407119989395142,
-1.6305660009384155,
-1.5886471271514893,
0.9423604011535645,
0.4275318682193756,
-0.867017924785614,
0.17682042717933655,
-0.06242118403315544,
-0.07379043102264404,
0.08954887092113495,
1.1232393980026245,
1.121740460395813,
0.7608270645141602,
-0.2891305387020111,
-1.0329769849777222,
0.1072835922241211,
0.09231690317392349,
-0.7740930318832397,
-1.7588696479797363,
-0.3480337858200073,
-0.15576402842998505,
0.8117862343788147,
-1.129461407661438,
1.8388967514038086,
1.1502958536148071,
1.8050076961517334,
0.9614118933677673,
-0.37787169218063354,
1.4126942157745361,
0.022239670157432556,
1.83877694606781,
-0.45176127552986145,
0.6968686580657959,
-0.3087092339992523,
-1.1348286867141724,
0.7398527264595032,
-0.22465430200099945,
-1.873160481452942,
-0.7133299112319946,
-0.8903988599777222,
-0.21560920774936676,
-0.8339024782180786,
1.030549168586731,
-0.1667715311050415,
-1.5776692628860474,
0.4592495262622833,
-0.6944360733032227,
0.08528400212526321,
-1.1978299617767334,
0.4961078464984894,
0.5747007131576538,
-0.7457128763198853,
-0.057724565267562866,
-0.2458459436893463,
-1.295731544494629,
-0.44810110330581665,
0.009455055929720402,
1.8570516109466553,
-0.8169313669204712,
1.0639160871505737,
0.9311293363571167,
-0.6317142844200134,
-0.09462151676416397,
0.405567467212677,
-0.16149228811264038,
0.7959646582603455,
-1.2157472372055054,
-0.49114805459976196,
1.1981933116912842,
0.00953910406678915,
-0.42319902777671814,
1.4283922910690308,
0.552634596824646,
-1.0660606622695923,
-0.1317194700241089,
-0.32791441679000854,
-0.6085283756256104,
-0.18821501731872559,
-1.5553686618804932,
-0.07028603553771973,
0.144052654504776,
-1.3261511325836182,
-0.5817257761955261,
-0.22965459525585175,
1.1795673370361328,
0.09361600130796432,
1.3660086393356323,
-0.2638426125049591,
-0.11322781443595886,
-0.5606732368469238,
-0.4541759788990021,
0.5930483341217041,
-0.1412876695394516,
-0.4524192214012146,
0.3485375940799713,
-0.7546415328979492,
0.23465904593467712,
1.5802905559539795,
0.23331592977046967,
0.13936902582645416,
0.4232519567012787,
0.8430246114730835,
0.22510558366775513,
0.2711665630340576,
-0.9533658027648926,
-1.3628345727920532,
2.144834518432617,
-1.569271206855774,
2.022531509399414,
0.7909209132194519,
-0.17977726459503174,
-1.8909053802490234,
-1.7967963218688965,
1.2869678735733032,
1.1624375581741333,
2.2098875045776367,
0.6194261312484741,
0.20647422969341278,
-0.8036054372787476,
-0.5609422326087952,
0.48982173204421997,
-1.0486187934875488,
-0.7721830010414124,
-0.027846459299325943,
2.3639886379241943,
1.5667579174041748,
-0.5745095014572144,
-0.14499542117118835,
-0.8673040270805359,
1.299564003944397,
-0.11431864649057388,
0.36639338731765747,
1.9020525217056274,
-0.5521268844604492,
-1.311379313468933,
1.1954748630523682,
-2.357914447784424,
0.1297948658466339,
2.074638605117798,
0.4983547627925873,
0.20904093980789185,
-1.5420506000518799,
-0.7455665469169617,
-0.10390244424343109,
-0.6035727858543396,
-1.3668683767318726,
0.6789994239807129,
-0.3463030159473419,
-0.8735744953155518,
-1.545767068862915,
0.14729981124401093,
-1.1157156229019165,
-1.7567845582962036,
0.44440311193466187,
1.7161669731140137,
2.1559619903564453,
-0.8415656089782715,
1.5290066003799438,
-0.1790429949760437,
0.26918140053749084,
1.1858824491500854,
1.1051286458969116,
3.0500593185424805,
2.025214433670044,
-1.1482678651809692,
0.6308958530426025,
-0.08311933279037476,
-0.5408303737640381,
1.2957607507705688,
-1.0318806171417236,
1.4080878496170044,
-0.3564870059490204,
-0.9829623699188232,
-1.1572279930114746,
0.7731482982635498,
0.19602470099925995,
-0.04043259099125862,
-0.3960430324077606,
1.280332326889038,
0.15271304547786713,
1.2193872928619385,
0.508815348148346,
-0.39907094836235046,
0.5065956115722656,
-0.45254096388816833,
-0.27087482810020447,
1.5526899099349976,
0.2578202784061432,
-1.430670976638794,
-2.3339929580688477,
-0.04123523831367493,
-0.8418432474136353,
0.10102251917123795,
-0.5980660319328308,
-0.9854053258895874,
1.6111280918121338,
0.5135194063186646,
-1.264487385749817,
-0.31861796975135803,
-0.500331461429596,
-0.5143511295318604,
2.34454607963562,
-1.5175833702087402,
-0.11465808749198914,
-0.8525373935699463,
-0.5136077404022217,
1.5303430557250977,
-1.240647315979004,
0.020629413425922394,
-1.164275884628296,
-0.6676760315895081,
-1.56338632106781,
-0.5297786593437195,
0.0801052376627922,
-0.8183042407035828,
0.7909420132637024,
0.23137129843235016,
-1.0829477310180664,
-0.2689121961593628,
-0.886553168296814,
0.6371109485626221,
-0.030159950256347656,
0.5917757153511047,
1.853065848350525,
0.3195352852344513,
-0.5576213002204895,
0.46062514185905457,
1.114336609840393,
0.7050931453704834,
-0.614621102809906,
0.23720020055770874,
-0.7604578733444214,
0.4331137537956238,
-1.2057979106903076,
0.2337789535522461,
-3.0526044368743896,
0.7246288061141968,
-0.0172412246465683,
-0.3100292980670929,
-0.10620483756065369,
-1.3834574222564697,
1.1176228523254395,
2.443890333175659,
-1.026565432548523,
0.6304391026496887,
0.21419574320316315,
1.1876320838928223,
-1.394594669342041,
0.3377208411693573,
-0.4701431393623352,
2.2268319129943848,
0.24295994639396667,
1.1681965589523315,
-0.38579487800598145,
-2.142094135284424,
0.6792957782745361,
-1.2820051908493042,
-1.1373907327651978,
0.7742398381233215,
-0.7865423560142517,
-0.08353343605995178,
-1.367537260055542,
-0.07541299611330032,
-1.0090364217758179,
-1.2822983264923096,
1.0838264226913452,
0.4631946384906769,
0.694584846496582,
-0.6637777090072632,
0.2887386679649353,
-2.120681047439575,
-1.4124664068222046,
-0.2343132346868515,
-0.9393103718757629,
0.44743266701698303,
-0.34522512555122375,
0.7088675498962402,
-0.09585504233837128,
0.0055076610296964645,
0.48529717326164246,
1.1345552206039429,
3.5016894340515137,
0.17450131475925446,
0.4734118580818176,
-0.1375257521867752,
-1.0231767892837524,
1.4983181953430176,
1.1215424537658691,
-0.05809299275279045,
-0.8701992630958557,
-1.1364539861679077,
1.220234751701355,
1.8353121280670166,
0.9355415105819702,
0.11851514130830765,
-0.7338252663612366,
-0.4794747531414032,
-0.13401949405670166,
0.2697274386882782,
0.3689558804035187,
1.0564451217651367,
-0.07459291815757751,
0.12664124369621277,
1.5806262493133545,
1.1477328538894653,
-0.4538845419883728,
0.2324601709842682,
-0.8967755436897278,
-0.38452380895614624,
0.6281931400299072,
0.42952415347099304,
0.2159709334373474,
0.35195934772491455,
-0.8929590582847595,
-0.49396178126335144,
-0.05879135802388191,
-1.077349066734314,
-0.7104126214981079,
-0.37424179911613464,
-0.5156458616256714,
1.5834664106369019,
0.04623698443174362,
-0.6322340965270996,
-0.15482565760612488,
-0.8881756067276001,
0.026502538472414017,
-1.086425542831421,
-0.01727864146232605,
-0.10022354125976562,
-0.06691540032625198,
-0.12159782648086548,
1.8834635019302368,
-0.8862747550010681,
-2.129075288772583,
0.3172365725040436,
0.2596341371536255,
-0.32769522070884705,
0.21064011752605438,
1.605966567993164,
0.464853972196579,
1.2250866889953613,
1.1529244184494019,
1.069937825202942,
-0.6046057939529419,
-1.1684952974319458,
0.7455493211746216,
0.9433679580688477,
-1.6178982257843018,
0.7581498622894287,
0.20069390535354614,
-0.5076617002487183,
0.8360943794250488,
0.9480193853378296,
0.4127558767795563,
-1.7747541666030884,
0.8154457807540894,
-0.821831226348877,
0.9983005523681641,
0.5194600224494934,
0.8541364073753357,
0.05399085581302643,
0.9302099943161011,
-1.2825384140014648,
-1.0386358499526978,
-0.7730758190155029,
-0.5545535087585449,
1.9735817909240723,
-0.33440184593200684,
0.5161160230636597,
-0.3846827745437622,
-1.0465302467346191,
-0.37073376774787903,
0.7546263933181763,
0.3063344955444336,
-0.3625755310058594,
0.622543215751648,
-0.5763871073722839,
-1.0983706712722778,
-1.4654169082641602,
-0.4087161421775818,
-0.8576580286026001,
-0.8240869045257568,
1.1474251747131348,
0.7619950771331787,
0.4459696412086487,
2.0914721488952637,
0.3755653202533722,
0.20018641650676727,
-2.5465683937072754,
0.8374647498130798,
0.27648165822029114,
-0.0026576006785035133,
1.0568883419036865,
0.3166162967681885,
1.2083370685577393,
-0.16713666915893555,
0.5676883459091187,
-2.358989953994751,
2.3064932823181152,
-0.2629989683628082,
0.765500009059906,
0.13834695518016815,
-0.0684199333190918,
1.061145305633545,
0.6865177750587463,
0.6120094656944275,
-1.116973876953125,
0.5193923115730286,
-0.6010950207710266,
1.427531123161316,
1.1271998882293701,
-0.7518661618232727,
-0.020785469561815262,
1.3093657493591309,
0.4814439117908478,
-0.44920745491981506,
-0.8324798941612244,
-0.8566768765449524,
0.8937631845474243,
1.8125163316726685,
-0.20498861372470856,
0.01800435781478882,
0.6249207258224487,
0.7399055361747742,
-1.1936936378479004,
0.06362905353307724,
-0.8403306007385254,
-0.8981081247329712,
1.5827170610427856,
1.9933863878250122,
-0.1410318911075592,
-0.10832265764474869,
-0.6261464953422546,
-1.198655128479004,
0.9774298071861267,
0.012750924564898014,
0.21833127737045288,
0.679170548915863,
-0.7619337439537048,
1.3124510049819946,
0.7094079256057739,
0.7134730219841003,
0.16962768137454987,
0.288506418466568,
0.4787478744983673,
-0.06280744820833206,
-0.9916214346885681,
-0.21206477284431458,
-1.2105295658111572,
-2.6408817768096924,
0.3382822573184967,
-0.17867451906204224,
-1.4242205619812012,
-0.21820805966854095,
-1.016087532043457,
0.7935577630996704,
-0.4964136779308319,
-1.0285251140594482,
-1.5553869009017944,
0.12004423886537552,
-0.013533449731767178,
0.9526882767677307,
-1.8416402339935303,
-0.03451954200863838,
1.1766082048416138,
1.0554893016815186,
-0.5989609956741333,
1.0104284286499023,
0.347777396440506,
0.9501505494117737,
0.9084615707397461,
-0.366965115070343,
0.6376410722732544,
0.13781343400478363,
-1.2614030838012695,
0.4558769166469574,
1.3330634832382202,
0.058904632925987244,
1.4368571043014526,
-0.3528796136379242,
0.024515531957149506,
0.3829256594181061,
-0.645522952079773,
-0.6293346285820007,
-0.45242810249328613,
0.6895983219146729,
-0.023858122527599335,
-0.7760726809501648,
0.022702578455209732,
-0.14499105513095856,
-0.12119419872760773,
0.11710260063409805,
-1.3076053857803345,
-0.34292080998420715,
-0.2522854208946228,
-0.5134910941123962,
-1.500382661819458,
-0.46716082096099854,
1.442792534828186,
-0.5243061184883118,
-0.1175348162651062,
0.6598339676856995,
0.5979836583137512,
0.3969177007675171,
0.3699510395526886,
-0.40899673104286194,
-0.5105776190757751,
-0.33510807156562805,
-0.3612312078475952,
0.26465311646461487,
1.3449864387512207,
-0.198037788271904,
-0.9687525033950806,
0.6391273736953735,
-0.49323955178260803,
0.008492882363498211,
1.8111090660095215,
0.014425533823668957,
-0.9406520128250122,
0.36882132291793823,
-0.5973160862922668,
2.0364925861358643,
1.6028050184249878,
1.2311975955963135,
-0.04500404745340347,
-0.8294847011566162,
0.8361513614654541,
-0.3730813264846802,
-0.4393421411514282,
0.8831754922866821,
0.2512657940387726,
-0.26293936371803284,
-1.3335187435150146,
0.48921602964401245,
1.3013243675231934,
-0.827495813369751,
-0.7514711022377014,
-0.059753306210041046,
-0.792439877986908,
0.9064379334449768,
0.7775068879127502,
0.7124632596969604,
0.25516176223754883,
1.7316601276397705,
0.8124066591262817,
-0.6101324558258057,
0.6808871626853943,
0.43005022406578064,
0.0593375489115715,
-2.2078967094421387,
-1.1596176624298096,
0.4510349631309509,
-0.5405173301696777,
-1.5950133800506592,
1.328293800354004,
-1.1029202938079834,
-1.0717846155166626,
0.7517386078834534,
-0.06479758024215698,
1.4102894067764282,
0.45091718435287476,
1.5919800996780396,
2.098752021789551,
0.7967935800552368,
0.3919387459754944,
1.4623756408691406,
-0.2764762043952942,
-0.25475767254829407,
2.029129981994629,
-0.3632868826389313,
0.5270949602127075,
1.1965659856796265,
-0.22543591260910034,
-0.9680413603782654,
-0.792266309261322,
-1.3333362340927124,
-0.8922498822212219,
1.0521446466445923,
-0.0036257999017834663,
-1.1956571340560913,
0.22207148373126984,
1.5862241983413696,
-0.037994030863046646,
-0.19787658751010895,
0.5786431431770325,
0.31019389629364014,
-0.7777534127235413,
0.03454253450036049,
-1.1654727458953857,
0.4261906147003174,
-0.3358668088912964,
-0.5258025527000427,
0.3824029266834259,
0.4610530436038971,
1.2430174350738525,
-0.2352907359600067,
0.2632109522819519,
1.335521936416626,
-1.5821508169174194,
1.5508090257644653,
-0.6350117325782776,
0.10149265825748444,
-2.381413459777832,
1.4157090187072754,
-0.6739210486412048,
1.8135089874267578,
-2.754763603210449,
0.3186247944831848,
-0.4728787839412689,
-0.6251206994056702,
0.3331301510334015,
-0.1977338194847107,
0.27624088525772095,
-0.322264701128006,
-1.0046298503875732,
0.04925847798585892,
-0.4934740960597992,
0.4143146574497223,
0.9247450828552246,
1.0922563076019287,
-1.2169748544692993,
-0.30326783657073975,
-1.6365622282028198,
0.006634131073951721,
-0.5531659126281738,
0.27590587735176086,
-2.355133295059204,
-0.19249360263347626,
-1.6671119928359985,
-2.1472227573394775,
-1.1704241037368774,
-0.8351261615753174,
1.2472044229507446,
0.14552168548107147,
-0.9786920547485352,
0.9095895886421204,
-0.19805477559566498,
-1.8920494318008423,
0.7695959210395813,
-2.165992021560669
] |
https://github.com/huggingface/datasets/issues/5013 | would huggingface like publish cpp binding for datasets package ? | > Hi ! Can you share more information about your use case ? How could it help you to have cpp bindings versus using the python libraries ?
for example ,the huggingface load_model() and load_dataset() can execute in cpp env | HI:
I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it.
thanks | 512 | 40 | would huggingface like publish cpp binding for datasets package ?
HI:
I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it.
thanks
> Hi ! Can you share more information about your use case ? How could it help you to have cpp bindings versus using the python libraries ?
for example ,the huggingface load_model() and load_dataset() can execute in cpp env | [
-1.2628298997879028,
-0.992477536201477,
-0.8191248774528503,
1.4229978322982788,
-0.25545990467071533,
-1.228739857673645,
-0.01833684742450714,
-1.0722885131835938,
1.5810531377792358,
-0.9167892932891846,
0.43643590807914734,
-1.6209015846252441,
0.0685027688741684,
-0.3827572762966156,
-0.7063183188438416,
-1.0467740297317505,
-0.47138887643814087,
-0.7502491474151611,
1.0364888906478882,
2.5945892333984375,
1.0688941478729248,
-1.4310704469680786,
2.69533109664917,
0.7110775113105774,
-0.2675575911998749,
-1.0804840326309204,
0.5207666158676147,
-0.044723570346832275,
-1.1778059005737305,
-0.41300126910209656,
-1.187206506729126,
-0.03750557452440262,
-0.7983779907226562,
-0.487333744764328,
-0.07156137377023697,
0.3543356657028198,
-0.0458005890250206,
-0.36081555485725403,
-0.37953677773475647,
-0.6181126236915588,
0.5427871346473694,
-0.3935772776603699,
0.9803714156150818,
-0.45497891306877136,
1.7470054626464844,
-0.4606301188468933,
0.44682109355926514,
0.8097109198570251,
1.3515055179595947,
0.22537170350551605,
-0.2074555903673172,
0.17198212444782257,
0.49623119831085205,
-0.2635626792907715,
0.3767474591732025,
1.0209307670593262,
0.36622074246406555,
0.6451398730278015,
0.5562084913253784,
-2.128349542617798,
1.3789409399032593,
-1.2326849699020386,
0.3457745909690857,
1.2871179580688477,
-1.084787368774414,
0.3615831136703491,
-1.6484777927398682,
-0.15832480788230896,
0.5361354351043701,
-2.094376564025879,
0.19140946865081787,
-1.1545453071594238,
-0.6045834422111511,
0.8997452259063721,
0.30553555488586426,
-1.4792579412460327,
0.1058579534292221,
-0.2469666749238968,
1.0532550811767578,
0.4496455490589142,
1.189550757408142,
-1.6644306182861328,
0.32632267475128174,
-0.45152926445007324,
0.03516707569360733,
-1.1711726188659668,
-1.4762425422668457,
0.5938038229942322,
0.5642621517181396,
0.49728429317474365,
0.06119546294212341,
1.0421465635299683,
-0.9789431691169739,
0.9676315188407898,
-0.8753055334091187,
-1.4087584018707275,
-1.3517929315567017,
-2.4193918704986572,
-2.2971441745758057,
0.7419267892837524,
-0.56620854139328,
-0.47015321254730225,
2.0521738529205322,
-1.3368265628814697,
-1.862913727760315,
1.3122166395187378,
0.20377235114574432,
-0.06598521023988724,
2.3332929611206055,
0.23917825520038605,
-0.4799605906009674,
0.38557326793670654,
-0.813914954662323,
0.9268010854721069,
-0.39990636706352234,
1.4140760898590088,
0.5831823945045471,
-0.9990738034248352,
1.495453953742981,
-0.5919294953346252,
0.5682374835014343,
-0.35484153032302856,
-0.741313636302948,
-0.9536187648773193,
0.37745052576065063,
1.8390272855758667,
-0.3038005828857422,
1.5996146202087402,
-0.4796801507472992,
-1.6185942888259888,
-1.550380825996399,
0.9325819611549377,
0.4684920012950897,
-0.8306753039360046,
0.12715938687324524,
-0.20122216641902924,
-0.07553097605705261,
0.15365388989448547,
1.1290762424468994,
1.0972974300384521,
0.717156708240509,
-0.28260424733161926,
-0.9592878818511963,
0.1176740974187851,
0.11399957537651062,
-0.6913583874702454,
-1.784740686416626,
-0.3096979260444641,
-0.1192854717373848,
0.7096180319786072,
-1.121952772140503,
1.7935988903045654,
1.0927313566207886,
1.8350474834442139,
0.9356922507286072,
-0.2902912199497223,
1.4268803596496582,
0.0012424904853105545,
1.8004149198532104,
-0.4760500490665436,
0.7149228453636169,
-0.30237671732902527,
-1.2342947721481323,
0.8343729376792908,
-0.3157513737678528,
-1.9583728313446045,
-0.7675742506980896,
-0.8282094597816467,
-0.2500860393047333,
-0.8609315752983093,
1.068024754524231,
-0.24249568581581116,
-1.5152543783187866,
0.3924503028392792,
-0.6274373531341553,
0.20804233849048615,
-1.1782103776931763,
0.42874160408973694,
0.6451647281646729,
-0.7181969285011292,
-0.1406659185886383,
-0.26853108406066895,
-1.2574963569641113,
-0.3590916395187378,
0.05723859369754791,
1.8879207372665405,
-0.7840052843093872,
1.0294362306594849,
0.9659058451652527,
-0.6209599375724792,
-0.012881267815828323,
0.2317984700202942,
-0.2022312581539154,
0.8522830009460449,
-1.1412439346313477,
-0.4726148247718811,
1.263574242591858,
-0.04041007533669472,
-0.4745403528213501,
1.430009126663208,
0.5199931263923645,
-1.046473741531372,
-0.07201796025037766,
-0.34286391735076904,
-0.7532452940940857,
-0.16498863697052002,
-1.5905158519744873,
-0.058218616992235184,
0.17459502816200256,
-1.305869221687317,
-0.5688371658325195,
-0.16403505206108093,
1.2157742977142334,
-0.03811869025230408,
1.4183025360107422,
-0.33497950434684753,
-0.05672488734126091,
-0.5378950238227844,
-0.45427846908569336,
0.49615538120269775,
-0.13074319064617157,
-0.5180680751800537,
0.2997979521751404,
-0.8133423924446106,
0.21560180187225342,
1.5894278287887573,
0.29975008964538574,
0.19003379344940186,
0.44410642981529236,
0.891876757144928,
0.32148250937461853,
0.08543319255113602,
-0.9439161419868469,
-1.470264196395874,
2.1849865913391113,
-1.5438544750213623,
2.00549578666687,
0.7560229301452637,
-0.13012635707855225,
-1.897716760635376,
-1.8021336793899536,
1.2286065816879272,
1.2305176258087158,
2.186782121658325,
0.5648269057273865,
0.2535319924354553,
-0.8339287638664246,
-0.6010016798973083,
0.4580731987953186,
-1.0975109338760376,
-0.707219123840332,
-0.03182561695575714,
2.3215651512145996,
1.6408687829971313,
-0.5490647554397583,
-0.13372235000133514,
-0.9049478769302368,
1.281042456626892,
-0.160098597407341,
0.30164915323257446,
1.8761297464370728,
-0.5185442566871643,
-1.2845039367675781,
1.2673933506011963,
-2.349281072616577,
0.06626333296298981,
2.0441012382507324,
0.47187379002571106,
0.14626458287239075,
-1.5293097496032715,
-0.6777971386909485,
-0.11932957917451859,
-0.4882206320762634,
-1.403702735900879,
0.7363763451576233,
-0.2837355434894562,
-0.837204098701477,
-1.52289617061615,
0.1329638957977295,
-1.1905120611190796,
-1.7629345655441284,
0.4315527081489563,
1.725272297859192,
2.17771053314209,
-0.7887976765632629,
1.5571138858795166,
-0.2846921384334564,
0.2495964616537094,
1.1665290594100952,
1.1259618997573853,
2.977067232131958,
1.946166753768921,
-1.191963791847229,
0.5854023098945618,
-0.09267160296440125,
-0.6168503761291504,
1.3738481998443604,
-1.044075608253479,
1.460466980934143,
-0.3224242627620697,
-1.0476289987564087,
-1.1606152057647705,
0.8355854153633118,
0.21682506799697876,
0.02055772766470909,
-0.440744549036026,
1.3320692777633667,
0.10093294829130173,
1.2455816268920898,
0.5248763561248779,
-0.4278099536895752,
0.4588983654975891,
-0.4702799916267395,
-0.42447999119758606,
1.597275733947754,
0.23682472109794617,
-1.483447551727295,
-2.362683057785034,
-0.10918466746807098,
-0.8148252367973328,
0.09034398943185806,
-0.6074089407920837,
-0.9701585173606873,
1.5921708345413208,
0.48617953062057495,
-1.311198115348816,
-0.37017324566841125,
-0.48624444007873535,
-0.5242133140563965,
2.4737203121185303,
-1.5536894798278809,
-0.10945210605859756,
-0.9343253374099731,
-0.5545202493667603,
1.5391334295272827,
-1.2795718908309937,
0.03669742867350578,
-1.1643569469451904,
-0.6427005529403687,
-1.5511921644210815,
-0.5077039003372192,
0.054469794034957886,
-0.9560393691062927,
0.7092059850692749,
0.2121051847934723,
-1.1335647106170654,
-0.23853197693824768,
-0.8537497520446777,
0.7958957552909851,
-0.10264149308204651,
0.44531378149986267,
1.8399289846420288,
0.2322039008140564,
-0.5610093474388123,
0.6220400333404541,
1.208566427230835,
0.6993038654327393,
-0.6140354871749878,
0.15026888251304626,
-0.789734959602356,
0.43754997849464417,
-1.311153531074524,
0.21140973269939423,
-3.082918167114258,
0.7610005736351013,
-0.027139104902744293,
-0.2369145005941391,
-0.06617128103971481,
-1.3983981609344482,
1.040456771850586,
2.4680089950561523,
-1.089281439781189,
0.5839273929595947,
0.2432584911584854,
1.186898946762085,
-1.4459620714187622,
0.35040614008903503,
-0.5319936871528625,
2.2024943828582764,
0.24367551505565643,
1.19832444190979,
-0.49873587489128113,
-2.1023521423339844,
0.6965847015380859,
-1.3222527503967285,
-1.1025140285491943,
0.7969194054603577,
-0.8096722364425659,
0.06488599628210068,
-1.3956670761108398,
-0.14938905835151672,
-1.011946439743042,
-1.1834133863449097,
0.9520711898803711,
0.4056376814842224,
0.6151519417762756,
-0.6177545785903931,
0.2722102999687195,
-2.1455557346343994,
-1.3721892833709717,
-0.21788272261619568,
-0.9731285572052002,
0.4078456163406372,
-0.36039817333221436,
0.6373257040977478,
-0.13742198050022125,
0.04547934606671333,
0.44086265563964844,
1.1877652406692505,
3.547781229019165,
0.14329893887043,
0.4832148253917694,
-0.08000552654266357,
-1.004294991493225,
1.5025842189788818,
1.0959738492965698,
-0.08448754996061325,
-0.8410951495170593,
-1.0046149492263794,
1.2660682201385498,
1.8465583324432373,
0.9010891318321228,
0.08918048441410065,
-0.7924615740776062,
-0.4429137110710144,
-0.17391188442707062,
0.2510184347629547,
0.4187906086444855,
0.988781213760376,
0.02502700686454773,
0.1775464415550232,
1.5863361358642578,
1.1360138654708862,
-0.42106616497039795,
0.20464076101779938,
-0.9000327587127686,
-0.46344465017318726,
0.6064496040344238,
0.4058332145214081,
0.12136368453502655,
0.44898295402526855,
-0.7570048570632935,
-0.49493929743766785,
-0.1414247751235962,
-0.9587275981903076,
-0.6771764159202576,
-0.3692501187324524,
-0.5160544514656067,
1.63624906539917,
0.06483063101768494,
-0.5734341144561768,
-0.11647979170084,
-0.8810702562332153,
-0.05676344409584999,
-1.100170373916626,
0.1392834633588791,
-0.07915656268596649,
-0.0354410782456398,
-0.15531879663467407,
1.7880891561508179,
-0.856712818145752,
-2.208031177520752,
0.305535227060318,
0.27880173921585083,
-0.3023463487625122,
0.14208132028579712,
1.5968018770217896,
0.457203209400177,
1.2746961116790771,
1.1666803359985352,
1.0360780954360962,
-0.5963752269744873,
-1.2335902452468872,
0.7426896095275879,
0.9596944451332092,
-1.6135070323944092,
0.82255619764328,
0.11254400759935379,
-0.47641146183013916,
0.809061586856842,
1.021738886833191,
0.489398330450058,
-1.8421117067337036,
0.8818857669830322,
-0.8803988099098206,
1.013859748840332,
0.6074931621551514,
0.7784461379051208,
0.10504547506570816,
0.9571194052696228,
-1.2714840173721313,
-1.1100809574127197,
-0.7582418322563171,
-0.5626303553581238,
1.968178391456604,
-0.3623678386211395,
0.603879988193512,
-0.39478397369384766,
-1.0732399225234985,
-0.329522043466568,
0.6647669672966003,
0.2236902266740799,
-0.35763704776763916,
0.728755533695221,
-0.5747058987617493,
-1.0788450241088867,
-1.4807308912277222,
-0.35379862785339355,
-0.9399965405464172,
-0.8895880579948425,
1.0978186130523682,
0.6716152429580688,
0.37602686882019043,
2.0148658752441406,
0.4144939184188843,
0.2010353058576584,
-2.5353152751922607,
0.8595545291900635,
0.2590859532356262,
0.009262978099286556,
0.9928024411201477,
0.28996706008911133,
1.2743995189666748,
-0.07667645812034607,
0.5378109812736511,
-2.291290283203125,
2.290118932723999,
-0.25099337100982666,
0.73741614818573,
0.11528720706701279,
-0.11179602146148682,
1.071124792098999,
0.6649934649467468,
0.624298095703125,
-1.1472151279449463,
0.5825709700584412,
-0.5819360613822937,
1.346919059753418,
1.1205224990844727,
-0.7427539825439453,
-0.02921077236533165,
1.3651373386383057,
0.44765886664390564,
-0.5204873085021973,
-0.8944672346115112,
-0.8088614344596863,
0.9290139675140381,
1.767966389656067,
-0.12915381789207458,
0.018193285912275314,
0.6327541470527649,
0.7206292152404785,
-1.1767836809158325,
0.1007642149925232,
-0.805135190486908,
-0.8652040958404541,
1.5703338384628296,
1.9321086406707764,
-0.14587074518203735,
-0.04534827172756195,
-0.6292356848716736,
-1.1754034757614136,
0.9798150658607483,
0.00496471393853426,
0.2720663249492645,
0.656170129776001,
-0.7772089242935181,
1.1772844791412354,
0.7967639565467834,
0.7704669237136841,
0.1309177577495575,
0.36641573905944824,
0.5517038106918335,
-0.04129772260785103,
-1.0328551530838013,
-0.18001535534858704,
-1.1809048652648926,
-2.643544912338257,
0.2977529466152191,
-0.28103139996528625,
-1.4014869928359985,
-0.18605589866638184,
-0.9814877510070801,
0.8262075781822205,
-0.5693038702011108,
-1.0098317861557007,
-1.6570732593536377,
0.12102045118808746,
-0.03136829659342766,
0.9288150668144226,
-1.769030213356018,
-0.007172612007707357,
1.1919565200805664,
1.0319000482559204,
-0.6525577306747437,
1.1116951704025269,
0.2995595633983612,
0.983945369720459,
0.8461604118347168,
-0.4006662964820862,
0.6458717584609985,
0.20913425087928772,
-1.2148748636245728,
0.5139143466949463,
1.2965648174285889,
0.09193474054336548,
1.3345420360565186,
-0.3503338694572449,
-0.00021346844732761383,
0.39242926239967346,
-0.6568552255630493,
-0.6291032433509827,
-0.4061582088470459,
0.6887610554695129,
0.049708206206560135,
-0.7737591862678528,
0.023385051637887955,
-0.15636314451694489,
-0.2401820421218872,
0.24096278846263885,
-1.3855581283569336,
-0.30590885877609253,
-0.3665308356285095,
-0.4541184902191162,
-1.5101102590560913,
-0.3760785162448883,
1.4412801265716553,
-0.5198196768760681,
-0.10219002515077591,
0.6325759291648865,
0.549569308757782,
0.4275881350040436,
0.46400976181030273,
-0.48218321800231934,
-0.35111257433891296,
-0.3361361026763916,
-0.2583315670490265,
0.29991552233695984,
1.267674446105957,
-0.1600683033466339,
-0.9029260277748108,
0.6584516167640686,
-0.4584095776081085,
0.11781150102615356,
1.8912256956100464,
0.0014215502887964249,
-0.8911238312721252,
0.34182801842689514,
-0.6589745879173279,
1.9929345846176147,
1.6246395111083984,
1.2691011428833008,
-0.05225307121872902,
-0.8150116205215454,
0.7963016629219055,
-0.3623311221599579,
-0.35707342624664307,
0.8494175672531128,
0.35528266429901123,
-0.2358301877975464,
-1.4088127613067627,
0.5760440826416016,
1.2256205081939697,
-0.8424582481384277,
-0.6768943071365356,
-0.04813753440976143,
-0.778956413269043,
0.9548085331916809,
0.7099986672401428,
0.691851019859314,
0.24657560884952545,
1.6417200565338135,
0.789322555065155,
-0.5505382418632507,
0.6164630651473999,
0.4609541594982147,
-0.003258377779275179,
-2.154850959777832,
-1.121337890625,
0.4635426700115204,
-0.5154430866241455,
-1.5500555038452148,
1.390894889831543,
-1.1335413455963135,
-1.0356113910675049,
0.6820303201675415,
-0.10479705035686493,
1.4399265050888062,
0.3892286717891693,
1.5941789150238037,
2.130516767501831,
0.7698042988777161,
0.4006294012069702,
1.4959509372711182,
-0.20994578301906586,
-0.24368083477020264,
1.9621944427490234,
-0.32240861654281616,
0.4534069895744324,
1.1378940343856812,
-0.3164285123348236,
-0.9565228223800659,
-0.7955599427223206,
-1.2817460298538208,
-0.7850779891014099,
1.0411368608474731,
0.06022688001394272,
-1.1963623762130737,
0.17110414803028107,
1.5727266073226929,
-0.01925904117524624,
-0.19294363260269165,
0.6134806275367737,
0.33991023898124695,
-0.7847254872322083,
0.003694807179272175,
-1.107345700263977,
0.47217851877212524,
-0.2982788681983948,
-0.4476768374443054,
0.3555392920970917,
0.40887507796287537,
1.246529459953308,
-0.1378154158592224,
0.28290367126464844,
1.2419401407241821,
-1.5508992671966553,
1.4503694772720337,
-0.6030184626579285,
0.16254876554012299,
-2.380847215652466,
1.3941079378128052,
-0.6333694458007812,
1.8716506958007812,
-2.7869062423706055,
0.39805591106414795,
-0.5069646239280701,
-0.5505351424217224,
0.3463298976421356,
-0.2770904004573822,
0.24903778731822968,
-0.26300644874572754,
-0.9983433485031128,
0.029759813100099564,
-0.4789150059223175,
0.4938642382621765,
0.9899850487709045,
1.1268417835235596,
-1.1704260110855103,
-0.3397156298160553,
-1.6722333431243896,
0.03202859312295914,
-0.544619619846344,
0.1865462362766266,
-2.3512918949127197,
-0.1890527606010437,
-1.7403689622879028,
-2.2317795753479004,
-1.1667085886001587,
-0.7866103053092957,
1.215084433555603,
0.1634586602449417,
-0.9350423216819763,
1.0103304386138916,
-0.18965870141983032,
-1.858681321144104,
0.8823304176330566,
-2.1609385013580322
] |
https://github.com/huggingface/datasets/issues/5013 | would huggingface like publish cpp binding for datasets package ? | If it's a viable option for you, you can check [tch-rs](https://github.com/LaurentMazare/tch-rs) to load models in Rust. Regarding datasets, you can first download them in python and then use Arrow C++ or Rust to load them | HI:
I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it.
thanks | 512 | 35 | would huggingface like publish cpp binding for datasets package ?
HI:
I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it.
thanks
If it's a viable option for you, you can check [tch-rs](https://github.com/LaurentMazare/tch-rs) to load models in Rust. Regarding datasets, you can first download them in python and then use Arrow C++ or Rust to load them | [
-1.299614667892456,
-0.9503126740455627,
-0.8228557705879211,
1.436160683631897,
-0.16588139533996582,
-1.2459605932235718,
0.034280478954315186,
-1.0030772686004639,
1.6188971996307373,
-0.8383407592773438,
0.3626328706741333,
-1.6981534957885742,
0.041921623051166534,
-0.49333319067955017,
-0.795406699180603,
-0.9066177606582642,
-0.3516539931297302,
-0.7803229093551636,
0.9808232188224792,
2.552536725997925,
1.0647079944610596,
-1.5202932357788086,
2.64758038520813,
0.692176342010498,
-0.25558364391326904,
-1.0057240724563599,
0.5351846218109131,
-0.005550832487642765,
-1.1780356168746948,
-0.3799303472042084,
-1.1829934120178223,
-0.014959009364247322,
-0.6769866943359375,
-0.47671574354171753,
-0.12873214483261108,
0.39495402574539185,
-0.10955602675676346,
-0.3605377674102783,
-0.4110714793205261,
-0.6435906887054443,
0.5396687388420105,
-0.3292046785354614,
1.0143048763275146,
-0.3724272549152374,
1.7165002822875977,
-0.4298950731754303,
0.49958735704421997,
0.6660738587379456,
1.273454189300537,
0.14205533266067505,
-0.06933090090751648,
0.19418944418430328,
0.48593631386756897,
-0.2212003767490387,
0.43065404891967773,
1.1709390878677368,
0.5008499622344971,
0.6603290438652039,
0.6879962086677551,
-2.080181360244751,
1.363127589225769,
-1.116899847984314,
0.3254852890968323,
1.360031247138977,
-1.0420846939086914,
0.4062017798423767,
-1.7289798259735107,
-0.18743106722831726,
0.5284486413002014,
-2.1690871715545654,
0.23983554542064667,
-1.2264294624328613,
-0.6366307735443115,
0.9267285466194153,
0.3373706340789795,
-1.441178560256958,
0.17280739545822144,
-0.27634960412979126,
0.930597722530365,
0.4045894145965576,
1.1984732151031494,
-1.5989634990692139,
0.2979128062725067,
-0.30861979722976685,
0.042083412408828735,
-1.1934428215026855,
-1.4287394285202026,
0.5632643699645996,
0.6091620326042175,
0.5745989084243774,
-0.04403212293982506,
0.9820016026496887,
-1.038608193397522,
0.9013081192970276,
-0.8053911924362183,
-1.5204432010650635,
-1.36703622341156,
-2.474057197570801,
-2.3953728675842285,
0.8500816822052002,
-0.44971683621406555,
-0.462307333946228,
2.033517599105835,
-1.1801902055740356,
-1.8547313213348389,
1.223230242729187,
0.2528325021266937,
-0.10073322802782059,
2.3632688522338867,
0.3090989291667938,
-0.6254154443740845,
0.5663862824440002,
-0.8416680693626404,
0.9246571660041809,
-0.3954722285270691,
1.4537595510482788,
0.5625320076942444,
-0.9915128350257874,
1.658996343612671,
-0.597469687461853,
0.5575076341629028,
-0.4648490846157074,
-0.6523943543434143,
-0.8739163875579834,
0.42669740319252014,
1.8144773244857788,
-0.26393455266952515,
1.579618215560913,
-0.36261504888534546,
-1.560349941253662,
-1.446624517440796,
0.8706473708152771,
0.4369203448295593,
-0.7989827394485474,
0.11118820309638977,
-0.2836146652698517,
-0.11412779241800308,
0.09688965231180191,
1.1239752769470215,
1.2639830112457275,
0.724759042263031,
-0.26284265518188477,
-0.9947662353515625,
0.16229797899723053,
-0.04521939530968666,
-0.6649360060691833,
-1.863765835762024,
-0.31924131512641907,
0.03128911182284355,
0.6733086705207825,
-1.2867999076843262,
1.8074718713760376,
1.0248740911483765,
1.9328503608703613,
0.9990530610084534,
-0.4308530390262604,
1.388436198234558,
-0.06039992347359657,
1.8892525434494019,
-0.40844812989234924,
0.7696937918663025,
-0.28543925285339355,
-1.1632190942764282,
0.8047640919685364,
-0.32842037081718445,
-1.918389081954956,
-0.7852217555046082,
-0.9650552868843079,
-0.21909314393997192,
-0.9197630286216736,
1.1191295385360718,
-0.2393638640642166,
-1.4567389488220215,
0.36568596959114075,
-0.709470272064209,
0.18442459404468536,
-1.2487475872039795,
0.288267582654953,
0.6823704242706299,
-0.6344708800315857,
-0.11836958676576614,
-0.23790156841278076,
-1.3687739372253418,
-0.40397271513938904,
0.24638761579990387,
1.8432362079620361,
-0.7171985507011414,
1.016587734222412,
0.9943042397499084,
-0.6972271800041199,
-0.04065827280282974,
0.34173569083213806,
-0.21235783398151398,
0.7957155108451843,
-1.079153060913086,
-0.5266534686088562,
1.1301878690719604,
-0.08163187652826309,
-0.4985588788986206,
1.3891499042510986,
0.6241581439971924,
-0.9928211569786072,
-0.08443276584148407,
-0.24643832445144653,
-0.7183801531791687,
-0.10290767252445221,
-1.5482357740402222,
-0.1535315215587616,
0.28400227427482605,
-1.3284372091293335,
-0.5033789873123169,
-0.1285049468278885,
1.27372407913208,
-0.09991034865379333,
1.566436767578125,
-0.2298777848482132,
-0.08537568897008896,
-0.5212233066558838,
-0.5350308418273926,
0.26507657766342163,
-0.13980795443058014,
-0.5177030563354492,
0.3426348567008972,
-0.8190128207206726,
0.37970277667045593,
1.5040602684020996,
0.27950477600097656,
0.10162340849637985,
0.4773630201816559,
0.9725749492645264,
0.37470543384552,
0.05203866958618164,
-0.8689600825309753,
-1.4590460062026978,
2.062143564224243,
-1.468162178993225,
1.9728647470474243,
0.7567245960235596,
-0.14194464683532715,
-1.8393927812576294,
-1.827284574508667,
1.3442438840866089,
1.253463864326477,
2.245835304260254,
0.6332509517669678,
0.23153038322925568,
-0.7980961203575134,
-0.600010335445404,
0.42034628987312317,
-1.0411293506622314,
-0.6892197728157043,
0.032544687390327454,
2.3652803897857666,
1.795296549797058,
-0.5273572206497192,
-0.1388052999973297,
-0.9854594469070435,
1.200595736503601,
-0.23806633055210114,
0.23304450511932373,
1.944484829902649,
-0.49172475934028625,
-1.2488270998001099,
1.2968531847000122,
-2.3992769718170166,
0.1457848995923996,
2.069406270980835,
0.45398736000061035,
0.034155845642089844,
-1.5319814682006836,
-0.5916147828102112,
-0.155878946185112,
-0.45083799958229065,
-1.3351123332977295,
0.7820665836334229,
-0.27292105555534363,
-0.8971455693244934,
-1.4709219932556152,
0.1266491413116455,
-1.1240532398223877,
-1.790677785873413,
0.44877320528030396,
1.761238694190979,
2.227036476135254,
-0.7990115880966187,
1.4733283519744873,
-0.2139056771993637,
0.19342787563800812,
1.1154824495315552,
1.0742154121398926,
3.045646905899048,
1.9478882551193237,
-1.1776901483535767,
0.6302483677864075,
-0.05619990453124046,
-0.5963191986083984,
1.3493117094039917,
-1.0657435655593872,
1.3819361925125122,
-0.21281731128692627,
-1.1253236532211304,
-1.1642212867736816,
0.836223304271698,
0.2797708511352539,
0.005655341781675816,
-0.5046830773353577,
1.2652451992034912,
0.09952245652675629,
1.2164125442504883,
0.5339677929878235,
-0.3455727696418762,
0.522213876247406,
-0.42070332169532776,
-0.4761925935745239,
1.6051381826400757,
0.17089183628559113,
-1.5709484815597534,
-2.377192497253418,
-0.12319868057966232,
-0.8825579881668091,
-0.09853119403123856,
-0.6506815552711487,
-1.030757188796997,
1.6525276899337769,
0.47152847051620483,
-1.1126937866210938,
-0.3154849112033844,
-0.47264668345451355,
-0.5543105602264404,
2.5849556922912598,
-1.5767265558242798,
-0.20596826076507568,
-0.9866210222244263,
-0.6185529828071594,
1.5956164598464966,
-1.2282700538635254,
0.073204904794693,
-1.1155413389205933,
-0.6374004483222961,
-1.5329759120941162,
-0.4557498097419739,
-0.008030188269913197,
-0.8239030241966248,
0.6422587633132935,
0.17929363250732422,
-1.0957157611846924,
-0.24013443291187286,
-0.8542429208755493,
0.8444811701774597,
-0.12456656992435455,
0.42999452352523804,
1.809533715248108,
0.29600709676742554,
-0.4843617081642151,
0.6594492197036743,
1.2089217901229858,
0.681861400604248,
-0.6475191116333008,
0.13175944983959198,
-0.7351363301277161,
0.46251338720321655,
-1.3380128145217896,
0.2375781089067459,
-2.9582557678222656,
0.7067855000495911,
-0.10332322865724564,
-0.22245539724826813,
-0.01797935739159584,
-1.4109193086624146,
1.1368082761764526,
2.4383935928344727,
-1.1765527725219727,
0.5872871279716492,
0.26436856389045715,
1.1546404361724854,
-1.3316984176635742,
0.28723016381263733,
-0.557478666305542,
2.218994617462158,
0.13921351730823517,
1.0528541803359985,
-0.5749272704124451,
-2.08332896232605,
0.6876545548439026,
-1.1983916759490967,
-1.04794442653656,
0.8274891376495361,
-0.9251697659492493,
0.09632749855518341,
-1.3395235538482666,
-0.14758828282356262,
-1.0067566633224487,
-1.2236578464508057,
0.8885064721107483,
0.346484899520874,
0.5574408769607544,
-0.5974041223526001,
0.4220696687698364,
-2.2012252807617188,
-1.3864707946777344,
-0.20821160078048706,
-0.972446084022522,
0.45519208908081055,
-0.3344254195690155,
0.6184460520744324,
-0.1831003874540329,
-0.03974923864006996,
0.3537469804286957,
1.2580101490020752,
3.4411585330963135,
0.046827930957078934,
0.45936518907546997,
-0.08086234331130981,
-1.0712857246398926,
1.4946680068969727,
1.185285210609436,
-0.05960281938314438,
-0.7021760940551758,
-1.0296821594238281,
1.3303403854370117,
1.8835546970367432,
0.9723057746887207,
0.03637337312102318,
-0.9152697324752808,
-0.5881531238555908,
-0.027508243918418884,
0.1826781928539276,
0.47154638171195984,
1.0469672679901123,
-0.01311726588755846,
0.1376144140958786,
1.5210641622543335,
1.135470986366272,
-0.3781752288341522,
0.319735050201416,
-0.9020654559135437,
-0.404631644487381,
0.5077807903289795,
0.42544031143188477,
0.14960084855556488,
0.43520334362983704,
-0.8906111121177673,
-0.44929468631744385,
-0.13869880139827728,
-1.0414891242980957,
-0.7637750506401062,
-0.3572971820831299,
-0.41418755054473877,
1.6671385765075684,
0.07972102612257004,
-0.5957046151161194,
0.04132254794239998,
-0.9043095111846924,
-0.03904518485069275,
-1.0586732625961304,
0.11817361414432526,
-0.0848841443657875,
-0.0027240519411861897,
-0.1528300642967224,
1.7838866710662842,
-0.8913196921348572,
-2.1896891593933105,
0.1989227831363678,
0.3295377492904663,
-0.338653564453125,
0.10514141619205475,
1.6119130849838257,
0.588865339756012,
1.3255571126937866,
1.2466278076171875,
1.0325266122817993,
-0.5630176067352295,
-1.2839940786361694,
0.7514740228652954,
0.9652398824691772,
-1.6066784858703613,
0.9252503514289856,
-0.017696717754006386,
-0.5482977628707886,
0.7631557583808899,
1.1183029413223267,
0.3956412672996521,
-1.9475888013839722,
0.8829765319824219,
-0.9256492853164673,
0.9089431166648865,
0.5737780928611755,
0.8609281778335571,
0.14928144216537476,
0.8534883260726929,
-1.3131904602050781,
-1.1151294708251953,
-0.7703967094421387,
-0.6301754713058472,
2.0262205600738525,
-0.21129675209522247,
0.5859155654907227,
-0.3090907633304596,
-1.2029259204864502,
-0.2913877069950104,
0.6748156547546387,
0.2981419563293457,
-0.3808533847332001,
0.715792179107666,
-0.6067957878112793,
-1.1124567985534668,
-1.4638071060180664,
-0.412195086479187,
-0.8387225270271301,
-0.8999674916267395,
1.0579025745391846,
0.6386986374855042,
0.5049196481704712,
2.0329644680023193,
0.4453199803829193,
0.15243291854858398,
-2.5540268421173096,
0.9774187207221985,
0.33347246050834656,
0.03309135511517525,
0.8835428953170776,
0.33763229846954346,
1.2610580921173096,
-0.103156678378582,
0.621789813041687,
-2.287510395050049,
2.1316540241241455,
-0.23775960505008698,
0.6721259951591492,
0.11656524240970612,
-0.022555802017450333,
1.0206233263015747,
0.7293925881385803,
0.6245410442352295,
-1.208054780960083,
0.6864540576934814,
-0.6598240733146667,
1.3185969591140747,
1.1316266059875488,
-0.7070949673652649,
-0.057420533150434494,
1.3473591804504395,
0.421215683221817,
-0.38060110807418823,
-0.9826431274414062,
-0.7949447631835938,
0.9347435832023621,
1.6600148677825928,
-0.17257729172706604,
0.0447235032916069,
0.7213802933692932,
0.5877937078475952,
-1.2930505275726318,
0.06034965440630913,
-0.8376484513282776,
-0.8003042936325073,
1.6613532304763794,
1.9238451719284058,
-0.15012335777282715,
-0.1211908608675003,
-0.7242661118507385,
-1.2379965782165527,
0.870668351650238,
-0.05302773416042328,
0.22464920580387115,
0.7136003375053406,
-0.8185189962387085,
1.1321702003479004,
0.7263199687004089,
0.6610851287841797,
0.09417089074850082,
0.3194066882133484,
0.4424826502799988,
-0.07034368067979813,
-1.127478837966919,
-0.23959924280643463,
-1.119529366493225,
-2.6677684783935547,
0.23969419300556183,
-0.35804733633995056,
-1.4552321434020996,
-0.12374091893434525,
-1.0453252792358398,
0.8186288475990295,
-0.5448886752128601,
-1.0598399639129639,
-1.5897667407989502,
0.22635461390018463,
-0.07941216975450516,
1.0006706714630127,
-1.6843883991241455,
-0.0635492131114006,
1.1994863748550415,
0.9978154301643372,
-0.6602283120155334,
1.1715894937515259,
0.33289480209350586,
1.08086097240448,
0.7622321248054504,
-0.43133601546287537,
0.48391786217689514,
0.1351478546857834,
-1.2545453310012817,
0.4725653827190399,
1.2920663356781006,
0.09211350977420807,
1.3269201517105103,
-0.4407774806022644,
-0.015116480179131031,
0.42344218492507935,
-0.5075886249542236,
-0.5068475008010864,
-0.4090375304222107,
0.7115565538406372,
0.09438491612672806,
-0.7949395775794983,
-0.013815348967909813,
-0.16060708463191986,
-0.1465962529182434,
0.23197941482067108,
-1.4359835386276245,
-0.25813060998916626,
-0.36549586057662964,
-0.4609861373901367,
-1.4993921518325806,
-0.16936646401882172,
1.3346470594406128,
-0.6697081327438354,
-0.09739072620868683,
0.5577194094657898,
0.5170565247535706,
0.4631592631340027,
0.4594063460826874,
-0.5131829977035522,
-0.3732425570487976,
-0.3368764817714691,
-0.32461580634117126,
0.3463756740093231,
1.284751534461975,
-0.17252467572689056,
-0.9969107508659363,
0.6697869896888733,
-0.4683837890625,
0.052368998527526855,
1.9084428548812866,
-0.004047730937600136,
-0.9380145072937012,
0.3843807578086853,
-0.6976302266120911,
1.9363104104995728,
1.6036063432693481,
1.2283824682235718,
-0.0031943260692059994,
-0.791068434715271,
0.6873206496238708,
-0.29804614186286926,
-0.3525882363319397,
0.8822248578071594,
0.3754633665084839,
-0.16634969413280487,
-1.3856091499328613,
0.5334645509719849,
1.24539053440094,
-0.867696225643158,
-0.6947607398033142,
-0.03221174329519272,
-0.85380619764328,
1.0409613847732544,
0.737723708152771,
0.5857505798339844,
0.2748751640319824,
1.6482497453689575,
0.7399632334709167,
-0.5602588057518005,
0.6499423980712891,
0.4822869598865509,
-0.08469749242067337,
-2.129269599914551,
-1.1682065725326538,
0.36031314730644226,
-0.42037808895111084,
-1.526817798614502,
1.2638616561889648,
-1.1796258687973022,
-1.0157486200332642,
0.6176978349685669,
0.04373794049024582,
1.3249967098236084,
0.3345770835876465,
1.6041165590286255,
2.0677647590637207,
0.7793465852737427,
0.32068121433258057,
1.4260318279266357,
-0.24696116149425507,
-0.28615087270736694,
1.8201221227645874,
-0.41168132424354553,
0.5400499105453491,
1.0723671913146973,
-0.33516377210617065,
-0.9599654078483582,
-0.8159087300300598,
-1.3026942014694214,
-0.6835727095603943,
1.012291669845581,
0.14907540380954742,
-1.1772664785385132,
0.22226881980895996,
1.5674210786819458,
0.032030850648880005,
-0.24886131286621094,
0.5900595188140869,
0.4564191997051239,
-0.7951428294181824,
-0.030620615929365158,
-0.9942812919616699,
0.5035383701324463,
-0.15069697797298431,
-0.3826228380203247,
0.30345210433006287,
0.5012531280517578,
1.2422555685043335,
-0.11010482162237167,
0.2920279800891876,
1.2348052263259888,
-1.4787273406982422,
1.5262759923934937,
-0.5698769688606262,
0.17804604768753052,
-2.3358118534088135,
1.3631893396377563,
-0.7086255550384521,
1.8921343088150024,
-2.773298978805542,
0.3730044662952423,
-0.4575157165527344,
-0.5996402502059937,
0.32163065671920776,
-0.3268342912197113,
0.25601691007614136,
-0.21244139969348907,
-1.005829930305481,
-0.006889485754072666,
-0.6078703999519348,
0.4466414451599121,
1.002062201499939,
1.1875618696212769,
-1.0239256620407104,
-0.34157222509384155,
-1.6999417543411255,
-0.048990633338689804,
-0.5313706398010254,
0.28201785683631897,
-2.200223684310913,
-0.195914164185524,
-1.7706141471862793,
-2.262032985687256,
-1.3271048069000244,
-0.8600925207138062,
1.2312726974487305,
0.10491988807916641,
-1.0073449611663818,
0.9903351068496704,
-0.29073506593704224,
-1.807121753692627,
0.9960313439369202,
-2.145733594894409
] |
https://github.com/huggingface/datasets/issues/5013 | would huggingface like publish cpp binding for datasets package ? | If you are more adventurous, another option is to embed python calls inside c++ e.g. with `pybind11`. | HI:
I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it.
thanks | 512 | 17 | would huggingface like publish cpp binding for datasets package ?
HI:
I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it.
thanks
If you are more adventurous, another option is to embed python calls inside c++ e.g. with `pybind11`. | [
-1.2439446449279785,
-1.0476725101470947,
-0.8406955003738403,
1.4629206657409668,
-0.33755922317504883,
-1.2675344944000244,
0.031185489147901535,
-1.0103613138198853,
1.615330696105957,
-0.8791929483413696,
0.411289781332016,
-1.7254832983016968,
0.05265878885984421,
-0.4174445569515228,
-0.7062698602676392,
-1.0092300176620483,
-0.42760807275772095,
-0.768505871295929,
1.0206389427185059,
2.574850559234619,
1.0015339851379395,
-1.4221385717391968,
2.4604504108428955,
0.6744585633277893,
-0.24772115051746368,
-1.1042228937149048,
0.5825533866882324,
-0.021576810628175735,
-1.1648203134536743,
-0.4052797555923462,
-1.1468591690063477,
-0.12005230784416199,
-0.7915605902671814,
-0.6507374048233032,
-0.051178693771362305,
0.34804314374923706,
-0.01070941612124443,
-0.45381343364715576,
-0.4657687544822693,
-0.6685709357261658,
0.5909367203712463,
-0.42013129591941833,
0.9839704036712646,
-0.422519326210022,
1.7283965349197388,
-0.5271367430686951,
0.5256167054176331,
0.8826841711997986,
1.378456950187683,
0.2424343228340149,
-0.1624288558959961,
0.1425645798444748,
0.5349326729774475,
-0.17416630685329437,
0.43237200379371643,
0.9141086339950562,
0.38532504439353943,
0.5922052264213562,
0.6398277282714844,
-2.1650586128234863,
1.4439178705215454,
-1.2170342206954956,
0.3378852903842926,
1.3126375675201416,
-1.0875611305236816,
0.32203611731529236,
-1.7050589323043823,
-0.2340720146894455,
0.47503915429115295,
-2.064918279647827,
0.28290462493896484,
-1.2228279113769531,
-0.5559223294258118,
0.9559726119041443,
0.38407155871391296,
-1.4531282186508179,
0.11899241805076599,
-0.18557356297969818,
0.921967089176178,
0.4795628488063812,
1.2022771835327148,
-1.6204451322555542,
0.22758173942565918,
-0.5620630979537964,
0.10477488487958908,
-1.1490992307662964,
-1.3909207582473755,
0.5360528826713562,
0.6576104164123535,
0.4203577935695648,
0.00039114151149988174,
0.9925358891487122,
-0.902444064617157,
1.0240267515182495,
-0.8935487270355225,
-1.5023272037506104,
-1.4053725004196167,
-2.43692946434021,
-2.352825164794922,
0.7842420339584351,
-0.5128294825553894,
-0.42485836148262024,
1.907385230064392,
-1.3597757816314697,
-1.9367159605026245,
1.3122708797454834,
0.16134542226791382,
-0.17327061295509338,
2.313937187194824,
0.28273239731788635,
-0.45019638538360596,
0.3702722191810608,
-1.0227992534637451,
0.9409888982772827,
-0.49606022238731384,
1.4253045320510864,
0.5555616617202759,
-0.9909747838973999,
1.6553099155426025,
-0.5747630596160889,
0.6432873010635376,
-0.49669408798217773,
-0.6328122019767761,
-0.8942524194717407,
0.3880097270011902,
1.8312253952026367,
-0.353746622800827,
1.601690649986267,
-0.5565376281738281,
-1.6020233631134033,
-1.5480926036834717,
0.9787600636482239,
0.4269959032535553,
-0.7838141322135925,
0.1437692642211914,
-0.0924115851521492,
-0.024231484159827232,
0.09427735954523087,
1.1614701747894287,
1.2044947147369385,
0.8444047570228577,
-0.42248398065567017,
-1.0040578842163086,
0.08460407704114914,
0.13411180675029755,
-0.7955326437950134,
-1.8635129928588867,
-0.40633419156074524,
-0.13276976346969604,
0.7407957911491394,
-1.134214162826538,
1.8080769777297974,
1.102015495300293,
1.8896108865737915,
0.9748958349227905,
-0.42678213119506836,
1.333806037902832,
-0.01571059040725231,
1.894221305847168,
-0.47345471382141113,
0.7713484168052673,
-0.2744266986846924,
-1.1787012815475464,
0.7855685353279114,
-0.20020784437656403,
-1.9474953413009644,
-0.8046956658363342,
-0.8375624418258667,
-0.203633114695549,
-0.8484118580818176,
1.036625862121582,
-0.22030146420001984,
-1.5911169052124023,
0.3479197323322296,
-0.6480169296264648,
0.0900239497423172,
-1.2201024293899536,
0.3961542546749115,
0.5966095924377441,
-0.7374778389930725,
0.07748834043741226,
-0.2304835021495819,
-1.2184933423995972,
-0.47057926654815674,
0.039550621062517166,
1.8809292316436768,
-0.8514549136161804,
1.089890480041504,
0.9436461329460144,
-0.6778361797332764,
-0.0456014908850193,
0.33176323771476746,
-0.11364351212978363,
0.7286678552627563,
-1.119856357574463,
-0.4551381468772888,
1.1848649978637695,
-0.0004870416596531868,
-0.367180734872818,
1.4300705194473267,
0.7138638496398926,
-1.0658897161483765,
-0.07342388480901718,
-0.35531896352767944,
-0.5663393139839172,
-0.1458253264427185,
-1.5522347688674927,
-0.09574522823095322,
0.2410176396369934,
-1.3074795007705688,
-0.5494810938835144,
-0.3057255446910858,
1.259071707725525,
0.0686812773346901,
1.3636454343795776,
-0.2381288856267929,
-0.18651637434959412,
-0.5185198783874512,
-0.3955216109752655,
0.5053607821464539,
-0.06231065094470978,
-0.49864521622657776,
0.39643430709838867,
-0.7739863991737366,
0.2747614085674286,
1.5754307508468628,
0.23504845798015594,
0.18101300299167633,
0.44003698229789734,
0.8622931838035583,
0.28260985016822815,
0.21628743410110474,
-0.9486914873123169,
-1.3282896280288696,
2.1246278285980225,
-1.494445562362671,
2.015423059463501,
0.7425240874290466,
-0.08940180391073227,
-1.8704031705856323,
-1.8086845874786377,
1.3280690908432007,
1.2073612213134766,
2.2033095359802246,
0.7195842862129211,
0.20947852730751038,
-0.8663625717163086,
-0.5402436256408691,
0.3662911355495453,
-1.0789399147033691,
-0.733672022819519,
-0.07884680479764938,
2.377608299255371,
1.6027419567108154,
-0.5811014175415039,
-0.10726524144411087,
-0.9924504160881042,
1.2132363319396973,
-0.08447562903165817,
0.3699221611022949,
1.9453715085983276,
-0.4991239309310913,
-1.2594655752182007,
1.247755765914917,
-2.3714852333068848,
0.15647131204605103,
2.053689956665039,
0.38564324378967285,
0.11885941028594971,
-1.5941412448883057,
-0.6798060536384583,
-0.11044754832983017,
-0.6164472699165344,
-1.2865712642669678,
0.7252774834632874,
-0.27565911412239075,
-0.8509456515312195,
-1.5585023164749146,
0.16536977887153625,
-1.04279625415802,
-1.7641217708587646,
0.4501599073410034,
1.7491915225982666,
2.070505142211914,
-0.7780968546867371,
1.4835413694381714,
-0.24946466088294983,
0.23293542861938477,
1.186561107635498,
1.1490007638931274,
2.9055190086364746,
2.010793447494507,
-1.1875382661819458,
0.7362030744552612,
-0.06906873732805252,
-0.5065474510192871,
1.3157625198364258,
-1.1082428693771362,
1.3629961013793945,
-0.31345638632774353,
-1.0519047975540161,
-1.1888025999069214,
0.7873319983482361,
0.2804127037525177,
-0.0595439188182354,
-0.2980269193649292,
1.3514481782913208,
0.2561701536178589,
1.2294272184371948,
0.5138051509857178,
-0.31082263588905334,
0.5856726765632629,
-0.39413997530937195,
-0.41024649143218994,
1.5380758047103882,
0.3126105070114136,
-1.451705813407898,
-2.330049991607666,
-0.0856693834066391,
-0.8938930630683899,
-0.06124025955796242,
-0.5053282380104065,
-0.9656640887260437,
1.7393137216567993,
0.4800616502761841,
-1.1737583875656128,
-0.2523624300956726,
-0.4913889169692993,
-0.48966386914253235,
2.4246480464935303,
-1.4716870784759521,
-0.15148302912712097,
-0.8203422427177429,
-0.5504694581031799,
1.5148588418960571,
-1.2371633052825928,
0.04897592216730118,
-1.1997215747833252,
-0.4971204996109009,
-1.5374892950057983,
-0.5133247375488281,
-0.015658635646104813,
-0.8349788188934326,
0.727952241897583,
0.21271175146102905,
-1.1057640314102173,
-0.41455981135368347,
-0.8684051632881165,
0.7141755819320679,
0.006963777355849743,
0.5186020731925964,
1.8440152406692505,
0.36239033937454224,
-0.48697254061698914,
0.5640771389007568,
1.1223734617233276,
0.6899339556694031,
-0.5491601228713989,
0.2610054314136505,
-0.6420989036560059,
0.39742735028266907,
-1.2320657968521118,
0.20035351812839508,
-2.9213409423828125,
0.6821424961090088,
-0.0838930755853653,
-0.2864949405193329,
-0.12807323038578033,
-1.4406630992889404,
1.1277852058410645,
2.4632115364074707,
-1.0566866397857666,
0.48920705914497375,
0.16090522706508636,
1.1844929456710815,
-1.2971930503845215,
0.39309269189834595,
-0.49081456661224365,
2.2653017044067383,
0.3070562481880188,
1.1404837369918823,
-0.4597069323062897,
-2.1007747650146484,
0.6171553134918213,
-1.2467783689498901,
-1.1263049840927124,
0.8517336845397949,
-0.7825573086738586,
-0.07275532931089401,
-1.3380588293075562,
-0.10442259162664413,
-0.9583325386047363,
-1.2929750680923462,
1.049689531326294,
0.5092955827713013,
0.716032862663269,
-0.7247806787490845,
0.41499796509742737,
-2.2147488594055176,
-1.3810595273971558,
-0.2433415949344635,
-0.9269477128982544,
0.4141506254673004,
-0.30582794547080994,
0.6768609881401062,
-0.12268394976854324,
-0.009392309933900833,
0.49003833532333374,
1.286149263381958,
3.519508123397827,
0.12037624418735504,
0.49266481399536133,
-0.18252018094062805,
-1.0350013971328735,
1.5164133310317993,
1.059500813484192,
-0.12551140785217285,
-0.7053363919258118,
-1.035109281539917,
1.1171290874481201,
1.9293601512908936,
0.9696817994117737,
0.02320445328950882,
-0.736721932888031,
-0.6214215159416199,
-0.03740505501627922,
0.24720856547355652,
0.3982527554035187,
1.0375665426254272,
0.022543124854564667,
0.07407187670469284,
1.6426438093185425,
1.175168752670288,
-0.4981827139854431,
0.3344733417034149,
-0.8794698715209961,
-0.41164082288742065,
0.6340465545654297,
0.4051450788974762,
0.20278967916965485,
0.32455065846443176,
-0.9462745189666748,
-0.4210805296897888,
-0.08625946193933487,
-1.0356292724609375,
-0.7750834226608276,
-0.41932281851768494,
-0.5481501817703247,
1.6170105934143066,
0.00660307239741087,
-0.6260195374488831,
-0.08045303821563721,
-0.8258510828018188,
-0.01946406066417694,
-1.0204455852508545,
-0.01318869087845087,
-0.07025474309921265,
-0.059812597930431366,
-0.08613122254610062,
1.8773260116577148,
-0.9049713015556335,
-2.1027474403381348,
0.37632429599761963,
0.26978424191474915,
-0.408844918012619,
0.2143467515707016,
1.5557754039764404,
0.4534231722354889,
1.248216986656189,
1.2005829811096191,
1.0402330160140991,
-0.6969462633132935,
-1.1925245523452759,
0.6889839172363281,
0.8810858130455017,
-1.6668553352355957,
0.774985134601593,
0.11158102005720139,
-0.4195410907268524,
0.7664640545845032,
1.0032063722610474,
0.38538071513175964,
-1.9280632734298706,
0.746060848236084,
-0.8179293274879456,
0.907326340675354,
0.5463488698005676,
0.8827027678489685,
0.10317927598953247,
0.8609970211982727,
-1.2366701364517212,
-1.0141682624816895,
-0.7329766750335693,
-0.5456125140190125,
2.0216405391693115,
-0.3517754077911377,
0.656221330165863,
-0.37462159991264343,
-1.1507779359817505,
-0.35858604311943054,
0.7872176170349121,
0.3446556627750397,
-0.47797730565071106,
0.6008446216583252,
-0.48155272006988525,
-1.1558213233947754,
-1.4384562969207764,
-0.49660247564315796,
-0.9491601586341858,
-0.8866892457008362,
1.0955235958099365,
0.6465453505516052,
0.4056289792060852,
2.022864818572998,
0.3627636730670929,
0.11913971602916718,
-2.5795063972473145,
0.9537501335144043,
0.2591029405593872,
0.11474967002868652,
0.9541922807693481,
0.3835891783237457,
1.1302270889282227,
-0.14771628379821777,
0.7152799367904663,
-2.3345587253570557,
2.3002192974090576,
-0.24124419689178467,
0.6907098889350891,
0.09652559459209442,
-0.08113183826208115,
0.9610353708267212,
0.7029370069503784,
0.6507221460342407,
-1.172852635383606,
0.44852620363235474,
-0.7410879731178284,
1.429832100868225,
1.1034612655639648,
-0.6978781223297119,
-0.014786635525524616,
1.3360376358032227,
0.37604978680610657,
-0.2900021970272064,
-0.8662254810333252,
-0.8929248452186584,
0.9068926572799683,
1.7332175970077515,
-0.29190656542778015,
-0.017461100593209267,
0.6524264216423035,
0.7076459527015686,
-1.324587345123291,
0.0542382150888443,
-0.9373552203178406,
-0.8435177803039551,
1.6039867401123047,
1.9858742952346802,
-0.1658582240343094,
-0.11768041551113129,
-0.6679516434669495,
-1.1443935632705688,
0.9986308217048645,
-0.020187292248010635,
0.15785598754882812,
0.7031185030937195,
-0.7334800958633423,
1.307774305343628,
0.6360397934913635,
0.7860864996910095,
0.23527586460113525,
0.3059432804584503,
0.3713664412498474,
-0.0752604752779007,
-0.9215513467788696,
-0.20102600753307343,
-1.2362444400787354,
-2.6553707122802734,
0.3140503764152527,
-0.2898693084716797,
-1.5120022296905518,
-0.1864674985408783,
-1.0816634893417358,
0.7585534453392029,
-0.5622454285621643,
-0.920195460319519,
-1.481512427330017,
0.05417441576719284,
0.005499443970620632,
0.9192402958869934,
-1.86275315284729,
0.062271952629089355,
1.249743938446045,
1.020972490310669,
-0.6968298554420471,
1.152162790298462,
0.33962395787239075,
1.0787551403045654,
0.8709896206855774,
-0.3058965802192688,
0.5598037242889404,
0.06495430320501328,
-1.247578501701355,
0.44306695461273193,
1.269646167755127,
0.09845034778118134,
1.3788046836853027,
-0.4275588095188141,
0.04161090403795242,
0.3816359341144562,
-0.7293746471405029,
-0.5641310811042786,
-0.4481920301914215,
0.7501954436302185,
0.0050164395943284035,
-0.8633644580841064,
0.09844059497117996,
-0.07344620674848557,
-0.07121308892965317,
0.19190257787704468,
-1.2646514177322388,
-0.35694849491119385,
-0.2995252311229706,
-0.4809654951095581,
-1.4987729787826538,
-0.35172489285469055,
1.3642011880874634,
-0.48229214549064636,
-0.020180746912956238,
0.6751887798309326,
0.6081736087799072,
0.4274969696998596,
0.43894991278648376,
-0.4423524737358093,
-0.559925377368927,
-0.3450949788093567,
-0.3748878538608551,
0.39926037192344666,
1.3598133325576782,
-0.15669257938861847,
-1.0302013158798218,
0.727268397808075,
-0.4902662932872772,
0.03694121539592743,
1.8881222009658813,
-0.045260507613420486,
-0.9263436794281006,
0.42991501092910767,
-0.5653958320617676,
2.0009095668792725,
1.6193509101867676,
1.2483621835708618,
0.008956891484558582,
-0.8607190847396851,
0.7576985955238342,
-0.32878804206848145,
-0.33621546626091003,
0.910895586013794,
0.2779863476753235,
-0.15435528755187988,
-1.3017969131469727,
0.4740530550479889,
1.3113231658935547,
-0.7806509733200073,
-0.7995226979255676,
-0.06151841953396797,
-0.7247917056083679,
0.9470842480659485,
0.7738977670669556,
0.6965103149414062,
0.16860176622867584,
1.6440167427062988,
0.7884507775306702,
-0.5428725481033325,
0.7737390398979187,
0.4077717661857605,
-0.02008782885968685,
-2.189810037612915,
-1.1109864711761475,
0.38572782278060913,
-0.4968712031841278,
-1.6084671020507812,
1.308482050895691,
-1.2508485317230225,
-1.0533487796783447,
0.7102422118186951,
0.04070677235722542,
1.4047991037368774,
0.4633693993091583,
1.6030277013778687,
2.1165530681610107,
0.8473336696624756,
0.35330185294151306,
1.4148838520050049,
-0.34492188692092896,
-0.33143728971481323,
1.857775092124939,
-0.35920608043670654,
0.5473313927650452,
1.212479829788208,
-0.2104579657316208,
-0.9315782785415649,
-0.8004236221313477,
-1.2910969257354736,
-0.8404814600944519,
1.1164779663085938,
0.07791288942098618,
-1.2000318765640259,
0.2156001180410385,
1.5635215044021606,
-0.09226736426353455,
-0.2988530099391937,
0.6024754643440247,
0.388906329870224,
-0.8147651553153992,
0.0032326262444257736,
-1.0455524921417236,
0.3559592366218567,
-0.37154170870780945,
-0.5062592029571533,
0.4225037693977356,
0.4175049662590027,
1.1805373430252075,
-0.21119281649589539,
0.34214815497398376,
1.2802979946136475,
-1.5413475036621094,
1.5995253324508667,
-0.5009900331497192,
0.12339174747467041,
-2.352484703063965,
1.4300984144210815,
-0.670172393321991,
1.7157251834869385,
-2.8175714015960693,
0.3536175489425659,
-0.4028131365776062,
-0.6190444827079773,
0.2811024487018585,
-0.31062543392181396,
0.23149679601192474,
-0.27187633514404297,
-0.9924151301383972,
0.1305040866136551,
-0.5832825899124146,
0.31605303287506104,
0.877553403377533,
1.0480217933654785,
-1.1438575983047485,
-0.3207382559776306,
-1.6169570684432983,
-0.07946887612342834,
-0.5836427807807922,
0.39101117849349976,
-2.2975611686706543,
-0.19142501056194305,
-1.7301921844482422,
-2.146712064743042,
-1.2183672189712524,
-0.8338744640350342,
1.2334284782409668,
0.1544821858406067,
-0.8256326913833618,
0.8924535512924194,
-0.18659043312072754,
-1.994672417640686,
0.8797128200531006,
-2.16424822807312
] |
https://github.com/huggingface/datasets/issues/5012 | Force JSON format regardless of file naming on S3 | Hi ! Support for URIs like `s3://...` is not implemented yet in `data_files=`. You can use the HTTP URL instead if your data is public in the meantime | I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run
```python
dataset = load_dataset(
"json",
data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
)
```
It gives me
```
InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
```
However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming? | 513 | 28 | Force JSON format regardless of file naming on S3
I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run
```python
dataset = load_dataset(
"json",
data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
)
```
It gives me
```
InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
```
However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming?
Hi ! Support for URIs like `s3://...` is not implemented yet in `data_files=`. You can use the HTTP URL instead if your data is public in the meantime | [
-1.156455636024475,
-0.8050859570503235,
-0.8201022744178772,
1.4521727561950684,
-0.22113214433193207,
-1.1223407983779907,
0.2464982122182846,
-1.0725516080856323,
1.7613621950149536,
-0.7829986214637756,
0.3984522819519043,
-1.610437035560608,
-0.012405806221067905,
-0.5475820899009705,
-0.6943180561065674,
-0.9309648275375366,
-0.4359675943851471,
-0.9145508408546448,
0.964187741279602,
2.601044178009033,
1.2643073797225952,
-1.4394460916519165,
2.636355400085449,
0.6327938437461853,
-0.27781662344932556,
-0.9365750551223755,
0.4188585579395294,
0.007487940602004528,
-1.1356652975082397,
-0.5467829704284668,
-0.968198835849762,
-0.14452318847179413,
-0.5534303188323975,
-0.5855061411857605,
0.0771205797791481,
0.39485839009284973,
-0.3502134084701538,
-0.356891930103302,
-0.5639723539352417,
-0.8360725045204163,
0.5257740020751953,
-0.3187018036842346,
1.032638430595398,
-0.33801671862602234,
1.8472245931625366,
-0.5238662958145142,
0.28057771921157837,
0.7576453685760498,
1.3637253046035767,
0.14935441315174103,
-0.06703449785709381,
0.30614665150642395,
0.27556243538856506,
-0.03226607292890549,
0.4122127294540405,
1.191369891166687,
0.4672170877456665,
0.4887070953845978,
0.7144021987915039,
-2.263418436050415,
1.2352845668792725,
-1.088471531867981,
0.27990543842315674,
1.271165132522583,
-0.9582575559616089,
0.34899160265922546,
-1.834651231765747,
0.05049411207437515,
0.5895814299583435,
-2.258620500564575,
0.3086635172367096,
-1.2839213609695435,
-0.45093125104904175,
0.8620622158050537,
0.22044813632965088,
-1.3025407791137695,
0.19726011157035828,
-0.5020564198493958,
1.1316221952438354,
0.4994826018810272,
1.1139492988586426,
-1.9488579034805298,
-0.0241539403796196,
-0.35775914788246155,
0.2961985170841217,
-1.3377388715744019,
-1.517211675643921,
0.5592139363288879,
0.6045162081718445,
0.5831258893013,
0.06216215342283249,
1.1166528463363647,
-0.9742616415023804,
0.8536456823348999,
-1.1023297309875488,
-1.5397001504898071,
-1.3572276830673218,
-2.1301090717315674,
-2.3183319568634033,
0.6628290414810181,
-0.4904864430427551,
-0.5403447151184082,
1.9894616603851318,
-0.9304537773132324,
-1.737394094467163,
1.1027040481567383,
0.31652241945266724,
-0.11606979370117188,
2.28012752532959,
0.2290637046098709,
-0.7920210957527161,
0.3716244697570801,
-0.6850065588951111,
0.8530388474464417,
-0.41924580931663513,
1.3921781778335571,
0.5552889108657837,
-0.9714722037315369,
1.7065260410308838,
-0.44183263182640076,
0.6302687525749207,
-0.6898150444030762,
-0.5502195358276367,
-0.8801630139350891,
0.35610008239746094,
1.9558227062225342,
-0.38924267888069153,
1.5357475280761719,
-0.3602849543094635,
-1.5958623886108398,
-1.5305434465408325,
0.9553324580192566,
0.5126115679740906,
-0.7883033156394958,
0.2559848427772522,
-0.40198761224746704,
0.16225141286849976,
-0.09872544556856155,
1.049892544746399,
1.186532735824585,
0.7953473329544067,
-0.14468669891357422,
-0.9485195875167847,
0.2363702356815338,
-0.05899865925312042,
-0.7328416109085083,
-1.8589847087860107,
-0.40468019247055054,
0.06124740093946457,
0.6410906910896301,
-1.2569620609283447,
1.7444090843200684,
0.7537423968315125,
2.041736364364624,
0.996545135974884,
-0.34112370014190674,
1.6209033727645874,
0.016605954617261887,
1.8405555486679077,
-0.4638667702674866,
0.6713277697563171,
-0.31083089113235474,
-1.1763018369674683,
0.8920350670814514,
-0.35213470458984375,
-2.0507748126983643,
-0.8187997937202454,
-0.7182154059410095,
-0.2008388489484787,
-0.7679439187049866,
0.855877161026001,
-0.3610343337059021,
-1.527698040008545,
0.34645748138427734,
-0.5747553110122681,
0.21977990865707397,
-1.2093721628189087,
0.402772456407547,
0.7351032495498657,
-0.6441378593444824,
0.09914294630289078,
-0.2768312394618988,
-1.2648545503616333,
-0.500282883644104,
0.20658700168132782,
1.9395819902420044,
-0.7041894793510437,
0.8896828293800354,
0.9770727157592773,
-0.6666552424430847,
0.030809029936790466,
0.22627370059490204,
-0.21231450140476227,
0.8372685313224792,
-1.2160969972610474,
-0.3656032085418701,
1.1503835916519165,
-0.1260552555322647,
-0.6749515533447266,
1.2674071788787842,
0.7806460857391357,
-1.0692874193191528,
-0.17420430481433868,
-0.3215242326259613,
-0.846274733543396,
0.04750104248523712,
-1.575473427772522,
-0.048193663358688354,
0.3498021364212036,
-1.4541213512420654,
-0.42882078886032104,
-0.21326163411140442,
1.3387542963027954,
-0.19942955672740936,
1.487709879875183,
-0.3854582905769348,
-0.27857789397239685,
-0.3661711812019348,
-0.35093554854393005,
0.1459307074546814,
-0.19632160663604736,
-0.712185800075531,
0.08860818296670914,
-0.700758159160614,
0.3838563561439514,
1.4696887731552124,
0.3452664315700531,
-0.00023365579545497894,
0.5159031748771667,
1.2349598407745361,
0.30129361152648926,
0.10123161971569061,
-0.8798595070838928,
-1.4122507572174072,
1.9931788444519043,
-1.434748649597168,
1.925600290298462,
0.7994903922080994,
0.026645753532648087,
-1.785969853401184,
-1.8603628873825073,
1.3784385919570923,
1.3016548156738281,
2.1988344192504883,
0.7234200239181519,
0.40674763917922974,
-0.7717158794403076,
-0.6265055537223816,
0.317208468914032,
-1.1200093030929565,
-0.7176644802093506,
0.18084637820720673,
2.4538769721984863,
1.6960604190826416,
-0.569499135017395,
-0.3316020369529724,
-0.9350647330284119,
1.2994264364242554,
-0.17037971317768097,
0.11310866475105286,
1.9798029661178589,
-0.239882230758667,
-1.1790921688079834,
1.3212463855743408,
-2.292483329772949,
0.15599507093429565,
1.9983527660369873,
0.2590324878692627,
0.13412103056907654,
-1.4976798295974731,
-0.7700629830360413,
-0.17282524704933167,
-0.4330325126647949,
-1.3274621963500977,
0.4620685279369354,
-0.35904791951179504,
-0.7653883099555969,
-1.5333350896835327,
0.1883843094110489,
-1.034934163093567,
-1.6464227437973022,
0.21955296397209167,
1.9326653480529785,
1.8597514629364014,
-0.788785457611084,
1.4772698879241943,
-0.3054403066635132,
0.18191051483154297,
1.3498504161834717,
1.2551519870758057,
3.079444169998169,
1.8399027585983276,
-1.2271801233291626,
0.6272778511047363,
-0.19693607091903687,
-0.5244916081428528,
1.2014038562774658,
-1.2267740964889526,
1.1634989976882935,
-0.23436512053012848,
-1.1010972261428833,
-1.2452282905578613,
0.8713820576667786,
0.5831465125083923,
0.12005255371332169,
-0.49110928177833557,
1.2721995115280151,
0.08107571303844452,
1.2424272298812866,
0.5825414061546326,
-0.43263694643974304,
0.6424105763435364,
-0.42048776149749756,
-0.4075656533241272,
1.6986949443817139,
0.2329045832157135,
-1.2920423746109009,
-2.435939311981201,
-0.18946129083633423,
-0.8253258466720581,
0.029200255870819092,
-0.492925226688385,
-1.0594134330749512,
1.729714035987854,
0.3891015648841858,
-1.2270188331604004,
-0.2534750699996948,
-0.3123708963394165,
-0.5816884636878967,
2.6735410690307617,
-1.392688274383545,
-0.21749377250671387,
-0.9816120862960815,
-0.5866522192955017,
1.6023839712142944,
-1.1882280111312866,
-0.20556041598320007,
-0.9738492965698242,
-0.5428022146224976,
-1.342278003692627,
-0.6107900142669678,
-0.11928977072238922,
-0.7698625326156616,
0.7564623355865479,
0.31304430961608887,
-1.2177425622940063,
-0.32376429438591003,
-0.8171743154525757,
0.8864054083824158,
-0.06061267852783203,
0.31260815262794495,
1.9132041931152344,
0.503471851348877,
-0.46234413981437683,
0.7243518233299255,
1.1627960205078125,
0.6219789981842041,
-0.6910185813903809,
0.14911291003227234,
-0.710809051990509,
0.12920567393302917,
-1.3731180429458618,
0.35882678627967834,
-2.8975369930267334,
0.7684500217437744,
-0.06599156558513641,
-0.1582344025373459,
-0.033633437007665634,
-1.2363297939300537,
1.0175206661224365,
2.720961809158325,
-1.1855101585388184,
0.4013996720314026,
0.34019970893859863,
1.2345914840698242,
-1.62776517868042,
0.17854014039039612,
-0.4070366322994232,
2.1822643280029297,
0.24406249821186066,
1.3100109100341797,
-0.4679889678955078,
-2.3063459396362305,
0.5386805534362793,
-1.2651599645614624,
-1.3131242990493774,
0.7933472990989685,
-0.8434847593307495,
-0.033041927963495255,
-1.3385555744171143,
-0.20084303617477417,
-0.9999549984931946,
-1.2856935262680054,
0.853316068649292,
0.14843405783176422,
0.4132496416568756,
-0.6119949221611023,
0.3831479251384735,
-2.0600969791412354,
-1.4544798135757446,
-0.16653569042682648,
-0.9863121509552002,
0.42463433742523193,
-0.3106693625450134,
0.689368724822998,
-0.13322332501411438,
0.11944735795259476,
0.3469530940055847,
1.4641311168670654,
3.3632850646972656,
0.19375699758529663,
0.37314867973327637,
-0.19721835851669312,
-0.9195896983146667,
1.4162194728851318,
0.8906319737434387,
-0.029742974787950516,
-0.5488461256027222,
-1.055787205696106,
1.1688880920410156,
2.0125746726989746,
0.9858407378196716,
0.07652723789215088,
-0.745122492313385,
-0.5852484107017517,
-0.13544462621212006,
0.20217105746269226,
0.5848701596260071,
0.8618942499160767,
0.03805443271994591,
0.0064943451434373856,
1.2862604856491089,
1.1113402843475342,
-0.42971521615982056,
0.39974239468574524,
-0.7857588529586792,
-0.4520207643508911,
0.5715662837028503,
0.21580801904201508,
0.051173608750104904,
0.3359532356262207,
-1.0095947980880737,
-0.3621668815612793,
-0.38776257634162903,
-0.984771192073822,
-0.7520841956138611,
-0.4476085305213928,
-0.2476707547903061,
1.646519660949707,
0.08073118329048157,
-0.45465603470802307,
-0.0628923624753952,
-0.7193635106086731,
-0.10494919866323471,
-1.1139870882034302,
0.21403978765010834,
-0.19378243386745453,
-0.17785823345184326,
-0.03338644281029701,
1.6824963092803955,
-0.9433047771453857,
-2.124082326889038,
0.17133164405822754,
0.3210259974002838,
-0.45037028193473816,
0.3920280635356903,
1.5956590175628662,
0.48625311255455017,
1.38667631149292,
1.2908356189727783,
1.0394995212554932,
-0.7241958975791931,
-1.2485074996948242,
0.6209692358970642,
0.920669436454773,
-1.4818819761276245,
0.7641570568084717,
0.07468818873167038,
-0.5162963271141052,
0.6959572434425354,
1.270499587059021,
0.5629585981369019,
-1.9655860662460327,
0.7511913776397705,
-0.8092296719551086,
0.6442339420318604,
0.656720757484436,
0.734294056892395,
0.3077872097492218,
0.9216619729995728,
-1.2000404596328735,
-1.168742060661316,
-0.701288104057312,
-0.6483527421951294,
1.8909045457839966,
-0.3313688039779663,
0.5913844704627991,
-0.060560960322618484,
-1.1946065425872803,
-0.04842048138380051,
0.8386629223823547,
0.32040417194366455,
-0.4466942548751831,
0.8125112056732178,
-0.7221208810806274,
-1.0445053577423096,
-1.2971192598342896,
-0.45106178522109985,
-0.9551225900650024,
-0.9474551677703857,
1.0201947689056396,
0.8636287450790405,
0.41989412903785706,
1.947197675704956,
0.6641024351119995,
0.123631052672863,
-2.5419249534606934,
0.8449985980987549,
0.3997930884361267,
0.022353626787662506,
0.9715096950531006,
0.2888360023498535,
1.0844594240188599,
0.00761695671826601,
0.6385495662689209,
-2.330033779144287,
2.2401316165924072,
-0.2433544397354126,
0.6586281061172485,
-0.004318049643188715,
-0.32109034061431885,
1.0909994840621948,
0.4265238642692566,
0.5138691067695618,
-1.1048638820648193,
0.6033017039299011,
-0.6666631102561951,
1.2058213949203491,
0.8693646788597107,
-0.8871405124664307,
0.024832833558321,
1.2999094724655151,
0.4676780104637146,
-0.502457857131958,
-0.8897532820701599,
-0.8896364569664001,
0.9086244106292725,
1.646885633468628,
-0.05362629517912865,
0.032437995076179504,
0.9423288106918335,
0.6673691868782043,
-1.3647197484970093,
0.13930442929267883,
-0.7354580163955688,
-0.92061448097229,
1.6610832214355469,
1.9735456705093384,
-0.17883548140525818,
-0.25175127387046814,
-0.825054407119751,
-1.2048722505569458,
0.8522564768791199,
0.09040039032697678,
0.061600349843502045,
0.49237439036369324,
-0.7462515830993652,
1.0655097961425781,
0.8172305822372437,
1.016509771347046,
0.1399112194776535,
0.5083487629890442,
0.4332144856452942,
-0.38518574833869934,
-1.1717585325241089,
-0.22239451110363007,
-1.1688401699066162,
-2.631857395172119,
0.4893631637096405,
-0.2691129744052887,
-1.4307364225387573,
0.05317644774913788,
-0.9766772985458374,
0.8458431363105774,
-0.5739032030105591,
-1.1166235208511353,
-1.4860607385635376,
0.27048900723457336,
-0.08388333767652512,
0.9323737025260925,
-1.5783522129058838,
0.007890664972364902,
1.3025281429290771,
1.002729058265686,
-0.6648608446121216,
0.8926050066947937,
0.21299467980861664,
0.9913832545280457,
0.9764319658279419,
-0.4199071228504181,
0.586271345615387,
0.045096445828676224,
-1.3214720487594604,
0.4947057068347931,
1.1986883878707886,
0.2701151669025421,
1.6280611753463745,
-0.5233542323112488,
-0.059529948979616165,
0.3944167494773865,
-0.5279905796051025,
-0.5044359564781189,
-0.6250380873680115,
0.6304446458816528,
0.2027328461408615,
-0.9976176023483276,
0.07122189551591873,
-0.03409385681152344,
-0.17411388456821442,
0.24110741913318634,
-1.5120524168014526,
-0.2537359893321991,
-0.3925693929195404,
-0.46674367785453796,
-1.1996880769729614,
-0.06362137943506241,
1.2365185022354126,
-0.6394187808036804,
-0.19962184131145477,
0.4266517162322998,
0.5122228264808655,
0.5748388767242432,
0.5420666933059692,
-0.6503856182098389,
-0.5318958163261414,
-0.40226981043815613,
-0.3890133798122406,
0.36811140179634094,
1.1803277730941772,
-0.12186112254858017,
-1.0166553258895874,
0.7121275663375854,
-0.3482140600681305,
-0.0011201980523765087,
1.9114817380905151,
0.10483568906784058,
-0.690218985080719,
0.24133621156215668,
-0.658986508846283,
1.8406826257705688,
1.6636689901351929,
1.3591703176498413,
-0.25489675998687744,
-0.8953953981399536,
0.758264422416687,
-0.4459111988544464,
-0.4302152991294861,
0.9223390221595764,
0.48020315170288086,
-0.13044452667236328,
-1.3300508260726929,
0.6495227813720703,
1.3592464923858643,
-0.7783414721488953,
-0.8668988943099976,
0.09354293346405029,
-0.7255690693855286,
1.0520215034484863,
0.6573610901832581,
0.3369235098361969,
0.2573357820510864,
1.5906156301498413,
0.8509783148765564,
-0.4781683385372162,
0.6718718409538269,
0.4813641607761383,
-0.10948120057582855,
-2.1518375873565674,
-1.225242018699646,
0.3934783935546875,
-0.3660822808742523,
-1.5993592739105225,
1.3411508798599243,
-1.1708173751831055,
-1.0514247417449951,
0.5430694222450256,
0.07130371034145355,
1.376765251159668,
0.29370933771133423,
1.55539071559906,
2.1042323112487793,
0.8122450709342957,
0.3730359673500061,
1.322144865989685,
-0.0814003273844719,
-0.4681977331638336,
1.8252086639404297,
-0.4840865433216095,
0.4597533941268921,
1.0876154899597168,
-0.3593525290489197,
-1.1173385381698608,
-0.8785057067871094,
-1.3291990756988525,
-0.6261125802993774,
1.111625075340271,
0.13251207768917084,
-1.2301993370056152,
0.24447081983089447,
1.6868607997894287,
0.046990346163511276,
-0.3587246239185333,
0.6794207096099854,
0.4010961651802063,
-0.8015518188476562,
-0.011585928499698639,
-0.9985411167144775,
0.5266377925872803,
-0.09398066252470016,
-0.3272134065628052,
0.34569939970970154,
0.5718071460723877,
1.265535593032837,
0.012000375427305698,
0.03796109929680824,
1.2270442247390747,
-1.384286642074585,
1.4564448595046997,
-0.6252709627151489,
0.2323521375656128,
-2.52156400680542,
1.3458143472671509,
-0.7982189655303955,
1.9610226154327393,
-2.5240960121154785,
0.42135289311408997,
-0.547122597694397,
-0.30983516573905945,
0.4010109007358551,
-0.40003007650375366,
0.2194356620311737,
-0.2272253781557083,
-0.9076095223426819,
-0.1560131013393402,
-0.759422242641449,
0.6110191345214844,
1.0969793796539307,
1.3900257349014282,
-1.0956242084503174,
-0.17238092422485352,
-1.7531131505966187,
-0.07378494739532471,
-0.5383003950119019,
0.29510971903800964,
-2.1022799015045166,
-0.20943741500377655,
-2.0154919624328613,
-2.283299446105957,
-1.29669189453125,
-0.7453030943870544,
0.9743524789810181,
0.09961490333080292,
-0.8938044905662537,
1.116296648979187,
-0.3078508973121643,
-1.7860569953918457,
1.0123565196990967,
-2.0865840911865234
] |
https://github.com/huggingface/datasets/issues/5012 | Force JSON format regardless of file naming on S3 | Hi,
I want to make sure I understand this response. I have a set of files on S3 that are private for security reasons. Because they are not public files I cannot read those files (many are parquet) into my hf notebooks in Kaggle? That can't be correct, can it? | I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run
```python
dataset = load_dataset(
"json",
data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
)
```
It gives me
```
InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
```
However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming? | 513 | 50 | Force JSON format regardless of file naming on S3
I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run
```python
dataset = load_dataset(
"json",
data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
)
```
It gives me
```
InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
```
However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming?
Hi,
I want to make sure I understand this response. I have a set of files on S3 that are private for security reasons. Because they are not public files I cannot read those files (many are parquet) into my hf notebooks in Kaggle? That can't be correct, can it? | [
-1.1480594873428345,
-0.8443179130554199,
-0.8335782885551453,
1.4014124870300293,
-0.22609293460845947,
-1.1098272800445557,
0.22471532225608826,
-1.0779377222061157,
1.7414900064468384,
-0.7676782011985779,
0.37923476099967957,
-1.599247694015503,
0.04399460554122925,
-0.530978798866272,
-0.7059354782104492,
-0.9192172288894653,
-0.41110098361968994,
-0.93864506483078,
0.9984879493713379,
2.5988476276397705,
1.230973243713379,
-1.5134618282318115,
2.638932466506958,
0.6110888123512268,
-0.26793500781059265,
-0.9339842796325684,
0.43725869059562683,
0.06792910397052765,
-1.138582468032837,
-0.5303391814231873,
-0.9604789018630981,
-0.09785723686218262,
-0.5718930959701538,
-0.5328361988067627,
0.05999644100666046,
0.4025314450263977,
-0.3077092468738556,
-0.3771096169948578,
-0.5644508004188538,
-0.7897631525993347,
0.5350980162620544,
-0.3254859745502472,
1.0412700176239014,
-0.32048407196998596,
1.8523658514022827,
-0.47560563683509827,
0.2896837592124939,
0.727854311466217,
1.4008415937423706,
0.20243889093399048,
-0.039620064198970795,
0.2760935425758362,
0.27215999364852905,
-0.07789139449596405,
0.39894577860832214,
1.1898704767227173,
0.5136209726333618,
0.48316243290901184,
0.72490394115448,
-2.221652030944824,
1.234043836593628,
-1.1012938022613525,
0.34266772866249084,
1.2902499437332153,
-0.9425673484802246,
0.36510854959487915,
-1.79265558719635,
0.03446532040834427,
0.6111645102500916,
-2.253608226776123,
0.3100925087928772,
-1.2555468082427979,
-0.47062137722969055,
0.8699487447738647,
0.2120564579963684,
-1.296695351600647,
0.22423294186592102,
-0.5237528085708618,
1.1149579286575317,
0.4990575611591339,
1.1314678192138672,
-1.913771390914917,
0.0020002303645014763,
-0.35826534032821655,
0.2817591428756714,
-1.3480134010314941,
-1.5041277408599854,
0.5557170510292053,
0.567099928855896,
0.5594847202301025,
0.03803495317697525,
1.0472711324691772,
-1.0340640544891357,
0.8431857228279114,
-1.0517144203186035,
-1.464717149734497,
-1.3610674142837524,
-2.1491799354553223,
-2.3450658321380615,
0.7185884714126587,
-0.4749755859375,
-0.5107784271240234,
1.9865301847457886,
-0.9356680512428284,
-1.6850043535232544,
1.1503937244415283,
0.3261788487434387,
-0.11120743304491043,
2.29227614402771,
0.20894116163253784,
-0.7909297943115234,
0.4411701261997223,
-0.7585225105285645,
0.8673868179321289,
-0.4897204041481018,
1.4079959392547607,
0.5520234107971191,
-0.9395248889923096,
1.6830066442489624,
-0.44708701968193054,
0.6219817996025085,
-0.6548570990562439,
-0.5703126192092896,
-0.9252434968948364,
0.364481657743454,
1.9430934190750122,
-0.35915622115135193,
1.569299578666687,
-0.3416982591152191,
-1.6689472198486328,
-1.5722787380218506,
0.9820612668991089,
0.5020294189453125,
-0.8347916007041931,
0.25810691714286804,
-0.47517770528793335,
0.1562270224094391,
-0.08735653758049011,
1.051281213760376,
1.1884759664535522,
0.7732993364334106,
-0.142084002494812,
-0.9575662016868591,
0.22758415341377258,
-0.10081877559423447,
-0.7165412902832031,
-1.887445092201233,
-0.40827426314353943,
0.01563783921301365,
0.616524338722229,
-1.2890677452087402,
1.7610814571380615,
0.7737074494361877,
2.032991886138916,
0.9906287789344788,
-0.31811824440956116,
1.661087989807129,
0.04970579594373703,
1.81218683719635,
-0.4910050928592682,
0.6838677525520325,
-0.33755701780319214,
-1.151569128036499,
0.8633443713188171,
-0.38220131397247314,
-2.053593635559082,
-0.8475283980369568,
-0.7438961863517761,
-0.17828455567359924,
-0.7957485318183899,
0.8480445742607117,
-0.34096503257751465,
-1.5225170850753784,
0.3607606887817383,
-0.5126315355300903,
0.1927514672279358,
-1.1906118392944336,
0.44325417280197144,
0.7543489933013916,
-0.6384120583534241,
0.07744830846786499,
-0.25942686200141907,
-1.250518560409546,
-0.44141459465026855,
0.18646788597106934,
1.9540261030197144,
-0.7136217951774597,
0.9113730788230896,
0.9661017060279846,
-0.6652354001998901,
0.05727321654558182,
0.2708507478237152,
-0.2247450053691864,
0.8202540874481201,
-1.1946699619293213,
-0.33553609251976013,
1.1658241748809814,
-0.17358103394508362,
-0.562853991985321,
1.263588309288025,
0.7772443294525146,
-1.0549027919769287,
-0.145797997713089,
-0.3084288239479065,
-0.8567002415657043,
0.04939445108175278,
-1.5249630212783813,
-0.040065567940473557,
0.3354939818382263,
-1.4603805541992188,
-0.4619653820991516,
-0.195882648229599,
1.2830122709274292,
-0.2425687313079834,
1.4535895586013794,
-0.43366485834121704,
-0.23409423232078552,
-0.33352014422416687,
-0.3775660991668701,
0.2149983048439026,
-0.23361900448799133,
-0.7056095004081726,
0.1120619997382164,
-0.7209715843200684,
0.38237303495407104,
1.458754301071167,
0.3839060068130493,
-0.013958516530692577,
0.48516127467155457,
1.1938107013702393,
0.3220768868923187,
0.09744805842638016,
-0.8746655583381653,
-1.4237676858901978,
2.0022895336151123,
-1.4909820556640625,
1.969604253768921,
0.8355772495269775,
-0.006168267223984003,
-1.7273099422454834,
-1.8720250129699707,
1.3204728364944458,
1.298264980316162,
2.2237062454223633,
0.6633854508399963,
0.3918863534927368,
-0.7773787379264832,
-0.6424811482429504,
0.3452334403991699,
-1.138061285018921,
-0.7335465550422668,
0.13139498233795166,
2.3939592838287354,
1.7005549669265747,
-0.5850033164024353,
-0.3280749022960663,
-0.9350046515464783,
1.3510342836380005,
-0.17276570200920105,
0.14501038193702698,
1.9862333536148071,
-0.2695159316062927,
-1.2130420207977295,
1.2931338548660278,
-2.3271727561950684,
0.144661545753479,
1.9813940525054932,
0.3086321949958801,
0.1290585696697235,
-1.4995430707931519,
-0.7356244921684265,
-0.17768901586532593,
-0.42781996726989746,
-1.2552274465560913,
0.5171775221824646,
-0.36072731018066406,
-0.7604016661643982,
-1.5406091213226318,
0.20176857709884644,
-1.0959277153015137,
-1.6360461711883545,
0.2489948570728302,
1.9187958240509033,
1.9164541959762573,
-0.8024464845657349,
1.4948291778564453,
-0.3172168433666229,
0.18744617700576782,
1.3019987344741821,
1.1962347030639648,
3.065399646759033,
1.8155399560928345,
-1.2033480405807495,
0.5778857469558716,
-0.2090577483177185,
-0.529517650604248,
1.15151846408844,
-1.1742478609085083,
1.1515995264053345,
-0.1793757677078247,
-1.0535717010498047,
-1.234282374382019,
0.8529335856437683,
0.5549736618995667,
0.1347639262676239,
-0.4551321268081665,
1.2277178764343262,
0.06834892183542252,
1.2760982513427734,
0.5945741534233093,
-0.39445462822914124,
0.6215220093727112,
-0.4664422869682312,
-0.4376277029514313,
1.6753472089767456,
0.22675052285194397,
-1.3513394594192505,
-2.4092471599578857,
-0.22098314762115479,
-0.7882406711578369,
0.0671323910355568,
-0.5283699631690979,
-1.0588903427124023,
1.6856451034545898,
0.41613951325416565,
-1.2394081354141235,
-0.24116435647010803,
-0.2909257411956787,
-0.566264271736145,
2.633193254470825,
-1.3867409229278564,
-0.26633429527282715,
-0.9200838208198547,
-0.6044895648956299,
1.5586950778961182,
-1.1810331344604492,
-0.2006377875804901,
-0.9908921122550964,
-0.5669870376586914,
-1.3485921621322632,
-0.6252526044845581,
-0.12532269954681396,
-0.8045763969421387,
0.7445936799049377,
0.30734243988990784,
-1.182659387588501,
-0.33944258093833923,
-0.8464314937591553,
0.8539189100265503,
-0.018511667847633362,
0.37113240361213684,
1.880429983139038,
0.5078037977218628,
-0.48244136571884155,
0.7583706378936768,
1.1920132637023926,
0.623538076877594,
-0.7113434672355652,
0.10399699211120605,
-0.7388206124305725,
0.2012937366962433,
-1.3632644414901733,
0.38541677594184875,
-2.939539670944214,
0.7835707068443298,
-0.05978940427303314,
-0.15541979670524597,
-0.0335436686873436,
-1.2765041589736938,
1.0294188261032104,
2.6971869468688965,
-1.1364749670028687,
0.42017096281051636,
0.34417101740837097,
1.282609462738037,
-1.6599148511886597,
0.23365208506584167,
-0.37842145562171936,
2.239349842071533,
0.24845901131629944,
1.32182776927948,
-0.4898408353328705,
-2.3096628189086914,
0.5301147699356079,
-1.302612543106079,
-1.3230798244476318,
0.7848656177520752,
-0.884364664554596,
-0.062272343784570694,
-1.4004143476486206,
-0.23077529668807983,
-0.9244319200515747,
-1.2706321477890015,
0.8043457269668579,
0.14124035835266113,
0.43430379033088684,
-0.630275547504425,
0.41725167632102966,
-2.1141319274902344,
-1.4283149242401123,
-0.17286768555641174,
-0.9568148851394653,
0.4247882664203644,
-0.2980581223964691,
0.7153951525688171,
-0.1429726779460907,
0.13435712456703186,
0.3755927085876465,
1.494821310043335,
3.392721652984619,
0.20054379105567932,
0.3933391571044922,
-0.19606778025627136,
-0.8807629346847534,
1.4047743082046509,
0.8933051228523254,
-0.07171247899532318,
-0.5941760540008545,
-1.0651044845581055,
1.2418261766433716,
1.9952627420425415,
1.0023683309555054,
0.04954460263252258,
-0.6736738085746765,
-0.5491555333137512,
-0.19371327757835388,
0.18017491698265076,
0.5572680830955505,
0.8620831370353699,
-0.0009823166765272617,
0.03330584987998009,
1.3075822591781616,
1.144473671913147,
-0.500292181968689,
0.43752390146255493,
-0.8075050115585327,
-0.45477157831192017,
0.5114408135414124,
0.23385179042816162,
0.017161056399345398,
0.358048677444458,
-1.0036131143569946,
-0.3430144190788269,
-0.4059327244758606,
-0.9836578965187073,
-0.7302907109260559,
-0.46068936586380005,
-0.2453671395778656,
1.6644573211669922,
0.15020763874053955,
-0.47525134682655334,
-0.06848631054162979,
-0.7343009114265442,
-0.12017648667097092,
-1.1395817995071411,
0.161080002784729,
-0.18168088793754578,
-0.15729400515556335,
-0.04656563699245453,
1.754599690437317,
-0.8998339772224426,
-2.1210758686065674,
0.16837811470031738,
0.31452345848083496,
-0.3984525799751282,
0.3348095715045929,
1.6092698574066162,
0.44888362288475037,
1.4073561429977417,
1.254138708114624,
1.022426962852478,
-0.7063480615615845,
-1.219763159751892,
0.680216372013092,
0.9185298085212708,
-1.4414137601852417,
0.7464197278022766,
0.07765389233827591,
-0.49856993556022644,
0.6790882349014282,
1.2418771982192993,
0.5540339946746826,
-1.9300034046173096,
0.7751654982566833,
-0.8522746562957764,
0.64900803565979,
0.6344774961471558,
0.701445996761322,
0.32324638962745667,
0.9265035390853882,
-1.2225455045700073,
-1.142391324043274,
-0.7332167625427246,
-0.6488361358642578,
1.9371925592422485,
-0.2878546416759491,
0.5625154376029968,
-0.035550788044929504,
-1.1920284032821655,
-0.08473310619592667,
0.7649716138839722,
0.3118548095226288,
-0.36291345953941345,
0.8108030557632446,
-0.7294767498970032,
-1.0882678031921387,
-1.3472782373428345,
-0.3891732394695282,
-0.9808645248413086,
-0.9513964653015137,
1.0482310056686401,
0.821768045425415,
0.3974904716014862,
1.9517654180526733,
0.6728530526161194,
0.11936285346746445,
-2.558964729309082,
0.8538994789123535,
0.40989214181900024,
-0.043031394481658936,
0.9471191763877869,
0.27418237924575806,
1.0868364572525024,
0.021208954975008965,
0.5992161631584167,
-2.3310301303863525,
2.2102975845336914,
-0.23867347836494446,
0.7140607237815857,
-0.0076782372780144215,
-0.26973772048950195,
1.1288747787475586,
0.46548014879226685,
0.48474976420402527,
-1.1260992288589478,
0.5982640385627747,
-0.6408217549324036,
1.1728326082229614,
0.9286534786224365,
-0.881787121295929,
0.004908108152449131,
1.2526335716247559,
0.4635094106197357,
-0.49922841787338257,
-0.8993715047836304,
-0.8514276146888733,
0.9009867310523987,
1.6842013597488403,
-0.0906815454363823,
0.036094579845666885,
0.8509832620620728,
0.6780633330345154,
-1.366930365562439,
0.09574562311172485,
-0.7390202879905701,
-0.9536251425743103,
1.6828739643096924,
2.0155231952667236,
-0.1641952395439148,
-0.251908540725708,
-0.7931085228919983,
-1.2661494016647339,
0.8616527915000916,
0.05683423578739166,
0.12189636379480362,
0.49675503373146057,
-0.7814701199531555,
1.0487115383148193,
0.8672467470169067,
0.9808371663093567,
0.1507175862789154,
0.4358287453651428,
0.4421732425689697,
-0.3215670883655548,
-1.1221153736114502,
-0.24718260765075684,
-1.2164760828018188,
-2.6264820098876953,
0.47265753149986267,
-0.28286755084991455,
-1.4111632108688354,
0.02957627922296524,
-0.9821006059646606,
0.9009867310523987,
-0.5550704598426819,
-1.0711783170700073,
-1.533609390258789,
0.28181561827659607,
-0.0753994956612587,
0.9365261793136597,
-1.6017669439315796,
-0.025666888803243637,
1.2300912141799927,
0.9998800754547119,
-0.6299620866775513,
0.9338082075119019,
0.19125032424926758,
0.9296374320983887,
0.9155311584472656,
-0.46474626660346985,
0.5731260776519775,
0.08329202979803085,
-1.3479162454605103,
0.5067177414894104,
1.2099826335906982,
0.21989008784294128,
1.595396876335144,
-0.5122395157814026,
-0.03878287225961685,
0.39724093675613403,
-0.5242986679077148,
-0.4907473027706146,
-0.542332112789154,
0.6541993618011475,
0.15306159853935242,
-1.0011489391326904,
0.037498846650123596,
-0.06849294900894165,
-0.23558318614959717,
0.24239510297775269,
-1.5044869184494019,
-0.25879302620887756,
-0.41634315252304077,
-0.4493646025657654,
-1.2516499757766724,
-0.047384925186634064,
1.3198413848876953,
-0.6755540370941162,
-0.17674559354782104,
0.45838597416877747,
0.5900936722755432,
0.5595942735671997,
0.6147006154060364,
-0.6622136235237122,
-0.5142574310302734,
-0.36881566047668457,
-0.3851279616355896,
0.3108959197998047,
1.188517689704895,
-0.1277732253074646,
-1.0095419883728027,
0.6737653017044067,
-0.28873229026794434,
0.0040494529530406,
1.891958236694336,
0.15736597776412964,
-0.6723979711532593,
0.24274414777755737,
-0.7186716198921204,
1.892417550086975,
1.690330147743225,
1.338983178138733,
-0.22462844848632812,
-0.8819778561592102,
0.7372375726699829,
-0.40142956376075745,
-0.4054064452648163,
0.9188392758369446,
0.49237146973609924,
-0.13321128487586975,
-1.3745017051696777,
0.6604301929473877,
1.36219322681427,
-0.8220370411872864,
-0.834199845790863,
0.039305415004491806,
-0.7710900902748108,
1.062292456626892,
0.6350296139717102,
0.43265300989151,
0.27696332335472107,
1.6065363883972168,
0.8521692752838135,
-0.5248852372169495,
0.6496366858482361,
0.47270211577415466,
-0.08563727885484695,
-2.169969081878662,
-1.2097710371017456,
0.3944983184337616,
-0.39660030603408813,
-1.5537399053573608,
1.3603570461273193,
-1.0976471900939941,
-1.0312480926513672,
0.5720990896224976,
0.03308282420039177,
1.3191604614257812,
0.2999824583530426,
1.5552566051483154,
2.1148595809936523,
0.82316654920578,
0.3396541178226471,
1.2746037244796753,
-0.11602839827537537,
-0.47262781858444214,
1.85048508644104,
-0.4368918836116791,
0.4636160731315613,
1.119020938873291,
-0.39912447333335876,
-1.111938238143921,
-0.8584133386611938,
-1.2580713033676147,
-0.6341619491577148,
1.078236699104309,
0.15719428658485413,
-1.2099796533584595,
0.21557942032814026,
1.718155860900879,
0.04421016573905945,
-0.37185966968536377,
0.6626591086387634,
0.4171423017978668,
-0.784070611000061,
-0.009011097252368927,
-1.0357171297073364,
0.5424954891204834,
-0.18281430006027222,
-0.3711065351963043,
0.3445074260234833,
0.5552945733070374,
1.2469216585159302,
-0.031742773950099945,
0.006735165603458881,
1.226068139076233,
-1.4318612813949585,
1.4114874601364136,
-0.6287201642990112,
0.23286816477775574,
-2.4541525840759277,
1.3706222772598267,
-0.778706431388855,
2.012848138809204,
-2.538532257080078,
0.427631139755249,
-0.5847119092941284,
-0.3456422686576843,
0.3898647427558899,
-0.4057001769542694,
0.25960463285446167,
-0.17659509181976318,
-0.9284729957580566,
-0.17779973149299622,
-0.7102247476577759,
0.6026901602745056,
1.060276985168457,
1.3772857189178467,
-1.0577763319015503,
-0.21699419617652893,
-1.6907413005828857,
-0.09479748457670212,
-0.521844744682312,
0.24280589818954468,
-2.129246234893799,
-0.2324722707271576,
-1.9940084218978882,
-2.225990056991577,
-1.3645143508911133,
-0.7565525770187378,
1.0019665956497192,
0.11077385395765305,
-0.8696346282958984,
1.1496293544769287,
-0.3017202317714691,
-1.79445219039917,
1.0392693281173706,
-2.1158998012542725
] |
https://github.com/huggingface/datasets/issues/5012 | Force JSON format regardless of file naming on S3 | Hi ! There is a discussion at https://github.com/huggingface/datasets/issues/5281
Using the latest `datasets` 2.11 you can try passing fsspec URLs to private buckets to `data_files` in `load_dataset()`. Though this is still experimental and undocumented, so feedback is welcome. You may not have the best experience though, since anything related to performance and caching hasn't been tested properly yet. | I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run
```python
dataset = load_dataset(
"json",
data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
)
```
It gives me
```
InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
```
However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming? | 513 | 57 | Force JSON format regardless of file naming on S3
I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run
```python
dataset = load_dataset(
"json",
data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
)
```
It gives me
```
InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2'
```
However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming?
Hi ! There is a discussion at https://github.com/huggingface/datasets/issues/5281
Using the latest `datasets` 2.11 you can try passing fsspec URLs to private buckets to `data_files` in `load_dataset()`. Though this is still experimental and undocumented, so feedback is welcome. You may not have the best experience though, since anything related to performance and caching hasn't been tested properly yet. | [
-1.1584593057632446,
-0.8250495195388794,
-0.8118614554405212,
1.4601250886917114,
-0.15638509392738342,
-1.108789324760437,
0.17470455169677734,
-1.0591611862182617,
1.748344898223877,
-0.7666803002357483,
0.37488269805908203,
-1.5903080701828003,
-0.039362698793411255,
-0.561504065990448,
-0.6895037293434143,
-0.9105870127677917,
-0.4122132360935211,
-0.8821123838424683,
0.9345333576202393,
2.5988409519195557,
1.2081243991851807,
-1.506246566772461,
2.632725715637207,
0.6490647196769714,
-0.2622252404689789,
-0.939486563205719,
0.4292446970939636,
0.03875376656651497,
-1.1161895990371704,
-0.5357896685600281,
-0.9213911294937134,
-0.08207423239946365,
-0.561160147190094,
-0.5779513120651245,
0.048049405217170715,
0.4228046238422394,
-0.34520626068115234,
-0.36992576718330383,
-0.5567059516906738,
-0.832953691482544,
0.5046986937522888,
-0.35288006067276,
1.0014065504074097,
-0.2951444685459137,
1.8347259759902954,
-0.4755665957927704,
0.3094402551651001,
0.7298851609230042,
1.3550307750701904,
0.1672956645488739,
-0.003947756718844175,
0.30765801668167114,
0.26186758279800415,
-0.04774381220340729,
0.4474509358406067,
1.1823948621749878,
0.5537336468696594,
0.47339630126953125,
0.7157235741615295,
-2.248736619949341,
1.2497339248657227,
-1.0872387886047363,
0.3369258940219879,
1.2625714540481567,
-0.9550821781158447,
0.34932267665863037,
-1.8296568393707275,
0.009480394423007965,
0.5881281495094299,
-2.249305486679077,
0.29230549931526184,
-1.2364239692687988,
-0.4001082479953766,
0.9169180989265442,
0.2163502275943756,
-1.2860420942306519,
0.22184178233146667,
-0.4768454134464264,
1.1165887117385864,
0.468302458524704,
1.1431431770324707,
-1.8912866115570068,
-0.013708136044442654,
-0.3302525579929352,
0.26503992080688477,
-1.33095383644104,
-1.5725733041763306,
0.4999140501022339,
0.5632893443107605,
0.6119060516357422,
0.022759348154067993,
1.076635479927063,
-0.9704107642173767,
0.8225769400596619,
-1.0965932607650757,
-1.5376455783843994,
-1.3687171936035156,
-2.156297445297241,
-2.3787450790405273,
0.7120451927185059,
-0.5070546269416809,
-0.5043877363204956,
1.9458367824554443,
-0.918834388256073,
-1.7436420917510986,
1.0804378986358643,
0.39747822284698486,
-0.07723431289196014,
2.280057430267334,
0.2300688624382019,
-0.8019616007804871,
0.39283889532089233,
-0.7110158205032349,
0.8576908707618713,
-0.39091697335243225,
1.3539975881576538,
0.5958188772201538,
-0.9843863844871521,
1.6945862770080566,
-0.42793363332748413,
0.6224708557128906,
-0.7042457461357117,
-0.5592690110206604,
-0.8735793232917786,
0.34912723302841187,
1.9208523035049438,
-0.40474021434783936,
1.5725691318511963,
-0.3773728311061859,
-1.629698395729065,
-1.5583381652832031,
0.9435243606567383,
0.4841543138027191,
-0.7924374938011169,
0.2000454068183899,
-0.4361189603805542,
0.11876539140939713,
-0.08990082889795303,
1.0577878952026367,
1.2119865417480469,
0.7435611486434937,
-0.20571407675743103,
-0.9618147015571594,
0.2211625874042511,
-0.07711680978536606,
-0.6964349150657654,
-1.8645910024642944,
-0.39037153124809265,
0.10690662264823914,
0.592547595500946,
-1.2398779392242432,
1.7372488975524902,
0.7943875193595886,
1.997546672821045,
0.9974033832550049,
-0.3381473422050476,
1.6363439559936523,
0.02108580246567726,
1.8584702014923096,
-0.4556681215763092,
0.6540209650993347,
-0.323095440864563,
-1.1677370071411133,
0.8911477327346802,
-0.3501029312610626,
-2.0712168216705322,
-0.8171387910842896,
-0.7347916960716248,
-0.17954912781715393,
-0.7411077618598938,
0.8154035210609436,
-0.31044042110443115,
-1.5416860580444336,
0.3245042860507965,
-0.5445424914360046,
0.19785040616989136,
-1.1966129541397095,
0.3805712163448334,
0.7783691883087158,
-0.6691182851791382,
0.06510831415653229,
-0.26708975434303284,
-1.2814526557922363,
-0.4711918830871582,
0.23442256450653076,
1.9779493808746338,
-0.6950196623802185,
0.8859769105911255,
1.007238507270813,
-0.701973021030426,
0.0677991509437561,
0.22699204087257385,
-0.24688661098480225,
0.8128551244735718,
-1.203187346458435,
-0.3531254529953003,
1.171521782875061,
-0.1364305019378662,
-0.6587564945220947,
1.2931770086288452,
0.7732841372489929,
-1.049238681793213,
-0.14940589666366577,
-0.2680979371070862,
-0.8538584113121033,
0.040495775640010834,
-1.5521583557128906,
-0.10337125509977341,
0.3104032874107361,
-1.4389957189559937,
-0.4605276882648468,
-0.24706345796585083,
1.334193468093872,
-0.24098286032676697,
1.4330328702926636,
-0.3829551041126251,
-0.25240957736968994,
-0.37999865412712097,
-0.3782244324684143,
0.1667589545249939,
-0.2435699701309204,
-0.6957830190658569,
0.14362338185310364,
-0.7535845041275024,
0.3708522915840149,
1.4513715505599976,
0.36486247181892395,
-0.004368707071989775,
0.49675923585891724,
1.2091141939163208,
0.29927733540534973,
0.08036169409751892,
-0.8770433068275452,
-1.4462974071502686,
1.9972202777862549,
-1.4262726306915283,
1.9277764558792114,
0.8020248413085938,
-0.007148686796426773,
-1.7746000289916992,
-1.8479022979736328,
1.3989248275756836,
1.2298153638839722,
2.2509169578552246,
0.660843551158905,
0.3952257037162781,
-0.7872587442398071,
-0.6427508592605591,
0.31556451320648193,
-1.080310583114624,
-0.7426096200942993,
0.1432599425315857,
2.4395089149475098,
1.696980595588684,
-0.5408986210823059,
-0.2866671681404114,
-0.9496018290519714,
1.3579634428024292,
-0.18512439727783203,
0.15752127766609192,
2.021501302719116,
-0.24475839734077454,
-1.1765354871749878,
1.346494436264038,
-2.3531510829925537,
0.15462183952331543,
2.00488543510437,
0.28931400179862976,
0.09719742834568024,
-1.4469311237335205,
-0.7449988722801208,
-0.17186298966407776,
-0.4631975293159485,
-1.284908652305603,
0.4858064651489258,
-0.29385754466056824,
-0.7917829155921936,
-1.5493558645248413,
0.16729813814163208,
-1.1070849895477295,
-1.6604057550430298,
0.2595001757144928,
1.9251238107681274,
1.9130903482437134,
-0.7503259778022766,
1.5355781316757202,
-0.2836810052394867,
0.16818907856941223,
1.2834910154342651,
1.239065170288086,
3.104667901992798,
1.8280154466629028,
-1.2476097345352173,
0.611474335193634,
-0.1857742965221405,
-0.5312356948852539,
1.171346664428711,
-1.2027873992919922,
1.178749680519104,
-0.24197250604629517,
-1.0905544757843018,
-1.2850861549377441,
0.8863941431045532,
0.5937256813049316,
0.12341286987066269,
-0.4867441952228546,
1.2308907508850098,
0.07209358364343643,
1.2563490867614746,
0.5656071901321411,
-0.41759300231933594,
0.6454864144325256,
-0.4318177103996277,
-0.4911785125732422,
1.6811147928237915,
0.21801409125328064,
-1.3312314748764038,
-2.38901424407959,
-0.232662171125412,
-0.8291857838630676,
-0.018852753564715385,
-0.5631770491600037,
-1.0273041725158691,
1.702483057975769,
0.4018573760986328,
-1.2231433391571045,
-0.2854304611682892,
-0.3111369013786316,
-0.5604309439659119,
2.6486265659332275,
-1.3429439067840576,
-0.20254617929458618,
-0.9665873646736145,
-0.5838550329208374,
1.568472146987915,
-1.1509156227111816,
-0.2383682131767273,
-1.0276269912719727,
-0.5980150103569031,
-1.3255479335784912,
-0.6206067800521851,
-0.09663855284452438,
-0.8348153829574585,
0.7475410103797913,
0.275179386138916,
-1.1765103340148926,
-0.29926514625549316,
-0.8446372747421265,
0.8997700810432434,
-0.07319168001413345,
0.29300934076309204,
1.8800504207611084,
0.5125569105148315,
-0.42940494418144226,
0.7929489612579346,
1.1891145706176758,
0.6108841300010681,
-0.6971401572227478,
0.1304396390914917,
-0.7084437608718872,
0.16237697005271912,
-1.3705705404281616,
0.3164205551147461,
-2.9596776962280273,
0.7528849244117737,
-0.081028051674366,
-0.10002712905406952,
-0.00721028121188283,
-1.24591064453125,
1.0666172504425049,
2.7277138233184814,
-1.1961067914962769,
0.43939539790153503,
0.39211881160736084,
1.2159068584442139,
-1.6430152654647827,
0.20598286390304565,
-0.4007778465747833,
2.215357542037964,
0.2115461528301239,
1.2923585176467896,
-0.4968416392803192,
-2.297452449798584,
0.5111239552497864,
-1.268212914466858,
-1.3047361373901367,
0.8035081028938293,
-0.8938198089599609,
0.012647479772567749,
-1.4076910018920898,
-0.18852448463439941,
-0.9454753398895264,
-1.2788991928100586,
0.8067435026168823,
0.11263194680213928,
0.444396048784256,
-0.5671694874763489,
0.39293983578681946,
-2.089840888977051,
-1.441233515739441,
-0.16814681887626648,
-0.9891355037689209,
0.4511386454105377,
-0.3255172669887543,
0.6747035384178162,
-0.11786198616027832,
0.09597904235124588,
0.33456921577453613,
1.427506923675537,
3.3311471939086914,
0.19280019402503967,
0.365631103515625,
-0.1626325249671936,
-0.9184675812721252,
1.393839716911316,
0.8842607140541077,
-0.07564016431570053,
-0.5498217940330505,
-1.063495397567749,
1.2139099836349487,
2.023402214050293,
1.034591794013977,
0.03538314253091812,
-0.742098867893219,
-0.5978202223777771,
-0.09008621424436569,
0.20575159788131714,
0.5556931495666504,
0.8661893010139465,
0.016190312802791595,
0.02790689468383789,
1.2815419435501099,
1.1844428777694702,
-0.40712645649909973,
0.4054114520549774,
-0.8096274137496948,
-0.39813899993896484,
0.5300127267837524,
0.17477867007255554,
0.06945528090000153,
0.39072385430336,
-1.0275951623916626,
-0.33203431963920593,
-0.39674362540245056,
-0.9285022616386414,
-0.7479514479637146,
-0.48525187373161316,
-0.26107919216156006,
1.670879602432251,
0.09498549997806549,
-0.4670708477497101,
-0.05439968779683113,
-0.746329128742218,
-0.10597091913223267,
-1.0836296081542969,
0.24214431643486023,
-0.17744848132133484,
-0.1272156685590744,
-0.07426464557647705,
1.6901345252990723,
-0.9662290215492249,
-2.127284049987793,
0.18258917331695557,
0.3393208980560303,
-0.41872286796569824,
0.32858726382255554,
1.647402048110962,
0.48674270510673523,
1.401252269744873,
1.2803447246551514,
1.0257242918014526,
-0.6914532780647278,
-1.1967549324035645,
0.6360002756118774,
0.9725109934806824,
-1.3739712238311768,
0.7601620554924011,
0.029912926256656647,
-0.4918934404850006,
0.7163421511650085,
1.2875852584838867,
0.4959467053413391,
-1.9689269065856934,
0.7762967348098755,
-0.8336496949195862,
0.6832806468009949,
0.6114246845245361,
0.7184025645256042,
0.19978952407836914,
0.8924122452735901,
-1.2132574319839478,
-1.1681811809539795,
-0.7200704216957092,
-0.6489138603210449,
1.9627028703689575,
-0.27224665880203247,
0.5599880218505859,
-0.05039731785655022,
-1.2389633655548096,
-0.07008825242519379,
0.8136024475097656,
0.33341559767723083,
-0.46571192145347595,
0.8435858488082886,
-0.689706563949585,
-1.048946738243103,
-1.3665069341659546,
-0.4113568663597107,
-1.0024020671844482,
-0.9179090857505798,
1.0199917554855347,
0.8277351260185242,
0.4011572599411011,
1.9444726705551147,
0.6733781695365906,
0.18203261494636536,
-2.586869716644287,
0.8722916841506958,
0.4031848609447479,
-0.028182081878185272,
0.9832795858383179,
0.2779468595981598,
1.0603915452957153,
0.022201664745807648,
0.6397963166236877,
-2.3276264667510986,
2.231656312942505,
-0.1973969042301178,
0.698934018611908,
0.023351218551397324,
-0.276334285736084,
1.0422106981277466,
0.4196898639202118,
0.5126314759254456,
-1.1859867572784424,
0.6167541146278381,
-0.6198632121086121,
1.145480751991272,
0.8958693146705627,
-0.894743025302887,
-0.000565502792596817,
1.341355800628662,
0.43423062562942505,
-0.4654569923877716,
-0.9020145535469055,
-0.885432779788971,
0.9435830116271973,
1.6904797554016113,
-0.06910678744316101,
0.016962256282567978,
0.8926706910133362,
0.6744223237037659,
-1.3718186616897583,
0.1079125925898552,
-0.7181408405303955,
-0.8888537287712097,
1.6761538982391357,
1.9780336618423462,
-0.15549883246421814,
-0.25846245884895325,
-0.8174622654914856,
-1.2229574918746948,
0.8180476427078247,
0.06690110266208649,
0.12066251784563065,
0.5199541449546814,
-0.7440580725669861,
1.1133012771606445,
0.8254047632217407,
0.9550109505653381,
0.10377505421638489,
0.46099957823753357,
0.4531538188457489,
-0.33680275082588196,
-1.1455042362213135,
-0.2606829106807709,
-1.1382237672805786,
-2.607598304748535,
0.44738325476646423,
-0.23545190691947937,
-1.4320122003555298,
0.0008612647652626038,
-0.9524358510971069,
0.9089480042457581,
-0.5787040591239929,
-1.0964841842651367,
-1.491540789604187,
0.28840354084968567,
-0.09012560546398163,
0.9154899716377258,
-1.6091850996017456,
-0.00893361959606409,
1.3132985830307007,
0.9581486582756042,
-0.6747321486473083,
0.9525606632232666,
0.24216222763061523,
0.9678959250450134,
0.9365659952163696,
-0.4544617235660553,
0.5956990122795105,
0.08322340250015259,
-1.3377609252929688,
0.4709364175796509,
1.215205192565918,
0.26704898476600647,
1.5683987140655518,
-0.5490120649337769,
-0.0626613199710846,
0.3910244107246399,
-0.5472750663757324,
-0.519993007183075,
-0.5879762768745422,
0.6499930620193481,
0.14284509420394897,
-1.0459073781967163,
0.06146668642759323,
-0.05334265157580376,
-0.1843084692955017,
0.21015805006027222,
-1.4872338771820068,
-0.2632269561290741,
-0.3980026841163635,
-0.44283613562583923,
-1.2199053764343262,
-0.05234355852007866,
1.2694543600082397,
-0.6959320902824402,
-0.19357693195343018,
0.4461055397987366,
0.5214272737503052,
0.558502197265625,
0.5895144939422607,
-0.6442244052886963,
-0.48501747846603394,
-0.3751329481601715,
-0.3719457983970642,
0.3549862802028656,
1.206384301185608,
-0.12540313601493835,
-0.9909722208976746,
0.7248596549034119,
-0.364693284034729,
0.05732448399066925,
1.9173047542572021,
0.1298408806324005,
-0.7002738118171692,
0.2906217873096466,
-0.7110812067985535,
1.8499748706817627,
1.700609564781189,
1.3649921417236328,
-0.19897231459617615,
-0.9370394945144653,
0.7326085567474365,
-0.44317296147346497,
-0.3910592794418335,
0.9665989875793457,
0.4749992787837982,
-0.1415315866470337,
-1.3628112077713013,
0.6239681243896484,
1.3512117862701416,
-0.8161478042602539,
-0.8329228758811951,
0.06163950264453888,
-0.7746752500534058,
1.0258067846298218,
0.6822060346603394,
0.3566848337650299,
0.22751954197883606,
1.5909852981567383,
0.8362596035003662,
-0.47139471769332886,
0.6427121162414551,
0.4788728952407837,
-0.14407923817634583,
-2.1072566509246826,
-1.167494297027588,
0.374532014131546,
-0.39885982871055603,
-1.5777971744537354,
1.3566123247146606,
-1.1373075246810913,
-1.0307432413101196,
0.5095072984695435,
0.04484063759446144,
1.3831533193588257,
0.3406819999217987,
1.5704432725906372,
2.1209356784820557,
0.8047615885734558,
0.3297593593597412,
1.281315803527832,
-0.1198822408914566,
-0.4495827257633209,
1.8595455884933472,
-0.4546022415161133,
0.4449847638607025,
1.0751521587371826,
-0.3586534261703491,
-1.0931727886199951,
-0.853251039981842,
-1.3165078163146973,
-0.6536963582038879,
1.1115241050720215,
0.10766201466321945,
-1.197812557220459,
0.23181447386741638,
1.708740472793579,
0.05204218253493309,
-0.35167640447616577,
0.6752055287361145,
0.4407021105289459,
-0.8301820755004883,
-0.04073788970708847,
-0.9780784845352173,
0.5060634016990662,
-0.11402541399002075,
-0.30752032995224,
0.3259984850883484,
0.5377731919288635,
1.267054557800293,
0.022086262702941895,
0.032262612134218216,
1.1711477041244507,
-1.3942440748214722,
1.4760160446166992,
-0.6451005935668945,
0.2587572932243347,
-2.4591164588928223,
1.3521231412887573,
-0.7917263507843018,
1.9599212408065796,
-2.5218393802642822,
0.45780739188194275,
-0.5481973886489868,
-0.33198636770248413,
0.39056870341300964,
-0.38035848736763,
0.22537869215011597,
-0.17873793840408325,
-0.9397808909416199,
-0.18421632051467896,
-0.684985339641571,
0.5974206924438477,
1.0981190204620361,
1.3586429357528687,
-1.1012622117996216,
-0.2442285120487213,
-1.7499442100524902,
-0.09887842833995819,
-0.5358761548995972,
0.2844291627407074,
-2.0511560440063477,
-0.23457685112953186,
-1.9684172868728638,
-2.3199265003204346,
-1.2991392612457275,
-0.7439407706260681,
1.0412156581878662,
0.11255495250225067,
-0.9319347739219666,
1.1547274589538574,
-0.32430166006088257,
-1.8050543069839478,
1.075068473815918,
-2.0836801528930664
] |
https://github.com/huggingface/datasets/issues/5009 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly | I think this is because some columns are mostly empty lists. In particular the train and validation splits only have empty lists for `val_ann`. Therefore the type inference doesn't know which type is inside (or it would have to scan the other splits first before knowing).
You can fix that by specifying the features types explicitly.
Then you can save the feature types inside the dataset repository, so that you won't need to specify the features in subsequent calls:
```python
from datasets import load_dataset, Features, Sequence, Value
from datasets.info import DatasetInfosDict
features = Features({
'narrative': Value('string'),
'question': Value('string'),
'original_sentence_for_question': Value('string'),
'narrative_lexical_overlap': Value('float64'),
'is_ques_answerable': Value('string'),
'answer': Value('string'),
'is_ques_answerable_annotator': Value('string'),
'original_narrative_form': Sequence(Value('string')),
'question_meta': Value('string'),
'helpful_sentences': Sequence(Value('int64')),
'human_eval': Value('bool'),
'val_ann': Sequence(Value('int64')),
'gram_ann': Sequence(Value('int64'))
})
ds = load_dataset('StonyBrookNLP/tellmewhy', features=features)
DatasetInfosDict({"default": ds["train"].info}).write_to_directory("path/to/local/tellmewhy")
```
and then after pushing the change to the dataset repository on the Hub, `load_dataset("StonyBrookNLP/tellmewhy")` will work directly` | ## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 515 | 145 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
I think this is because some columns are mostly empty lists. In particular the train and validation splits only have empty lists for `val_ann`. Therefore the type inference doesn't know which type is inside (or it would have to scan the other splits first before knowing).
You can fix that by specifying the features types explicitly.
Then you can save the feature types inside the dataset repository, so that you won't need to specify the features in subsequent calls:
```python
from datasets import load_dataset, Features, Sequence, Value
from datasets.info import DatasetInfosDict
features = Features({
'narrative': Value('string'),
'question': Value('string'),
'original_sentence_for_question': Value('string'),
'narrative_lexical_overlap': Value('float64'),
'is_ques_answerable': Value('string'),
'answer': Value('string'),
'is_ques_answerable_annotator': Value('string'),
'original_narrative_form': Sequence(Value('string')),
'question_meta': Value('string'),
'helpful_sentences': Sequence(Value('int64')),
'human_eval': Value('bool'),
'val_ann': Sequence(Value('int64')),
'gram_ann': Sequence(Value('int64'))
})
ds = load_dataset('StonyBrookNLP/tellmewhy', features=features)
DatasetInfosDict({"default": ds["train"].info}).write_to_directory("path/to/local/tellmewhy")
```
and then after pushing the change to the dataset repository on the Hub, `load_dataset("StonyBrookNLP/tellmewhy")` will work directly` | [
-1.1767548322677612,
-0.9491956830024719,
-0.8158513903617859,
1.3935505151748657,
-0.07760877162218094,
-1.2096201181411743,
0.14519676566123962,
-1.101981520652771,
1.625927209854126,
-0.7225667834281921,
0.2835047245025635,
-1.7219820022583008,
-0.06851905584335327,
-0.6020216941833496,
-0.7026883959770203,
-0.9104107618331909,
-0.3298652768135071,
-0.8423004150390625,
0.9767367243766785,
2.493403196334839,
1.225740909576416,
-1.2641856670379639,
2.7374987602233887,
0.7038471698760986,
-0.280811607837677,
-0.9609861373901367,
0.5246084928512573,
-0.051943693310022354,
-1.3116977214813232,
-0.4307197332382202,
-0.987808883190155,
-0.00018073339015245438,
-0.5740779638290405,
-0.5059898495674133,
0.16210471093654633,
0.3886721730232239,
-0.3499446511268616,
-0.339586466550827,
-0.5573390126228333,
-0.7140049338340759,
0.5231000781059265,
-0.36560189723968506,
0.9699820280075073,
-0.33397775888442993,
1.77835214138031,
-0.6300383806228638,
0.42593318223953247,
0.7335081696510315,
1.272831916809082,
0.23580150306224823,
0.09409519284963608,
0.3273729979991913,
0.3161623775959015,
0.08621193468570709,
0.4726007580757141,
1.2069029808044434,
0.5613086223602295,
0.4832024872303009,
0.7295911312103271,
-2.196279525756836,
1.2579030990600586,
-0.9820602536201477,
0.28486883640289307,
1.3308348655700684,
-0.8848650455474854,
0.35985076427459717,
-1.8743730783462524,
-0.10791432857513428,
0.5685137510299683,
-2.226616621017456,
0.24423488974571228,
-1.339465618133545,
-0.48758664727211,
0.9630916714668274,
0.2907906472682953,
-1.2159596681594849,
0.17748002707958221,
-0.5028072595596313,
1.0391056537628174,
0.4506506323814392,
1.1938737630844116,
-1.6509482860565186,
-0.12039069086313248,
-0.295674592256546,
0.09270841628313065,
-1.3385628461837769,
-1.555009365081787,
0.581320583820343,
0.5859531164169312,
0.7520624399185181,
-0.13670757412910461,
1.0903822183609009,
-1.0413693189620972,
0.7837634086608887,
-0.9173579216003418,
-1.7310864925384521,
-1.3511854410171509,
-2.2606425285339355,
-2.2927603721618652,
0.7865217924118042,
-0.4969102442264557,
-0.5016077756881714,
2.068972587585449,
-1.0373209714889526,
-1.7634508609771729,
1.0879086256027222,
0.3340775966644287,
-0.06641015410423279,
2.380702018737793,
0.24304786324501038,
-0.767290472984314,
0.5138272047042847,
-0.7055226564407349,
0.757663905620575,
-0.22906725108623505,
1.397152066230774,
0.5151922702789307,
-1.0003823041915894,
1.609587550163269,
-0.3788045048713684,
0.6213095188140869,
-0.7234678864479065,
-0.5399230122566223,
-0.8193785548210144,
0.2480074167251587,
1.9476224184036255,
-0.3746165931224823,
1.6550418138504028,
-0.2366514950990677,
-1.6223841905593872,
-1.577374815940857,
0.8003396987915039,
0.4590665102005005,
-0.8232707381248474,
0.11708999425172806,
-0.4058852195739746,
0.13335292041301727,
0.02861597016453743,
1.1146318912506104,
1.2158411741256714,
0.6822187304496765,
-0.28420397639274597,
-0.8378336429595947,
0.1700916737318039,
-0.04893621429800987,
-0.7014268636703491,
-1.7070308923721313,
-0.42095792293548584,
0.17551590502262115,
0.6518149375915527,
-1.1931233406066895,
1.7180132865905762,
0.8526495099067688,
1.9347312450408936,
1.0512478351593018,
-0.41610005497932434,
1.4538308382034302,
0.06328574568033218,
1.8462820053100586,
-0.5115999579429626,
0.6484323143959045,
-0.3689247965812683,
-1.1893748044967651,
0.8158851861953735,
-0.36323124170303345,
-2.051954507827759,
-0.7392709851264954,
-0.7723957896232605,
-0.18114590644836426,
-0.7220182418823242,
0.9152830243110657,
-0.3590890169143677,
-1.4449412822723389,
0.22447839379310608,
-0.6853388547897339,
0.0558013841509819,
-1.345318078994751,
0.23290401697158813,
0.7125895619392395,
-0.6736940741539001,
0.05386009067296982,
-0.24137985706329346,
-1.2951011657714844,
-0.46405619382858276,
0.2888719439506531,
1.8967618942260742,
-0.7632476687431335,
0.9371138215065002,
1.0416765213012695,
-0.7366002202033997,
0.12703751027584076,
0.36761099100112915,
-0.347126305103302,
0.8188834190368652,
-1.0916954278945923,
-0.30935412645339966,
1.2199275493621826,
-0.1290525197982788,
-0.5949993133544922,
1.365810751914978,
0.7718394994735718,
-1.059948444366455,
-0.20949845016002655,
-0.203250452876091,
-0.8311050534248352,
-0.01930134743452072,
-1.57277512550354,
-0.1586231291294098,
0.41382962465286255,
-1.3680803775787354,
-0.45112699270248413,
-0.2790679335594177,
1.273810625076294,
-0.210229754447937,
1.4066792726516724,
-0.30044567584991455,
-0.2361927181482315,
-0.34066611528396606,
-0.4905788004398346,
0.16217564046382904,
-0.20281054079532623,
-0.6287326812744141,
0.2456859052181244,
-0.8029535412788391,
0.2847333252429962,
1.4526970386505127,
0.35097599029541016,
0.024905581027269363,
0.529617190361023,
1.0820894241333008,
0.3986855149269104,
-0.11283408850431442,
-0.9139460325241089,
-1.5781304836273193,
2.015308380126953,
-1.444027304649353,
1.8653367757797241,
0.790647566318512,
-0.036155182868242264,
-1.847060203552246,
-1.8492897748947144,
1.3862361907958984,
1.1397407054901123,
2.4404070377349854,
0.5615025758743286,
0.4392884075641632,
-0.7667044401168823,
-0.7228814363479614,
0.37971317768096924,
-1.0212161540985107,
-0.7355970740318298,
0.18340416252613068,
2.4027087688446045,
1.7400137186050415,
-0.548954427242279,
-0.2267714887857437,
-0.9297861456871033,
1.1890227794647217,
-0.20049931108951569,
0.2509783208370209,
2.052809476852417,
-0.32544851303100586,
-1.053432583808899,
1.2672226428985596,
-2.282034397125244,
0.154961496591568,
2.0190603733062744,
0.24907812476158142,
0.08077211678028107,
-1.4992707967758179,
-0.6420232653617859,
-0.23545308411121368,
-0.4634445905685425,
-1.2982299327850342,
0.578120231628418,
-0.27479422092437744,
-0.8528759479522705,
-1.5013010501861572,
0.02021234855055809,
-1.1287329196929932,
-1.660786509513855,
0.30629345774650574,
1.902036190032959,
2.061690092086792,
-0.7262170910835266,
1.468990445137024,
-0.22243423759937286,
0.16734467446804047,
1.1818883419036865,
1.2705973386764526,
3.111229658126831,
1.857857346534729,
-1.3040904998779297,
0.7243930101394653,
-0.09152788668870926,
-0.5335765480995178,
1.1614042520523071,
-1.0512477159500122,
1.2351384162902832,
-0.282963365316391,
-1.2070904970169067,
-1.24753999710083,
1.0010230541229248,
0.395001083612442,
0.007528378628194332,
-0.49633094668388367,
1.2426496744155884,
0.08471854776144028,
1.2984654903411865,
0.6008298993110657,
-0.38125330209732056,
0.62783282995224,
-0.31653571128845215,
-0.5388824343681335,
1.5890002250671387,
0.2603795826435089,
-1.4472882747650146,
-2.399994373321533,
-0.24713818728923798,
-0.8629116415977478,
0.08274354785680771,
-0.6120669841766357,
-1.0162986516952515,
1.6767425537109375,
0.3848084509372711,
-1.2386457920074463,
-0.2400932013988495,
-0.3122904598712921,
-0.5762194395065308,
2.6620612144470215,
-1.3406516313552856,
-0.13274304568767548,
-0.9793283343315125,
-0.6510740518569946,
1.612295389175415,
-1.1232534646987915,
-0.125529482960701,
-1.101654291152954,
-0.6200364828109741,
-1.3698400259017944,
-0.5446001887321472,
0.055851973593235016,
-0.9383742809295654,
0.8936719298362732,
0.15387997031211853,
-1.1459416151046753,
-0.1827535182237625,
-0.9352536797523499,
0.9452283382415771,
-0.19836005568504333,
0.21249611675739288,
1.923620581626892,
0.47158536314964294,
-0.38772404193878174,
0.6982332468032837,
1.2111034393310547,
0.6057168841362,
-0.7058472633361816,
0.1290518194437027,
-0.7608948349952698,
0.2598643898963928,
-1.3897300958633423,
0.25217369198799133,
-2.8347480297088623,
0.7291800379753113,
-0.10777866095304489,
-0.05160684511065483,
0.027741998434066772,
-1.2881035804748535,
1.029348373413086,
2.6106507778167725,
-1.1808193922042847,
0.4695478677749634,
0.3997013568878174,
1.1898105144500732,
-1.569549322128296,
0.23176699876785278,
-0.48906266689300537,
2.088510274887085,
0.18944069743156433,
1.1932166814804077,
-0.5436043739318848,
-2.154167890548706,
0.6014764308929443,
-1.232291579246521,
-1.119879126548767,
0.8397927284240723,
-0.9079840183258057,
0.1408461630344391,
-1.4570704698562622,
-0.21800357103347778,
-0.9462484121322632,
-1.2078537940979004,
0.7794972062110901,
0.1275378167629242,
0.5522536635398865,
-0.515717625617981,
0.34248775243759155,
-2.2268881797790527,
-1.3835557699203491,
-0.17031952738761902,
-0.9943810701370239,
0.44989705085754395,
-0.3152509927749634,
0.6728278994560242,
-0.21068337559700012,
0.047143835574388504,
0.3915666341781616,
1.4020116329193115,
3.3161330223083496,
0.1459021270275116,
0.3064032793045044,
-0.10451827943325043,
-0.9820468425750732,
1.4052067995071411,
0.9043801426887512,
-0.0565604530274868,
-0.6143860220909119,
-1.0181819200515747,
1.1852467060089111,
2.0618784427642822,
1.1152479648590088,
0.05763499438762665,
-0.8394444584846497,
-0.7716976404190063,
0.03739296644926071,
0.20337864756584167,
0.4730131924152374,
0.8882830142974854,
0.04235297441482544,
0.08550131320953369,
1.4686540365219116,
1.1135685443878174,
-0.3652702569961548,
0.3656998872756958,
-0.8184607625007629,
-0.4255903661251068,
0.442157119512558,
0.23154094815254211,
0.08620477467775345,
0.34158414602279663,
-1.0971436500549316,
-0.24629920721054077,
-0.4620552361011505,
-0.9363791942596436,
-0.7291603088378906,
-0.41946786642074585,
-0.3699731230735779,
1.6146602630615234,
0.06866854429244995,
-0.48665422201156616,
0.04831209033727646,
-0.7510673403739929,
-0.1538616567850113,
-1.098608136177063,
0.31419020891189575,
-0.1593894064426422,
-0.10720545053482056,
-0.0480152852833271,
1.7239543199539185,
-0.9984956383705139,
-2.1096229553222656,
0.1882096529006958,
0.2479332685470581,
-0.32525384426116943,
0.14002415537834167,
1.6238861083984375,
0.6075106263160706,
1.4141396284103394,
1.2765164375305176,
0.9455858469009399,
-0.6906675696372986,
-1.2420238256454468,
0.6772680282592773,
0.9465574026107788,
-1.3495088815689087,
0.8644546866416931,
-0.10239153355360031,
-0.5057929754257202,
0.604191780090332,
1.307532548904419,
0.40324121713638306,
-2.0517590045928955,
0.8048239946365356,
-0.903881311416626,
0.6383981108665466,
0.7007335424423218,
0.7553361058235168,
0.23394986987113953,
0.7719429135322571,
-1.1608248949050903,
-1.1367789506912231,
-0.7325112819671631,
-0.5692110061645508,
1.9481837749481201,
-0.07944213598966599,
0.5311486124992371,
-0.15341000258922577,
-1.2305712699890137,
-0.0002648215740919113,
0.6768003106117249,
0.4183899760246277,
-0.5079213380813599,
0.8313072919845581,
-0.55682772397995,
-1.0430848598480225,
-1.3473869562149048,
-0.40974944829940796,
-1.102118968963623,
-0.9630776047706604,
0.9818909168243408,
0.7376902103424072,
0.3737943768501282,
1.8448021411895752,
0.6350353956222534,
0.3218485116958618,
-2.6247119903564453,
0.9485618472099304,
0.27882808446884155,
-0.08929896354675293,
0.943482518196106,
0.32183218002319336,
1.1047059297561646,
-0.07485640794038773,
0.5475848317146301,
-2.3623533248901367,
2.2699358463287354,
-0.2475501298904419,
0.6657047271728516,
0.027345050126314163,
-0.21429510414600372,
1.1143912076950073,
0.44934767484664917,
0.5181334614753723,
-0.9911567568778992,
0.7018203735351562,
-0.6182271242141724,
1.150820255279541,
1.000584602355957,
-0.9242182970046997,
0.15802375972270966,
1.3696811199188232,
0.44245147705078125,
-0.4366397261619568,
-0.9237833619117737,
-0.8781682252883911,
1.0313608646392822,
1.6846308708190918,
-0.01667633466422558,
-0.03056110069155693,
0.9668232202529907,
0.6385859251022339,
-1.3339933156967163,
0.10014595091342926,
-0.7240704894065857,
-0.7079388499259949,
1.6305830478668213,
2.039050340652466,
-0.08283797651529312,
-0.17035256326198578,
-0.7689527273178101,
-1.2556520700454712,
0.7659721374511719,
0.009255158714950085,
0.16729794442653656,
0.7084140777587891,
-0.7074413299560547,
1.156075358390808,
0.7919023036956787,
0.9744800925254822,
0.17641578614711761,
0.3684293329715729,
0.31062519550323486,
-0.35042664408683777,
-1.1588387489318848,
-0.31132611632347107,
-1.0570095777511597,
-2.511884927749634,
0.516665518283844,
-0.20998050272464752,
-1.470169186592102,
0.0815071165561676,
-1.037182331085205,
0.885395348072052,
-0.6274901628494263,
-1.0480282306671143,
-1.626675009727478,
0.29632577300071716,
-0.21890577673912048,
0.9210015535354614,
-1.6078060865402222,
-0.1791050136089325,
1.1291313171386719,
0.9967717528343201,
-0.6364224553108215,
0.947332501411438,
0.25587135553359985,
0.9771762490272522,
0.8504989147186279,
-0.35954365134239197,
0.5473794937133789,
0.07670518010854721,
-1.3579007387161255,
0.42314061522483826,
1.2116719484329224,
0.2582911252975464,
1.4590637683868408,
-0.528171718120575,
0.03164331242442131,
0.4133714437484741,
-0.5024266839027405,
-0.4838222563266754,
-0.5368131995201111,
0.6816977262496948,
0.08079607784748077,
-0.9999671578407288,
-0.07117350399494171,
-0.07712152600288391,
-0.1608818918466568,
0.23580411076545715,
-1.5008788108825684,
-0.2095736265182495,
-0.40890762209892273,
-0.6227977275848389,
-1.212133526802063,
0.023806534707546234,
1.341840386390686,
-0.781912088394165,
-0.2319626808166504,
0.42978599667549133,
0.3754015266895294,
0.4925101697444916,
0.5952187776565552,
-0.7584205865859985,
-0.2777736783027649,
-0.23539020121097565,
-0.4181499779224396,
0.2892031669616699,
1.3368207216262817,
-0.09037327766418457,
-1.01258385181427,
0.6892426609992981,
-0.3961775302886963,
0.10616268962621689,
1.9703009128570557,
0.05861596763134003,
-0.8708340525627136,
0.2957013249397278,
-0.7094140648841858,
1.8507113456726074,
1.7587523460388184,
1.353331446647644,
-0.11121436208486557,
-0.867918074131012,
0.6047595739364624,
-0.26697441935539246,
-0.3532974123954773,
0.988378643989563,
0.4226173162460327,
-0.143701434135437,
-1.462353229522705,
0.6863227486610413,
1.2970541715621948,
-0.8749797940254211,
-0.7869485020637512,
0.08765100687742233,
-0.8759879469871521,
1.0502328872680664,
0.7010849118232727,
0.3260561525821686,
0.22208543121814728,
1.5750049352645874,
0.735317051410675,
-0.49817609786987305,
0.538673460483551,
0.4638315439224243,
-0.15653643012046814,
-2.1409363746643066,
-1.0982385873794556,
0.33967891335487366,
-0.3741922080516815,
-1.619206190109253,
1.4109925031661987,
-1.1665022373199463,
-0.9103996753692627,
0.5765758156776428,
0.1743335872888565,
1.415264368057251,
0.39458441734313965,
1.6748367547988892,
2.0942647457122803,
0.8692116737365723,
0.3165307939052582,
1.271085262298584,
-0.09687850624322891,
-0.413417786359787,
1.827391266822815,
-0.42873960733413696,
0.5253797173500061,
0.9651819467544556,
-0.28378862142562866,
-1.0664998292922974,
-0.7772405743598938,
-1.2037311792373657,
-0.6358840465545654,
1.1217103004455566,
0.08667631447315216,
-1.1285561323165894,
0.22815975546836853,
1.5915578603744507,
0.09592636674642563,
-0.29272234439849854,
0.720644474029541,
0.42704495787620544,
-0.7580556273460388,
-0.06492345035076141,
-0.8898020386695862,
0.5925244092941284,
-0.15157821774482727,
-0.3144459128379822,
0.24971240758895874,
0.506808340549469,
1.393838882446289,
-0.026024773716926575,
0.10831249505281448,
1.2433993816375732,
-1.3107569217681885,
1.527117371559143,
-0.6435328125953674,
0.2585667073726654,
-2.3915538787841797,
1.406697392463684,
-0.8143830895423889,
1.8408129215240479,
-2.59192156791687,
0.45675987005233765,
-0.5510923862457275,
-0.45276883244514465,
0.2208063304424286,
-0.37443721294403076,
0.1384323388338089,
-0.1461780071258545,
-1.0412933826446533,
-0.07972409576177597,
-0.7690739631652832,
0.5777996778488159,
1.157812237739563,
1.3534780740737915,
-1.028786540031433,
-0.39164817333221436,
-1.8266377449035645,
-0.17707474529743195,
-0.632651150226593,
0.30039113759994507,
-1.915682077407837,
-0.19096671044826508,
-1.9432240724563599,
-2.4925737380981445,
-1.4106557369232178,
-0.8479306697845459,
1.098036289215088,
0.14998359978199005,
-0.9818500280380249,
1.1799097061157227,
-0.3893318772315979,
-1.8461507558822632,
1.1121464967727661,
-2.2040960788726807
] |
https://github.com/huggingface/datasets/issues/5009 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly | `gram_ann` and `val_ann` are annotations that only exist for part of the test set. I wanted to keep all the columns consistent across all files, so I added them to train and validation as well. I'll check if removing them from those files is still compliant with this repo. Otherwise, I will do as you suggested. Thanks @lhoestq ! | ## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 515 | 59 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
`gram_ann` and `val_ann` are annotations that only exist for part of the test set. I wanted to keep all the columns consistent across all files, so I added them to train and validation as well. I'll check if removing them from those files is still compliant with this repo. Otherwise, I will do as you suggested. Thanks @lhoestq ! | [
-1.1767548322677612,
-0.9491956830024719,
-0.8158513903617859,
1.3935505151748657,
-0.07760877162218094,
-1.2096201181411743,
0.14519676566123962,
-1.101981520652771,
1.625927209854126,
-0.7225667834281921,
0.2835047245025635,
-1.7219820022583008,
-0.06851905584335327,
-0.6020216941833496,
-0.7026883959770203,
-0.9104107618331909,
-0.3298652768135071,
-0.8423004150390625,
0.9767367243766785,
2.493403196334839,
1.225740909576416,
-1.2641856670379639,
2.7374987602233887,
0.7038471698760986,
-0.280811607837677,
-0.9609861373901367,
0.5246084928512573,
-0.051943693310022354,
-1.3116977214813232,
-0.4307197332382202,
-0.987808883190155,
-0.00018073339015245438,
-0.5740779638290405,
-0.5059898495674133,
0.16210471093654633,
0.3886721730232239,
-0.3499446511268616,
-0.339586466550827,
-0.5573390126228333,
-0.7140049338340759,
0.5231000781059265,
-0.36560189723968506,
0.9699820280075073,
-0.33397775888442993,
1.77835214138031,
-0.6300383806228638,
0.42593318223953247,
0.7335081696510315,
1.272831916809082,
0.23580150306224823,
0.09409519284963608,
0.3273729979991913,
0.3161623775959015,
0.08621193468570709,
0.4726007580757141,
1.2069029808044434,
0.5613086223602295,
0.4832024872303009,
0.7295911312103271,
-2.196279525756836,
1.2579030990600586,
-0.9820602536201477,
0.28486883640289307,
1.3308348655700684,
-0.8848650455474854,
0.35985076427459717,
-1.8743730783462524,
-0.10791432857513428,
0.5685137510299683,
-2.226616621017456,
0.24423488974571228,
-1.339465618133545,
-0.48758664727211,
0.9630916714668274,
0.2907906472682953,
-1.2159596681594849,
0.17748002707958221,
-0.5028072595596313,
1.0391056537628174,
0.4506506323814392,
1.1938737630844116,
-1.6509482860565186,
-0.12039069086313248,
-0.295674592256546,
0.09270841628313065,
-1.3385628461837769,
-1.555009365081787,
0.581320583820343,
0.5859531164169312,
0.7520624399185181,
-0.13670757412910461,
1.0903822183609009,
-1.0413693189620972,
0.7837634086608887,
-0.9173579216003418,
-1.7310864925384521,
-1.3511854410171509,
-2.2606425285339355,
-2.2927603721618652,
0.7865217924118042,
-0.4969102442264557,
-0.5016077756881714,
2.068972587585449,
-1.0373209714889526,
-1.7634508609771729,
1.0879086256027222,
0.3340775966644287,
-0.06641015410423279,
2.380702018737793,
0.24304786324501038,
-0.767290472984314,
0.5138272047042847,
-0.7055226564407349,
0.757663905620575,
-0.22906725108623505,
1.397152066230774,
0.5151922702789307,
-1.0003823041915894,
1.609587550163269,
-0.3788045048713684,
0.6213095188140869,
-0.7234678864479065,
-0.5399230122566223,
-0.8193785548210144,
0.2480074167251587,
1.9476224184036255,
-0.3746165931224823,
1.6550418138504028,
-0.2366514950990677,
-1.6223841905593872,
-1.577374815940857,
0.8003396987915039,
0.4590665102005005,
-0.8232707381248474,
0.11708999425172806,
-0.4058852195739746,
0.13335292041301727,
0.02861597016453743,
1.1146318912506104,
1.2158411741256714,
0.6822187304496765,
-0.28420397639274597,
-0.8378336429595947,
0.1700916737318039,
-0.04893621429800987,
-0.7014268636703491,
-1.7070308923721313,
-0.42095792293548584,
0.17551590502262115,
0.6518149375915527,
-1.1931233406066895,
1.7180132865905762,
0.8526495099067688,
1.9347312450408936,
1.0512478351593018,
-0.41610005497932434,
1.4538308382034302,
0.06328574568033218,
1.8462820053100586,
-0.5115999579429626,
0.6484323143959045,
-0.3689247965812683,
-1.1893748044967651,
0.8158851861953735,
-0.36323124170303345,
-2.051954507827759,
-0.7392709851264954,
-0.7723957896232605,
-0.18114590644836426,
-0.7220182418823242,
0.9152830243110657,
-0.3590890169143677,
-1.4449412822723389,
0.22447839379310608,
-0.6853388547897339,
0.0558013841509819,
-1.345318078994751,
0.23290401697158813,
0.7125895619392395,
-0.6736940741539001,
0.05386009067296982,
-0.24137985706329346,
-1.2951011657714844,
-0.46405619382858276,
0.2888719439506531,
1.8967618942260742,
-0.7632476687431335,
0.9371138215065002,
1.0416765213012695,
-0.7366002202033997,
0.12703751027584076,
0.36761099100112915,
-0.347126305103302,
0.8188834190368652,
-1.0916954278945923,
-0.30935412645339966,
1.2199275493621826,
-0.1290525197982788,
-0.5949993133544922,
1.365810751914978,
0.7718394994735718,
-1.059948444366455,
-0.20949845016002655,
-0.203250452876091,
-0.8311050534248352,
-0.01930134743452072,
-1.57277512550354,
-0.1586231291294098,
0.41382962465286255,
-1.3680803775787354,
-0.45112699270248413,
-0.2790679335594177,
1.273810625076294,
-0.210229754447937,
1.4066792726516724,
-0.30044567584991455,
-0.2361927181482315,
-0.34066611528396606,
-0.4905788004398346,
0.16217564046382904,
-0.20281054079532623,
-0.6287326812744141,
0.2456859052181244,
-0.8029535412788391,
0.2847333252429962,
1.4526970386505127,
0.35097599029541016,
0.024905581027269363,
0.529617190361023,
1.0820894241333008,
0.3986855149269104,
-0.11283408850431442,
-0.9139460325241089,
-1.5781304836273193,
2.015308380126953,
-1.444027304649353,
1.8653367757797241,
0.790647566318512,
-0.036155182868242264,
-1.847060203552246,
-1.8492897748947144,
1.3862361907958984,
1.1397407054901123,
2.4404070377349854,
0.5615025758743286,
0.4392884075641632,
-0.7667044401168823,
-0.7228814363479614,
0.37971317768096924,
-1.0212161540985107,
-0.7355970740318298,
0.18340416252613068,
2.4027087688446045,
1.7400137186050415,
-0.548954427242279,
-0.2267714887857437,
-0.9297861456871033,
1.1890227794647217,
-0.20049931108951569,
0.2509783208370209,
2.052809476852417,
-0.32544851303100586,
-1.053432583808899,
1.2672226428985596,
-2.282034397125244,
0.154961496591568,
2.0190603733062744,
0.24907812476158142,
0.08077211678028107,
-1.4992707967758179,
-0.6420232653617859,
-0.23545308411121368,
-0.4634445905685425,
-1.2982299327850342,
0.578120231628418,
-0.27479422092437744,
-0.8528759479522705,
-1.5013010501861572,
0.02021234855055809,
-1.1287329196929932,
-1.660786509513855,
0.30629345774650574,
1.902036190032959,
2.061690092086792,
-0.7262170910835266,
1.468990445137024,
-0.22243423759937286,
0.16734467446804047,
1.1818883419036865,
1.2705973386764526,
3.111229658126831,
1.857857346534729,
-1.3040904998779297,
0.7243930101394653,
-0.09152788668870926,
-0.5335765480995178,
1.1614042520523071,
-1.0512477159500122,
1.2351384162902832,
-0.282963365316391,
-1.2070904970169067,
-1.24753999710083,
1.0010230541229248,
0.395001083612442,
0.007528378628194332,
-0.49633094668388367,
1.2426496744155884,
0.08471854776144028,
1.2984654903411865,
0.6008298993110657,
-0.38125330209732056,
0.62783282995224,
-0.31653571128845215,
-0.5388824343681335,
1.5890002250671387,
0.2603795826435089,
-1.4472882747650146,
-2.399994373321533,
-0.24713818728923798,
-0.8629116415977478,
0.08274354785680771,
-0.6120669841766357,
-1.0162986516952515,
1.6767425537109375,
0.3848084509372711,
-1.2386457920074463,
-0.2400932013988495,
-0.3122904598712921,
-0.5762194395065308,
2.6620612144470215,
-1.3406516313552856,
-0.13274304568767548,
-0.9793283343315125,
-0.6510740518569946,
1.612295389175415,
-1.1232534646987915,
-0.125529482960701,
-1.101654291152954,
-0.6200364828109741,
-1.3698400259017944,
-0.5446001887321472,
0.055851973593235016,
-0.9383742809295654,
0.8936719298362732,
0.15387997031211853,
-1.1459416151046753,
-0.1827535182237625,
-0.9352536797523499,
0.9452283382415771,
-0.19836005568504333,
0.21249611675739288,
1.923620581626892,
0.47158536314964294,
-0.38772404193878174,
0.6982332468032837,
1.2111034393310547,
0.6057168841362,
-0.7058472633361816,
0.1290518194437027,
-0.7608948349952698,
0.2598643898963928,
-1.3897300958633423,
0.25217369198799133,
-2.8347480297088623,
0.7291800379753113,
-0.10777866095304489,
-0.05160684511065483,
0.027741998434066772,
-1.2881035804748535,
1.029348373413086,
2.6106507778167725,
-1.1808193922042847,
0.4695478677749634,
0.3997013568878174,
1.1898105144500732,
-1.569549322128296,
0.23176699876785278,
-0.48906266689300537,
2.088510274887085,
0.18944069743156433,
1.1932166814804077,
-0.5436043739318848,
-2.154167890548706,
0.6014764308929443,
-1.232291579246521,
-1.119879126548767,
0.8397927284240723,
-0.9079840183258057,
0.1408461630344391,
-1.4570704698562622,
-0.21800357103347778,
-0.9462484121322632,
-1.2078537940979004,
0.7794972062110901,
0.1275378167629242,
0.5522536635398865,
-0.515717625617981,
0.34248775243759155,
-2.2268881797790527,
-1.3835557699203491,
-0.17031952738761902,
-0.9943810701370239,
0.44989705085754395,
-0.3152509927749634,
0.6728278994560242,
-0.21068337559700012,
0.047143835574388504,
0.3915666341781616,
1.4020116329193115,
3.3161330223083496,
0.1459021270275116,
0.3064032793045044,
-0.10451827943325043,
-0.9820468425750732,
1.4052067995071411,
0.9043801426887512,
-0.0565604530274868,
-0.6143860220909119,
-1.0181819200515747,
1.1852467060089111,
2.0618784427642822,
1.1152479648590088,
0.05763499438762665,
-0.8394444584846497,
-0.7716976404190063,
0.03739296644926071,
0.20337864756584167,
0.4730131924152374,
0.8882830142974854,
0.04235297441482544,
0.08550131320953369,
1.4686540365219116,
1.1135685443878174,
-0.3652702569961548,
0.3656998872756958,
-0.8184607625007629,
-0.4255903661251068,
0.442157119512558,
0.23154094815254211,
0.08620477467775345,
0.34158414602279663,
-1.0971436500549316,
-0.24629920721054077,
-0.4620552361011505,
-0.9363791942596436,
-0.7291603088378906,
-0.41946786642074585,
-0.3699731230735779,
1.6146602630615234,
0.06866854429244995,
-0.48665422201156616,
0.04831209033727646,
-0.7510673403739929,
-0.1538616567850113,
-1.098608136177063,
0.31419020891189575,
-0.1593894064426422,
-0.10720545053482056,
-0.0480152852833271,
1.7239543199539185,
-0.9984956383705139,
-2.1096229553222656,
0.1882096529006958,
0.2479332685470581,
-0.32525384426116943,
0.14002415537834167,
1.6238861083984375,
0.6075106263160706,
1.4141396284103394,
1.2765164375305176,
0.9455858469009399,
-0.6906675696372986,
-1.2420238256454468,
0.6772680282592773,
0.9465574026107788,
-1.3495088815689087,
0.8644546866416931,
-0.10239153355360031,
-0.5057929754257202,
0.604191780090332,
1.307532548904419,
0.40324121713638306,
-2.0517590045928955,
0.8048239946365356,
-0.903881311416626,
0.6383981108665466,
0.7007335424423218,
0.7553361058235168,
0.23394986987113953,
0.7719429135322571,
-1.1608248949050903,
-1.1367789506912231,
-0.7325112819671631,
-0.5692110061645508,
1.9481837749481201,
-0.07944213598966599,
0.5311486124992371,
-0.15341000258922577,
-1.2305712699890137,
-0.0002648215740919113,
0.6768003106117249,
0.4183899760246277,
-0.5079213380813599,
0.8313072919845581,
-0.55682772397995,
-1.0430848598480225,
-1.3473869562149048,
-0.40974944829940796,
-1.102118968963623,
-0.9630776047706604,
0.9818909168243408,
0.7376902103424072,
0.3737943768501282,
1.8448021411895752,
0.6350353956222534,
0.3218485116958618,
-2.6247119903564453,
0.9485618472099304,
0.27882808446884155,
-0.08929896354675293,
0.943482518196106,
0.32183218002319336,
1.1047059297561646,
-0.07485640794038773,
0.5475848317146301,
-2.3623533248901367,
2.2699358463287354,
-0.2475501298904419,
0.6657047271728516,
0.027345050126314163,
-0.21429510414600372,
1.1143912076950073,
0.44934767484664917,
0.5181334614753723,
-0.9911567568778992,
0.7018203735351562,
-0.6182271242141724,
1.150820255279541,
1.000584602355957,
-0.9242182970046997,
0.15802375972270966,
1.3696811199188232,
0.44245147705078125,
-0.4366397261619568,
-0.9237833619117737,
-0.8781682252883911,
1.0313608646392822,
1.6846308708190918,
-0.01667633466422558,
-0.03056110069155693,
0.9668232202529907,
0.6385859251022339,
-1.3339933156967163,
0.10014595091342926,
-0.7240704894065857,
-0.7079388499259949,
1.6305830478668213,
2.039050340652466,
-0.08283797651529312,
-0.17035256326198578,
-0.7689527273178101,
-1.2556520700454712,
0.7659721374511719,
0.009255158714950085,
0.16729794442653656,
0.7084140777587891,
-0.7074413299560547,
1.156075358390808,
0.7919023036956787,
0.9744800925254822,
0.17641578614711761,
0.3684293329715729,
0.31062519550323486,
-0.35042664408683777,
-1.1588387489318848,
-0.31132611632347107,
-1.0570095777511597,
-2.511884927749634,
0.516665518283844,
-0.20998050272464752,
-1.470169186592102,
0.0815071165561676,
-1.037182331085205,
0.885395348072052,
-0.6274901628494263,
-1.0480282306671143,
-1.626675009727478,
0.29632577300071716,
-0.21890577673912048,
0.9210015535354614,
-1.6078060865402222,
-0.1791050136089325,
1.1291313171386719,
0.9967717528343201,
-0.6364224553108215,
0.947332501411438,
0.25587135553359985,
0.9771762490272522,
0.8504989147186279,
-0.35954365134239197,
0.5473794937133789,
0.07670518010854721,
-1.3579007387161255,
0.42314061522483826,
1.2116719484329224,
0.2582911252975464,
1.4590637683868408,
-0.528171718120575,
0.03164331242442131,
0.4133714437484741,
-0.5024266839027405,
-0.4838222563266754,
-0.5368131995201111,
0.6816977262496948,
0.08079607784748077,
-0.9999671578407288,
-0.07117350399494171,
-0.07712152600288391,
-0.1608818918466568,
0.23580411076545715,
-1.5008788108825684,
-0.2095736265182495,
-0.40890762209892273,
-0.6227977275848389,
-1.212133526802063,
0.023806534707546234,
1.341840386390686,
-0.781912088394165,
-0.2319626808166504,
0.42978599667549133,
0.3754015266895294,
0.4925101697444916,
0.5952187776565552,
-0.7584205865859985,
-0.2777736783027649,
-0.23539020121097565,
-0.4181499779224396,
0.2892031669616699,
1.3368207216262817,
-0.09037327766418457,
-1.01258385181427,
0.6892426609992981,
-0.3961775302886963,
0.10616268962621689,
1.9703009128570557,
0.05861596763134003,
-0.8708340525627136,
0.2957013249397278,
-0.7094140648841858,
1.8507113456726074,
1.7587523460388184,
1.353331446647644,
-0.11121436208486557,
-0.867918074131012,
0.6047595739364624,
-0.26697441935539246,
-0.3532974123954773,
0.988378643989563,
0.4226173162460327,
-0.143701434135437,
-1.462353229522705,
0.6863227486610413,
1.2970541715621948,
-0.8749797940254211,
-0.7869485020637512,
0.08765100687742233,
-0.8759879469871521,
1.0502328872680664,
0.7010849118232727,
0.3260561525821686,
0.22208543121814728,
1.5750049352645874,
0.735317051410675,
-0.49817609786987305,
0.538673460483551,
0.4638315439224243,
-0.15653643012046814,
-2.1409363746643066,
-1.0982385873794556,
0.33967891335487366,
-0.3741922080516815,
-1.619206190109253,
1.4109925031661987,
-1.1665022373199463,
-0.9103996753692627,
0.5765758156776428,
0.1743335872888565,
1.415264368057251,
0.39458441734313965,
1.6748367547988892,
2.0942647457122803,
0.8692116737365723,
0.3165307939052582,
1.271085262298584,
-0.09687850624322891,
-0.413417786359787,
1.827391266822815,
-0.42873960733413696,
0.5253797173500061,
0.9651819467544556,
-0.28378862142562866,
-1.0664998292922974,
-0.7772405743598938,
-1.2037311792373657,
-0.6358840465545654,
1.1217103004455566,
0.08667631447315216,
-1.1285561323165894,
0.22815975546836853,
1.5915578603744507,
0.09592636674642563,
-0.29272234439849854,
0.720644474029541,
0.42704495787620544,
-0.7580556273460388,
-0.06492345035076141,
-0.8898020386695862,
0.5925244092941284,
-0.15157821774482727,
-0.3144459128379822,
0.24971240758895874,
0.506808340549469,
1.393838882446289,
-0.026024773716926575,
0.10831249505281448,
1.2433993816375732,
-1.3107569217681885,
1.527117371559143,
-0.6435328125953674,
0.2585667073726654,
-2.3915538787841797,
1.406697392463684,
-0.8143830895423889,
1.8408129215240479,
-2.59192156791687,
0.45675987005233765,
-0.5510923862457275,
-0.45276883244514465,
0.2208063304424286,
-0.37443721294403076,
0.1384323388338089,
-0.1461780071258545,
-1.0412933826446533,
-0.07972409576177597,
-0.7690739631652832,
0.5777996778488159,
1.157812237739563,
1.3534780740737915,
-1.028786540031433,
-0.39164817333221436,
-1.8266377449035645,
-0.17707474529743195,
-0.632651150226593,
0.30039113759994507,
-1.915682077407837,
-0.19096671044826508,
-1.9432240724563599,
-2.4925737380981445,
-1.4106557369232178,
-0.8479306697845459,
1.098036289215088,
0.14998359978199005,
-0.9818500280380249,
1.1799097061157227,
-0.3893318772315979,
-1.8461507558822632,
1.1121464967727661,
-2.2040960788726807
] |
https://github.com/huggingface/datasets/issues/5009 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly | @lhoestq I followed the exact steps you described but it seems like I'm getting the same error unfortunately. Any other ideas? Thanks in advance | ## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 515 | 24 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
@lhoestq I followed the exact steps you described but it seems like I'm getting the same error unfortunately. Any other ideas? Thanks in advance | [
-1.1767548322677612,
-0.9491956830024719,
-0.8158513903617859,
1.3935505151748657,
-0.07760877162218094,
-1.2096201181411743,
0.14519676566123962,
-1.101981520652771,
1.625927209854126,
-0.7225667834281921,
0.2835047245025635,
-1.7219820022583008,
-0.06851905584335327,
-0.6020216941833496,
-0.7026883959770203,
-0.9104107618331909,
-0.3298652768135071,
-0.8423004150390625,
0.9767367243766785,
2.493403196334839,
1.225740909576416,
-1.2641856670379639,
2.7374987602233887,
0.7038471698760986,
-0.280811607837677,
-0.9609861373901367,
0.5246084928512573,
-0.051943693310022354,
-1.3116977214813232,
-0.4307197332382202,
-0.987808883190155,
-0.00018073339015245438,
-0.5740779638290405,
-0.5059898495674133,
0.16210471093654633,
0.3886721730232239,
-0.3499446511268616,
-0.339586466550827,
-0.5573390126228333,
-0.7140049338340759,
0.5231000781059265,
-0.36560189723968506,
0.9699820280075073,
-0.33397775888442993,
1.77835214138031,
-0.6300383806228638,
0.42593318223953247,
0.7335081696510315,
1.272831916809082,
0.23580150306224823,
0.09409519284963608,
0.3273729979991913,
0.3161623775959015,
0.08621193468570709,
0.4726007580757141,
1.2069029808044434,
0.5613086223602295,
0.4832024872303009,
0.7295911312103271,
-2.196279525756836,
1.2579030990600586,
-0.9820602536201477,
0.28486883640289307,
1.3308348655700684,
-0.8848650455474854,
0.35985076427459717,
-1.8743730783462524,
-0.10791432857513428,
0.5685137510299683,
-2.226616621017456,
0.24423488974571228,
-1.339465618133545,
-0.48758664727211,
0.9630916714668274,
0.2907906472682953,
-1.2159596681594849,
0.17748002707958221,
-0.5028072595596313,
1.0391056537628174,
0.4506506323814392,
1.1938737630844116,
-1.6509482860565186,
-0.12039069086313248,
-0.295674592256546,
0.09270841628313065,
-1.3385628461837769,
-1.555009365081787,
0.581320583820343,
0.5859531164169312,
0.7520624399185181,
-0.13670757412910461,
1.0903822183609009,
-1.0413693189620972,
0.7837634086608887,
-0.9173579216003418,
-1.7310864925384521,
-1.3511854410171509,
-2.2606425285339355,
-2.2927603721618652,
0.7865217924118042,
-0.4969102442264557,
-0.5016077756881714,
2.068972587585449,
-1.0373209714889526,
-1.7634508609771729,
1.0879086256027222,
0.3340775966644287,
-0.06641015410423279,
2.380702018737793,
0.24304786324501038,
-0.767290472984314,
0.5138272047042847,
-0.7055226564407349,
0.757663905620575,
-0.22906725108623505,
1.397152066230774,
0.5151922702789307,
-1.0003823041915894,
1.609587550163269,
-0.3788045048713684,
0.6213095188140869,
-0.7234678864479065,
-0.5399230122566223,
-0.8193785548210144,
0.2480074167251587,
1.9476224184036255,
-0.3746165931224823,
1.6550418138504028,
-0.2366514950990677,
-1.6223841905593872,
-1.577374815940857,
0.8003396987915039,
0.4590665102005005,
-0.8232707381248474,
0.11708999425172806,
-0.4058852195739746,
0.13335292041301727,
0.02861597016453743,
1.1146318912506104,
1.2158411741256714,
0.6822187304496765,
-0.28420397639274597,
-0.8378336429595947,
0.1700916737318039,
-0.04893621429800987,
-0.7014268636703491,
-1.7070308923721313,
-0.42095792293548584,
0.17551590502262115,
0.6518149375915527,
-1.1931233406066895,
1.7180132865905762,
0.8526495099067688,
1.9347312450408936,
1.0512478351593018,
-0.41610005497932434,
1.4538308382034302,
0.06328574568033218,
1.8462820053100586,
-0.5115999579429626,
0.6484323143959045,
-0.3689247965812683,
-1.1893748044967651,
0.8158851861953735,
-0.36323124170303345,
-2.051954507827759,
-0.7392709851264954,
-0.7723957896232605,
-0.18114590644836426,
-0.7220182418823242,
0.9152830243110657,
-0.3590890169143677,
-1.4449412822723389,
0.22447839379310608,
-0.6853388547897339,
0.0558013841509819,
-1.345318078994751,
0.23290401697158813,
0.7125895619392395,
-0.6736940741539001,
0.05386009067296982,
-0.24137985706329346,
-1.2951011657714844,
-0.46405619382858276,
0.2888719439506531,
1.8967618942260742,
-0.7632476687431335,
0.9371138215065002,
1.0416765213012695,
-0.7366002202033997,
0.12703751027584076,
0.36761099100112915,
-0.347126305103302,
0.8188834190368652,
-1.0916954278945923,
-0.30935412645339966,
1.2199275493621826,
-0.1290525197982788,
-0.5949993133544922,
1.365810751914978,
0.7718394994735718,
-1.059948444366455,
-0.20949845016002655,
-0.203250452876091,
-0.8311050534248352,
-0.01930134743452072,
-1.57277512550354,
-0.1586231291294098,
0.41382962465286255,
-1.3680803775787354,
-0.45112699270248413,
-0.2790679335594177,
1.273810625076294,
-0.210229754447937,
1.4066792726516724,
-0.30044567584991455,
-0.2361927181482315,
-0.34066611528396606,
-0.4905788004398346,
0.16217564046382904,
-0.20281054079532623,
-0.6287326812744141,
0.2456859052181244,
-0.8029535412788391,
0.2847333252429962,
1.4526970386505127,
0.35097599029541016,
0.024905581027269363,
0.529617190361023,
1.0820894241333008,
0.3986855149269104,
-0.11283408850431442,
-0.9139460325241089,
-1.5781304836273193,
2.015308380126953,
-1.444027304649353,
1.8653367757797241,
0.790647566318512,
-0.036155182868242264,
-1.847060203552246,
-1.8492897748947144,
1.3862361907958984,
1.1397407054901123,
2.4404070377349854,
0.5615025758743286,
0.4392884075641632,
-0.7667044401168823,
-0.7228814363479614,
0.37971317768096924,
-1.0212161540985107,
-0.7355970740318298,
0.18340416252613068,
2.4027087688446045,
1.7400137186050415,
-0.548954427242279,
-0.2267714887857437,
-0.9297861456871033,
1.1890227794647217,
-0.20049931108951569,
0.2509783208370209,
2.052809476852417,
-0.32544851303100586,
-1.053432583808899,
1.2672226428985596,
-2.282034397125244,
0.154961496591568,
2.0190603733062744,
0.24907812476158142,
0.08077211678028107,
-1.4992707967758179,
-0.6420232653617859,
-0.23545308411121368,
-0.4634445905685425,
-1.2982299327850342,
0.578120231628418,
-0.27479422092437744,
-0.8528759479522705,
-1.5013010501861572,
0.02021234855055809,
-1.1287329196929932,
-1.660786509513855,
0.30629345774650574,
1.902036190032959,
2.061690092086792,
-0.7262170910835266,
1.468990445137024,
-0.22243423759937286,
0.16734467446804047,
1.1818883419036865,
1.2705973386764526,
3.111229658126831,
1.857857346534729,
-1.3040904998779297,
0.7243930101394653,
-0.09152788668870926,
-0.5335765480995178,
1.1614042520523071,
-1.0512477159500122,
1.2351384162902832,
-0.282963365316391,
-1.2070904970169067,
-1.24753999710083,
1.0010230541229248,
0.395001083612442,
0.007528378628194332,
-0.49633094668388367,
1.2426496744155884,
0.08471854776144028,
1.2984654903411865,
0.6008298993110657,
-0.38125330209732056,
0.62783282995224,
-0.31653571128845215,
-0.5388824343681335,
1.5890002250671387,
0.2603795826435089,
-1.4472882747650146,
-2.399994373321533,
-0.24713818728923798,
-0.8629116415977478,
0.08274354785680771,
-0.6120669841766357,
-1.0162986516952515,
1.6767425537109375,
0.3848084509372711,
-1.2386457920074463,
-0.2400932013988495,
-0.3122904598712921,
-0.5762194395065308,
2.6620612144470215,
-1.3406516313552856,
-0.13274304568767548,
-0.9793283343315125,
-0.6510740518569946,
1.612295389175415,
-1.1232534646987915,
-0.125529482960701,
-1.101654291152954,
-0.6200364828109741,
-1.3698400259017944,
-0.5446001887321472,
0.055851973593235016,
-0.9383742809295654,
0.8936719298362732,
0.15387997031211853,
-1.1459416151046753,
-0.1827535182237625,
-0.9352536797523499,
0.9452283382415771,
-0.19836005568504333,
0.21249611675739288,
1.923620581626892,
0.47158536314964294,
-0.38772404193878174,
0.6982332468032837,
1.2111034393310547,
0.6057168841362,
-0.7058472633361816,
0.1290518194437027,
-0.7608948349952698,
0.2598643898963928,
-1.3897300958633423,
0.25217369198799133,
-2.8347480297088623,
0.7291800379753113,
-0.10777866095304489,
-0.05160684511065483,
0.027741998434066772,
-1.2881035804748535,
1.029348373413086,
2.6106507778167725,
-1.1808193922042847,
0.4695478677749634,
0.3997013568878174,
1.1898105144500732,
-1.569549322128296,
0.23176699876785278,
-0.48906266689300537,
2.088510274887085,
0.18944069743156433,
1.1932166814804077,
-0.5436043739318848,
-2.154167890548706,
0.6014764308929443,
-1.232291579246521,
-1.119879126548767,
0.8397927284240723,
-0.9079840183258057,
0.1408461630344391,
-1.4570704698562622,
-0.21800357103347778,
-0.9462484121322632,
-1.2078537940979004,
0.7794972062110901,
0.1275378167629242,
0.5522536635398865,
-0.515717625617981,
0.34248775243759155,
-2.2268881797790527,
-1.3835557699203491,
-0.17031952738761902,
-0.9943810701370239,
0.44989705085754395,
-0.3152509927749634,
0.6728278994560242,
-0.21068337559700012,
0.047143835574388504,
0.3915666341781616,
1.4020116329193115,
3.3161330223083496,
0.1459021270275116,
0.3064032793045044,
-0.10451827943325043,
-0.9820468425750732,
1.4052067995071411,
0.9043801426887512,
-0.0565604530274868,
-0.6143860220909119,
-1.0181819200515747,
1.1852467060089111,
2.0618784427642822,
1.1152479648590088,
0.05763499438762665,
-0.8394444584846497,
-0.7716976404190063,
0.03739296644926071,
0.20337864756584167,
0.4730131924152374,
0.8882830142974854,
0.04235297441482544,
0.08550131320953369,
1.4686540365219116,
1.1135685443878174,
-0.3652702569961548,
0.3656998872756958,
-0.8184607625007629,
-0.4255903661251068,
0.442157119512558,
0.23154094815254211,
0.08620477467775345,
0.34158414602279663,
-1.0971436500549316,
-0.24629920721054077,
-0.4620552361011505,
-0.9363791942596436,
-0.7291603088378906,
-0.41946786642074585,
-0.3699731230735779,
1.6146602630615234,
0.06866854429244995,
-0.48665422201156616,
0.04831209033727646,
-0.7510673403739929,
-0.1538616567850113,
-1.098608136177063,
0.31419020891189575,
-0.1593894064426422,
-0.10720545053482056,
-0.0480152852833271,
1.7239543199539185,
-0.9984956383705139,
-2.1096229553222656,
0.1882096529006958,
0.2479332685470581,
-0.32525384426116943,
0.14002415537834167,
1.6238861083984375,
0.6075106263160706,
1.4141396284103394,
1.2765164375305176,
0.9455858469009399,
-0.6906675696372986,
-1.2420238256454468,
0.6772680282592773,
0.9465574026107788,
-1.3495088815689087,
0.8644546866416931,
-0.10239153355360031,
-0.5057929754257202,
0.604191780090332,
1.307532548904419,
0.40324121713638306,
-2.0517590045928955,
0.8048239946365356,
-0.903881311416626,
0.6383981108665466,
0.7007335424423218,
0.7553361058235168,
0.23394986987113953,
0.7719429135322571,
-1.1608248949050903,
-1.1367789506912231,
-0.7325112819671631,
-0.5692110061645508,
1.9481837749481201,
-0.07944213598966599,
0.5311486124992371,
-0.15341000258922577,
-1.2305712699890137,
-0.0002648215740919113,
0.6768003106117249,
0.4183899760246277,
-0.5079213380813599,
0.8313072919845581,
-0.55682772397995,
-1.0430848598480225,
-1.3473869562149048,
-0.40974944829940796,
-1.102118968963623,
-0.9630776047706604,
0.9818909168243408,
0.7376902103424072,
0.3737943768501282,
1.8448021411895752,
0.6350353956222534,
0.3218485116958618,
-2.6247119903564453,
0.9485618472099304,
0.27882808446884155,
-0.08929896354675293,
0.943482518196106,
0.32183218002319336,
1.1047059297561646,
-0.07485640794038773,
0.5475848317146301,
-2.3623533248901367,
2.2699358463287354,
-0.2475501298904419,
0.6657047271728516,
0.027345050126314163,
-0.21429510414600372,
1.1143912076950073,
0.44934767484664917,
0.5181334614753723,
-0.9911567568778992,
0.7018203735351562,
-0.6182271242141724,
1.150820255279541,
1.000584602355957,
-0.9242182970046997,
0.15802375972270966,
1.3696811199188232,
0.44245147705078125,
-0.4366397261619568,
-0.9237833619117737,
-0.8781682252883911,
1.0313608646392822,
1.6846308708190918,
-0.01667633466422558,
-0.03056110069155693,
0.9668232202529907,
0.6385859251022339,
-1.3339933156967163,
0.10014595091342926,
-0.7240704894065857,
-0.7079388499259949,
1.6305830478668213,
2.039050340652466,
-0.08283797651529312,
-0.17035256326198578,
-0.7689527273178101,
-1.2556520700454712,
0.7659721374511719,
0.009255158714950085,
0.16729794442653656,
0.7084140777587891,
-0.7074413299560547,
1.156075358390808,
0.7919023036956787,
0.9744800925254822,
0.17641578614711761,
0.3684293329715729,
0.31062519550323486,
-0.35042664408683777,
-1.1588387489318848,
-0.31132611632347107,
-1.0570095777511597,
-2.511884927749634,
0.516665518283844,
-0.20998050272464752,
-1.470169186592102,
0.0815071165561676,
-1.037182331085205,
0.885395348072052,
-0.6274901628494263,
-1.0480282306671143,
-1.626675009727478,
0.29632577300071716,
-0.21890577673912048,
0.9210015535354614,
-1.6078060865402222,
-0.1791050136089325,
1.1291313171386719,
0.9967717528343201,
-0.6364224553108215,
0.947332501411438,
0.25587135553359985,
0.9771762490272522,
0.8504989147186279,
-0.35954365134239197,
0.5473794937133789,
0.07670518010854721,
-1.3579007387161255,
0.42314061522483826,
1.2116719484329224,
0.2582911252975464,
1.4590637683868408,
-0.528171718120575,
0.03164331242442131,
0.4133714437484741,
-0.5024266839027405,
-0.4838222563266754,
-0.5368131995201111,
0.6816977262496948,
0.08079607784748077,
-0.9999671578407288,
-0.07117350399494171,
-0.07712152600288391,
-0.1608818918466568,
0.23580411076545715,
-1.5008788108825684,
-0.2095736265182495,
-0.40890762209892273,
-0.6227977275848389,
-1.212133526802063,
0.023806534707546234,
1.341840386390686,
-0.781912088394165,
-0.2319626808166504,
0.42978599667549133,
0.3754015266895294,
0.4925101697444916,
0.5952187776565552,
-0.7584205865859985,
-0.2777736783027649,
-0.23539020121097565,
-0.4181499779224396,
0.2892031669616699,
1.3368207216262817,
-0.09037327766418457,
-1.01258385181427,
0.6892426609992981,
-0.3961775302886963,
0.10616268962621689,
1.9703009128570557,
0.05861596763134003,
-0.8708340525627136,
0.2957013249397278,
-0.7094140648841858,
1.8507113456726074,
1.7587523460388184,
1.353331446647644,
-0.11121436208486557,
-0.867918074131012,
0.6047595739364624,
-0.26697441935539246,
-0.3532974123954773,
0.988378643989563,
0.4226173162460327,
-0.143701434135437,
-1.462353229522705,
0.6863227486610413,
1.2970541715621948,
-0.8749797940254211,
-0.7869485020637512,
0.08765100687742233,
-0.8759879469871521,
1.0502328872680664,
0.7010849118232727,
0.3260561525821686,
0.22208543121814728,
1.5750049352645874,
0.735317051410675,
-0.49817609786987305,
0.538673460483551,
0.4638315439224243,
-0.15653643012046814,
-2.1409363746643066,
-1.0982385873794556,
0.33967891335487366,
-0.3741922080516815,
-1.619206190109253,
1.4109925031661987,
-1.1665022373199463,
-0.9103996753692627,
0.5765758156776428,
0.1743335872888565,
1.415264368057251,
0.39458441734313965,
1.6748367547988892,
2.0942647457122803,
0.8692116737365723,
0.3165307939052582,
1.271085262298584,
-0.09687850624322891,
-0.413417786359787,
1.827391266822815,
-0.42873960733413696,
0.5253797173500061,
0.9651819467544556,
-0.28378862142562866,
-1.0664998292922974,
-0.7772405743598938,
-1.2037311792373657,
-0.6358840465545654,
1.1217103004455566,
0.08667631447315216,
-1.1285561323165894,
0.22815975546836853,
1.5915578603744507,
0.09592636674642563,
-0.29272234439849854,
0.720644474029541,
0.42704495787620544,
-0.7580556273460388,
-0.06492345035076141,
-0.8898020386695862,
0.5925244092941284,
-0.15157821774482727,
-0.3144459128379822,
0.24971240758895874,
0.506808340549469,
1.393838882446289,
-0.026024773716926575,
0.10831249505281448,
1.2433993816375732,
-1.3107569217681885,
1.527117371559143,
-0.6435328125953674,
0.2585667073726654,
-2.3915538787841797,
1.406697392463684,
-0.8143830895423889,
1.8408129215240479,
-2.59192156791687,
0.45675987005233765,
-0.5510923862457275,
-0.45276883244514465,
0.2208063304424286,
-0.37443721294403076,
0.1384323388338089,
-0.1461780071258545,
-1.0412933826446533,
-0.07972409576177597,
-0.7690739631652832,
0.5777996778488159,
1.157812237739563,
1.3534780740737915,
-1.028786540031433,
-0.39164817333221436,
-1.8266377449035645,
-0.17707474529743195,
-0.632651150226593,
0.30039113759994507,
-1.915682077407837,
-0.19096671044826508,
-1.9432240724563599,
-2.4925737380981445,
-1.4106557369232178,
-0.8479306697845459,
1.098036289215088,
0.14998359978199005,
-0.9818500280380249,
1.1799097061157227,
-0.3893318772315979,
-1.8461507558822632,
1.1121464967727661,
-2.2040960788726807
] |
https://github.com/huggingface/datasets/issues/5009 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly | Hi ! If you move `dataset_infos.json` from `data/` to the root of your dataset repository if should work :) | ## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 515 | 19 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Hi ! If you move `dataset_infos.json` from `data/` to the root of your dataset repository if should work :) | [
-1.1767548322677612,
-0.9491956830024719,
-0.8158513903617859,
1.3935505151748657,
-0.07760877162218094,
-1.2096201181411743,
0.14519676566123962,
-1.101981520652771,
1.625927209854126,
-0.7225667834281921,
0.2835047245025635,
-1.7219820022583008,
-0.06851905584335327,
-0.6020216941833496,
-0.7026883959770203,
-0.9104107618331909,
-0.3298652768135071,
-0.8423004150390625,
0.9767367243766785,
2.493403196334839,
1.225740909576416,
-1.2641856670379639,
2.7374987602233887,
0.7038471698760986,
-0.280811607837677,
-0.9609861373901367,
0.5246084928512573,
-0.051943693310022354,
-1.3116977214813232,
-0.4307197332382202,
-0.987808883190155,
-0.00018073339015245438,
-0.5740779638290405,
-0.5059898495674133,
0.16210471093654633,
0.3886721730232239,
-0.3499446511268616,
-0.339586466550827,
-0.5573390126228333,
-0.7140049338340759,
0.5231000781059265,
-0.36560189723968506,
0.9699820280075073,
-0.33397775888442993,
1.77835214138031,
-0.6300383806228638,
0.42593318223953247,
0.7335081696510315,
1.272831916809082,
0.23580150306224823,
0.09409519284963608,
0.3273729979991913,
0.3161623775959015,
0.08621193468570709,
0.4726007580757141,
1.2069029808044434,
0.5613086223602295,
0.4832024872303009,
0.7295911312103271,
-2.196279525756836,
1.2579030990600586,
-0.9820602536201477,
0.28486883640289307,
1.3308348655700684,
-0.8848650455474854,
0.35985076427459717,
-1.8743730783462524,
-0.10791432857513428,
0.5685137510299683,
-2.226616621017456,
0.24423488974571228,
-1.339465618133545,
-0.48758664727211,
0.9630916714668274,
0.2907906472682953,
-1.2159596681594849,
0.17748002707958221,
-0.5028072595596313,
1.0391056537628174,
0.4506506323814392,
1.1938737630844116,
-1.6509482860565186,
-0.12039069086313248,
-0.295674592256546,
0.09270841628313065,
-1.3385628461837769,
-1.555009365081787,
0.581320583820343,
0.5859531164169312,
0.7520624399185181,
-0.13670757412910461,
1.0903822183609009,
-1.0413693189620972,
0.7837634086608887,
-0.9173579216003418,
-1.7310864925384521,
-1.3511854410171509,
-2.2606425285339355,
-2.2927603721618652,
0.7865217924118042,
-0.4969102442264557,
-0.5016077756881714,
2.068972587585449,
-1.0373209714889526,
-1.7634508609771729,
1.0879086256027222,
0.3340775966644287,
-0.06641015410423279,
2.380702018737793,
0.24304786324501038,
-0.767290472984314,
0.5138272047042847,
-0.7055226564407349,
0.757663905620575,
-0.22906725108623505,
1.397152066230774,
0.5151922702789307,
-1.0003823041915894,
1.609587550163269,
-0.3788045048713684,
0.6213095188140869,
-0.7234678864479065,
-0.5399230122566223,
-0.8193785548210144,
0.2480074167251587,
1.9476224184036255,
-0.3746165931224823,
1.6550418138504028,
-0.2366514950990677,
-1.6223841905593872,
-1.577374815940857,
0.8003396987915039,
0.4590665102005005,
-0.8232707381248474,
0.11708999425172806,
-0.4058852195739746,
0.13335292041301727,
0.02861597016453743,
1.1146318912506104,
1.2158411741256714,
0.6822187304496765,
-0.28420397639274597,
-0.8378336429595947,
0.1700916737318039,
-0.04893621429800987,
-0.7014268636703491,
-1.7070308923721313,
-0.42095792293548584,
0.17551590502262115,
0.6518149375915527,
-1.1931233406066895,
1.7180132865905762,
0.8526495099067688,
1.9347312450408936,
1.0512478351593018,
-0.41610005497932434,
1.4538308382034302,
0.06328574568033218,
1.8462820053100586,
-0.5115999579429626,
0.6484323143959045,
-0.3689247965812683,
-1.1893748044967651,
0.8158851861953735,
-0.36323124170303345,
-2.051954507827759,
-0.7392709851264954,
-0.7723957896232605,
-0.18114590644836426,
-0.7220182418823242,
0.9152830243110657,
-0.3590890169143677,
-1.4449412822723389,
0.22447839379310608,
-0.6853388547897339,
0.0558013841509819,
-1.345318078994751,
0.23290401697158813,
0.7125895619392395,
-0.6736940741539001,
0.05386009067296982,
-0.24137985706329346,
-1.2951011657714844,
-0.46405619382858276,
0.2888719439506531,
1.8967618942260742,
-0.7632476687431335,
0.9371138215065002,
1.0416765213012695,
-0.7366002202033997,
0.12703751027584076,
0.36761099100112915,
-0.347126305103302,
0.8188834190368652,
-1.0916954278945923,
-0.30935412645339966,
1.2199275493621826,
-0.1290525197982788,
-0.5949993133544922,
1.365810751914978,
0.7718394994735718,
-1.059948444366455,
-0.20949845016002655,
-0.203250452876091,
-0.8311050534248352,
-0.01930134743452072,
-1.57277512550354,
-0.1586231291294098,
0.41382962465286255,
-1.3680803775787354,
-0.45112699270248413,
-0.2790679335594177,
1.273810625076294,
-0.210229754447937,
1.4066792726516724,
-0.30044567584991455,
-0.2361927181482315,
-0.34066611528396606,
-0.4905788004398346,
0.16217564046382904,
-0.20281054079532623,
-0.6287326812744141,
0.2456859052181244,
-0.8029535412788391,
0.2847333252429962,
1.4526970386505127,
0.35097599029541016,
0.024905581027269363,
0.529617190361023,
1.0820894241333008,
0.3986855149269104,
-0.11283408850431442,
-0.9139460325241089,
-1.5781304836273193,
2.015308380126953,
-1.444027304649353,
1.8653367757797241,
0.790647566318512,
-0.036155182868242264,
-1.847060203552246,
-1.8492897748947144,
1.3862361907958984,
1.1397407054901123,
2.4404070377349854,
0.5615025758743286,
0.4392884075641632,
-0.7667044401168823,
-0.7228814363479614,
0.37971317768096924,
-1.0212161540985107,
-0.7355970740318298,
0.18340416252613068,
2.4027087688446045,
1.7400137186050415,
-0.548954427242279,
-0.2267714887857437,
-0.9297861456871033,
1.1890227794647217,
-0.20049931108951569,
0.2509783208370209,
2.052809476852417,
-0.32544851303100586,
-1.053432583808899,
1.2672226428985596,
-2.282034397125244,
0.154961496591568,
2.0190603733062744,
0.24907812476158142,
0.08077211678028107,
-1.4992707967758179,
-0.6420232653617859,
-0.23545308411121368,
-0.4634445905685425,
-1.2982299327850342,
0.578120231628418,
-0.27479422092437744,
-0.8528759479522705,
-1.5013010501861572,
0.02021234855055809,
-1.1287329196929932,
-1.660786509513855,
0.30629345774650574,
1.902036190032959,
2.061690092086792,
-0.7262170910835266,
1.468990445137024,
-0.22243423759937286,
0.16734467446804047,
1.1818883419036865,
1.2705973386764526,
3.111229658126831,
1.857857346534729,
-1.3040904998779297,
0.7243930101394653,
-0.09152788668870926,
-0.5335765480995178,
1.1614042520523071,
-1.0512477159500122,
1.2351384162902832,
-0.282963365316391,
-1.2070904970169067,
-1.24753999710083,
1.0010230541229248,
0.395001083612442,
0.007528378628194332,
-0.49633094668388367,
1.2426496744155884,
0.08471854776144028,
1.2984654903411865,
0.6008298993110657,
-0.38125330209732056,
0.62783282995224,
-0.31653571128845215,
-0.5388824343681335,
1.5890002250671387,
0.2603795826435089,
-1.4472882747650146,
-2.399994373321533,
-0.24713818728923798,
-0.8629116415977478,
0.08274354785680771,
-0.6120669841766357,
-1.0162986516952515,
1.6767425537109375,
0.3848084509372711,
-1.2386457920074463,
-0.2400932013988495,
-0.3122904598712921,
-0.5762194395065308,
2.6620612144470215,
-1.3406516313552856,
-0.13274304568767548,
-0.9793283343315125,
-0.6510740518569946,
1.612295389175415,
-1.1232534646987915,
-0.125529482960701,
-1.101654291152954,
-0.6200364828109741,
-1.3698400259017944,
-0.5446001887321472,
0.055851973593235016,
-0.9383742809295654,
0.8936719298362732,
0.15387997031211853,
-1.1459416151046753,
-0.1827535182237625,
-0.9352536797523499,
0.9452283382415771,
-0.19836005568504333,
0.21249611675739288,
1.923620581626892,
0.47158536314964294,
-0.38772404193878174,
0.6982332468032837,
1.2111034393310547,
0.6057168841362,
-0.7058472633361816,
0.1290518194437027,
-0.7608948349952698,
0.2598643898963928,
-1.3897300958633423,
0.25217369198799133,
-2.8347480297088623,
0.7291800379753113,
-0.10777866095304489,
-0.05160684511065483,
0.027741998434066772,
-1.2881035804748535,
1.029348373413086,
2.6106507778167725,
-1.1808193922042847,
0.4695478677749634,
0.3997013568878174,
1.1898105144500732,
-1.569549322128296,
0.23176699876785278,
-0.48906266689300537,
2.088510274887085,
0.18944069743156433,
1.1932166814804077,
-0.5436043739318848,
-2.154167890548706,
0.6014764308929443,
-1.232291579246521,
-1.119879126548767,
0.8397927284240723,
-0.9079840183258057,
0.1408461630344391,
-1.4570704698562622,
-0.21800357103347778,
-0.9462484121322632,
-1.2078537940979004,
0.7794972062110901,
0.1275378167629242,
0.5522536635398865,
-0.515717625617981,
0.34248775243759155,
-2.2268881797790527,
-1.3835557699203491,
-0.17031952738761902,
-0.9943810701370239,
0.44989705085754395,
-0.3152509927749634,
0.6728278994560242,
-0.21068337559700012,
0.047143835574388504,
0.3915666341781616,
1.4020116329193115,
3.3161330223083496,
0.1459021270275116,
0.3064032793045044,
-0.10451827943325043,
-0.9820468425750732,
1.4052067995071411,
0.9043801426887512,
-0.0565604530274868,
-0.6143860220909119,
-1.0181819200515747,
1.1852467060089111,
2.0618784427642822,
1.1152479648590088,
0.05763499438762665,
-0.8394444584846497,
-0.7716976404190063,
0.03739296644926071,
0.20337864756584167,
0.4730131924152374,
0.8882830142974854,
0.04235297441482544,
0.08550131320953369,
1.4686540365219116,
1.1135685443878174,
-0.3652702569961548,
0.3656998872756958,
-0.8184607625007629,
-0.4255903661251068,
0.442157119512558,
0.23154094815254211,
0.08620477467775345,
0.34158414602279663,
-1.0971436500549316,
-0.24629920721054077,
-0.4620552361011505,
-0.9363791942596436,
-0.7291603088378906,
-0.41946786642074585,
-0.3699731230735779,
1.6146602630615234,
0.06866854429244995,
-0.48665422201156616,
0.04831209033727646,
-0.7510673403739929,
-0.1538616567850113,
-1.098608136177063,
0.31419020891189575,
-0.1593894064426422,
-0.10720545053482056,
-0.0480152852833271,
1.7239543199539185,
-0.9984956383705139,
-2.1096229553222656,
0.1882096529006958,
0.2479332685470581,
-0.32525384426116943,
0.14002415537834167,
1.6238861083984375,
0.6075106263160706,
1.4141396284103394,
1.2765164375305176,
0.9455858469009399,
-0.6906675696372986,
-1.2420238256454468,
0.6772680282592773,
0.9465574026107788,
-1.3495088815689087,
0.8644546866416931,
-0.10239153355360031,
-0.5057929754257202,
0.604191780090332,
1.307532548904419,
0.40324121713638306,
-2.0517590045928955,
0.8048239946365356,
-0.903881311416626,
0.6383981108665466,
0.7007335424423218,
0.7553361058235168,
0.23394986987113953,
0.7719429135322571,
-1.1608248949050903,
-1.1367789506912231,
-0.7325112819671631,
-0.5692110061645508,
1.9481837749481201,
-0.07944213598966599,
0.5311486124992371,
-0.15341000258922577,
-1.2305712699890137,
-0.0002648215740919113,
0.6768003106117249,
0.4183899760246277,
-0.5079213380813599,
0.8313072919845581,
-0.55682772397995,
-1.0430848598480225,
-1.3473869562149048,
-0.40974944829940796,
-1.102118968963623,
-0.9630776047706604,
0.9818909168243408,
0.7376902103424072,
0.3737943768501282,
1.8448021411895752,
0.6350353956222534,
0.3218485116958618,
-2.6247119903564453,
0.9485618472099304,
0.27882808446884155,
-0.08929896354675293,
0.943482518196106,
0.32183218002319336,
1.1047059297561646,
-0.07485640794038773,
0.5475848317146301,
-2.3623533248901367,
2.2699358463287354,
-0.2475501298904419,
0.6657047271728516,
0.027345050126314163,
-0.21429510414600372,
1.1143912076950073,
0.44934767484664917,
0.5181334614753723,
-0.9911567568778992,
0.7018203735351562,
-0.6182271242141724,
1.150820255279541,
1.000584602355957,
-0.9242182970046997,
0.15802375972270966,
1.3696811199188232,
0.44245147705078125,
-0.4366397261619568,
-0.9237833619117737,
-0.8781682252883911,
1.0313608646392822,
1.6846308708190918,
-0.01667633466422558,
-0.03056110069155693,
0.9668232202529907,
0.6385859251022339,
-1.3339933156967163,
0.10014595091342926,
-0.7240704894065857,
-0.7079388499259949,
1.6305830478668213,
2.039050340652466,
-0.08283797651529312,
-0.17035256326198578,
-0.7689527273178101,
-1.2556520700454712,
0.7659721374511719,
0.009255158714950085,
0.16729794442653656,
0.7084140777587891,
-0.7074413299560547,
1.156075358390808,
0.7919023036956787,
0.9744800925254822,
0.17641578614711761,
0.3684293329715729,
0.31062519550323486,
-0.35042664408683777,
-1.1588387489318848,
-0.31132611632347107,
-1.0570095777511597,
-2.511884927749634,
0.516665518283844,
-0.20998050272464752,
-1.470169186592102,
0.0815071165561676,
-1.037182331085205,
0.885395348072052,
-0.6274901628494263,
-1.0480282306671143,
-1.626675009727478,
0.29632577300071716,
-0.21890577673912048,
0.9210015535354614,
-1.6078060865402222,
-0.1791050136089325,
1.1291313171386719,
0.9967717528343201,
-0.6364224553108215,
0.947332501411438,
0.25587135553359985,
0.9771762490272522,
0.8504989147186279,
-0.35954365134239197,
0.5473794937133789,
0.07670518010854721,
-1.3579007387161255,
0.42314061522483826,
1.2116719484329224,
0.2582911252975464,
1.4590637683868408,
-0.528171718120575,
0.03164331242442131,
0.4133714437484741,
-0.5024266839027405,
-0.4838222563266754,
-0.5368131995201111,
0.6816977262496948,
0.08079607784748077,
-0.9999671578407288,
-0.07117350399494171,
-0.07712152600288391,
-0.1608818918466568,
0.23580411076545715,
-1.5008788108825684,
-0.2095736265182495,
-0.40890762209892273,
-0.6227977275848389,
-1.212133526802063,
0.023806534707546234,
1.341840386390686,
-0.781912088394165,
-0.2319626808166504,
0.42978599667549133,
0.3754015266895294,
0.4925101697444916,
0.5952187776565552,
-0.7584205865859985,
-0.2777736783027649,
-0.23539020121097565,
-0.4181499779224396,
0.2892031669616699,
1.3368207216262817,
-0.09037327766418457,
-1.01258385181427,
0.6892426609992981,
-0.3961775302886963,
0.10616268962621689,
1.9703009128570557,
0.05861596763134003,
-0.8708340525627136,
0.2957013249397278,
-0.7094140648841858,
1.8507113456726074,
1.7587523460388184,
1.353331446647644,
-0.11121436208486557,
-0.867918074131012,
0.6047595739364624,
-0.26697441935539246,
-0.3532974123954773,
0.988378643989563,
0.4226173162460327,
-0.143701434135437,
-1.462353229522705,
0.6863227486610413,
1.2970541715621948,
-0.8749797940254211,
-0.7869485020637512,
0.08765100687742233,
-0.8759879469871521,
1.0502328872680664,
0.7010849118232727,
0.3260561525821686,
0.22208543121814728,
1.5750049352645874,
0.735317051410675,
-0.49817609786987305,
0.538673460483551,
0.4638315439224243,
-0.15653643012046814,
-2.1409363746643066,
-1.0982385873794556,
0.33967891335487366,
-0.3741922080516815,
-1.619206190109253,
1.4109925031661987,
-1.1665022373199463,
-0.9103996753692627,
0.5765758156776428,
0.1743335872888565,
1.415264368057251,
0.39458441734313965,
1.6748367547988892,
2.0942647457122803,
0.8692116737365723,
0.3165307939052582,
1.271085262298584,
-0.09687850624322891,
-0.413417786359787,
1.827391266822815,
-0.42873960733413696,
0.5253797173500061,
0.9651819467544556,
-0.28378862142562866,
-1.0664998292922974,
-0.7772405743598938,
-1.2037311792373657,
-0.6358840465545654,
1.1217103004455566,
0.08667631447315216,
-1.1285561323165894,
0.22815975546836853,
1.5915578603744507,
0.09592636674642563,
-0.29272234439849854,
0.720644474029541,
0.42704495787620544,
-0.7580556273460388,
-0.06492345035076141,
-0.8898020386695862,
0.5925244092941284,
-0.15157821774482727,
-0.3144459128379822,
0.24971240758895874,
0.506808340549469,
1.393838882446289,
-0.026024773716926575,
0.10831249505281448,
1.2433993816375732,
-1.3107569217681885,
1.527117371559143,
-0.6435328125953674,
0.2585667073726654,
-2.3915538787841797,
1.406697392463684,
-0.8143830895423889,
1.8408129215240479,
-2.59192156791687,
0.45675987005233765,
-0.5510923862457275,
-0.45276883244514465,
0.2208063304424286,
-0.37443721294403076,
0.1384323388338089,
-0.1461780071258545,
-1.0412933826446533,
-0.07972409576177597,
-0.7690739631652832,
0.5777996778488159,
1.157812237739563,
1.3534780740737915,
-1.028786540031433,
-0.39164817333221436,
-1.8266377449035645,
-0.17707474529743195,
-0.632651150226593,
0.30039113759994507,
-1.915682077407837,
-0.19096671044826508,
-1.9432240724563599,
-2.4925737380981445,
-1.4106557369232178,
-0.8479306697845459,
1.098036289215088,
0.14998359978199005,
-0.9818500280380249,
1.1799097061157227,
-0.3893318772315979,
-1.8461507558822632,
1.1121464967727661,
-2.2040960788726807
] |
https://github.com/huggingface/datasets/issues/5009 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly | I tried that and pushed to the [hub](https://huggingface.co/datasets/StonyBrookNLP/tellmewhy/tree/main). Now, there is a new error.
```
File "/home/yklal95/tellmewhy/src/prepare_data.py", line 67, in main
dataset = load_dataset('StonyBrookNLP/tellmewhy')
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 775, in _download_and_prepare
verify_checksums(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/utils/info_utils.py", line 33, in verify_checksums
raise ExpectedMoreDownloadedFiles(str(set(expected_checksums) - set(recorded_checksums)))
datasets.utils.info_utils.ExpectedMoreDownloadedFiles: {'/home/yklal95/tellmewhy/data/test.json', '/home/yklal95/tellmewhy/data/validation.json', '/home/yklal95/tellmewhy/data/train.json'}
```
No changes were made to any of the other files and they are still on the hub. Let me know if you have any ideas @lhoestq Thanks! | ## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 515 | 87 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
I tried that and pushed to the [hub](https://huggingface.co/datasets/StonyBrookNLP/tellmewhy/tree/main). Now, there is a new error.
```
File "/home/yklal95/tellmewhy/src/prepare_data.py", line 67, in main
dataset = load_dataset('StonyBrookNLP/tellmewhy')
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 775, in _download_and_prepare
verify_checksums(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/utils/info_utils.py", line 33, in verify_checksums
raise ExpectedMoreDownloadedFiles(str(set(expected_checksums) - set(recorded_checksums)))
datasets.utils.info_utils.ExpectedMoreDownloadedFiles: {'/home/yklal95/tellmewhy/data/test.json', '/home/yklal95/tellmewhy/data/validation.json', '/home/yklal95/tellmewhy/data/train.json'}
```
No changes were made to any of the other files and they are still on the hub. Let me know if you have any ideas @lhoestq Thanks! | [
-1.1767548322677612,
-0.9491956830024719,
-0.8158513903617859,
1.3935505151748657,
-0.07760877162218094,
-1.2096201181411743,
0.14519676566123962,
-1.101981520652771,
1.625927209854126,
-0.7225667834281921,
0.2835047245025635,
-1.7219820022583008,
-0.06851905584335327,
-0.6020216941833496,
-0.7026883959770203,
-0.9104107618331909,
-0.3298652768135071,
-0.8423004150390625,
0.9767367243766785,
2.493403196334839,
1.225740909576416,
-1.2641856670379639,
2.7374987602233887,
0.7038471698760986,
-0.280811607837677,
-0.9609861373901367,
0.5246084928512573,
-0.051943693310022354,
-1.3116977214813232,
-0.4307197332382202,
-0.987808883190155,
-0.00018073339015245438,
-0.5740779638290405,
-0.5059898495674133,
0.16210471093654633,
0.3886721730232239,
-0.3499446511268616,
-0.339586466550827,
-0.5573390126228333,
-0.7140049338340759,
0.5231000781059265,
-0.36560189723968506,
0.9699820280075073,
-0.33397775888442993,
1.77835214138031,
-0.6300383806228638,
0.42593318223953247,
0.7335081696510315,
1.272831916809082,
0.23580150306224823,
0.09409519284963608,
0.3273729979991913,
0.3161623775959015,
0.08621193468570709,
0.4726007580757141,
1.2069029808044434,
0.5613086223602295,
0.4832024872303009,
0.7295911312103271,
-2.196279525756836,
1.2579030990600586,
-0.9820602536201477,
0.28486883640289307,
1.3308348655700684,
-0.8848650455474854,
0.35985076427459717,
-1.8743730783462524,
-0.10791432857513428,
0.5685137510299683,
-2.226616621017456,
0.24423488974571228,
-1.339465618133545,
-0.48758664727211,
0.9630916714668274,
0.2907906472682953,
-1.2159596681594849,
0.17748002707958221,
-0.5028072595596313,
1.0391056537628174,
0.4506506323814392,
1.1938737630844116,
-1.6509482860565186,
-0.12039069086313248,
-0.295674592256546,
0.09270841628313065,
-1.3385628461837769,
-1.555009365081787,
0.581320583820343,
0.5859531164169312,
0.7520624399185181,
-0.13670757412910461,
1.0903822183609009,
-1.0413693189620972,
0.7837634086608887,
-0.9173579216003418,
-1.7310864925384521,
-1.3511854410171509,
-2.2606425285339355,
-2.2927603721618652,
0.7865217924118042,
-0.4969102442264557,
-0.5016077756881714,
2.068972587585449,
-1.0373209714889526,
-1.7634508609771729,
1.0879086256027222,
0.3340775966644287,
-0.06641015410423279,
2.380702018737793,
0.24304786324501038,
-0.767290472984314,
0.5138272047042847,
-0.7055226564407349,
0.757663905620575,
-0.22906725108623505,
1.397152066230774,
0.5151922702789307,
-1.0003823041915894,
1.609587550163269,
-0.3788045048713684,
0.6213095188140869,
-0.7234678864479065,
-0.5399230122566223,
-0.8193785548210144,
0.2480074167251587,
1.9476224184036255,
-0.3746165931224823,
1.6550418138504028,
-0.2366514950990677,
-1.6223841905593872,
-1.577374815940857,
0.8003396987915039,
0.4590665102005005,
-0.8232707381248474,
0.11708999425172806,
-0.4058852195739746,
0.13335292041301727,
0.02861597016453743,
1.1146318912506104,
1.2158411741256714,
0.6822187304496765,
-0.28420397639274597,
-0.8378336429595947,
0.1700916737318039,
-0.04893621429800987,
-0.7014268636703491,
-1.7070308923721313,
-0.42095792293548584,
0.17551590502262115,
0.6518149375915527,
-1.1931233406066895,
1.7180132865905762,
0.8526495099067688,
1.9347312450408936,
1.0512478351593018,
-0.41610005497932434,
1.4538308382034302,
0.06328574568033218,
1.8462820053100586,
-0.5115999579429626,
0.6484323143959045,
-0.3689247965812683,
-1.1893748044967651,
0.8158851861953735,
-0.36323124170303345,
-2.051954507827759,
-0.7392709851264954,
-0.7723957896232605,
-0.18114590644836426,
-0.7220182418823242,
0.9152830243110657,
-0.3590890169143677,
-1.4449412822723389,
0.22447839379310608,
-0.6853388547897339,
0.0558013841509819,
-1.345318078994751,
0.23290401697158813,
0.7125895619392395,
-0.6736940741539001,
0.05386009067296982,
-0.24137985706329346,
-1.2951011657714844,
-0.46405619382858276,
0.2888719439506531,
1.8967618942260742,
-0.7632476687431335,
0.9371138215065002,
1.0416765213012695,
-0.7366002202033997,
0.12703751027584076,
0.36761099100112915,
-0.347126305103302,
0.8188834190368652,
-1.0916954278945923,
-0.30935412645339966,
1.2199275493621826,
-0.1290525197982788,
-0.5949993133544922,
1.365810751914978,
0.7718394994735718,
-1.059948444366455,
-0.20949845016002655,
-0.203250452876091,
-0.8311050534248352,
-0.01930134743452072,
-1.57277512550354,
-0.1586231291294098,
0.41382962465286255,
-1.3680803775787354,
-0.45112699270248413,
-0.2790679335594177,
1.273810625076294,
-0.210229754447937,
1.4066792726516724,
-0.30044567584991455,
-0.2361927181482315,
-0.34066611528396606,
-0.4905788004398346,
0.16217564046382904,
-0.20281054079532623,
-0.6287326812744141,
0.2456859052181244,
-0.8029535412788391,
0.2847333252429962,
1.4526970386505127,
0.35097599029541016,
0.024905581027269363,
0.529617190361023,
1.0820894241333008,
0.3986855149269104,
-0.11283408850431442,
-0.9139460325241089,
-1.5781304836273193,
2.015308380126953,
-1.444027304649353,
1.8653367757797241,
0.790647566318512,
-0.036155182868242264,
-1.847060203552246,
-1.8492897748947144,
1.3862361907958984,
1.1397407054901123,
2.4404070377349854,
0.5615025758743286,
0.4392884075641632,
-0.7667044401168823,
-0.7228814363479614,
0.37971317768096924,
-1.0212161540985107,
-0.7355970740318298,
0.18340416252613068,
2.4027087688446045,
1.7400137186050415,
-0.548954427242279,
-0.2267714887857437,
-0.9297861456871033,
1.1890227794647217,
-0.20049931108951569,
0.2509783208370209,
2.052809476852417,
-0.32544851303100586,
-1.053432583808899,
1.2672226428985596,
-2.282034397125244,
0.154961496591568,
2.0190603733062744,
0.24907812476158142,
0.08077211678028107,
-1.4992707967758179,
-0.6420232653617859,
-0.23545308411121368,
-0.4634445905685425,
-1.2982299327850342,
0.578120231628418,
-0.27479422092437744,
-0.8528759479522705,
-1.5013010501861572,
0.02021234855055809,
-1.1287329196929932,
-1.660786509513855,
0.30629345774650574,
1.902036190032959,
2.061690092086792,
-0.7262170910835266,
1.468990445137024,
-0.22243423759937286,
0.16734467446804047,
1.1818883419036865,
1.2705973386764526,
3.111229658126831,
1.857857346534729,
-1.3040904998779297,
0.7243930101394653,
-0.09152788668870926,
-0.5335765480995178,
1.1614042520523071,
-1.0512477159500122,
1.2351384162902832,
-0.282963365316391,
-1.2070904970169067,
-1.24753999710083,
1.0010230541229248,
0.395001083612442,
0.007528378628194332,
-0.49633094668388367,
1.2426496744155884,
0.08471854776144028,
1.2984654903411865,
0.6008298993110657,
-0.38125330209732056,
0.62783282995224,
-0.31653571128845215,
-0.5388824343681335,
1.5890002250671387,
0.2603795826435089,
-1.4472882747650146,
-2.399994373321533,
-0.24713818728923798,
-0.8629116415977478,
0.08274354785680771,
-0.6120669841766357,
-1.0162986516952515,
1.6767425537109375,
0.3848084509372711,
-1.2386457920074463,
-0.2400932013988495,
-0.3122904598712921,
-0.5762194395065308,
2.6620612144470215,
-1.3406516313552856,
-0.13274304568767548,
-0.9793283343315125,
-0.6510740518569946,
1.612295389175415,
-1.1232534646987915,
-0.125529482960701,
-1.101654291152954,
-0.6200364828109741,
-1.3698400259017944,
-0.5446001887321472,
0.055851973593235016,
-0.9383742809295654,
0.8936719298362732,
0.15387997031211853,
-1.1459416151046753,
-0.1827535182237625,
-0.9352536797523499,
0.9452283382415771,
-0.19836005568504333,
0.21249611675739288,
1.923620581626892,
0.47158536314964294,
-0.38772404193878174,
0.6982332468032837,
1.2111034393310547,
0.6057168841362,
-0.7058472633361816,
0.1290518194437027,
-0.7608948349952698,
0.2598643898963928,
-1.3897300958633423,
0.25217369198799133,
-2.8347480297088623,
0.7291800379753113,
-0.10777866095304489,
-0.05160684511065483,
0.027741998434066772,
-1.2881035804748535,
1.029348373413086,
2.6106507778167725,
-1.1808193922042847,
0.4695478677749634,
0.3997013568878174,
1.1898105144500732,
-1.569549322128296,
0.23176699876785278,
-0.48906266689300537,
2.088510274887085,
0.18944069743156433,
1.1932166814804077,
-0.5436043739318848,
-2.154167890548706,
0.6014764308929443,
-1.232291579246521,
-1.119879126548767,
0.8397927284240723,
-0.9079840183258057,
0.1408461630344391,
-1.4570704698562622,
-0.21800357103347778,
-0.9462484121322632,
-1.2078537940979004,
0.7794972062110901,
0.1275378167629242,
0.5522536635398865,
-0.515717625617981,
0.34248775243759155,
-2.2268881797790527,
-1.3835557699203491,
-0.17031952738761902,
-0.9943810701370239,
0.44989705085754395,
-0.3152509927749634,
0.6728278994560242,
-0.21068337559700012,
0.047143835574388504,
0.3915666341781616,
1.4020116329193115,
3.3161330223083496,
0.1459021270275116,
0.3064032793045044,
-0.10451827943325043,
-0.9820468425750732,
1.4052067995071411,
0.9043801426887512,
-0.0565604530274868,
-0.6143860220909119,
-1.0181819200515747,
1.1852467060089111,
2.0618784427642822,
1.1152479648590088,
0.05763499438762665,
-0.8394444584846497,
-0.7716976404190063,
0.03739296644926071,
0.20337864756584167,
0.4730131924152374,
0.8882830142974854,
0.04235297441482544,
0.08550131320953369,
1.4686540365219116,
1.1135685443878174,
-0.3652702569961548,
0.3656998872756958,
-0.8184607625007629,
-0.4255903661251068,
0.442157119512558,
0.23154094815254211,
0.08620477467775345,
0.34158414602279663,
-1.0971436500549316,
-0.24629920721054077,
-0.4620552361011505,
-0.9363791942596436,
-0.7291603088378906,
-0.41946786642074585,
-0.3699731230735779,
1.6146602630615234,
0.06866854429244995,
-0.48665422201156616,
0.04831209033727646,
-0.7510673403739929,
-0.1538616567850113,
-1.098608136177063,
0.31419020891189575,
-0.1593894064426422,
-0.10720545053482056,
-0.0480152852833271,
1.7239543199539185,
-0.9984956383705139,
-2.1096229553222656,
0.1882096529006958,
0.2479332685470581,
-0.32525384426116943,
0.14002415537834167,
1.6238861083984375,
0.6075106263160706,
1.4141396284103394,
1.2765164375305176,
0.9455858469009399,
-0.6906675696372986,
-1.2420238256454468,
0.6772680282592773,
0.9465574026107788,
-1.3495088815689087,
0.8644546866416931,
-0.10239153355360031,
-0.5057929754257202,
0.604191780090332,
1.307532548904419,
0.40324121713638306,
-2.0517590045928955,
0.8048239946365356,
-0.903881311416626,
0.6383981108665466,
0.7007335424423218,
0.7553361058235168,
0.23394986987113953,
0.7719429135322571,
-1.1608248949050903,
-1.1367789506912231,
-0.7325112819671631,
-0.5692110061645508,
1.9481837749481201,
-0.07944213598966599,
0.5311486124992371,
-0.15341000258922577,
-1.2305712699890137,
-0.0002648215740919113,
0.6768003106117249,
0.4183899760246277,
-0.5079213380813599,
0.8313072919845581,
-0.55682772397995,
-1.0430848598480225,
-1.3473869562149048,
-0.40974944829940796,
-1.102118968963623,
-0.9630776047706604,
0.9818909168243408,
0.7376902103424072,
0.3737943768501282,
1.8448021411895752,
0.6350353956222534,
0.3218485116958618,
-2.6247119903564453,
0.9485618472099304,
0.27882808446884155,
-0.08929896354675293,
0.943482518196106,
0.32183218002319336,
1.1047059297561646,
-0.07485640794038773,
0.5475848317146301,
-2.3623533248901367,
2.2699358463287354,
-0.2475501298904419,
0.6657047271728516,
0.027345050126314163,
-0.21429510414600372,
1.1143912076950073,
0.44934767484664917,
0.5181334614753723,
-0.9911567568778992,
0.7018203735351562,
-0.6182271242141724,
1.150820255279541,
1.000584602355957,
-0.9242182970046997,
0.15802375972270966,
1.3696811199188232,
0.44245147705078125,
-0.4366397261619568,
-0.9237833619117737,
-0.8781682252883911,
1.0313608646392822,
1.6846308708190918,
-0.01667633466422558,
-0.03056110069155693,
0.9668232202529907,
0.6385859251022339,
-1.3339933156967163,
0.10014595091342926,
-0.7240704894065857,
-0.7079388499259949,
1.6305830478668213,
2.039050340652466,
-0.08283797651529312,
-0.17035256326198578,
-0.7689527273178101,
-1.2556520700454712,
0.7659721374511719,
0.009255158714950085,
0.16729794442653656,
0.7084140777587891,
-0.7074413299560547,
1.156075358390808,
0.7919023036956787,
0.9744800925254822,
0.17641578614711761,
0.3684293329715729,
0.31062519550323486,
-0.35042664408683777,
-1.1588387489318848,
-0.31132611632347107,
-1.0570095777511597,
-2.511884927749634,
0.516665518283844,
-0.20998050272464752,
-1.470169186592102,
0.0815071165561676,
-1.037182331085205,
0.885395348072052,
-0.6274901628494263,
-1.0480282306671143,
-1.626675009727478,
0.29632577300071716,
-0.21890577673912048,
0.9210015535354614,
-1.6078060865402222,
-0.1791050136089325,
1.1291313171386719,
0.9967717528343201,
-0.6364224553108215,
0.947332501411438,
0.25587135553359985,
0.9771762490272522,
0.8504989147186279,
-0.35954365134239197,
0.5473794937133789,
0.07670518010854721,
-1.3579007387161255,
0.42314061522483826,
1.2116719484329224,
0.2582911252975464,
1.4590637683868408,
-0.528171718120575,
0.03164331242442131,
0.4133714437484741,
-0.5024266839027405,
-0.4838222563266754,
-0.5368131995201111,
0.6816977262496948,
0.08079607784748077,
-0.9999671578407288,
-0.07117350399494171,
-0.07712152600288391,
-0.1608818918466568,
0.23580411076545715,
-1.5008788108825684,
-0.2095736265182495,
-0.40890762209892273,
-0.6227977275848389,
-1.212133526802063,
0.023806534707546234,
1.341840386390686,
-0.781912088394165,
-0.2319626808166504,
0.42978599667549133,
0.3754015266895294,
0.4925101697444916,
0.5952187776565552,
-0.7584205865859985,
-0.2777736783027649,
-0.23539020121097565,
-0.4181499779224396,
0.2892031669616699,
1.3368207216262817,
-0.09037327766418457,
-1.01258385181427,
0.6892426609992981,
-0.3961775302886963,
0.10616268962621689,
1.9703009128570557,
0.05861596763134003,
-0.8708340525627136,
0.2957013249397278,
-0.7094140648841858,
1.8507113456726074,
1.7587523460388184,
1.353331446647644,
-0.11121436208486557,
-0.867918074131012,
0.6047595739364624,
-0.26697441935539246,
-0.3532974123954773,
0.988378643989563,
0.4226173162460327,
-0.143701434135437,
-1.462353229522705,
0.6863227486610413,
1.2970541715621948,
-0.8749797940254211,
-0.7869485020637512,
0.08765100687742233,
-0.8759879469871521,
1.0502328872680664,
0.7010849118232727,
0.3260561525821686,
0.22208543121814728,
1.5750049352645874,
0.735317051410675,
-0.49817609786987305,
0.538673460483551,
0.4638315439224243,
-0.15653643012046814,
-2.1409363746643066,
-1.0982385873794556,
0.33967891335487366,
-0.3741922080516815,
-1.619206190109253,
1.4109925031661987,
-1.1665022373199463,
-0.9103996753692627,
0.5765758156776428,
0.1743335872888565,
1.415264368057251,
0.39458441734313965,
1.6748367547988892,
2.0942647457122803,
0.8692116737365723,
0.3165307939052582,
1.271085262298584,
-0.09687850624322891,
-0.413417786359787,
1.827391266822815,
-0.42873960733413696,
0.5253797173500061,
0.9651819467544556,
-0.28378862142562866,
-1.0664998292922974,
-0.7772405743598938,
-1.2037311792373657,
-0.6358840465545654,
1.1217103004455566,
0.08667631447315216,
-1.1285561323165894,
0.22815975546836853,
1.5915578603744507,
0.09592636674642563,
-0.29272234439849854,
0.720644474029541,
0.42704495787620544,
-0.7580556273460388,
-0.06492345035076141,
-0.8898020386695862,
0.5925244092941284,
-0.15157821774482727,
-0.3144459128379822,
0.24971240758895874,
0.506808340549469,
1.393838882446289,
-0.026024773716926575,
0.10831249505281448,
1.2433993816375732,
-1.3107569217681885,
1.527117371559143,
-0.6435328125953674,
0.2585667073726654,
-2.3915538787841797,
1.406697392463684,
-0.8143830895423889,
1.8408129215240479,
-2.59192156791687,
0.45675987005233765,
-0.5510923862457275,
-0.45276883244514465,
0.2208063304424286,
-0.37443721294403076,
0.1384323388338089,
-0.1461780071258545,
-1.0412933826446533,
-0.07972409576177597,
-0.7690739631652832,
0.5777996778488159,
1.157812237739563,
1.3534780740737915,
-1.028786540031433,
-0.39164817333221436,
-1.8266377449035645,
-0.17707474529743195,
-0.632651150226593,
0.30039113759994507,
-1.915682077407837,
-0.19096671044826508,
-1.9432240724563599,
-2.4925737380981445,
-1.4106557369232178,
-0.8479306697845459,
1.098036289215088,
0.14998359978199005,
-0.9818500280380249,
1.1799097061157227,
-0.3893318772315979,
-1.8461507558822632,
1.1121464967727661,
-2.2040960788726807
] |
https://github.com/huggingface/datasets/issues/5009 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly | Oh I see - the code I gave you returns local paths instead of URLs to store metadata about files to download.
I opened a PR in your repo here to remove this: https://huggingface.co/datasets/StonyBrookNLP/tellmewhy/discussions/1
sorry for the inconvenience ! | ## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 515 | 39 | Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
## Describe the bug
I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error.
## Steps to reproduce the bug
```python
dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy')
```
## Expected results
Successfully load the `StonyBrookNLP/tellmewhy` dataset.
## Actual results
```
Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff
Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253...
Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s]
Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s]
Traceback (most recent call last):
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module>
main(args)
File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main
dataset = datasets.load_dataset(args.dataset_name)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset
builder_instance.download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split
writer.write_table(table)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast
return cast_table_to_schema(table, schema)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper
return func(array, *args, **kwargs)
File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast
raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
TypeError: Couldn't cast array of type int64 to null
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.4.0
- Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Oh I see - the code I gave you returns local paths instead of URLs to store metadata about files to download.
I opened a PR in your repo here to remove this: https://huggingface.co/datasets/StonyBrookNLP/tellmewhy/discussions/1
sorry for the inconvenience ! | [
-1.1767548322677612,
-0.9491956830024719,
-0.8158513903617859,
1.3935505151748657,
-0.07760877162218094,
-1.2096201181411743,
0.14519676566123962,
-1.101981520652771,
1.625927209854126,
-0.7225667834281921,
0.2835047245025635,
-1.7219820022583008,
-0.06851905584335327,
-0.6020216941833496,
-0.7026883959770203,
-0.9104107618331909,
-0.3298652768135071,
-0.8423004150390625,
0.9767367243766785,
2.493403196334839,
1.225740909576416,
-1.2641856670379639,
2.7374987602233887,
0.7038471698760986,
-0.280811607837677,
-0.9609861373901367,
0.5246084928512573,
-0.051943693310022354,
-1.3116977214813232,
-0.4307197332382202,
-0.987808883190155,
-0.00018073339015245438,
-0.5740779638290405,
-0.5059898495674133,
0.16210471093654633,
0.3886721730232239,
-0.3499446511268616,
-0.339586466550827,
-0.5573390126228333,
-0.7140049338340759,
0.5231000781059265,
-0.36560189723968506,
0.9699820280075073,
-0.33397775888442993,
1.77835214138031,
-0.6300383806228638,
0.42593318223953247,
0.7335081696510315,
1.272831916809082,
0.23580150306224823,
0.09409519284963608,
0.3273729979991913,
0.3161623775959015,
0.08621193468570709,
0.4726007580757141,
1.2069029808044434,
0.5613086223602295,
0.4832024872303009,
0.7295911312103271,
-2.196279525756836,
1.2579030990600586,
-0.9820602536201477,
0.28486883640289307,
1.3308348655700684,
-0.8848650455474854,
0.35985076427459717,
-1.8743730783462524,
-0.10791432857513428,
0.5685137510299683,
-2.226616621017456,
0.24423488974571228,
-1.339465618133545,
-0.48758664727211,
0.9630916714668274,
0.2907906472682953,
-1.2159596681594849,
0.17748002707958221,
-0.5028072595596313,
1.0391056537628174,
0.4506506323814392,
1.1938737630844116,
-1.6509482860565186,
-0.12039069086313248,
-0.295674592256546,
0.09270841628313065,
-1.3385628461837769,
-1.555009365081787,
0.581320583820343,
0.5859531164169312,
0.7520624399185181,
-0.13670757412910461,
1.0903822183609009,
-1.0413693189620972,
0.7837634086608887,
-0.9173579216003418,
-1.7310864925384521,
-1.3511854410171509,
-2.2606425285339355,
-2.2927603721618652,
0.7865217924118042,
-0.4969102442264557,
-0.5016077756881714,
2.068972587585449,
-1.0373209714889526,
-1.7634508609771729,
1.0879086256027222,
0.3340775966644287,
-0.06641015410423279,
2.380702018737793,
0.24304786324501038,
-0.767290472984314,
0.5138272047042847,
-0.7055226564407349,
0.757663905620575,
-0.22906725108623505,
1.397152066230774,
0.5151922702789307,
-1.0003823041915894,
1.609587550163269,
-0.3788045048713684,
0.6213095188140869,
-0.7234678864479065,
-0.5399230122566223,
-0.8193785548210144,
0.2480074167251587,
1.9476224184036255,
-0.3746165931224823,
1.6550418138504028,
-0.2366514950990677,
-1.6223841905593872,
-1.577374815940857,
0.8003396987915039,
0.4590665102005005,
-0.8232707381248474,
0.11708999425172806,
-0.4058852195739746,
0.13335292041301727,
0.02861597016453743,
1.1146318912506104,
1.2158411741256714,
0.6822187304496765,
-0.28420397639274597,
-0.8378336429595947,
0.1700916737318039,
-0.04893621429800987,
-0.7014268636703491,
-1.7070308923721313,
-0.42095792293548584,
0.17551590502262115,
0.6518149375915527,
-1.1931233406066895,
1.7180132865905762,
0.8526495099067688,
1.9347312450408936,
1.0512478351593018,
-0.41610005497932434,
1.4538308382034302,
0.06328574568033218,
1.8462820053100586,
-0.5115999579429626,
0.6484323143959045,
-0.3689247965812683,
-1.1893748044967651,
0.8158851861953735,
-0.36323124170303345,
-2.051954507827759,
-0.7392709851264954,
-0.7723957896232605,
-0.18114590644836426,
-0.7220182418823242,
0.9152830243110657,
-0.3590890169143677,
-1.4449412822723389,
0.22447839379310608,
-0.6853388547897339,
0.0558013841509819,
-1.345318078994751,
0.23290401697158813,
0.7125895619392395,
-0.6736940741539001,
0.05386009067296982,
-0.24137985706329346,
-1.2951011657714844,
-0.46405619382858276,
0.2888719439506531,
1.8967618942260742,
-0.7632476687431335,
0.9371138215065002,
1.0416765213012695,
-0.7366002202033997,
0.12703751027584076,
0.36761099100112915,
-0.347126305103302,
0.8188834190368652,
-1.0916954278945923,
-0.30935412645339966,
1.2199275493621826,
-0.1290525197982788,
-0.5949993133544922,
1.365810751914978,
0.7718394994735718,
-1.059948444366455,
-0.20949845016002655,
-0.203250452876091,
-0.8311050534248352,
-0.01930134743452072,
-1.57277512550354,
-0.1586231291294098,
0.41382962465286255,
-1.3680803775787354,
-0.45112699270248413,
-0.2790679335594177,
1.273810625076294,
-0.210229754447937,
1.4066792726516724,
-0.30044567584991455,
-0.2361927181482315,
-0.34066611528396606,
-0.4905788004398346,
0.16217564046382904,
-0.20281054079532623,
-0.6287326812744141,
0.2456859052181244,
-0.8029535412788391,
0.2847333252429962,
1.4526970386505127,
0.35097599029541016,
0.024905581027269363,
0.529617190361023,
1.0820894241333008,
0.3986855149269104,
-0.11283408850431442,
-0.9139460325241089,
-1.5781304836273193,
2.015308380126953,
-1.444027304649353,
1.8653367757797241,
0.790647566318512,
-0.036155182868242264,
-1.847060203552246,
-1.8492897748947144,
1.3862361907958984,
1.1397407054901123,
2.4404070377349854,
0.5615025758743286,
0.4392884075641632,
-0.7667044401168823,
-0.7228814363479614,
0.37971317768096924,
-1.0212161540985107,
-0.7355970740318298,
0.18340416252613068,
2.4027087688446045,
1.7400137186050415,
-0.548954427242279,
-0.2267714887857437,
-0.9297861456871033,
1.1890227794647217,
-0.20049931108951569,
0.2509783208370209,
2.052809476852417,
-0.32544851303100586,
-1.053432583808899,
1.2672226428985596,
-2.282034397125244,
0.154961496591568,
2.0190603733062744,
0.24907812476158142,
0.08077211678028107,
-1.4992707967758179,
-0.6420232653617859,
-0.23545308411121368,
-0.4634445905685425,
-1.2982299327850342,
0.578120231628418,
-0.27479422092437744,
-0.8528759479522705,
-1.5013010501861572,
0.02021234855055809,
-1.1287329196929932,
-1.660786509513855,
0.30629345774650574,
1.902036190032959,
2.061690092086792,
-0.7262170910835266,
1.468990445137024,
-0.22243423759937286,
0.16734467446804047,
1.1818883419036865,
1.2705973386764526,
3.111229658126831,
1.857857346534729,
-1.3040904998779297,
0.7243930101394653,
-0.09152788668870926,
-0.5335765480995178,
1.1614042520523071,
-1.0512477159500122,
1.2351384162902832,
-0.282963365316391,
-1.2070904970169067,
-1.24753999710083,
1.0010230541229248,
0.395001083612442,
0.007528378628194332,
-0.49633094668388367,
1.2426496744155884,
0.08471854776144028,
1.2984654903411865,
0.6008298993110657,
-0.38125330209732056,
0.62783282995224,
-0.31653571128845215,
-0.5388824343681335,
1.5890002250671387,
0.2603795826435089,
-1.4472882747650146,
-2.399994373321533,
-0.24713818728923798,
-0.8629116415977478,
0.08274354785680771,
-0.6120669841766357,
-1.0162986516952515,
1.6767425537109375,
0.3848084509372711,
-1.2386457920074463,
-0.2400932013988495,
-0.3122904598712921,
-0.5762194395065308,
2.6620612144470215,
-1.3406516313552856,
-0.13274304568767548,
-0.9793283343315125,
-0.6510740518569946,
1.612295389175415,
-1.1232534646987915,
-0.125529482960701,
-1.101654291152954,
-0.6200364828109741,
-1.3698400259017944,
-0.5446001887321472,
0.055851973593235016,
-0.9383742809295654,
0.8936719298362732,
0.15387997031211853,
-1.1459416151046753,
-0.1827535182237625,
-0.9352536797523499,
0.9452283382415771,
-0.19836005568504333,
0.21249611675739288,
1.923620581626892,
0.47158536314964294,
-0.38772404193878174,
0.6982332468032837,
1.2111034393310547,
0.6057168841362,
-0.7058472633361816,
0.1290518194437027,
-0.7608948349952698,
0.2598643898963928,
-1.3897300958633423,
0.25217369198799133,
-2.8347480297088623,
0.7291800379753113,
-0.10777866095304489,
-0.05160684511065483,
0.027741998434066772,
-1.2881035804748535,
1.029348373413086,
2.6106507778167725,
-1.1808193922042847,
0.4695478677749634,
0.3997013568878174,
1.1898105144500732,
-1.569549322128296,
0.23176699876785278,
-0.48906266689300537,
2.088510274887085,
0.18944069743156433,
1.1932166814804077,
-0.5436043739318848,
-2.154167890548706,
0.6014764308929443,
-1.232291579246521,
-1.119879126548767,
0.8397927284240723,
-0.9079840183258057,
0.1408461630344391,
-1.4570704698562622,
-0.21800357103347778,
-0.9462484121322632,
-1.2078537940979004,
0.7794972062110901,
0.1275378167629242,
0.5522536635398865,
-0.515717625617981,
0.34248775243759155,
-2.2268881797790527,
-1.3835557699203491,
-0.17031952738761902,
-0.9943810701370239,
0.44989705085754395,
-0.3152509927749634,
0.6728278994560242,
-0.21068337559700012,
0.047143835574388504,
0.3915666341781616,
1.4020116329193115,
3.3161330223083496,
0.1459021270275116,
0.3064032793045044,
-0.10451827943325043,
-0.9820468425750732,
1.4052067995071411,
0.9043801426887512,
-0.0565604530274868,
-0.6143860220909119,
-1.0181819200515747,
1.1852467060089111,
2.0618784427642822,
1.1152479648590088,
0.05763499438762665,
-0.8394444584846497,
-0.7716976404190063,
0.03739296644926071,
0.20337864756584167,
0.4730131924152374,
0.8882830142974854,
0.04235297441482544,
0.08550131320953369,
1.4686540365219116,
1.1135685443878174,
-0.3652702569961548,
0.3656998872756958,
-0.8184607625007629,
-0.4255903661251068,
0.442157119512558,
0.23154094815254211,
0.08620477467775345,
0.34158414602279663,
-1.0971436500549316,
-0.24629920721054077,
-0.4620552361011505,
-0.9363791942596436,
-0.7291603088378906,
-0.41946786642074585,
-0.3699731230735779,
1.6146602630615234,
0.06866854429244995,
-0.48665422201156616,
0.04831209033727646,
-0.7510673403739929,
-0.1538616567850113,
-1.098608136177063,
0.31419020891189575,
-0.1593894064426422,
-0.10720545053482056,
-0.0480152852833271,
1.7239543199539185,
-0.9984956383705139,
-2.1096229553222656,
0.1882096529006958,
0.2479332685470581,
-0.32525384426116943,
0.14002415537834167,
1.6238861083984375,
0.6075106263160706,
1.4141396284103394,
1.2765164375305176,
0.9455858469009399,
-0.6906675696372986,
-1.2420238256454468,
0.6772680282592773,
0.9465574026107788,
-1.3495088815689087,
0.8644546866416931,
-0.10239153355360031,
-0.5057929754257202,
0.604191780090332,
1.307532548904419,
0.40324121713638306,
-2.0517590045928955,
0.8048239946365356,
-0.903881311416626,
0.6383981108665466,
0.7007335424423218,
0.7553361058235168,
0.23394986987113953,
0.7719429135322571,
-1.1608248949050903,
-1.1367789506912231,
-0.7325112819671631,
-0.5692110061645508,
1.9481837749481201,
-0.07944213598966599,
0.5311486124992371,
-0.15341000258922577,
-1.2305712699890137,
-0.0002648215740919113,
0.6768003106117249,
0.4183899760246277,
-0.5079213380813599,
0.8313072919845581,
-0.55682772397995,
-1.0430848598480225,
-1.3473869562149048,
-0.40974944829940796,
-1.102118968963623,
-0.9630776047706604,
0.9818909168243408,
0.7376902103424072,
0.3737943768501282,
1.8448021411895752,
0.6350353956222534,
0.3218485116958618,
-2.6247119903564453,
0.9485618472099304,
0.27882808446884155,
-0.08929896354675293,
0.943482518196106,
0.32183218002319336,
1.1047059297561646,
-0.07485640794038773,
0.5475848317146301,
-2.3623533248901367,
2.2699358463287354,
-0.2475501298904419,
0.6657047271728516,
0.027345050126314163,
-0.21429510414600372,
1.1143912076950073,
0.44934767484664917,
0.5181334614753723,
-0.9911567568778992,
0.7018203735351562,
-0.6182271242141724,
1.150820255279541,
1.000584602355957,
-0.9242182970046997,
0.15802375972270966,
1.3696811199188232,
0.44245147705078125,
-0.4366397261619568,
-0.9237833619117737,
-0.8781682252883911,
1.0313608646392822,
1.6846308708190918,
-0.01667633466422558,
-0.03056110069155693,
0.9668232202529907,
0.6385859251022339,
-1.3339933156967163,
0.10014595091342926,
-0.7240704894065857,
-0.7079388499259949,
1.6305830478668213,
2.039050340652466,
-0.08283797651529312,
-0.17035256326198578,
-0.7689527273178101,
-1.2556520700454712,
0.7659721374511719,
0.009255158714950085,
0.16729794442653656,
0.7084140777587891,
-0.7074413299560547,
1.156075358390808,
0.7919023036956787,
0.9744800925254822,
0.17641578614711761,
0.3684293329715729,
0.31062519550323486,
-0.35042664408683777,
-1.1588387489318848,
-0.31132611632347107,
-1.0570095777511597,
-2.511884927749634,
0.516665518283844,
-0.20998050272464752,
-1.470169186592102,
0.0815071165561676,
-1.037182331085205,
0.885395348072052,
-0.6274901628494263,
-1.0480282306671143,
-1.626675009727478,
0.29632577300071716,
-0.21890577673912048,
0.9210015535354614,
-1.6078060865402222,
-0.1791050136089325,
1.1291313171386719,
0.9967717528343201,
-0.6364224553108215,
0.947332501411438,
0.25587135553359985,
0.9771762490272522,
0.8504989147186279,
-0.35954365134239197,
0.5473794937133789,
0.07670518010854721,
-1.3579007387161255,
0.42314061522483826,
1.2116719484329224,
0.2582911252975464,
1.4590637683868408,
-0.528171718120575,
0.03164331242442131,
0.4133714437484741,
-0.5024266839027405,
-0.4838222563266754,
-0.5368131995201111,
0.6816977262496948,
0.08079607784748077,
-0.9999671578407288,
-0.07117350399494171,
-0.07712152600288391,
-0.1608818918466568,
0.23580411076545715,
-1.5008788108825684,
-0.2095736265182495,
-0.40890762209892273,
-0.6227977275848389,
-1.212133526802063,
0.023806534707546234,
1.341840386390686,
-0.781912088394165,
-0.2319626808166504,
0.42978599667549133,
0.3754015266895294,
0.4925101697444916,
0.5952187776565552,
-0.7584205865859985,
-0.2777736783027649,
-0.23539020121097565,
-0.4181499779224396,
0.2892031669616699,
1.3368207216262817,
-0.09037327766418457,
-1.01258385181427,
0.6892426609992981,
-0.3961775302886963,
0.10616268962621689,
1.9703009128570557,
0.05861596763134003,
-0.8708340525627136,
0.2957013249397278,
-0.7094140648841858,
1.8507113456726074,
1.7587523460388184,
1.353331446647644,
-0.11121436208486557,
-0.867918074131012,
0.6047595739364624,
-0.26697441935539246,
-0.3532974123954773,
0.988378643989563,
0.4226173162460327,
-0.143701434135437,
-1.462353229522705,
0.6863227486610413,
1.2970541715621948,
-0.8749797940254211,
-0.7869485020637512,
0.08765100687742233,
-0.8759879469871521,
1.0502328872680664,
0.7010849118232727,
0.3260561525821686,
0.22208543121814728,
1.5750049352645874,
0.735317051410675,
-0.49817609786987305,
0.538673460483551,
0.4638315439224243,
-0.15653643012046814,
-2.1409363746643066,
-1.0982385873794556,
0.33967891335487366,
-0.3741922080516815,
-1.619206190109253,
1.4109925031661987,
-1.1665022373199463,
-0.9103996753692627,
0.5765758156776428,
0.1743335872888565,
1.415264368057251,
0.39458441734313965,
1.6748367547988892,
2.0942647457122803,
0.8692116737365723,
0.3165307939052582,
1.271085262298584,
-0.09687850624322891,
-0.413417786359787,
1.827391266822815,
-0.42873960733413696,
0.5253797173500061,
0.9651819467544556,
-0.28378862142562866,
-1.0664998292922974,
-0.7772405743598938,
-1.2037311792373657,
-0.6358840465545654,
1.1217103004455566,
0.08667631447315216,
-1.1285561323165894,
0.22815975546836853,
1.5915578603744507,
0.09592636674642563,
-0.29272234439849854,
0.720644474029541,
0.42704495787620544,
-0.7580556273460388,
-0.06492345035076141,
-0.8898020386695862,
0.5925244092941284,
-0.15157821774482727,
-0.3144459128379822,
0.24971240758895874,
0.506808340549469,
1.393838882446289,
-0.026024773716926575,
0.10831249505281448,
1.2433993816375732,
-1.3107569217681885,
1.527117371559143,
-0.6435328125953674,
0.2585667073726654,
-2.3915538787841797,
1.406697392463684,
-0.8143830895423889,
1.8408129215240479,
-2.59192156791687,
0.45675987005233765,
-0.5510923862457275,
-0.45276883244514465,
0.2208063304424286,
-0.37443721294403076,
0.1384323388338089,
-0.1461780071258545,
-1.0412933826446533,
-0.07972409576177597,
-0.7690739631652832,
0.5777996778488159,
1.157812237739563,
1.3534780740737915,
-1.028786540031433,
-0.39164817333221436,
-1.8266377449035645,
-0.17707474529743195,
-0.632651150226593,
0.30039113759994507,
-1.915682077407837,
-0.19096671044826508,
-1.9432240724563599,
-2.4925737380981445,
-1.4106557369232178,
-0.8479306697845459,
1.098036289215088,
0.14998359978199005,
-0.9818500280380249,
1.1799097061157227,
-0.3893318772315979,
-1.8461507558822632,
1.1121464967727661,
-2.2040960788726807
] |
https://github.com/huggingface/datasets/issues/5000 | Dataset Viewer issue for asapp/slue | <img width="519" alt="Capture d’écran 2022-09-20 à 22 33 47" src="https://user-images.githubusercontent.com/1676121/191358952-1220cb7d-745a-4203-a66b-3c707b25038f.png">
```
Not found.
Error code: SplitsResponseNotFound
```
https://datasets-server.huggingface.co/splits?dataset=asapp/slue
```json
{"error":"Not found."}
``` | ### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes | 518 | 22 | Dataset Viewer issue for asapp/slue
### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes
<img width="519" alt="Capture d’écran 2022-09-20 à 22 33 47" src="https://user-images.githubusercontent.com/1676121/191358952-1220cb7d-745a-4203-a66b-3c707b25038f.png">
```
Not found.
Error code: SplitsResponseNotFound
```
https://datasets-server.huggingface.co/splits?dataset=asapp/slue
```json
{"error":"Not found."}
``` | [
-1.0410507917404175,
-0.860905110836029,
-0.7824278473854065,
1.4716877937316895,
-0.13530300557613373,
-1.251380443572998,
0.17049266397953033,
-1.078908085823059,
1.6794973611831665,
-0.6592941284179688,
0.30917635560035706,
-1.6796305179595947,
-0.06625889241695404,
-0.5816165804862976,
-0.6300210356712341,
-0.8824931383132935,
-0.3827616274356842,
-0.7278848886489868,
0.9734268188476562,
2.610687017440796,
1.260368824005127,
-1.275158166885376,
2.7333240509033203,
0.7224637866020203,
-0.2690943479537964,
-0.9317893385887146,
0.5602822303771973,
0.10811716318130493,
-1.2043704986572266,
-0.42687317728996277,
-0.9566650986671448,
-0.09300810098648071,
-0.5328104496002197,
-0.5515256524085999,
0.02481231652200222,
0.5341169834136963,
-0.24372965097427368,
-0.39175987243652344,
-0.5694429874420166,
-0.845841646194458,
0.44086208939552307,
-0.47895100712776184,
0.8769639730453491,
-0.466420978307724,
1.8162541389465332,
-0.6374678611755371,
0.37149515748023987,
0.5709097981452942,
1.2454596757888794,
0.21810275316238403,
-0.013809030875563622,
0.19031204283237457,
0.4141767621040344,
0.004424329847097397,
0.5197590589523315,
1.2147667407989502,
0.5270597338676453,
0.6079906821250916,
0.6706976890563965,
-2.1866283416748047,
1.2598662376403809,
-0.9147469401359558,
0.11725335568189621,
1.439804196357727,
-0.994774580001831,
0.3570866584777832,
-1.8488032817840576,
-0.06901865452528,
0.4283900260925293,
-2.2319047451019287,
0.3118700087070465,
-1.329259991645813,
-0.6716945171356201,
0.9562832713127136,
0.3048693537712097,
-1.2804429531097412,
0.02142331562936306,
-0.42314794659614563,
0.9810033440589905,
0.4618246853351593,
1.1381313800811768,
-1.7094537019729614,
-0.06583455950021744,
-0.31882840394973755,
0.09142957627773285,
-1.3315614461898804,
-1.5006239414215088,
0.5710789561271667,
0.6751959323883057,
0.687428891658783,
-0.07726283371448517,
0.8675013780593872,
-1.0485366582870483,
0.7388830780982971,
-0.8826692700386047,
-1.8169184923171997,
-1.3420902490615845,
-2.2695608139038086,
-2.3039023876190186,
0.8019299507141113,
-0.4187922179698944,
-0.505231499671936,
1.9489009380340576,
-0.975736677646637,
-1.7163790464401245,
1.1003392934799194,
0.3265664577484131,
-0.0236235149204731,
2.371277093887329,
0.3511546552181244,
-0.701917827129364,
0.3628985285758972,
-0.7381818294525146,
0.7589105367660522,
-0.4323404133319855,
1.3962355852127075,
0.5551087260246277,
-1.0155234336853027,
1.6741372346878052,
-0.47186702489852905,
0.605985701084137,
-0.7713281512260437,
-0.4308612048625946,
-0.770692765712738,
0.2592953145503998,
1.983394742012024,
-0.3504752218723297,
1.5870521068572998,
-0.24041421711444855,
-1.5958335399627686,
-1.55705726146698,
0.9038515090942383,
0.4659924805164337,
-0.8223045468330383,
0.15960566699504852,
-0.39066746830940247,
0.12312231212854385,
0.01535085029900074,
1.0953404903411865,
1.2733286619186401,
0.7979030609130859,
-0.25502195954322815,
-0.8824959993362427,
0.2652619481086731,
0.049637436866760254,
-0.6815232038497925,
-1.7334049940109253,
-0.3598100244998932,
0.2221970409154892,
0.602030873298645,
-1.2218108177185059,
1.7875794172286987,
0.8186346888542175,
1.9249317646026611,
1.0280488729476929,
-0.3343294858932495,
1.5177080631256104,
0.03132494539022446,
1.8756920099258423,
-0.5731055736541748,
0.6910955309867859,
-0.3152761161327362,
-1.1365638971328735,
0.8028464317321777,
-0.36003178358078003,
-2.0043649673461914,
-0.7054097056388855,
-0.9107398390769958,
-0.1712234914302826,
-0.7979184985160828,
0.9538924098014832,
-0.2384435534477234,
-1.3959892988204956,
0.1550617665052414,
-0.6792024374008179,
0.03635384887456894,
-1.3627668619155884,
0.2959413528442383,
0.7525612711906433,
-0.6318058967590332,
0.08850456774234772,
-0.28233009576797485,
-1.27140474319458,
-0.5108616352081299,
0.2925538718700409,
1.9507242441177368,
-0.7239187955856323,
0.9720492959022522,
0.9274314045906067,
-0.7729405164718628,
0.032401926815509796,
0.43708327412605286,
-0.33585596084594727,
0.8058761358261108,
-1.2166767120361328,
-0.3306654691696167,
1.0876753330230713,
-0.12503260374069214,
-0.6746259331703186,
1.4662668704986572,
0.8176019191741943,
-0.9861751198768616,
-0.1790911704301834,
-0.2057744562625885,
-0.6856064200401306,
0.03723166882991791,
-1.6065808534622192,
-0.1097259670495987,
0.27991190552711487,
-1.3267117738723755,
-0.6130597591400146,
-0.2157374769449234,
1.2471672296524048,
-0.1851458102464676,
1.3080666065216064,
-0.25847315788269043,
-0.28560391068458557,
-0.466272234916687,
-0.43836671113967896,
0.06857200711965561,
-0.23046167194843292,
-0.6614065766334534,
0.298176109790802,
-0.8155350685119629,
0.27704229950904846,
1.4810258150100708,
0.3385940492153168,
0.14838574826717377,
0.5388345122337341,
1.0932141542434692,
0.32141590118408203,
-0.10063474625349045,
-1.0102757215499878,
-1.5703359842300415,
1.9214192628860474,
-1.4705168008804321,
1.9771978855133057,
0.7608950138092041,
-0.03668524697422981,
-1.7827811241149902,
-1.9708387851715088,
1.3445192575454712,
1.3018170595169067,
2.4837751388549805,
0.6812081933021545,
0.4264729917049408,
-0.7774386405944824,
-0.7238288521766663,
0.2956746816635132,
-1.1101211309432983,
-0.7182897329330444,
0.21503163874149323,
2.291865825653076,
1.7261728048324585,
-0.6017684936523438,
-0.3011094331741333,
-1.075640320777893,
1.2425276041030884,
-0.1485547125339508,
0.19325804710388184,
2.0104820728302,
-0.31232738494873047,
-1.0500829219818115,
1.1808656454086304,
-2.321988344192505,
0.14236681163311005,
1.941225290298462,
0.24475044012069702,
0.13864603638648987,
-1.4022777080535889,
-0.8040860891342163,
-0.2065005749464035,
-0.41671445965766907,
-1.2433621883392334,
0.5430150628089905,
-0.24672013521194458,
-0.8401414752006531,
-1.5235368013381958,
0.10857128351926804,
-1.0893638134002686,
-1.6797511577606201,
0.2726753056049347,
1.8169386386871338,
1.993119478225708,
-0.8723521828651428,
1.4284616708755493,
-0.22575652599334717,
0.06738405674695969,
1.277665138244629,
1.2433611154556274,
3.1891064643859863,
1.9797192811965942,
-1.21236252784729,
0.8250538110733032,
-0.13791602849960327,
-0.4365634322166443,
1.285744309425354,
-1.1317164897918701,
1.1824016571044922,
-0.27644944190979004,
-1.1861613988876343,
-1.258536696434021,
0.8638092279434204,
0.48661157488822937,
-0.005019196309149265,
-0.4828091859817505,
1.158941388130188,
0.06684823334217072,
1.3809651136398315,
0.574097216129303,
-0.3849705457687378,
0.6740074157714844,
-0.3878076672554016,
-0.3059348464012146,
1.5954866409301758,
0.24161529541015625,
-1.4068641662597656,
-2.328932046890259,
-0.15163858234882355,
-0.8921746015548706,
-0.128860205411911,
-0.630054235458374,
-1.0851367712020874,
1.6761237382888794,
0.47789281606674194,
-1.2145782709121704,
-0.23133203387260437,
-0.2994214594364166,
-0.6342287063598633,
2.7162466049194336,
-1.423182487487793,
-0.22347962856292725,
-1.0567171573638916,
-0.5402970314025879,
1.719622015953064,
-1.17726469039917,
-0.12333229929208755,
-1.0377033948898315,
-0.49870356917381287,
-1.3607177734375,
-0.5347766876220703,
0.05777052789926529,
-0.7695810198783875,
0.874814510345459,
0.11255650967359543,
-1.1759676933288574,
-0.2596763074398041,
-0.9071443676948547,
0.823216438293457,
-0.13981980085372925,
0.3469419479370117,
1.9995911121368408,
0.4471452832221985,
-0.35726335644721985,
0.647431492805481,
1.2061736583709717,
0.5042973160743713,
-0.688816249370575,
0.3370146155357361,
-0.7120410203933716,
0.2371099293231964,
-1.3924857378005981,
0.19273324310779572,
-2.8330636024475098,
0.6784430742263794,
-0.06788492202758789,
-0.11796721816062927,
0.03759850561618805,
-1.3429818153381348,
1.0890812873840332,
2.521260976791382,
-1.1745649576187134,
0.48516222834587097,
0.2622649669647217,
1.2425674200057983,
-1.5425024032592773,
0.20387554168701172,
-0.38569214940071106,
1.99190092086792,
0.2158418595790863,
1.1588327884674072,
-0.438622385263443,
-2.1409308910369873,
0.5640801787376404,
-1.2880743741989136,
-1.0900957584381104,
0.7184078693389893,
-0.8518726825714111,
-0.021006086841225624,
-1.3633968830108643,
-0.14615970849990845,
-0.8886555433273315,
-1.2637544870376587,
0.8244043588638306,
0.1036684438586235,
0.529172420501709,
-0.583000123500824,
0.4151802062988281,
-2.0965116024017334,
-1.3692718744277954,
-0.2852950692176819,
-0.8392015695571899,
0.4409256875514984,
-0.2932663559913635,
0.6897045373916626,
-0.16973133385181427,
0.05896076560020447,
0.35718297958374023,
1.456238865852356,
3.3121092319488525,
0.1605268120765686,
0.32224878668785095,
-0.1479577273130417,
-1.0357879400253296,
1.5236183404922485,
0.9341588020324707,
0.02696319855749607,
-0.5793993473052979,
-1.0232254266738892,
1.269272804260254,
1.9039537906646729,
1.1489967107772827,
0.1617412269115448,
-0.9373856782913208,
-0.7295360565185547,
-0.049229614436626434,
0.16229648888111115,
0.3754816949367523,
0.8930990695953369,
0.07399118691682816,
0.04182408004999161,
1.463520884513855,
1.2104336023330688,
-0.4434347450733185,
0.38813579082489014,
-0.9075826406478882,
-0.37414833903312683,
0.5495434999465942,
0.3169277608394623,
0.10947021096944809,
0.339557021856308,
-1.1094611883163452,
-0.2345694899559021,
-0.287300169467926,
-0.9293836951255798,
-0.8069049119949341,
-0.5231512188911438,
-0.31043753027915955,
1.6420634984970093,
-0.0345367006957531,
-0.46489840745925903,
-0.02952328696846962,
-0.8922349810600281,
-0.0986381322145462,
-1.0897668600082397,
0.24593573808670044,
-0.17069055140018463,
-0.133558988571167,
-0.07369023561477661,
1.820925235748291,
-1.0471247434616089,
-2.1533024311065674,
0.3329155147075653,
0.20750649273395538,
-0.5128180980682373,
0.14236438274383545,
1.639864444732666,
0.5109060406684875,
1.3715555667877197,
1.2920172214508057,
1.0719337463378906,
-0.6792664527893066,
-1.3222342729568481,
0.6002495288848877,
0.9592680335044861,
-1.35887610912323,
0.8496118187904358,
-0.06467070430517197,
-0.4541236162185669,
0.5765555500984192,
1.2624003887176514,
0.44912514090538025,
-1.7948006391525269,
0.6370312571525574,
-0.8536643981933594,
0.8391976952552795,
0.6953057646751404,
0.7762324213981628,
0.192121684551239,
0.7966189384460449,
-1.3076626062393188,
-1.0558074712753296,
-0.7129422426223755,
-0.528340756893158,
1.8585848808288574,
-0.06715551018714905,
0.4863015115261078,
-0.2249162644147873,
-1.2676185369491577,
0.04108390957117081,
0.7940155267715454,
0.3903563916683197,
-0.48398393392562866,
0.7667077779769897,
-0.5873819589614868,
-0.9412243366241455,
-1.3104265928268433,
-0.5136051177978516,
-0.9498003125190735,
-0.9738987684249878,
1.085721492767334,
0.8057360649108887,
0.37723881006240845,
1.9108234643936157,
0.6637600660324097,
0.262589693069458,
-2.6939449310302734,
0.8725264668464661,
0.3080446720123291,
0.06890112906694412,
0.8938381671905518,
0.29722386598587036,
1.0886722803115845,
-0.16206474602222443,
0.5514439940452576,
-2.3364908695220947,
2.343433141708374,
-0.2138235867023468,
0.5964342355728149,
-0.01227056235074997,
-0.14004966616630554,
1.0675021409988403,
0.5113366842269897,
0.4915521740913391,
-1.160169243812561,
0.7251257300376892,
-0.5645524263381958,
1.0931462049484253,
0.9164130687713623,
-0.8816142678260803,
0.11971240490674973,
1.260118007659912,
0.5454166531562805,
-0.5136412382125854,
-0.9250734448432922,
-0.8037522435188293,
0.9465604424476624,
1.7016221284866333,
-0.0036377077922225,
-0.01041351817548275,
0.9272093772888184,
0.5282740592956543,
-1.29965078830719,
0.028235359117388725,
-0.7157216668128967,
-0.593155026435852,
1.7526668310165405,
2.0410704612731934,
-0.04538746178150177,
-0.2242872416973114,
-0.7252450585365295,
-1.2103281021118164,
0.7914361357688904,
0.10547996312379837,
0.07817623764276505,
0.8172975182533264,
-0.6661609411239624,
1.1679234504699707,
0.7905045747756958,
0.9851788282394409,
0.09500496089458466,
0.4222566783428192,
0.4232950508594513,
-0.3844090700149536,
-1.2052369117736816,
-0.3096480071544647,
-1.0857844352722168,
-2.6158416271209717,
0.5292370319366455,
-0.25026607513427734,
-1.400721549987793,
0.022803572937846184,
-1.0984433889389038,
0.8772482872009277,
-0.587483286857605,
-1.0202746391296387,
-1.4620013236999512,
0.2497035264968872,
-0.18313993513584137,
0.9048044085502625,
-1.6081441640853882,
-0.13668036460876465,
1.244172215461731,
0.980813205242157,
-0.7005301117897034,
0.9309183359146118,
0.22692403197288513,
1.1002473831176758,
0.9006956815719604,
-0.3591196537017822,
0.4351847767829895,
0.019449330866336823,
-1.419869303703308,
0.4239206612110138,
1.2348244190216064,
0.21239489316940308,
1.4172627925872803,
-0.5188776254653931,
0.11137952655553818,
0.46688947081565857,
-0.3927197754383087,
-0.47196507453918457,
-0.5778362154960632,
0.6762388348579407,
0.1127701848745346,
-1.0411920547485352,
-0.0324501171708107,
-0.030890289694070816,
-0.07888615131378174,
0.19140397012233734,
-1.4755637645721436,
-0.1443144977092743,
-0.3904114067554474,
-0.6323018074035645,
-1.2752525806427002,
-0.0029478096403181553,
1.2306296825408936,
-0.7618203163146973,
-0.1814563125371933,
0.5392136573791504,
0.23235109448432922,
0.5004862546920776,
0.431774765253067,
-0.7902071475982666,
-0.360639363527298,
-0.25242969393730164,
-0.41277000308036804,
0.2807179093360901,
1.2921030521392822,
-0.13792107999324799,
-1.1052035093307495,
0.6842531561851501,
-0.31583335995674133,
0.15185333788394928,
1.988760232925415,
0.05417846143245697,
-0.8690940141677856,
0.1833956390619278,
-0.6601178646087646,
1.8889105319976807,
1.6772609949111938,
1.3594753742218018,
-0.10738132148981094,
-0.8169465661048889,
0.5961368083953857,
-0.3142828047275543,
-0.35813114047050476,
0.8785353899002075,
0.3703724145889282,
-0.2068834751844406,
-1.4522278308868408,
0.5844586491584778,
1.3792608976364136,
-0.9471335411071777,
-0.8163030743598938,
0.10112610459327698,
-0.8114016652107239,
1.0980000495910645,
0.7179535627365112,
0.3626154661178589,
0.307455837726593,
1.53147554397583,
0.6656038761138916,
-0.4314334988594055,
0.49332094192504883,
0.4419502913951874,
-0.05132380872964859,
-2.0287024974823,
-1.0941756963729858,
0.3543306887149811,
-0.40440720319747925,
-1.595953345298767,
1.362679123878479,
-1.2810308933258057,
-0.9169741272926331,
0.562675952911377,
0.282725989818573,
1.4817203283309937,
0.32496803998947144,
1.6737391948699951,
2.105576753616333,
0.8650067448616028,
0.28769540786743164,
1.269855260848999,
-0.03555073216557503,
-0.490994930267334,
1.7938448190689087,
-0.45788291096687317,
0.51051265001297,
0.9839462637901306,
-0.29835301637649536,
-1.177878737449646,
-0.8262379169464111,
-1.3095933198928833,
-0.6306253671646118,
1.1972862482070923,
0.18522696197032928,
-1.1829982995986938,
0.14767144620418549,
1.6174055337905884,
0.0456814169883728,
-0.3181321620941162,
0.7274550199508667,
0.43621909618377686,
-0.7847729921340942,
-0.006594800390303135,
-0.8927397727966309,
0.5357271432876587,
-0.04897760599851608,
-0.32747790217399597,
0.26351162791252136,
0.5366204977035522,
1.2419331073760986,
0.028450915589928627,
0.04543568193912506,
1.2894254922866821,
-1.3125296831130981,
1.5848506689071655,
-0.6273998618125916,
0.1817486435174942,
-2.41796875,
1.5085431337356567,
-0.8245614171028137,
1.8009332418441772,
-2.596766710281372,
0.4471556544303894,
-0.5020154714584351,
-0.410565048456192,
0.23095156252384186,
-0.394388884305954,
0.14609090983867645,
-0.11258801817893982,
-1.0318984985351562,
-0.10804353654384613,
-0.7857924699783325,
0.605046272277832,
1.2240265607833862,
1.331926941871643,
-1.1218770742416382,
-0.29802924394607544,
-1.8671393394470215,
-0.021651986986398697,
-0.7132211923599243,
0.25073671340942383,
-1.9842538833618164,
-0.20236080884933472,
-1.8898617029190063,
-2.365766763687134,
-1.5111068487167358,
-0.8075317144393921,
1.1188064813613892,
0.1631520539522171,
-0.8830461502075195,
1.0821706056594849,
-0.38741374015808105,
-1.815269112586975,
1.100197672843933,
-2.2033193111419678
] |
https://github.com/huggingface/datasets/issues/5000 | Dataset Viewer issue for asapp/slue | I just launched a refresh. It's weird, I don't see any entry for this dataset in the cache, it's a bug on our side. In order to try to understand what happened, did you change the visibility status from private to public, by any chance? | ### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes | 518 | 45 | Dataset Viewer issue for asapp/slue
### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes
I just launched a refresh. It's weird, I don't see any entry for this dataset in the cache, it's a bug on our side. In order to try to understand what happened, did you change the visibility status from private to public, by any chance? | [
-1.151690125465393,
-0.9202831387519836,
-0.9790621399879456,
1.3383560180664062,
-0.2735154330730438,
-1.2110549211502075,
0.20909249782562256,
-1.044950008392334,
1.629253625869751,
-0.7419853210449219,
0.14139539003372192,
-1.6594988107681274,
-0.0895329937338829,
-0.5455899238586426,
-0.6076578497886658,
-0.9344713091850281,
-0.5054341554641724,
-0.7463055849075317,
1.067050814628601,
2.695791244506836,
1.045941710472107,
-1.3882173299789429,
2.7002060413360596,
0.7220476269721985,
-0.18563851714134216,
-1.020776391029358,
0.6081199645996094,
0.061949558556079865,
-1.08412504196167,
-0.4669576585292816,
-1.0910321474075317,
-0.00499386340379715,
-0.551172137260437,
-0.3525382876396179,
-0.006225093733519316,
0.4239805340766907,
-0.10494110733270645,
-0.3480452001094818,
-0.5379549860954285,
-0.7554982304573059,
0.38805896043777466,
-0.48766109347343445,
0.9359750747680664,
-0.39882341027259827,
1.8151462078094482,
-0.4220968782901764,
0.3572681248188019,
0.6941947937011719,
1.3273348808288574,
0.036956220865249634,
-0.03006715513765812,
0.2374369502067566,
0.3811202645301819,
-0.10991210490465164,
0.3855571448802948,
1.0608311891555786,
0.40190136432647705,
0.6448071002960205,
0.4585804343223572,
-2.224263906478882,
1.274349570274353,
-0.9633359909057617,
0.37378251552581787,
1.4850170612335205,
-1.0738086700439453,
0.4481145143508911,
-1.7500996589660645,
-0.1095309853553772,
0.5987513065338135,
-2.1752731800079346,
0.3658054769039154,
-1.1023207902908325,
-0.5811158418655396,
0.8597080707550049,
0.3331896662712097,
-1.3318759202957153,
0.1461200714111328,
-0.5052762627601624,
1.0480339527130127,
0.45284605026245117,
1.119381070137024,
-1.6773930788040161,
0.20589089393615723,
-0.3405015170574188,
0.02656073123216629,
-1.303990125656128,
-1.4412729740142822,
0.5178906321525574,
0.6723169088363647,
0.6506166458129883,
-0.050398197025060654,
0.7528336644172668,
-1.0441557168960571,
0.748419463634491,
-0.740509033203125,
-1.6797266006469727,
-1.3043829202651978,
-2.4540390968322754,
-2.3711607456207275,
0.8810867667198181,
-0.3836424946784973,
-0.5932938456535339,
1.9688268899917603,
-0.8969417810440063,
-1.759124755859375,
1.3326624631881714,
0.28421276807785034,
-0.06856037676334381,
2.4176175594329834,
0.28650107979774475,
-0.6137937903404236,
0.4121212959289551,
-0.7380669116973877,
0.9628900289535522,
-0.6200840473175049,
1.449416995048523,
0.5532748699188232,
-0.9652838110923767,
1.7342345714569092,
-0.5563676357269287,
0.6375624537467957,
-0.7108456492424011,
-0.531791627407074,
-1.0092228651046753,
0.390731543302536,
1.8469547033309937,
-0.3141399621963501,
1.5938489437103271,
-0.3825375437736511,
-1.5306963920593262,
-1.6171809434890747,
0.9889028668403625,
0.49008992314338684,
-0.8348339796066284,
0.17891588807106018,
-0.37624290585517883,
0.11079050600528717,
-0.02871020883321762,
1.0146164894104004,
1.303694248199463,
0.563482403755188,
-0.22569742798805237,
-1.0275644063949585,
0.2806991636753082,
-0.10368061810731888,
-0.6365724802017212,
-1.9144293069839478,
-0.3304797410964966,
0.14403408765792847,
0.5704339146614075,
-1.2260587215423584,
1.6687132120132446,
0.8969091773033142,
1.9355528354644775,
1.0629642009735107,
-0.3418791592121124,
1.4650834798812866,
0.021371180191636086,
1.8399829864501953,
-0.5995454788208008,
0.7072079181671143,
-0.23632654547691345,
-1.1307448148727417,
0.8737649917602539,
-0.42060720920562744,
-1.9371145963668823,
-0.9298127889633179,
-0.9773122668266296,
-0.26040026545524597,
-0.689376950263977,
1.0614182949066162,
-0.22689300775527954,
-1.3393630981445312,
0.22318577766418457,
-0.5623464584350586,
0.186335027217865,
-1.2771649360656738,
0.2794495224952698,
0.6369243264198303,
-0.48774254322052,
0.0006024613976478577,
-0.30498215556144714,
-1.4213178157806396,
-0.33252596855163574,
0.35231080651283264,
1.8104878664016724,
-0.7689239382743835,
0.9001966714859009,
0.8523065447807312,
-0.7743778228759766,
-0.07477203011512756,
0.2969283163547516,
-0.21081125736236572,
0.8214868307113647,
-1.2519816160202026,
-0.41308894753456116,
1.0577616691589355,
-0.2605045735836029,
-0.6546136140823364,
1.3733757734298706,
0.6686761379241943,
-1.056979775428772,
-0.1295454353094101,
-0.2579447031021118,
-0.8619142174720764,
-0.02524971403181553,
-1.6793150901794434,
-0.10192862898111343,
0.21494978666305542,
-1.4782967567443848,
-0.5098455548286438,
-0.22984880208969116,
1.2569715976715088,
-0.12440414726734161,
1.4301563501358032,
-0.2797524631023407,
-0.2523476481437683,
-0.4336136281490326,
-0.5325035452842712,
0.2219078242778778,
-0.1456718146800995,
-0.5004480481147766,
0.23226678371429443,
-0.8772298097610474,
0.39986324310302734,
1.5006753206253052,
0.395892858505249,
0.1560089886188507,
0.6614047288894653,
0.9072638154029846,
0.3428688049316406,
-0.012424455024302006,
-0.9146028757095337,
-1.5790067911148071,
1.8889673948287964,
-1.5084192752838135,
1.896144986152649,
0.7228851914405823,
-0.08628131449222565,
-1.832034707069397,
-1.8325566053390503,
1.3977220058441162,
1.3528310060501099,
2.2790727615356445,
0.6833279728889465,
0.39004701375961304,
-0.7770800590515137,
-0.7506551146507263,
0.12491575628519058,
-1.1538232564926147,
-0.7328258752822876,
0.13614341616630554,
2.2903966903686523,
1.7342197895050049,
-0.5263285636901855,
-0.17941102385520935,
-1.1861896514892578,
1.313809871673584,
-0.22045236825942993,
0.25058111548423767,
2.0248119831085205,
-0.38029053807258606,
-0.9889849424362183,
1.1488652229309082,
-2.4142913818359375,
0.12848156690597534,
1.9886199235916138,
0.21996518969535828,
0.15620189905166626,
-1.4804744720458984,
-0.7307417392730713,
-0.07253798842430115,
-0.3567633330821991,
-1.3409281969070435,
0.7851691842079163,
-0.27105969190597534,
-0.7768951058387756,
-1.5219792127609253,
0.18325147032737732,
-1.0586405992507935,
-1.5796617269515991,
0.24766147136688232,
1.8923207521438599,
2.0968778133392334,
-0.8901782631874084,
1.4361352920532227,
-0.14789733290672302,
0.21621540188789368,
1.2599306106567383,
1.1099660396575928,
3.0275416374206543,
2.136212110519409,
-1.1429026126861572,
0.7586844563484192,
-0.11337049305438995,
-0.5366801023483276,
1.277944564819336,
-1.0302492380142212,
1.3094080686569214,
-0.19854605197906494,
-1.1892527341842651,
-1.1788228750228882,
0.9378610253334045,
0.5148271918296814,
0.1208232119679451,
-0.4779454171657562,
1.342665672302246,
-0.011860028840601444,
1.2300217151641846,
0.6226733326911926,
-0.54029381275177,
0.5770633816719055,
-0.5152736306190491,
-0.3863413631916046,
1.6878750324249268,
0.31018704175949097,
-1.5330644845962524,
-2.3187615871429443,
-0.2087588608264923,
-0.8867043852806091,
-0.16851010918617249,
-0.5982854962348938,
-1.0205109119415283,
1.423323392868042,
0.4249539375305176,
-1.0478249788284302,
-0.3659331202507019,
-0.31349024176597595,
-0.6692284941673279,
2.679039716720581,
-1.3985607624053955,
-0.37292739748954773,
-0.9110527038574219,
-0.4811907708644867,
1.7663663625717163,
-1.1374236345291138,
-0.07655272632837296,
-1.0887459516525269,
-0.5977690815925598,
-1.3620766401290894,
-0.5222046971321106,
0.010165749117732048,
-0.9034380912780762,
0.744080126285553,
0.08435503393411636,
-1.12949800491333,
-0.046194933354854584,
-0.8156173825263977,
0.8047131299972534,
-0.03854924440383911,
0.47168707847595215,
1.9669660329818726,
0.31030434370040894,
-0.39498230814933777,
0.7071017026901245,
1.2598748207092285,
0.5250530242919922,
-0.7137481570243835,
0.0771426185965538,
-0.7793978452682495,
0.32287654280662537,
-1.249863624572754,
0.2297056019306183,
-2.842000722885132,
0.7176767587661743,
-0.08029191195964813,
-0.1888267695903778,
-0.0255693718791008,
-1.265404462814331,
1.1014691591262817,
2.470452308654785,
-1.2146178483963013,
0.5720558762550354,
0.3558817505836487,
1.338208556175232,
-1.4301246404647827,
0.27009955048561096,
-0.5344997048377991,
2.0656485557556152,
0.18148955702781677,
1.142809510231018,
-0.504965603351593,
-2.1598892211914062,
0.5862230658531189,
-1.2999699115753174,
-1.1642564535140991,
0.6951436400413513,
-0.8847770690917969,
-0.10186987370252609,
-1.4467763900756836,
-0.08552989363670349,
-0.8828333616256714,
-1.3626676797866821,
0.7489047050476074,
0.13058006763458252,
0.5498294234275818,
-0.6378123164176941,
0.3884946405887604,
-2.177060127258301,
-1.3580039739608765,
-0.2757006883621216,
-0.8415433168411255,
0.43436530232429504,
-0.35465583205223083,
0.7085229158401489,
-0.22611412405967712,
0.11858173459768295,
0.18324676156044006,
1.3332107067108154,
3.348606824874878,
0.12718573212623596,
0.4305003881454468,
-0.046304479241371155,
-1.0093815326690674,
1.531809687614441,
1.0883970260620117,
0.027606043964624405,
-0.5990479588508606,
-0.9518769979476929,
1.3171342611312866,
1.9663704633712769,
1.0495691299438477,
0.19172921776771545,
-0.9689921736717224,
-0.41464486718177795,
-0.055482231080532074,
0.1475372314453125,
0.3309279978275299,
0.874174952507019,
-0.0558399073779583,
0.13066887855529785,
1.4650417566299438,
1.2022379636764526,
-0.41609835624694824,
0.4589815139770508,
-0.866287887096405,
-0.35307052731513977,
0.4491034746170044,
0.3717753291130066,
0.03230488672852516,
0.4055614769458771,
-0.9707661271095276,
-0.2774966061115265,
-0.242098867893219,
-1.0831183195114136,
-0.845249593257904,
-0.3255768120288849,
-0.3009548485279083,
1.710029125213623,
0.18950238823890686,
-0.5014120936393738,
-0.011338863521814346,
-0.7749781608581543,
-0.10289756208658218,
-1.0120614767074585,
0.19508615136146545,
-0.09382860362529755,
-0.12339311838150024,
-0.0486970990896225,
1.9521732330322266,
-1.1277917623519897,
-2.2259490489959717,
0.18419083952903748,
0.31150421500205994,
-0.29802021384239197,
0.15138933062553406,
1.5085581541061401,
0.44448843598365784,
1.538962483406067,
1.301063895225525,
1.0694875717163086,
-0.6662138104438782,
-1.3847094774246216,
0.6725110411643982,
1.0963071584701538,
-1.4209058284759521,
0.7701617479324341,
-0.006763524375855923,
-0.5413995981216431,
0.7244345545768738,
1.1944907903671265,
0.35912269353866577,
-1.9401577711105347,
0.7693458795547485,
-0.9868446588516235,
0.8662024736404419,
0.6234590411186218,
0.8150245547294617,
0.3301497995853424,
0.7481464147567749,
-1.3312095403671265,
-1.1927162408828735,
-0.8304620385169983,
-0.5901975035667419,
2.035398006439209,
-0.18667984008789062,
0.7374335527420044,
-0.1375812590122223,
-1.3037248849868774,
-0.10820645838975906,
0.834572434425354,
0.3504156172275543,
-0.35479530692100525,
0.7469915151596069,
-0.6515816450119019,
-1.0629396438598633,
-1.4745826721191406,
-0.4613051414489746,
-0.9483053684234619,
-0.9703170657157898,
1.1176376342773438,
0.8025127053260803,
0.3201274573802948,
1.8651020526885986,
0.5162374377250671,
0.30455976724624634,
-2.640467882156372,
0.9701507687568665,
0.40225741267204285,
0.0562402680516243,
0.7638178467750549,
0.2823289632797241,
1.1075847148895264,
-0.03812167048454285,
0.567067563533783,
-2.2282156944274902,
2.1528077125549316,
-0.18145647644996643,
0.5907195806503296,
0.042932573705911636,
-0.09548124670982361,
1.0076249837875366,
0.5845206379890442,
0.6509470343589783,
-1.08156418800354,
0.7096675038337708,
-0.5267494320869446,
1.270707607269287,
1.0089527368545532,
-0.7322506904602051,
-0.0586906261742115,
1.3884941339492798,
0.5307893753051758,
-0.39835426211357117,
-0.9916973114013672,
-0.7370898723602295,
1.0079286098480225,
1.7030473947525024,
-0.1425420641899109,
0.08613727986812592,
0.8116990327835083,
0.3872459828853607,
-1.3035883903503418,
0.06271414458751678,
-0.8057796359062195,
-0.5980227589607239,
1.5834689140319824,
2.0484399795532227,
-0.138787180185318,
-0.0560438372194767,
-0.7145202159881592,
-1.2661619186401367,
0.6802672147750854,
-0.04396076500415802,
0.14033454656600952,
0.8268762826919556,
-0.5747045874595642,
1.0354399681091309,
0.6549381613731384,
0.9416719675064087,
-0.006534582935273647,
0.3730621337890625,
0.37837326526641846,
-0.3040432929992676,
-1.1446303129196167,
-0.3123503625392914,
-1.0953713655471802,
-2.6127586364746094,
0.29062891006469727,
-0.40488719940185547,
-1.439258337020874,
0.0765133872628212,
-1.0096780061721802,
1.02425217628479,
-0.49367067217826843,
-1.1112440824508667,
-1.606753945350647,
0.2602598965167999,
-0.1420879065990448,
0.9489307999610901,
-1.596608281135559,
-0.08195266127586365,
1.1624910831451416,
0.8897953629493713,
-0.8152347803115845,
1.185256838798523,
0.32358184456825256,
1.0372389554977417,
0.7377710938453674,
-0.4048534035682678,
0.42485669255256653,
-0.05244315043091774,
-1.3248367309570312,
0.6476582288742065,
1.1547950506210327,
0.14146113395690918,
1.2852883338928223,
-0.6620134115219116,
-0.05819631740450859,
0.5767033696174622,
-0.45053109526634216,
-0.41713908314704895,
-0.27016401290893555,
0.676531195640564,
0.206872820854187,
-0.9137771129608154,
-0.0855853334069252,
-0.08375383168458939,
-0.2224518060684204,
0.17824727296829224,
-1.5233769416809082,
-0.22514212131500244,
-0.48582443594932556,
-0.5427708625793457,
-1.3846899271011353,
0.16610270738601685,
1.2807013988494873,
-0.6740009188652039,
-0.2681679129600525,
0.5695420503616333,
0.5003510117530823,
0.5078756809234619,
0.5645538568496704,
-0.637910783290863,
-0.30756595730781555,
-0.25177159905433655,
-0.2225237786769867,
0.2665681540966034,
1.2638182640075684,
-0.304155558347702,
-1.1206368207931519,
0.8010775446891785,
-0.4302734136581421,
0.06044142693281174,
1.8731647729873657,
0.21472159028053284,
-0.8492652773857117,
0.26405322551727295,
-0.6276966333389282,
1.9298406839370728,
1.5884286165237427,
1.3147821426391602,
-0.04916210472583771,
-0.787733256816864,
0.6212314963340759,
-0.2235758900642395,
-0.3408414125442505,
0.8589476346969604,
0.402682363986969,
-0.11025670915842056,
-1.500152349472046,
0.5348631739616394,
1.3350075483322144,
-0.8606835603713989,
-0.8383497595787048,
0.00417206808924675,
-0.8785673379898071,
1.113710641860962,
0.7662443518638611,
0.49739810824394226,
0.1838083565235138,
1.5747698545455933,
0.7035631537437439,
-0.6053041815757751,
0.5474336743354797,
0.4569198489189148,
0.008948907256126404,
-2.1091511249542236,
-1.0218274593353271,
0.2856985330581665,
-0.3753562271595001,
-1.5808916091918945,
1.2950823307037354,
-1.1410210132598877,
-0.9154148101806641,
0.49095383286476135,
0.207475483417511,
1.4975354671478271,
0.3002051115036011,
1.5048507452011108,
2.089597702026367,
0.9087985157966614,
0.2636829614639282,
1.3839974403381348,
-0.0633600726723671,
-0.3963072597980499,
1.8783987760543823,
-0.4243943691253662,
0.44612976908683777,
1.0608751773834229,
-0.4469963312149048,
-0.9782493710517883,
-0.712169349193573,
-1.164064884185791,
-0.3600981533527374,
1.1005771160125732,
0.19665756821632385,
-1.1025339365005493,
0.15212512016296387,
1.4903490543365479,
0.17370477318763733,
-0.3715322017669678,
0.6402280330657959,
0.5672694444656372,
-0.8609344363212585,
-0.03188132494688034,
-0.8930123448371887,
0.5210772156715393,
-0.17875030636787415,
-0.25672054290771484,
0.36752450466156006,
0.5201274752616882,
1.2135391235351562,
-0.13192404806613922,
0.1238693967461586,
1.172700047492981,
-1.453662633895874,
1.569726586341858,
-0.5504062175750732,
0.12319257110357285,
-2.49072003364563,
1.3639711141586304,
-0.6693381667137146,
1.8198941946029663,
-2.642932653427124,
0.2918158769607544,
-0.5740698575973511,
-0.40621301531791687,
0.35762128233909607,
-0.32455602288246155,
0.046136584132909775,
-0.12323831766843796,
-1.0861011743545532,
0.06429890543222427,
-0.6159379482269287,
0.538962185382843,
1.1371240615844727,
1.2108581066131592,
-1.0552481412887573,
-0.21418213844299316,
-1.864166021347046,
-0.0664973258972168,
-0.7240458130836487,
0.3896896541118622,
-2.1539130210876465,
-0.2767373025417328,
-1.8216384649276733,
-2.3228437900543213,
-1.4465590715408325,
-0.8370338082313538,
1.1211085319519043,
0.1389274299144745,
-1.058043122291565,
1.2047135829925537,
-0.3202994167804718,
-1.8261171579360962,
1.0216882228851318,
-2.155874252319336
] |
https://github.com/huggingface/datasets/issues/5000 | Dataset Viewer issue for asapp/slue | The dataset is being refreshed, please retry later.
<img width="802" alt="Capture d’écran 2022-09-20 à 22 39 46" src="https://user-images.githubusercontent.com/1676121/191360072-7cc86486-4e84-4b47-8f9a-4a69fe84a5ac.png">
| ### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes | 518 | 18 | Dataset Viewer issue for asapp/slue
### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes
The dataset is being refreshed, please retry later.
<img width="802" alt="Capture d’écran 2022-09-20 à 22 39 46" src="https://user-images.githubusercontent.com/1676121/191360072-7cc86486-4e84-4b47-8f9a-4a69fe84a5ac.png">
| [
-1.0905165672302246,
-0.813915491104126,
-0.8700715899467468,
1.4335856437683105,
-0.15641513466835022,
-1.2605022192001343,
0.12618866562843323,
-0.9959618449211121,
1.5595754384994507,
-0.7646375894546509,
0.23101912438869476,
-1.6282778978347778,
-0.10361127555370331,
-0.5051901936531067,
-0.574738621711731,
-0.8917275667190552,
-0.3946891725063324,
-0.7153074145317078,
1.091441035270691,
2.692502975463867,
1.227669596672058,
-1.2620786428451538,
2.775320053100586,
0.6828195452690125,
-0.26342007517814636,
-0.9778277277946472,
0.620819091796875,
0.14688527584075928,
-1.230210542678833,
-0.4155682921409607,
-0.9335855841636658,
0.04206754267215729,
-0.5144948363304138,
-0.40921443700790405,
0.021770674735307693,
0.49336111545562744,
-0.18970507383346558,
-0.38598722219467163,
-0.5597862005233765,
-0.8072797656059265,
0.4653995633125305,
-0.47143492102622986,
0.8672966361045837,
-0.37997180223464966,
1.8118228912353516,
-0.5813170671463013,
0.30703848600387573,
0.6418200135231018,
1.3061944246292114,
0.10465303063392639,
-0.05502922460436821,
0.2282199263572693,
0.3461451232433319,
-0.0893278643488884,
0.463365375995636,
1.208518147468567,
0.5304305553436279,
0.5691781044006348,
0.6255199909210205,
-2.1630938053131104,
1.356634259223938,
-0.8968071341514587,
0.2589739263057709,
1.4750251770019531,
-1.1463500261306763,
0.49195992946624756,
-1.8403139114379883,
-0.10738471150398254,
0.38247817754745483,
-2.340419054031372,
0.32535240054130554,
-1.2602487802505493,
-0.6243600845336914,
0.916238009929657,
0.25721219182014465,
-1.2956414222717285,
0.013433492742478848,
-0.5571481585502625,
1.028349757194519,
0.44171586632728577,
1.1137499809265137,
-1.6846230030059814,
-0.05855422839522362,
-0.26406949758529663,
0.015110530890524387,
-1.4623322486877441,
-1.53778076171875,
0.5105182528495789,
0.6643114686012268,
0.7016221284866333,
0.04055309668183327,
0.8068128824234009,
-1.0669834613800049,
0.7241241335868835,
-0.8012915849685669,
-1.7256802320480347,
-1.2864900827407837,
-2.3437650203704834,
-2.29072904586792,
0.800077497959137,
-0.40213537216186523,
-0.5669335722923279,
1.9807121753692627,
-1.0279414653778076,
-1.7228270769119263,
1.1752220392227173,
0.2514019310474396,
-0.06737315654754639,
2.4834516048431396,
0.38079023361206055,
-0.7472536563873291,
0.40668490529060364,
-0.7630695700645447,
0.8333706855773926,
-0.4548896253108978,
1.393754005432129,
0.5626215934753418,
-1.000289797782898,
1.7137733697891235,
-0.44667506217956543,
0.5629463195800781,
-0.7311440110206604,
-0.46508461236953735,
-0.939163327217102,
0.2719995379447937,
1.9143157005310059,
-0.3512841463088989,
1.5788575410842896,
-0.32591214776039124,
-1.5949612855911255,
-1.572180986404419,
0.9113323092460632,
0.5080097913742065,
-0.8569144010543823,
0.10168597102165222,
-0.31511008739471436,
0.10383975505828857,
0.11904749274253845,
1.0238909721374512,
1.2413151264190674,
0.7395668625831604,
-0.2695844769477844,
-0.9610540270805359,
0.26503506302833557,
0.020568110048770905,
-0.5901943445205688,
-1.83892822265625,
-0.3272245526313782,
0.19949083030223846,
0.6305409669876099,
-1.2630876302719116,
1.7169102430343628,
0.8804322481155396,
1.8912361860275269,
0.9886000752449036,
-0.36217501759529114,
1.5239101648330688,
0.008876717649400234,
1.8999309539794922,
-0.5229571461677551,
0.7309419512748718,
-0.2819715440273285,
-1.144592046737671,
0.7929162383079529,
-0.3136696517467499,
-2.0258424282073975,
-0.8395768404006958,
-0.9067871570587158,
-0.18583133816719055,
-0.7500817179679871,
0.9992188811302185,
-0.2886742055416107,
-1.3922985792160034,
0.15871714055538177,
-0.6412522196769714,
0.12605977058410645,
-1.4161808490753174,
0.2733932435512543,
0.7109122276306152,
-0.5446736812591553,
0.013836869038641453,
-0.2354479283094406,
-1.3314268589019775,
-0.4216856062412262,
0.2894207239151001,
1.936385154724121,
-0.7022638320922852,
0.9878302216529846,
0.9592172503471375,
-0.8022404313087463,
-0.05234617739915848,
0.3122006952762604,
-0.300332248210907,
0.8862709999084473,
-1.166602611541748,
-0.33857518434524536,
1.0487478971481323,
-0.1163441389799118,
-0.6363467574119568,
1.4260977506637573,
0.8273530006408691,
-0.9874787330627441,
-0.2675081491470337,
-0.23289543390274048,
-0.7284740209579468,
-0.009111941792070866,
-1.6341978311538696,
-0.1459764987230301,
0.28723767399787903,
-1.4070088863372803,
-0.5341789126396179,
-0.20497338473796844,
1.2954354286193848,
-0.19717548787593842,
1.3785704374313354,
-0.28947415947914124,
-0.26297083497047424,
-0.4532482624053955,
-0.5216123461723328,
0.15204142034053802,
-0.17115971446037292,
-0.605114221572876,
0.33252501487731934,
-0.857917308807373,
0.23427066206932068,
1.5256067514419556,
0.44914984703063965,
0.16636478900909424,
0.5356675386428833,
1.0583761930465698,
0.36751776933670044,
-0.14198444783687592,
-0.9393726587295532,
-1.6332972049713135,
1.9575932025909424,
-1.5466954708099365,
1.9502590894699097,
0.7499776482582092,
-0.08895869553089142,
-1.7598497867584229,
-1.9172502756118774,
1.3711962699890137,
1.3390922546386719,
2.4688031673431396,
0.6525962948799133,
0.46825316548347473,
-0.8067488074302673,
-0.814696729183197,
0.2440630942583084,
-1.2152644395828247,
-0.722957193851471,
0.18586860597133636,
2.259690046310425,
1.692124843597412,
-0.5478887557983398,
-0.1785009652376175,
-1.0633975267410278,
1.2245534658432007,
-0.10654010623693466,
0.1959371566772461,
1.9838588237762451,
-0.3296945095062256,
-1.008422613143921,
1.0910592079162598,
-2.3341453075408936,
0.14028441905975342,
1.922211766242981,
0.25415509939193726,
0.1009296253323555,
-1.395198106765747,
-0.7442070841789246,
-0.21363508701324463,
-0.3970508277416229,
-1.2923853397369385,
0.6358305215835571,
-0.22981077432632446,
-0.8657747507095337,
-1.534670352935791,
0.0903758704662323,
-1.114362120628357,
-1.6910418272018433,
0.3134470283985138,
1.7808257341384888,
2.115347146987915,
-0.9310150742530823,
1.3943692445755005,
-0.23221760988235474,
0.1004156544804573,
1.155226707458496,
1.2683186531066895,
3.1129908561706543,
1.9781951904296875,
-1.2299394607543945,
0.8003813624382019,
-0.12270142138004303,
-0.4363233745098114,
1.1734991073608398,
-1.0058799982070923,
1.2615759372711182,
-0.21821965277194977,
-1.2583211660385132,
-1.2323558330535889,
0.8987274765968323,
0.4723725914955139,
0.01102485042065382,
-0.3643683195114136,
1.2543829679489136,
0.04906629025936127,
1.389492392539978,
0.6198519468307495,
-0.34753456711769104,
0.6761378049850464,
-0.4412272274494171,
-0.373951256275177,
1.6446282863616943,
0.1814255714416504,
-1.4582117795944214,
-2.3696727752685547,
-0.23711463809013367,
-0.8441388010978699,
-0.10304522514343262,
-0.6455731987953186,
-1.1109721660614014,
1.6198322772979736,
0.48338833451271057,
-1.0766937732696533,
-0.3534676134586334,
-0.32575416564941406,
-0.6340909004211426,
2.637138605117798,
-1.4128214120864868,
-0.1652068942785263,
-0.971371054649353,
-0.5345561504364014,
1.6921826601028442,
-1.1597949266433716,
-0.09782464057207108,
-0.955680787563324,
-0.5786572098731995,
-1.3405901193618774,
-0.5536814332008362,
-0.05243559181690216,
-0.9013586044311523,
0.7405473589897156,
0.08406423777341843,
-1.0852150917053223,
-0.17971186339855194,
-0.9284783005714417,
0.7852857112884521,
-0.10002479702234268,
0.3639334738254547,
1.859137773513794,
0.34769952297210693,
-0.2997828722000122,
0.7388348579406738,
1.2276413440704346,
0.5255385637283325,
-0.7041246294975281,
0.18447111546993256,
-0.7526485323905945,
0.2159002125263214,
-1.2505083084106445,
0.17073754966259003,
-2.8983471393585205,
0.7003413438796997,
-0.09785565733909607,
-0.1058131530880928,
0.00031789205968379974,
-1.3013252019882202,
1.1491254568099976,
2.423565626144409,
-1.1060782670974731,
0.5571761727333069,
0.29203829169273376,
1.2832878828048706,
-1.547060251235962,
0.23201629519462585,
-0.4139097332954407,
2.05325984954834,
0.2213285118341446,
1.2457283735275269,
-0.49799010157585144,
-2.14497709274292,
0.5944716930389404,
-1.2571208477020264,
-1.0832395553588867,
0.7409601211547852,
-0.879915714263916,
0.07423023134469986,
-1.3244788646697998,
-0.25496166944503784,
-0.9042111039161682,
-1.2707144021987915,
0.7082985639572144,
0.07483770698308945,
0.5235711336135864,
-0.5095372796058655,
0.36854514479637146,
-2.1187939643859863,
-1.2835360765457153,
-0.23241309821605682,
-0.9001114964485168,
0.46570348739624023,
-0.28269708156585693,
0.6260038614273071,
-0.15867112576961517,
0.08447082340717316,
0.2733989953994751,
1.4187140464782715,
3.293149471282959,
0.1558324694633484,
0.3526777923107147,
-0.11300334334373474,
-1.0353355407714844,
1.5835602283477783,
0.9792815446853638,
0.030315645039081573,
-0.6503782272338867,
-0.9878368377685547,
1.3094812631607056,
1.8752726316452026,
1.0848822593688965,
0.1222238540649414,
-0.9109521508216858,
-0.5590023994445801,
0.026544839143753052,
0.17721842229366302,
0.40457072854042053,
0.9396871328353882,
0.008321591652929783,
0.05792677775025368,
1.483445405960083,
1.2953766584396362,
-0.49778836965560913,
0.4481678009033203,
-0.9729722142219543,
-0.39049527049064636,
0.4737836718559265,
0.24429751932621002,
-0.0112543236464262,
0.3631908893585205,
-1.0702835321426392,
-0.19313861429691315,
-0.23811395466327667,
-0.9919818639755249,
-0.8066619038581848,
-0.43732571601867676,
-0.30622154474258423,
1.6975828409194946,
0.05146947130560875,
-0.4328290820121765,
0.0831715390086174,
-0.8228435516357422,
-0.1591905951499939,
-1.1033918857574463,
0.25281769037246704,
-0.1572536826133728,
-0.10788686573505402,
-0.06478574872016907,
1.9277734756469727,
-1.049052119255066,
-2.2632949352264404,
0.26743176579475403,
0.23124900460243225,
-0.4075838625431061,
0.14574672281742096,
1.6209720373153687,
0.46567174792289734,
1.4277933835983276,
1.3311787843704224,
1.0501291751861572,
-0.7620898485183716,
-1.2894525527954102,
0.6470381021499634,
1.0005381107330322,
-1.3391695022583008,
0.7627086639404297,
-0.18110498785972595,
-0.48244160413742065,
0.6438515782356262,
1.272091269493103,
0.4351881146430969,
-1.8940742015838623,
0.8175568580627441,
-0.8842051029205322,
0.7916861772537231,
0.6874849796295166,
0.7883092164993286,
0.25651872158050537,
0.7861902117729187,
-1.3244484663009644,
-1.0501141548156738,
-0.7710997462272644,
-0.5148897171020508,
1.8877986669540405,
-0.13784825801849365,
0.5520225167274475,
-0.134845569729805,
-1.2190676927566528,
0.03547011315822601,
0.7622681260108948,
0.36848148703575134,
-0.3027237057685852,
0.7538514733314514,
-0.6145890355110168,
-1.0846121311187744,
-1.4457180500030518,
-0.4756002426147461,
-1.0039786100387573,
-0.9802858233451843,
1.0467541217803955,
0.6902614235877991,
0.2950924336910248,
1.8588745594024658,
0.6246115565299988,
0.28837257623672485,
-2.7550134658813477,
0.89345383644104,
0.31720811128616333,
0.13382083177566528,
0.8929482102394104,
0.277932733297348,
1.0999866724014282,
-0.08100740611553192,
0.45545467734336853,
-2.30122447013855,
2.2784054279327393,
-0.17154018580913544,
0.6862257719039917,
0.017204541712999344,
-0.11867551505565643,
1.0268542766571045,
0.501473069190979,
0.6215723156929016,
-1.130323886871338,
0.8018286824226379,
-0.5647849440574646,
1.1472458839416504,
0.9380401372909546,
-0.8210560083389282,
0.09958167374134064,
1.2910314798355103,
0.539962887763977,
-0.440245658159256,
-0.9779214859008789,
-0.7615980505943298,
0.9497055411338806,
1.8048125505447388,
-0.05600433796644211,
0.04302513971924782,
0.7542398571968079,
0.4902906119823456,
-1.2630828619003296,
-0.024044938385486603,
-0.670576274394989,
-0.59139484167099,
1.7316229343414307,
2.0379481315612793,
-0.05089607462286949,
-0.2595667243003845,
-0.7388752698898315,
-1.27237868309021,
0.7375941276550293,
0.053379278630018234,
0.20163840055465698,
0.8410184979438782,
-0.681821882724762,
1.1539987325668335,
0.6715468764305115,
0.8933671712875366,
0.06449935585260391,
0.3515138328075409,
0.4017510414123535,
-0.32750824093818665,
-1.179934024810791,
-0.2876809239387512,
-1.1206333637237549,
-2.648648262023926,
0.43437573313713074,
-0.3549121022224426,
-1.422783613204956,
0.046565666794776917,
-1.0572402477264404,
0.9121140837669373,
-0.559910237789154,
-1.0412631034851074,
-1.5003582239151,
0.258334219455719,
-0.23044316470623016,
0.8234786987304688,
-1.636600375175476,
-0.181791752576828,
1.2455754280090332,
1.0039520263671875,
-0.6988078355789185,
1.0973360538482666,
0.2520676255226135,
0.9898641705513,
0.79336017370224,
-0.4167744815349579,
0.45304715633392334,
0.08460690826177597,
-1.4243565797805786,
0.49231958389282227,
1.2920119762420654,
0.15758512914180756,
1.364102840423584,
-0.5319810509681702,
0.04579389467835426,
0.5553305745124817,
-0.35464924573898315,
-0.5053188800811768,
-0.4207465946674347,
0.7516694068908691,
0.08386508375406265,
-1.063294768333435,
-0.006228729151189327,
-0.11882983148097992,
-0.18566983938217163,
0.2585833668708801,
-1.4841059446334839,
-0.24061070382595062,
-0.48164471983909607,
-0.6200838088989258,
-1.3316869735717773,
0.041985657066106796,
1.2368764877319336,
-0.8049025535583496,
-0.17677469551563263,
0.5040438175201416,
0.339735746383667,
0.5648745894432068,
0.5344947576522827,
-0.7555956840515137,
-0.32719895243644714,
-0.24057845771312714,
-0.30711090564727783,
0.4098738431930542,
1.2166047096252441,
-0.2416445016860962,
-1.088847041130066,
0.6651390194892883,
-0.297012060880661,
0.16199389100074768,
1.9838275909423828,
0.11077506095170975,
-0.8391510248184204,
0.28623154759407043,
-0.646447479724884,
1.9247318506240845,
1.5679666996002197,
1.3935939073562622,
-0.1143680140376091,
-0.7801789045333862,
0.5888962149620056,
-0.19176939129829407,
-0.28048276901245117,
0.9240833520889282,
0.4654994308948517,
-0.12237611413002014,
-1.5308469533920288,
0.5800068974494934,
1.3898988962173462,
-0.878454864025116,
-0.7989929914474487,
0.07957462966442108,
-0.8058686256408691,
1.1614500284194946,
0.7505027651786804,
0.38295623660087585,
0.2293476164340973,
1.5813337564468384,
0.6640954613685608,
-0.5314998030662537,
0.4446435868740082,
0.41571125388145447,
-0.10442012548446655,
-2.0744998455047607,
-1.0164753198623657,
0.2694704532623291,
-0.34415584802627563,
-1.5137898921966553,
1.3912217617034912,
-1.1587125062942505,
-0.9363341331481934,
0.5771269798278809,
0.27053114771842957,
1.4942104816436768,
0.2880086600780487,
1.6446619033813477,
2.0516436100006104,
0.9326654076576233,
0.16544441878795624,
1.3148596286773682,
-0.12255723774433136,
-0.4117434322834015,
1.7964545488357544,
-0.4315848648548126,
0.4159177839756012,
0.9778488874435425,
-0.4421843886375427,
-1.1073174476623535,
-0.7769257426261902,
-1.1694774627685547,
-0.6117273569107056,
1.1607177257537842,
0.22387397289276123,
-1.1058714389801025,
0.11821827292442322,
1.565801739692688,
0.10256733745336533,
-0.35201746225357056,
0.6683028936386108,
0.5045895576477051,
-0.7273047566413879,
-0.07966893166303635,
-0.9312977194786072,
0.5028254389762878,
-0.1297319084405899,
-0.3064807057380676,
0.24372757971286774,
0.5130946040153503,
1.1257717609405518,
-0.024653952568769455,
0.1054343432188034,
1.2496631145477295,
-1.2887879610061646,
1.5174113512039185,
-0.6219326853752136,
0.17186908423900604,
-2.3385069370269775,
1.470210313796997,
-0.812881588935852,
1.8105864524841309,
-2.6225574016571045,
0.4132574200630188,
-0.5752766728401184,
-0.3593767583370209,
0.23556597530841827,
-0.3741008937358856,
0.1350826621055603,
-0.13445229828357697,
-1.0398781299591064,
-0.11066535115242004,
-0.7849888205528259,
0.5751421451568604,
1.1950167417526245,
1.219922423362732,
-1.1057190895080566,
-0.23478500545024872,
-1.820267915725708,
-0.03918806463479996,
-0.7696781754493713,
0.25943508744239807,
-2.0297138690948486,
-0.26887741684913635,
-1.9112869501113892,
-2.3228490352630615,
-1.4380979537963867,
-0.8132162094116211,
1.171700358390808,
0.272516131401062,
-0.898296058177948,
1.131381630897522,
-0.29254183173179626,
-1.767612338066101,
1.1744595766067505,
-2.174842596054077
] |
https://github.com/huggingface/datasets/issues/5000 | Dataset Viewer issue for asapp/slue | OK. We now have an issue because the dataset cannot be streamed, and the dataset viewer relies on it.
Maybe @huggingface/datasets can help:
```
Error code: StreamingRowsError
Exception: NotImplementedError
Message: Extraction protocol for TAR archives like 'https://public-dataset-model-store.awsdev.asapp.com/users/sshon/public/slue/slue-voxpopuli_v0.2_blind.tar.gz' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead.
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/responses/first_rows.py", line 337, in get_first_rows_response
rows = get_rows(dataset, config, split, streaming=True, rows_max_number=rows_max_number, hf_token=hf_token)
File "/src/services/worker/src/worker/utils.py", line 123, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/responses/first_rows.py", line 65, in get_rows
ds = load_dataset(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1739, in load_dataset
return builder_instance.as_streaming_dataset(split=split)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1025, in as_streaming_dataset
splits_generators = {sg.name: sg for sg in self._split_generators(dl_manager)}
File "/tmp/modules-cache/datasets_modules/datasets/asapp--slue/adaa0c78233e1a1df9c2f054e690ec5fc3eaf453bd76b80fe5cbe5728e55d9b1/slue.py", line 189, in _split_generators
dl_dir = dl_manager.download_and_extract(_DL_URLS[config_name])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 944, in download_and_extract
return self.extract(self.download(url_or_urls))
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 907, in extract
urlpaths = map_nested(self._extract, path_or_paths, map_tuple=True)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 385, in map_nested
return function(data_struct)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 912, in _extract
protocol = _get_extraction_protocol(urlpath, use_auth_token=self.download_config.use_auth_token)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 390, in _get_extraction_protocol
raise NotImplementedError(
NotImplementedError: Extraction protocol for TAR archives like 'https://public-dataset-model-store.awsdev.asapp.com/users/sshon/public/slue/slue-voxpopuli_v0.2_blind.tar.gz' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead.
``` | ### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes | 518 | 180 | Dataset Viewer issue for asapp/slue
### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes
OK. We now have an issue because the dataset cannot be streamed, and the dataset viewer relies on it.
Maybe @huggingface/datasets can help:
```
Error code: StreamingRowsError
Exception: NotImplementedError
Message: Extraction protocol for TAR archives like 'https://public-dataset-model-store.awsdev.asapp.com/users/sshon/public/slue/slue-voxpopuli_v0.2_blind.tar.gz' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead.
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/responses/first_rows.py", line 337, in get_first_rows_response
rows = get_rows(dataset, config, split, streaming=True, rows_max_number=rows_max_number, hf_token=hf_token)
File "/src/services/worker/src/worker/utils.py", line 123, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/responses/first_rows.py", line 65, in get_rows
ds = load_dataset(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1739, in load_dataset
return builder_instance.as_streaming_dataset(split=split)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1025, in as_streaming_dataset
splits_generators = {sg.name: sg for sg in self._split_generators(dl_manager)}
File "/tmp/modules-cache/datasets_modules/datasets/asapp--slue/adaa0c78233e1a1df9c2f054e690ec5fc3eaf453bd76b80fe5cbe5728e55d9b1/slue.py", line 189, in _split_generators
dl_dir = dl_manager.download_and_extract(_DL_URLS[config_name])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 944, in download_and_extract
return self.extract(self.download(url_or_urls))
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 907, in extract
urlpaths = map_nested(self._extract, path_or_paths, map_tuple=True)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 385, in map_nested
return function(data_struct)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 912, in _extract
protocol = _get_extraction_protocol(urlpath, use_auth_token=self.download_config.use_auth_token)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 390, in _get_extraction_protocol
raise NotImplementedError(
NotImplementedError: Extraction protocol for TAR archives like 'https://public-dataset-model-store.awsdev.asapp.com/users/sshon/public/slue/slue-voxpopuli_v0.2_blind.tar.gz' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead.
``` | [
-1.1872093677520752,
-0.9409164190292358,
-0.6680216193199158,
1.3826909065246582,
-0.12299003452062607,
-1.2252141237258911,
0.13486328721046448,
-0.9802899360656738,
1.5792384147644043,
-0.7114889621734619,
0.196751207113266,
-1.6948411464691162,
-0.0727529227733612,
-0.5198319554328918,
-0.6846647262573242,
-0.9270409345626831,
-0.39222487807273865,
-0.8176122307777405,
1.0444388389587402,
2.4975051879882812,
1.327591061592102,
-1.3069672584533691,
2.7752349376678467,
0.688281774520874,
-0.3354443609714508,
-1.048693299293518,
0.574360191822052,
0.024662084877490997,
-1.2214257717132568,
-0.45239704847335815,
-0.9557589888572693,
-0.0005395011976361275,
-0.558027982711792,
-0.29769670963287354,
0.10591963678598404,
0.4669293761253357,
-0.24082520604133606,
-0.14704565703868866,
-0.6701831817626953,
-0.764327883720398,
0.48323366045951843,
-0.39077726006507874,
0.927023708820343,
-0.3542155921459198,
1.7257168292999268,
-0.6142858266830444,
0.4069785475730896,
0.7295533418655396,
1.2809582948684692,
0.1351575255393982,
0.04329953342676163,
0.18094481527805328,
0.3857649266719818,
0.05678898096084595,
0.5611319541931152,
1.210716724395752,
0.575089693069458,
0.4951520264148712,
0.5281659960746765,
-2.219835042953491,
1.3118486404418945,
-0.8976871967315674,
0.26669493317604065,
1.402155876159668,
-0.8849158883094788,
0.40523388981819153,
-1.7977768182754517,
-0.12218734622001648,
0.6044461131095886,
-2.311157703399658,
0.2741714417934418,
-1.3341031074523926,
-0.5347872376441956,
0.9287005662918091,
0.3426899313926697,
-1.1905239820480347,
0.19397790729999542,
-0.5295278429985046,
1.1280572414398193,
0.5008077025413513,
1.0831974744796753,
-1.6955763101577759,
-0.055935975164175034,
-0.15032318234443665,
0.09531832486391068,
-1.3291136026382446,
-1.596369743347168,
0.5721074342727661,
0.6470849514007568,
0.666776716709137,
-0.05950913205742836,
0.9519782066345215,
-1.11258065700531,
0.7936859726905823,
-0.9221715331077576,
-1.6255954504013062,
-1.4026838541030884,
-2.456156015396118,
-2.312290668487549,
0.8599960803985596,
-0.4457218050956726,
-0.5163747072219849,
2.0245113372802734,
-0.9554875493049622,
-1.7144042253494263,
1.100631833076477,
0.291358083486557,
0.07907198369503021,
2.3909943103790283,
0.2688227593898773,
-0.7566432356834412,
0.4068317711353302,
-0.714948832988739,
0.8466373085975647,
-0.34220191836357117,
1.3930952548980713,
0.5383237600326538,
-1.030030369758606,
1.5584875345230103,
-0.5012416839599609,
0.5326876640319824,
-0.6249059438705444,
-0.4794237017631531,
-0.7442014217376709,
0.24154536426067352,
1.8727658987045288,
-0.35691899061203003,
1.5534846782684326,
-0.257547527551651,
-1.4878451824188232,
-1.5330355167388916,
0.8280887007713318,
0.5134065747261047,
-0.847736120223999,
0.019868336617946625,
-0.44402071833610535,
0.2006780505180359,
-0.059342220425605774,
1.0805612802505493,
1.2417744398117065,
0.7421401739120483,
-0.38414865732192993,
-0.8180128931999207,
0.2367919534444809,
-0.1493086814880371,
-0.6673144102096558,
-1.8732458353042603,
-0.2871575951576233,
0.2709513008594513,
0.6116985082626343,
-1.2424827814102173,
1.791606068611145,
0.8833312392234802,
1.9660968780517578,
0.9474530220031738,
-0.40356698632240295,
1.4734529256820679,
-0.0033258222974836826,
1.8387633562088013,
-0.517902672290802,
0.6227460503578186,
-0.3667762577533722,
-1.1653510332107544,
0.8511562943458557,
-0.31545233726501465,
-1.9942179918289185,
-0.7337056398391724,
-0.7797530889511108,
-0.16254955530166626,
-0.7355213761329651,
0.8885770440101624,
-0.23566478490829468,
-1.4891871213912964,
0.0642828643321991,
-0.692406177520752,
0.13068987429141998,
-1.2988802194595337,
0.1596560776233673,
0.6435331702232361,
-0.6686980128288269,
-0.11525086313486099,
-0.29638010263442993,
-1.2660740613937378,
-0.5507388114929199,
0.37488293647766113,
1.8968449831008911,
-0.513974666595459,
0.9538118839263916,
0.9905079007148743,
-0.7504074573516846,
0.05569807440042496,
0.2729848325252533,
-0.3207992911338806,
0.7345440983772278,
-1.0793192386627197,
-0.4603859484195709,
1.14960777759552,
-0.22790634632110596,
-0.7610845565795898,
1.4358317852020264,
0.8378200531005859,
-1.1169090270996094,
-0.2910805344581604,
-0.25587257742881775,
-0.7417376637458801,
0.03911326825618744,
-1.5553855895996094,
-0.17750662565231323,
0.37850260734558105,
-1.4497404098510742,
-0.33595260977745056,
-0.2249816358089447,
1.401387095451355,
-0.21985848248004913,
1.4335895776748657,
-0.3333844542503357,
-0.1495320200920105,
-0.3384323716163635,
-0.5064743757247925,
0.11310354620218277,
-0.17282335460186005,
-0.4996442198753357,
0.26285597681999207,
-0.9143280386924744,
0.3387875556945801,
1.5336275100708008,
0.3686344027519226,
0.06713163107633591,
0.492626816034317,
1.0035185813903809,
0.33531641960144043,
-0.10562650114297867,
-0.8795150518417358,
-1.5405892133712769,
1.9657107591629028,
-1.399788737297058,
1.9865022897720337,
0.8512491583824158,
-0.08331897854804993,
-1.8404895067214966,
-1.8426645994186401,
1.1716551780700684,
1.1652036905288696,
2.3781557083129883,
0.5115672945976257,
0.42448174953460693,
-0.7336609959602356,
-0.7828002572059631,
0.330501914024353,
-1.0865997076034546,
-0.6451976299285889,
0.23924334347248077,
2.3388938903808594,
1.844189167022705,
-0.5210223197937012,
-0.20810756087303162,
-0.9533560276031494,
1.2347229719161987,
-0.27942293882369995,
0.27829524874687195,
2.0971410274505615,
-0.2767123579978943,
-0.9716227054595947,
1.2784514427185059,
-2.362896203994751,
0.2915564179420471,
2.009549379348755,
0.22648754715919495,
0.14947420358657837,
-1.4298681020736694,
-0.6765504479408264,
-0.3201453685760498,
-0.46522530913352966,
-1.2192164659500122,
0.5686460137367249,
-0.34828609228134155,
-0.861403226852417,
-1.3898136615753174,
0.08228343725204468,
-1.089560627937317,
-1.8110862970352173,
0.3151794373989105,
1.8551801443099976,
2.1482226848602295,
-0.8159209489822388,
1.3568166494369507,
-0.2720765173435211,
0.006571716628968716,
1.257804274559021,
1.3043118715286255,
3.018949031829834,
1.9227042198181152,
-1.2975915670394897,
0.7411392331123352,
-0.1907905638217926,
-0.4100772440433502,
1.1521869897842407,
-1.112484097480774,
1.106558084487915,
-0.17628127336502075,
-1.2954970598220825,
-1.2705711126327515,
1.1274211406707764,
0.5276110768318176,
-0.035176586359739304,
-0.5174424052238464,
1.250658392906189,
0.07819343358278275,
1.400528907775879,
0.6521763801574707,
-0.46700844168663025,
0.5345578789710999,
-0.35637620091438293,
-0.5333102345466614,
1.653084635734558,
0.16105401515960693,
-1.5708919763565063,
-2.3372111320495605,
-0.2688137888908386,
-0.9272222518920898,
-0.08452890813350677,
-0.6279181838035583,
-1.0395331382751465,
1.5457983016967773,
0.3924781382083893,
-1.2080495357513428,
-0.27546095848083496,
-0.32963821291923523,
-0.5503078699111938,
2.658756971359253,
-1.2610394954681396,
-0.13915292918682098,
-0.9444083571434021,
-0.5476395487785339,
1.7025126218795776,
-1.2224172353744507,
-0.19278447329998016,
-1.0443178415298462,
-0.691012978553772,
-1.3269933462142944,
-0.46165546774864197,
0.049244679510593414,
-0.8974977135658264,
0.7526037693023682,
0.0820598229765892,
-1.0860188007354736,
-0.30445346236228943,
-0.8566597104072571,
1.0322816371917725,
-0.08682834357023239,
0.1994757056236267,
1.8958561420440674,
0.331677109003067,
-0.427729994058609,
0.6438415050506592,
1.1645821332931519,
0.5728305578231812,
-0.6292174458503723,
0.0653141662478447,
-0.7003740072250366,
0.34213364124298096,
-1.4108930826187134,
0.2577420175075531,
-2.9332730770111084,
0.815061092376709,
-0.154527947306633,
-0.09866512566804886,
-0.11198673397302628,
-1.265541911125183,
1.0497303009033203,
2.601519823074341,
-1.2303071022033691,
0.5529507994651794,
0.44043368101119995,
1.1644362211227417,
-1.557660698890686,
0.2794950306415558,
-0.49319759011268616,
2.076437473297119,
0.1474798172712326,
1.269580602645874,
-0.479721337556839,
-2.161036491394043,
0.6593155860900879,
-1.1958054304122925,
-0.9553896188735962,
0.8089514374732971,
-0.8816373944282532,
0.24308376014232635,
-1.41714608669281,
-0.1834135502576828,
-0.9084174633026123,
-1.2879610061645508,
0.7165267467498779,
0.11726691573858261,
0.44723668694496155,
-0.5884552001953125,
0.3150181770324707,
-2.163233757019043,
-1.2863773107528687,
-0.21653403341770172,
-0.8965407013893127,
0.5625978112220764,
-0.3452327847480774,
0.6172283887863159,
-0.06598062813282013,
0.055012352764606476,
0.31121236085891724,
1.4583334922790527,
3.4054858684539795,
0.10827391594648361,
0.1699894815683365,
-0.06283941864967346,
-1.0527092218399048,
1.366342544555664,
0.8760736584663391,
-0.10528315603733063,
-0.5535625219345093,
-1.0624902248382568,
1.3003711700439453,
1.9997223615646362,
1.1927915811538696,
0.20068521797657013,
-0.9177395105361938,
-0.767232358455658,
0.042703788727521896,
0.19580011069774628,
0.557944655418396,
0.8862396478652954,
-0.07177252322435379,
0.06739678978919983,
1.3957302570343018,
1.2437175512313843,
-0.33847007155418396,
0.39983975887298584,
-0.9697962403297424,
-0.41132912039756775,
0.37505239248275757,
0.2667643129825592,
0.013820013962686062,
0.47443658113479614,
-1.098358154296875,
-0.2688368260860443,
-0.26013603806495667,
-0.9453456997871399,
-0.7214146852493286,
-0.4055391848087311,
-0.4327266812324524,
1.6115998029708862,
0.10615962743759155,
-0.3712541162967682,
0.11970246583223343,
-0.7202847599983215,
-0.21297816932201385,
-1.1460144519805908,
0.16684898734092712,
-0.09739977866411209,
-0.03944198042154312,
-0.22419288754463196,
1.6825813055038452,
-0.8642547726631165,
-2.156198024749756,
0.22220325469970703,
0.30602937936782837,
-0.3999987840652466,
0.19640140235424042,
1.761336088180542,
0.4624025225639343,
1.3537653684616089,
1.2543574571609497,
1.0081976652145386,
-0.5582178235054016,
-1.2281075716018677,
0.7512887120246887,
1.0115692615509033,
-1.3850008249282837,
0.915751039981842,
-0.1795157641172409,
-0.49521109461784363,
0.7502517700195312,
1.32282555103302,
0.3925738036632538,
-2.0298004150390625,
0.8817614912986755,
-0.9955366253852844,
0.7192046642303467,
0.7097669839859009,
0.779286801815033,
0.2695845663547516,
0.9282905459403992,
-1.2951487302780151,
-1.1019318103790283,
-0.7389410138130188,
-0.6075186133384705,
1.8995747566223145,
-0.16694948077201843,
0.5983125567436218,
-0.18800394237041473,
-1.2499133348464966,
-0.06446684896945953,
0.7681083083152771,
0.3554594814777374,
-0.38848522305488586,
0.8736717104911804,
-0.6456336975097656,
-0.9543704390525818,
-1.3592994213104248,
-0.4168465733528137,
-1.0057215690612793,
-0.902596652507782,
0.9834888577461243,
0.7688384652137756,
0.36305010318756104,
1.892287015914917,
0.571169912815094,
0.3152935802936554,
-2.6537630558013916,
0.8794617056846619,
0.3352147936820984,
-0.0016652857884764671,
0.8799358010292053,
0.23477600514888763,
1.134738802909851,
-0.0003000907599925995,
0.5699847340583801,
-2.3453943729400635,
2.238076686859131,
-0.21500857174396515,
0.5997738242149353,
0.06722051650285721,
-0.2073802500963211,
1.087088704109192,
0.6452142000198364,
0.5984168648719788,
-1.0917749404907227,
0.7954736948013306,
-0.5655235052108765,
1.0938889980316162,
0.9960129857063293,
-0.8446887731552124,
0.029547087848186493,
1.4294614791870117,
0.45753028988838196,
-0.43902021646499634,
-0.9212823510169983,
-0.7689138650894165,
0.9466850161552429,
1.7259455919265747,
-0.11357086151838303,
-0.04520437493920326,
0.8322526812553406,
0.6297420859336853,
-1.2201377153396606,
0.03620091453194618,
-0.7472427487373352,
-0.6382524967193604,
1.6457924842834473,
2.047765016555786,
-0.12028565257787704,
-0.19430646300315857,
-0.7097780108451843,
-1.2473045587539673,
0.6894674301147461,
-0.15973398089408875,
0.03818473219871521,
0.8015533089637756,
-0.6203235387802124,
1.0989652872085571,
0.595994234085083,
1.005204439163208,
0.061572618782520294,
0.28836312890052795,
0.3788514733314514,
-0.39286014437675476,
-1.2083146572113037,
-0.3692667782306671,
-1.1338423490524292,
-2.6420094966888428,
0.44913339614868164,
-0.23600555956363678,
-1.4270633459091187,
0.07861367613077164,
-1.0365941524505615,
0.9279155135154724,
-0.557346522808075,
-1.1381902694702148,
-1.4157094955444336,
0.34319809079170227,
-0.2289687693119049,
0.9573180675506592,
-1.6886996030807495,
-0.1749352067708969,
1.224784016609192,
0.8268043994903564,
-0.5871675610542297,
1.0009422302246094,
0.24992810189723969,
1.0753881931304932,
0.7647963166236877,
-0.43921536207199097,
0.5873604416847229,
0.03245396167039871,
-1.3325955867767334,
0.44009730219841003,
1.1771636009216309,
0.15897317230701447,
1.3449089527130127,
-0.481524795293808,
0.14904522895812988,
0.4443216025829315,
-0.6480249166488647,
-0.5226743817329407,
-0.27650225162506104,
0.745569109916687,
0.031310368329286575,
-1.1024099588394165,
-0.12148568034172058,
-0.18539012968540192,
-0.25107187032699585,
0.2063664197921753,
-1.4470219612121582,
-0.2727892994880676,
-0.3993246853351593,
-0.44928303360939026,
-1.3632177114486694,
0.03109516203403473,
1.3318538665771484,
-0.8013616800308228,
-0.2775929272174835,
0.4771574139595032,
0.3859446942806244,
0.5673308968544006,
0.5843503475189209,
-0.8529854416847229,
-0.3258439600467682,
-0.3452392816543579,
-0.32573339343070984,
0.30464112758636475,
1.273024082183838,
-0.07290177047252655,
-0.9738938212394714,
0.7174975872039795,
-0.35568341612815857,
0.18140213191509247,
2.01387095451355,
0.11475097388029099,
-0.7901520729064941,
0.32573750615119934,
-0.672794759273529,
1.790799856185913,
1.7124489545822144,
1.2361949682235718,
-0.12860214710235596,
-0.7755410671234131,
0.541541337966919,
-0.292310506105423,
-0.36775174736976624,
0.8673937916755676,
0.4000150263309479,
-0.20199179649353027,
-1.462178349494934,
0.6094112396240234,
1.3096730709075928,
-0.7884929776191711,
-0.7909478545188904,
0.0795501247048378,
-0.9005966782569885,
1.200452208518982,
0.6221792697906494,
0.28470247983932495,
0.2719445824623108,
1.564752221107483,
0.7247768044471741,
-0.4977787137031555,
0.5351034998893738,
0.465520977973938,
-0.19258609414100647,
-2.1686601638793945,
-1.022584319114685,
0.2972106337547302,
-0.4236588776111603,
-1.5280566215515137,
1.3585788011550903,
-1.1235944032669067,
-1.0104529857635498,
0.5779115557670593,
0.12597231566905975,
1.3177293539047241,
0.342285692691803,
1.7448806762695312,
2.1186554431915283,
0.9016010761260986,
0.33192718029022217,
1.3052586317062378,
-0.039832863956689835,
-0.47031405568122864,
1.808341383934021,
-0.38854342699050903,
0.4568460285663605,
0.9941906332969666,
-0.4285382926464081,
-1.0518927574157715,
-0.8226576447486877,
-1.1435505151748657,
-0.5707656741142273,
1.2593907117843628,
0.1091756820678711,
-1.0227175951004028,
0.19014166295528412,
1.603116512298584,
0.148858904838562,
-0.18898841738700867,
0.7455702424049377,
0.4079359471797943,
-0.7188325524330139,
-0.03366929292678833,
-0.838721513748169,
0.48380517959594727,
-0.09362263232469559,
-0.3020416498184204,
0.2616393268108368,
0.5231704115867615,
1.3024301528930664,
-0.09191661328077316,
0.11255650967359543,
1.1447392702102661,
-1.3203563690185547,
1.542340636253357,
-0.5317087769508362,
0.25098854303359985,
-2.4791758060455322,
1.3427917957305908,
-0.769660234451294,
1.90773344039917,
-2.5222816467285156,
0.42333000898361206,
-0.4780329167842865,
-0.4667834937572479,
0.2034611850976944,
-0.4775775969028473,
0.11269253492355347,
-0.02824096381664276,
-1.0939620733261108,
-0.02945786714553833,
-0.7410951852798462,
0.5970844626426697,
1.213709831237793,
1.4695135354995728,
-1.1368862390518188,
-0.2546483874320984,
-1.8356902599334717,
-0.13010472059249878,
-0.8338783383369446,
0.3381071090698242,
-1.954620599746704,
-0.197391539812088,
-1.950189471244812,
-2.389681100845337,
-1.4290958642959595,
-0.9381978511810303,
1.0559258460998535,
0.18285293877124786,
-0.9197403192520142,
1.1109490394592285,
-0.36838969588279724,
-1.8709981441497803,
1.057178258895874,
-2.223341941833496
] |
https://github.com/huggingface/datasets/issues/5000 | Dataset Viewer issue for asapp/slue | Thanks @severo,
Do I have to modify the python script to support streaming so that it can be previewed?
Is there a document somewhere that I can follow?
| ### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes | 518 | 28 | Dataset Viewer issue for asapp/slue
### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes
Thanks @severo,
Do I have to modify the python script to support streaming so that it can be previewed?
Is there a document somewhere that I can follow?
| [
-1.016212821006775,
-0.9018278121948242,
-1.0164432525634766,
1.3725818395614624,
-0.30789914727211,
-1.2424458265304565,
0.19595816731452942,
-1.0243573188781738,
1.5460362434387207,
-0.723754346370697,
0.24635353684425354,
-1.6943093538284302,
-0.2019682079553604,
-0.509730339050293,
-0.6717700958251953,
-0.9100216627120972,
-0.47249966859817505,
-0.7033902406692505,
1.0189790725708008,
2.7798807621002197,
1.1039692163467407,
-1.2858973741531372,
2.765979528427124,
0.6769662499427795,
-0.2540297508239746,
-1.033532977104187,
0.6700838208198547,
0.07542722672224045,
-1.1018972396850586,
-0.48809564113616943,
-1.0151329040527344,
-0.0547502376139164,
-0.42264536023139954,
-0.3434157967567444,
0.017703205347061157,
0.44571566581726074,
-0.04107358306646347,
-0.4022925794124603,
-0.5762515068054199,
-0.671924352645874,
0.33879998326301575,
-0.4004853665828705,
0.9413747787475586,
-0.362862765789032,
1.8764578104019165,
-0.5274253487586975,
0.2299453616142273,
0.6949083805084229,
1.3271225690841675,
0.0742708221077919,
-0.00930224359035492,
0.11872246861457825,
0.49348101019859314,
-0.14679628610610962,
0.5547490119934082,
1.148163914680481,
0.444608598947525,
0.6597801446914673,
0.4850277006626129,
-2.146963119506836,
1.2815786600112915,
-0.9670295715332031,
0.36987388134002686,
1.4470218420028687,
-1.173309564590454,
0.5222351551055908,
-1.6856540441513062,
-0.12147046625614166,
0.5439807772636414,
-2.127831220626831,
0.3060675263404846,
-1.100517749786377,
-0.6283326745033264,
0.8302214741706848,
0.29168134927749634,
-1.4730907678604126,
0.13580076396465302,
-0.5455890893936157,
1.0502005815505981,
0.4636183977127075,
1.248014211654663,
-1.6620138883590698,
0.124844029545784,
-0.3395240902900696,
0.029865626245737076,
-1.3705477714538574,
-1.4694247245788574,
0.5890762209892273,
0.5981742143630981,
0.6981272101402283,
-0.03533446788787842,
0.644780695438385,
-1.1569832563400269,
0.7623369693756104,
-0.6603133082389832,
-1.7003709077835083,
-1.428836703300476,
-2.4055333137512207,
-2.332244873046875,
0.8551788330078125,
-0.33198073506355286,
-0.5357339978218079,
1.8334388732910156,
-1.0591539144515991,
-1.752013087272644,
1.3091144561767578,
0.22345256805419922,
-0.10395415127277374,
2.4862520694732666,
0.34111180901527405,
-0.5217767953872681,
0.2422904372215271,
-0.6909911632537842,
0.9427462220191956,
-0.6318854689598083,
1.3895586729049683,
0.5065955519676208,
-0.977458119392395,
1.7758532762527466,
-0.5772565007209778,
0.5866948366165161,
-0.6611233353614807,
-0.5001206398010254,
-0.918144166469574,
0.3128507137298584,
1.8695569038391113,
-0.40388867259025574,
1.648315668106079,
-0.44993770122528076,
-1.54092538356781,
-1.6239845752716064,
0.9792904853820801,
0.45166710019111633,
-0.9340456128120422,
0.28448793292045593,
-0.4366849362850189,
-0.024580497294664383,
-0.03468721732497215,
1.0875728130340576,
1.2829320430755615,
0.6307047009468079,
-0.1697331964969635,
-0.8785948157310486,
0.3154571056365967,
-0.025280330330133438,
-0.6393705010414124,
-1.7792309522628784,
-0.30864977836608887,
0.07598856091499329,
0.5893585085868835,
-1.2059053182601929,
1.6907284259796143,
0.8702856302261353,
1.8502718210220337,
1.1093922853469849,
-0.31779205799102783,
1.3674100637435913,
-0.042271051555871964,
1.8067876100540161,
-0.5249958038330078,
0.616578221321106,
-0.30738139152526855,
-1.1739873886108398,
0.8392317295074463,
-0.4891934394836426,
-2.0032880306243896,
-0.9079350233078003,
-0.8864118456840515,
-0.29011449217796326,
-0.7386816143989563,
0.9243054986000061,
-0.1681959331035614,
-1.364560604095459,
0.12362292408943176,
-0.6620100736618042,
0.14384648203849792,
-1.3258260488510132,
0.3415551483631134,
0.7714889645576477,
-0.5137944221496582,
-0.08812423795461655,
-0.2985248267650604,
-1.3992698192596436,
-0.26646047830581665,
0.3152543604373932,
1.968976616859436,
-0.814433217048645,
0.8849294185638428,
0.7221987843513489,
-0.6844816207885742,
-0.09999752789735794,
0.3214777708053589,
-0.3368164598941803,
0.8150916695594788,
-1.2061145305633545,
-0.37787070870399475,
1.0244704484939575,
-0.16616520285606384,
-0.6748207807540894,
1.44865882396698,
0.7935157418251038,
-0.9508255124092102,
-0.2407665103673935,
-0.2981412410736084,
-0.8511583805084229,
-0.0211121067404747,
-1.6984317302703857,
-0.12419668585062027,
0.19581560790538788,
-1.3805742263793945,
-0.6429963111877441,
-0.2205878645181656,
1.2778078317642212,
-0.024240996688604355,
1.4135076999664307,
-0.2830914258956909,
-0.20349347591400146,
-0.4723244905471802,
-0.5620344281196594,
0.3588794469833374,
-0.26718980073928833,
-0.43523651361465454,
0.2950661778450012,
-0.766390323638916,
0.4090869426727295,
1.4731444120407104,
0.3230830132961273,
0.20044372975826263,
0.6783732175827026,
0.9253172874450684,
0.2821561098098755,
-0.030393213033676147,
-0.8883553743362427,
-1.6119939088821411,
1.937965750694275,
-1.4269734621047974,
1.9681882858276367,
0.7175206542015076,
-0.09320961683988571,
-1.8566386699676514,
-1.876505732536316,
1.261178731918335,
1.3890665769577026,
2.2800543308258057,
0.6667466163635254,
0.3705118000507355,
-0.7758679389953613,
-0.784344494342804,
0.09541671723127365,
-1.1729989051818848,
-0.762848973274231,
0.227040633559227,
2.283923387527466,
1.737693428993225,
-0.6882272362709045,
-0.19809719920158386,
-1.1724423170089722,
1.2051143646240234,
-0.20104940235614777,
0.2524774372577667,
1.986459732055664,
-0.3968019187450409,
-0.9820341467857361,
1.1076182126998901,
-2.4246833324432373,
0.14960432052612305,
1.918321967124939,
0.14984236657619476,
0.11742863059043884,
-1.4896695613861084,
-0.755559504032135,
-0.07381134480237961,
-0.3658721446990967,
-1.2964484691619873,
0.8075993061065674,
-0.26294809579849243,
-0.7970500588417053,
-1.4714691638946533,
0.10315416008234024,
-1.0137704610824585,
-1.5179932117462158,
0.2830127775669098,
1.737428903579712,
2.057669162750244,
-0.9474741220474243,
1.4209246635437012,
-0.15663813054561615,
0.07498075067996979,
1.3055462837219238,
1.1854661703109741,
3.1226048469543457,
2.213243246078491,
-1.204256534576416,
0.8824859261512756,
-0.13544784486293793,
-0.5960903167724609,
1.289893388748169,
-1.0516911745071411,
1.2284326553344727,
-0.23850218951702118,
-1.214732050895691,
-1.152876377105713,
0.9754271507263184,
0.4752001166343689,
0.06066737323999405,
-0.43425196409225464,
1.3362618684768677,
-0.019462354481220245,
1.3665857315063477,
0.6855789422988892,
-0.44022274017333984,
0.5749527215957642,
-0.5236242413520813,
-0.3024856150150299,
1.6433281898498535,
0.30974653363227844,
-1.429735541343689,
-2.3246192932128906,
-0.19415627419948578,
-0.879048228263855,
-0.1425100415945053,
-0.6278497576713562,
-1.033014178276062,
1.4204730987548828,
0.5289777517318726,
-1.1229296922683716,
-0.3381254971027374,
-0.2835617959499359,
-0.656441867351532,
2.6444921493530273,
-1.4912679195404053,
-0.2907097041606903,
-0.9958674311637878,
-0.39431512355804443,
1.8408520221710205,
-1.1601561307907104,
-0.15500053763389587,
-1.074360966682434,
-0.6222625970840454,
-1.2807000875473022,
-0.5648739337921143,
0.050972528755664825,
-0.7853493690490723,
0.81373131275177,
0.04523872211575508,
-1.0548909902572632,
-0.07274258136749268,
-0.8289133310317993,
0.8127583265304565,
-0.10604292154312134,
0.5009207129478455,
1.9577651023864746,
0.35850536823272705,
-0.38434407114982605,
0.6815215349197388,
1.2573574781417847,
0.5558438897132874,
-0.7439365983009338,
0.13751477003097534,
-0.8112640380859375,
0.18779675662517548,
-1.2762316465377808,
0.149415984749794,
-2.8708202838897705,
0.5902212262153625,
-0.04789452999830246,
-0.19507718086242676,
-0.04723339527845383,
-1.294703483581543,
1.0758605003356934,
2.403876304626465,
-1.1471755504608154,
0.5430163741111755,
0.28382956981658936,
1.4228723049163818,
-1.4925318956375122,
0.22922176122665405,
-0.5086554884910583,
1.9658714532852173,
0.308781236410141,
1.1668274402618408,
-0.39674291014671326,
-2.08484148979187,
0.5399355292320251,
-1.3632352352142334,
-1.0308698415756226,
0.7518519759178162,
-0.8490828275680542,
-0.07508627325296402,
-1.4069766998291016,
-0.05940346419811249,
-0.8457071781158447,
-1.3280750513076782,
0.7246365547180176,
0.05085352808237076,
0.5245681405067444,
-0.5916675925254822,
0.42177197337150574,
-2.0810418128967285,
-1.2690560817718506,
-0.2744317352771759,
-0.8101828694343567,
0.4228817820549011,
-0.26511216163635254,
0.6644513607025146,
-0.2179657518863678,
0.20273321866989136,
0.23478837311267853,
1.2977449893951416,
3.3113603591918945,
0.11937659978866577,
0.3920701742172241,
-0.17727181315422058,
-0.9397945404052734,
1.512102723121643,
1.0117210149765015,
-0.011182397603988647,
-0.762208104133606,
-0.9505259990692139,
1.2735075950622559,
1.863662600517273,
1.191929817199707,
0.27639222145080566,
-0.8424752354621887,
-0.4205412268638611,
-0.1401614248752594,
0.21559347212314606,
0.29127392172813416,
0.9233864545822144,
-0.10088667273521423,
0.2031608372926712,
1.3451008796691895,
1.3281069993972778,
-0.43578022718429565,
0.5292993783950806,
-0.9229484796524048,
-0.31303665041923523,
0.3725108504295349,
0.3052332401275635,
-0.0505400113761425,
0.3930734097957611,
-1.0193120241165161,
-0.3662507236003876,
-0.29722192883491516,
-1.094622254371643,
-0.8220933079719543,
-0.29853442311286926,
-0.32408347725868225,
1.6818325519561768,
0.10154165327548981,
-0.599166989326477,
-0.03550935909152031,
-0.7090904712677002,
-0.0782291367650032,
-1.1365453004837036,
0.11833575367927551,
-0.08746098726987839,
-0.09567433595657349,
0.060097597539424896,
1.9576592445373535,
-1.0891947746276855,
-2.271221160888672,
0.3152115046977997,
0.3650185763835907,
-0.36530736088752747,
0.13000527024269104,
1.5027039051055908,
0.3367288410663605,
1.4992282390594482,
1.324267864227295,
1.0854769945144653,
-0.6691808700561523,
-1.351783275604248,
0.6606962084770203,
1.1114559173583984,
-1.5162850618362427,
0.7428995370864868,
-0.03605842590332031,
-0.4999120533466339,
0.7492654919624329,
1.1522687673568726,
0.38118329644203186,
-1.9155339002609253,
0.7494556307792664,
-0.9319563508033752,
0.8493499159812927,
0.5572549700737,
0.8025315403938293,
0.46204158663749695,
0.770549476146698,
-1.315462589263916,
-1.0799587965011597,
-0.8346630930900574,
-0.48663538694381714,
2.145127534866333,
-0.12299646437168121,
0.7338786125183105,
-0.09814812988042831,
-1.278821349143982,
-0.04588880389928818,
0.8525390625,
0.2966172993183136,
-0.41344597935676575,
0.7421428561210632,
-0.6069108247756958,
-1.1092565059661865,
-1.370179533958435,
-0.4885757863521576,
-1.0065879821777344,
-1.0107744932174683,
1.1634231805801392,
0.889579713344574,
0.31858348846435547,
1.8715574741363525,
0.45851531624794006,
0.3010743260383606,
-2.6989166736602783,
0.8215454816818237,
0.3152305781841278,
0.017711836844682693,
0.7898433208465576,
0.2617279887199402,
1.1020461320877075,
-0.05296175926923752,
0.505500078201294,
-2.4008285999298096,
2.278200387954712,
-0.1336687207221985,
0.6245869994163513,
0.009260847233235836,
-0.06700101494789124,
1.0440393686294556,
0.5334545969963074,
0.634982168674469,
-1.091625452041626,
0.6908038854598999,
-0.4698481261730194,
1.208893895149231,
0.9685124158859253,
-0.8681305646896362,
0.019551128149032593,
1.4318121671676636,
0.533491313457489,
-0.31631413102149963,
-0.9432449340820312,
-0.7450798749923706,
0.9795730710029602,
1.7462903261184692,
-0.05537405237555504,
0.053388386964797974,
0.7829526662826538,
0.48410481214523315,
-1.2547225952148438,
0.06047450006008148,
-0.8022214770317078,
-0.651123583316803,
1.5622094869613647,
2.1207082271575928,
-0.0891677588224411,
0.021747175604104996,
-0.7433487772941589,
-1.28834867477417,
0.7255699038505554,
0.0066411662846803665,
0.19662128388881683,
0.8306600451469421,
-0.5430993437767029,
1.171931266784668,
0.5227933526039124,
0.8835740089416504,
0.009385795332491398,
0.2700479328632355,
0.388683557510376,
-0.2133302539587021,
-1.047143578529358,
-0.3249620497226715,
-1.1292619705200195,
-2.5245885848999023,
0.3555780351161957,
-0.43069976568222046,
-1.4555834531784058,
0.05157439038157463,
-1.0248216390609741,
0.9128035306930542,
-0.5777686238288879,
-1.09746253490448,
-1.6543035507202148,
0.31816205382347107,
-0.14506541192531586,
0.9200612902641296,
-1.727605938911438,
-0.08288779854774475,
1.132917881011963,
0.8164033889770508,
-0.6774041652679443,
1.1439529657363892,
0.3660311698913574,
0.9775537848472595,
0.7583383917808533,
-0.38023534417152405,
0.3887200951576233,
-0.08001475036144257,
-1.4007352590560913,
0.6678701043128967,
1.2431328296661377,
0.06288052350282669,
1.3374165296554565,
-0.664177656173706,
0.0454346165060997,
0.5724470615386963,
-0.41900187730789185,
-0.45052704215049744,
-0.2575177550315857,
0.7574048042297363,
0.20551037788391113,
-0.9624164700508118,
-0.10756012797355652,
-0.16458477079868317,
-0.23196066915988922,
0.22716204822063446,
-1.4316892623901367,
-0.20730753242969513,
-0.5143919587135315,
-0.4865449368953705,
-1.3517704010009766,
0.1195937991142273,
1.3401793241500854,
-0.680168867111206,
-0.24267356097698212,
0.5813977122306824,
0.42770615220069885,
0.46126559376716614,
0.5280898809432983,
-0.6509135961532593,
-0.30455276370048523,
-0.20677608251571655,
-0.2458660900592804,
0.2820237874984741,
1.332541823387146,
-0.32128337025642395,
-1.0634390115737915,
0.7230741381645203,
-0.4342651665210724,
0.07159698754549026,
2.0529258251190186,
0.27381768822669983,
-0.8747187256813049,
0.3049253523349762,
-0.6130098700523376,
1.998691439628601,
1.5251764059066772,
1.3389536142349243,
-0.023405160754919052,
-0.8296964764595032,
0.6242942214012146,
-0.15536527335643768,
-0.32333242893218994,
0.8017353415489197,
0.36663293838500977,
-0.15839071571826935,
-1.5720492601394653,
0.516593873500824,
1.392970323562622,
-0.8678745627403259,
-0.8347477316856384,
-0.008940218016505241,
-0.8828641772270203,
1.0793166160583496,
0.7650455832481384,
0.43249398469924927,
0.13809913396835327,
1.4324570894241333,
0.6160753965377808,
-0.5123217701911926,
0.5703363418579102,
0.49005407094955444,
0.013966440223157406,
-2.0944337844848633,
-0.9357339143753052,
0.31100988388061523,
-0.3243659436702728,
-1.6364306211471558,
1.2732276916503906,
-1.1241134405136108,
-0.8843844532966614,
0.5011136531829834,
0.22744670510292053,
1.5338624715805054,
0.3613733947277069,
1.5967167615890503,
2.0342743396759033,
0.8839428424835205,
0.13649383187294006,
1.3459289073944092,
0.073463074862957,
-0.43443477153778076,
1.8871986865997314,
-0.40088120102882385,
0.3787963390350342,
1.0070289373397827,
-0.4393883943557739,
-1.1224398612976074,
-0.7264404892921448,
-1.0648454427719116,
-0.5358426570892334,
1.3274972438812256,
0.12183487415313721,
-0.9871583580970764,
0.07711240649223328,
1.5532450675964355,
0.09800413995981216,
-0.4490242004394531,
0.639521598815918,
0.49763020873069763,
-0.7441724538803101,
-0.06594142317771912,
-0.8766105771064758,
0.4710252583026886,
-0.11193672567605972,
-0.29798728227615356,
0.40713265538215637,
0.6176185011863708,
1.1137603521347046,
-0.12738299369812012,
0.05962691456079483,
1.2810308933258057,
-1.425965666770935,
1.6145068407058716,
-0.5225684642791748,
0.020212512463331223,
-2.5392041206359863,
1.5146194696426392,
-0.6148977875709534,
1.8006709814071655,
-2.615570306777954,
0.29735997319221497,
-0.5053781867027283,
-0.3659009337425232,
0.32966485619544983,
-0.20866762101650238,
0.10801347345113754,
-0.1671961396932602,
-1.0407042503356934,
0.0013639247044920921,
-0.7273088693618774,
0.5769730806350708,
1.0969507694244385,
1.1544780731201172,
-1.1219260692596436,
-0.2969321012496948,
-1.8081153631210327,
-0.01935604214668274,
-0.7888146042823792,
0.33348798751831055,
-2.1454875469207764,
-0.2952984571456909,
-1.8035802841186523,
-2.297025442123413,
-1.475627064704895,
-0.8321768045425415,
1.1180447340011597,
0.3126709461212158,
-0.9531348943710327,
1.1426196098327637,
-0.3805546760559082,
-1.889410376548767,
1.0305781364440918,
-2.1619009971618652
] |
https://github.com/huggingface/datasets/issues/5000 | Dataset Viewer issue for asapp/slue | Hi @fwu-asapp thanks for reporting, and thanks @severo for the investigation.
As explained by @severo, the preview requires that your dataset loading script supports streaming.
There are several options here:
- the easiest would be to replace the source files, archived using ZIP instead TAR: the TAR format does not allow random access while streaming, but only sequential access; the ZIP files support streaming out of the box.
- alternatively, to stream TAR archives you can use `dl_manager.iter_archive`: the only prerequisite is that your "index" files (.tsv) should have been archived before their corresponding audio files, so while iterating the content of the TAR archive, the metadata files appear first. I think this is the case for voxpopuli tar but not for voxceleb.
- if your .tsv files were not archived before their corresponding audio files (I think this is the case for voxceleb), then you should extract the .tsv files and host them separately (you can host them on the same Hugging Face Hub).
- you can take as example, e.g.: https://huggingface.co/datasets/vivos/blob/main/vivos.py
As an advanced approach, you can handle both streaming and non-streaming cases separately.
- as for example: https://huggingface.co/datasets/librispeech_asr/blob/main/librispeech_asr.py or https://huggingface.co/datasets/google/fleurs/blob/main/fleurs.py
See related discussion:
- https://github.com/huggingface/datasets/issues/4697#issuecomment-1191502492 | ### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes | 518 | 198 | Dataset Viewer issue for asapp/slue
### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes
Hi @fwu-asapp thanks for reporting, and thanks @severo for the investigation.
As explained by @severo, the preview requires that your dataset loading script supports streaming.
There are several options here:
- the easiest would be to replace the source files, archived using ZIP instead TAR: the TAR format does not allow random access while streaming, but only sequential access; the ZIP files support streaming out of the box.
- alternatively, to stream TAR archives you can use `dl_manager.iter_archive`: the only prerequisite is that your "index" files (.tsv) should have been archived before their corresponding audio files, so while iterating the content of the TAR archive, the metadata files appear first. I think this is the case for voxpopuli tar but not for voxceleb.
- if your .tsv files were not archived before their corresponding audio files (I think this is the case for voxceleb), then you should extract the .tsv files and host them separately (you can host them on the same Hugging Face Hub).
- you can take as example, e.g.: https://huggingface.co/datasets/vivos/blob/main/vivos.py
As an advanced approach, you can handle both streaming and non-streaming cases separately.
- as for example: https://huggingface.co/datasets/librispeech_asr/blob/main/librispeech_asr.py or https://huggingface.co/datasets/google/fleurs/blob/main/fleurs.py
See related discussion:
- https://github.com/huggingface/datasets/issues/4697#issuecomment-1191502492 | [
-1.146069049835205,
-0.9876996278762817,
-0.7791738510131836,
1.3807432651519775,
-0.127359077334404,
-1.3082213401794434,
0.07522983849048615,
-1.0208196640014648,
1.5531210899353027,
-0.7070396542549133,
0.2677609920501709,
-1.6658670902252197,
-0.039555102586746216,
-0.5593567490577698,
-0.6989378929138184,
-0.8820900321006775,
-0.4265865683555603,
-0.8676076531410217,
0.971188485622406,
2.6317946910858154,
1.2481027841567993,
-1.3701645135879517,
2.710944890975952,
0.6526634693145752,
-0.22717072069644928,
-1.1057350635528564,
0.6133184432983398,
-0.03073440119624138,
-1.2859398126602173,
-0.418801486492157,
-1.0397688150405884,
0.011391405947506428,
-0.5651088356971741,
-0.42846429347991943,
0.07910169661045074,
0.3547481894493103,
-0.15336979925632477,
-0.28692665696144104,
-0.614487886428833,
-0.73940509557724,
0.48498284816741943,
-0.3373599052429199,
1.0086678266525269,
-0.29434776306152344,
1.8304710388183594,
-0.615386962890625,
0.405059278011322,
0.7067450284957886,
1.3590545654296875,
0.1817481368780136,
0.00031464360654354095,
0.16312746703624725,
0.37562063336372375,
-0.022046059370040894,
0.4482581913471222,
1.1797829866409302,
0.6432689428329468,
0.4317912459373474,
0.5824085474014282,
-2.1957168579101562,
1.3037470579147339,
-0.9516659379005432,
0.2874200940132141,
1.430484414100647,
-1.002100944519043,
0.427848756313324,
-1.880127191543579,
-0.11510179191827774,
0.5488588213920593,
-2.24914813041687,
0.12666170299053192,
-1.2718069553375244,
-0.51528400182724,
0.9803367257118225,
0.24249868094921112,
-1.3282663822174072,
0.19900082051753998,
-0.48782986402511597,
1.0544602870941162,
0.5191652774810791,
1.1649049520492554,
-1.7351099252700806,
-0.02973107248544693,
-0.2595847249031067,
0.1051694005727768,
-1.308379054069519,
-1.6248959302902222,
0.5727430582046509,
0.6075336337089539,
0.5670387744903564,
-0.062390487641096115,
0.9158267378807068,
-1.09634530544281,
0.8823105692863464,
-0.8415718674659729,
-1.7339107990264893,
-1.4798073768615723,
-2.353424310684204,
-2.3524270057678223,
0.8253340125083923,
-0.4801380932331085,
-0.45288988947868347,
1.976071834564209,
-1.0536080598831177,
-1.7308201789855957,
1.16388738155365,
0.21365827322006226,
0.028760872781276703,
2.3950204849243164,
0.25496459007263184,
-0.726654052734375,
0.3585737645626068,
-0.7281571626663208,
0.7790383100509644,
-0.3638823926448822,
1.3512814044952393,
0.5474611520767212,
-0.9606510996818542,
1.6658165454864502,
-0.49800804257392883,
0.4324617385864258,
-0.678885281085968,
-0.4785817861557007,
-0.7667664885520935,
0.3318668305873871,
1.9022881984710693,
-0.4570852518081665,
1.6200000047683716,
-0.3565237522125244,
-1.5248310565948486,
-1.5593420267105103,
0.8107386827468872,
0.508215069770813,
-0.8511635661125183,
0.007025617174804211,
-0.3746175765991211,
0.05817602202296257,
-0.05243038386106491,
1.0448020696640015,
1.22501540184021,
0.6390727162361145,
-0.3692123591899872,
-0.8679625391960144,
0.2912364900112152,
-0.0996590256690979,
-0.6669028997421265,
-1.757920265197754,
-0.3088259994983673,
0.19208888709545135,
0.6811579465866089,
-1.2086390256881714,
1.7622758150100708,
0.8412359356880188,
1.9126559495925903,
1.0097583532333374,
-0.36891937255859375,
1.478395938873291,
0.003388364799320698,
1.90956449508667,
-0.5785808563232422,
0.6699555516242981,
-0.35967668890953064,
-1.1860023736953735,
0.8287407755851746,
-0.3721945881843567,
-1.9903799295425415,
-0.6497809886932373,
-0.8809846043586731,
-0.22539232671260834,
-0.7501810193061829,
0.9248960614204407,
-0.21621429920196533,
-1.3970600366592407,
0.20857365429401398,
-0.6575484275817871,
0.09552062302827835,
-1.2579460144042969,
0.2295047789812088,
0.8141589164733887,
-0.657084584236145,
0.004661736078560352,
-0.2667960822582245,
-1.2968813180923462,
-0.4641388952732086,
0.2800004482269287,
1.8832459449768066,
-0.6792336702346802,
0.9848082065582275,
0.9663404822349548,
-0.6585333347320557,
0.034867312759160995,
0.40265926718711853,
-0.30804964900016785,
0.8888137936592102,
-1.045531988143921,
-0.4270778298377991,
1.0617120265960693,
-0.21454007923603058,
-0.5997018218040466,
1.4104615449905396,
0.8193529844284058,
-0.9941256046295166,
-0.26510071754455566,
-0.17494216561317444,
-0.7708051204681396,
0.029245849698781967,
-1.635510802268982,
-0.13497097790241241,
0.2834382653236389,
-1.5356210470199585,
-0.4631296992301941,
-0.21417666971683502,
1.336691975593567,
-0.16152632236480713,
1.4861419200897217,
-0.3441418409347534,
-0.18524429202079773,
-0.4313246011734009,
-0.48176348209381104,
0.22876621782779694,
-0.1905338019132614,
-0.558955192565918,
0.33168497681617737,
-0.9184262156486511,
0.3393127918243408,
1.4756146669387817,
0.3732292354106903,
0.0859091505408287,
0.533073365688324,
1.0406211614608765,
0.29720938205718994,
-0.05507407337427139,
-0.9635524153709412,
-1.5841361284255981,
2.0942320823669434,
-1.4726043939590454,
2.0201032161712646,
0.8322795033454895,
-0.09879594296216965,
-1.8362504243850708,
-1.8391368389129639,
1.2791002988815308,
1.1490325927734375,
2.3882319927215576,
0.4950157701969147,
0.36152905225753784,
-0.773364245891571,
-0.6462591886520386,
0.3619407117366791,
-0.9877617359161377,
-0.7790665626525879,
0.10728717595338821,
2.3369345664978027,
1.749035120010376,
-0.5083364248275757,
-0.2592500150203705,
-1.062390685081482,
1.2527910470962524,
-0.11664024740457535,
0.2013237178325653,
2.048177480697632,
-0.2916424870491028,
-1.0105504989624023,
1.3013622760772705,
-2.341369152069092,
0.2542426586151123,
2.0098483562469482,
0.21538318693637848,
0.08860257267951965,
-1.420480728149414,
-0.5880826711654663,
-0.26280277967453003,
-0.46449705958366394,
-1.1983236074447632,
0.5451317429542542,
-0.2867870032787323,
-0.9050620794296265,
-1.512934684753418,
-0.011322185397148132,
-1.1564770936965942,
-1.772365689277649,
0.2942553162574768,
1.7733334302902222,
2.0354161262512207,
-0.8458425998687744,
1.4319100379943848,
-0.23572763800621033,
0.1308407038450241,
1.2741265296936035,
1.2077951431274414,
3.1769614219665527,
1.9572498798370361,
-1.276194453239441,
0.7753726243972778,
-0.16941222548484802,
-0.40218034386634827,
1.1176817417144775,
-1.0454366207122803,
1.18557870388031,
-0.2692989110946655,
-1.305569052696228,
-1.1556766033172607,
1.1186144351959229,
0.4146871268749237,
0.0029970724135637283,
-0.5196347832679749,
1.1968541145324707,
0.10804428905248642,
1.326593041419983,
0.6214142441749573,
-0.44062358140945435,
0.6022401452064514,
-0.3698378801345825,
-0.5114633440971375,
1.6397390365600586,
0.17399226129055023,
-1.4662436246871948,
-2.276332378387451,
-0.24227170646190643,
-0.9032540917396545,
-0.10032009333372116,
-0.6519870162010193,
-1.0005494356155396,
1.5221827030181885,
0.47504520416259766,
-1.2855446338653564,
-0.30572399497032166,
-0.4093506336212158,
-0.5648167133331299,
2.6360082626342773,
-1.4815034866333008,
-0.11913737654685974,
-1.0239266157150269,
-0.5027859210968018,
1.6366046667099,
-1.2319469451904297,
-0.1926720291376114,
-1.0311453342437744,
-0.6665705442428589,
-1.248678207397461,
-0.5907236933708191,
-0.03248417004942894,
-0.8533438444137573,
0.6494860649108887,
0.0909680724143982,
-1.0696009397506714,
-0.2727850079536438,
-0.8458488583564758,
0.8566058278083801,
-0.06866925209760666,
0.31542709469795227,
1.9240161180496216,
0.3332354724407196,
-0.41877245903015137,
0.6690386533737183,
1.1396031379699707,
0.6080256104469299,
-0.6065662503242493,
0.1371902972459793,
-0.7181065082550049,
0.27998924255371094,
-1.3297914266586304,
0.2658437490463257,
-2.831584930419922,
0.6909291744232178,
-0.09856797009706497,
-0.05939682945609093,
-0.0034619392827153206,
-1.2814042568206787,
1.069417953491211,
2.533388137817383,
-1.1305054426193237,
0.4941883385181427,
0.34944799542427063,
1.1470026969909668,
-1.5365451574325562,
0.25475072860717773,
-0.42113739252090454,
2.090082883834839,
0.15266601741313934,
1.2201560735702515,
-0.46703606843948364,
-2.1479156017303467,
0.5766805410385132,
-1.2753044366836548,
-1.0242102146148682,
0.7819386720657349,
-0.8221309185028076,
0.0933220386505127,
-1.3940963745117188,
-0.14590317010879517,
-0.9322574734687805,
-1.3178393840789795,
0.7522575855255127,
-0.022613149136304855,
0.4697197675704956,
-0.6388401985168457,
0.29366588592529297,
-2.1386325359344482,
-1.3239808082580566,
-0.1852937489748001,
-0.9279434680938721,
0.42596325278282166,
-0.25420039892196655,
0.6301702260971069,
-0.1566150039434433,
0.02834479883313179,
0.27153292298316956,
1.3629320859909058,
3.433537721633911,
0.23223817348480225,
0.3613109290599823,
-0.09531685709953308,
-0.9933133721351624,
1.474827527999878,
0.9990664124488831,
-0.10359450429677963,
-0.6172673106193542,
-1.0261508226394653,
1.3608636856079102,
1.936047077178955,
1.1309444904327393,
0.20464390516281128,
-0.801773190498352,
-0.7215045690536499,
0.060795437544584274,
0.2198849767446518,
0.49818721413612366,
0.9959197640419006,
-0.03875087574124336,
0.18225419521331787,
1.4723914861679077,
1.3006561994552612,
-0.46066009998321533,
0.41335225105285645,
-0.8918815851211548,
-0.4009593427181244,
0.42824557423591614,
0.30062738060951233,
0.08263733983039856,
0.43217337131500244,
-1.0896183252334595,
-0.3086000382900238,
-0.3373873829841614,
-1.003018856048584,
-0.6828521490097046,
-0.42998144030570984,
-0.3322960436344147,
1.5972034931182861,
0.09266973286867142,
-0.3961571455001831,
0.014075971208512783,
-0.748942494392395,
-0.1370638608932495,
-1.0865980386734009,
0.26165124773979187,
-0.06513173133134842,
-0.013956878334283829,
-0.12159272283315659,
1.789179801940918,
-0.8923912048339844,
-2.1686244010925293,
0.3135170638561249,
0.20261648297309875,
-0.4421631693840027,
0.18333284556865692,
1.675554633140564,
0.4450370967388153,
1.376414179801941,
1.396630048751831,
0.9823333621025085,
-0.6185563802719116,
-1.270663857460022,
0.6880258917808533,
1.0263478755950928,
-1.4966932535171509,
0.9155396223068237,
-0.1548440158367157,
-0.46550223231315613,
0.7103087902069092,
1.3053659200668335,
0.3607984781265259,
-1.9969128370285034,
0.8300327658653259,
-0.885405421257019,
0.7436586022377014,
0.6587562561035156,
0.8715658783912659,
0.25150442123413086,
0.7704015374183655,
-1.3217037916183472,
-1.057108998298645,
-0.7306168675422668,
-0.5228213667869568,
1.9150378704071045,
-0.11642895638942719,
0.6027491688728333,
-0.1694713830947876,
-1.2738529443740845,
-0.15027093887329102,
0.722811758518219,
0.32425716519355774,
-0.4234732985496521,
0.9050686955451965,
-0.6423583030700684,
-1.0605586767196655,
-1.3092937469482422,
-0.4229401648044586,
-0.992060661315918,
-0.8234499096870422,
1.015999674797058,
0.7929568290710449,
0.36549878120422363,
1.9831358194351196,
0.48665544390678406,
0.27531537413597107,
-2.770124673843384,
0.9249036312103271,
0.2866920232772827,
-0.019410470500588417,
1.0017119646072388,
0.18622396886348724,
1.1655747890472412,
-0.06093067675828934,
0.5081131458282471,
-2.349794626235962,
2.253507614135742,
-0.16852696239948273,
0.7642489075660706,
0.004099502228200436,
-0.13247999548912048,
1.072466254234314,
0.6026955246925354,
0.5980993509292603,
-1.1110012531280518,
0.758897066116333,
-0.6197794079780579,
1.1545716524124146,
0.9798924326896667,
-0.8863504528999329,
0.014653514139354229,
1.3115730285644531,
0.47960346937179565,
-0.424408882856369,
-0.9438267946243286,
-0.8729984760284424,
0.9036677479743958,
1.7922829389572144,
-0.025103136897087097,
0.03322858735918999,
0.8941835761070251,
0.6614132523536682,
-1.2476222515106201,
0.10696269571781158,
-0.7886923551559448,
-0.7329053282737732,
1.6225725412368774,
2.0127997398376465,
-0.06585079431533813,
-0.15307608246803284,
-0.710070013999939,
-1.233932375907898,
0.694355845451355,
-0.05175243318080902,
0.2058996856212616,
0.7059556841850281,
-0.6378576159477234,
1.1775153875350952,
0.7154041528701782,
0.9643201231956482,
0.114420585334301,
0.3064378499984741,
0.30415478348731995,
-0.3160010576248169,
-1.128504991531372,
-0.2520311772823334,
-1.1379574537277222,
-2.542996644973755,
0.5175337791442871,
-0.27326199412345886,
-1.474066138267517,
0.1015852838754654,
-0.9530186057090759,
0.8770517706871033,
-0.6175320744514465,
-1.1577950716018677,
-1.4819222688674927,
0.30822840332984924,
-0.16942797601222992,
0.9737008810043335,
-1.6301902532577515,
-0.057532742619514465,
1.1883565187454224,
0.8644267916679382,
-0.501842737197876,
1.0287045240402222,
0.25709906220436096,
1.013292908668518,
0.7703707814216614,
-0.3323935866355896,
0.43606388568878174,
0.16098563373088837,
-1.3617160320281982,
0.46823951601982117,
1.1569831371307373,
0.1487010270357132,
1.3590283393859863,
-0.5331109762191772,
0.14332447946071625,
0.508983314037323,
-0.5074765682220459,
-0.4421985447406769,
-0.4882490038871765,
0.7320976853370667,
-0.014428702183067799,
-0.9682956337928772,
0.011321029625833035,
-0.16190357506275177,
-0.18388275802135468,
0.18145550787448883,
-1.4644252061843872,
-0.26772943139076233,
-0.38917434215545654,
-0.5191472172737122,
-1.298745036125183,
-0.03025665134191513,
1.3554370403289795,
-0.8188192248344421,
-0.23693522810935974,
0.5310884118080139,
0.34114739298820496,
0.5709682106971741,
0.604457437992096,
-0.5891724824905396,
-0.3775930404663086,
-0.24325013160705566,
-0.34713950753211975,
0.29803842306137085,
1.1884355545043945,
-0.20397880673408508,
-0.9810790419578552,
0.7125757336616516,
-0.3798043429851532,
0.13171622157096863,
2.0251731872558594,
0.11262740939855576,
-0.7435911893844604,
0.2910584807395935,
-0.5436598062515259,
1.811525583267212,
1.6894673109054565,
1.299530267715454,
-0.14721688628196716,
-0.879517138004303,
0.6274155378341675,
-0.2609952688217163,
-0.31979650259017944,
0.8995952606201172,
0.4030952751636505,
-0.20112895965576172,
-1.4478353261947632,
0.5628430247306824,
1.324283480644226,
-0.9290387034416199,
-0.7591592669487,
0.0860927551984787,
-0.8582060933113098,
1.0731319189071655,
0.6679379940032959,
0.3756684362888336,
0.1767280399799347,
1.5912259817123413,
0.6967657208442688,
-0.41777482628822327,
0.49618956446647644,
0.4625581204891205,
-0.17350175976753235,
-2.134882926940918,
-1.0130748748779297,
0.24103529751300812,
-0.4111240804195404,
-1.5591596364974976,
1.3234443664550781,
-1.2060953378677368,
-0.9075577259063721,
0.46481069922447205,
0.12069343775510788,
1.4129887819290161,
0.32965219020843506,
1.6969118118286133,
2.124323844909668,
0.9144660234451294,
0.28488677740097046,
1.3491535186767578,
0.046695876866579056,
-0.4133269786834717,
1.8216196298599243,
-0.5011364221572876,
0.5483583807945251,
1.1059811115264893,
-0.4548112154006958,
-1.0567690134048462,
-0.7907501459121704,
-1.1036921739578247,
-0.5872410535812378,
1.1993744373321533,
0.08730825781822205,
-1.0196187496185303,
0.24245338141918182,
1.540025234222412,
0.07311078161001205,
-0.2824212610721588,
0.6555928587913513,
0.4559386968612671,
-0.6397494077682495,
-0.05567184463143349,
-0.8585228323936462,
0.46709755063056946,
-0.15933212637901306,
-0.3801749050617218,
0.3421827554702759,
0.5009950399398804,
1.1999716758728027,
-0.053312480449676514,
0.09569063782691956,
1.2834932804107666,
-1.433800458908081,
1.5401465892791748,
-0.5947909355163574,
0.2279534488916397,
-2.4311716556549072,
1.4393459558486938,
-0.839734673500061,
1.8758392333984375,
-2.556588888168335,
0.3941608965396881,
-0.5158706307411194,
-0.4711316227912903,
0.28292378783226013,
-0.38237282633781433,
0.11922948807477951,
-0.15918026864528656,
-1.0348156690597534,
-0.10726215690374374,
-0.7412740588188171,
0.5849288105964661,
1.1070572137832642,
1.3664122819900513,
-1.122275471687317,
-0.26977163553237915,
-1.8240716457366943,
-0.12316035479307175,
-0.7182738184928894,
0.31463029980659485,
-2.0020196437835693,
-0.16310520470142365,
-1.9311447143554688,
-2.35305118560791,
-1.4381513595581055,
-0.8766631484031677,
1.0998080968856812,
0.17547810077667236,
-0.9216232895851135,
1.1139477491378784,
-0.37668052315711975,
-1.8399076461791992,
1.039716124534607,
-2.200942039489746
] |
https://github.com/huggingface/datasets/issues/5000 | Dataset Viewer issue for asapp/slue | Thanks @albertvillanova for your clarification. I'll talk to my collaborators to see if we can replace those files. Let me just close this issue for now. | ### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes | 518 | 26 | Dataset Viewer issue for asapp/slue
### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes
Thanks @albertvillanova for your clarification. I'll talk to my collaborators to see if we can replace those files. Let me just close this issue for now. | [
-1.0411758422851562,
-0.9634326100349426,
-0.8906228542327881,
1.3546061515808105,
-0.2964822053909302,
-1.1379481554031372,
0.21266110241413116,
-1.0204097032546997,
1.5472053289413452,
-0.7022243738174438,
0.2397923767566681,
-1.667016863822937,
-0.0824132040143013,
-0.4518444836139679,
-0.6176723837852478,
-0.9783765077590942,
-0.44264325499534607,
-0.6005804538726807,
1.063382625579834,
2.7351319789886475,
1.1290704011917114,
-1.2444801330566406,
2.7687253952026367,
0.6673627495765686,
-0.16702760756015778,
-1.0571303367614746,
0.6899726986885071,
0.18411453068256378,
-1.1920840740203857,
-0.40415769815444946,
-1.0871731042861938,
-0.009819500148296356,
-0.43725016713142395,
-0.2856747508049011,
0.06167938932776451,
0.4620610177516937,
-0.00995230209082365,
-0.5195646286010742,
-0.5570147633552551,
-0.6557835936546326,
0.3602180480957031,
-0.43420594930648804,
0.856941819190979,
-0.30594000220298767,
1.8340020179748535,
-0.5430207848548889,
0.36008813977241516,
0.6042565703392029,
1.2827873229980469,
0.057074736803770065,
-0.066900335252285,
0.16304732859134674,
0.5072622895240784,
-0.09225413203239441,
0.41782146692276,
1.1201961040496826,
0.42417463660240173,
0.6464781165122986,
0.432502806186676,
-2.1706252098083496,
1.2837480306625366,
-0.9777695536613464,
0.30659836530685425,
1.543523907661438,
-1.1347346305847168,
0.5611063241958618,
-1.6967841386795044,
-0.10660593956708908,
0.5481687188148499,
-2.0922303199768066,
0.2428596168756485,
-1.1753613948822021,
-0.6306292414665222,
0.8216381072998047,
0.3686317801475525,
-1.438444972038269,
0.11416768282651901,
-0.5651056170463562,
1.1166102886199951,
0.4887814223766327,
1.1883171796798706,
-1.704481601715088,
0.18095430731773376,
-0.35235869884490967,
0.02589624747633934,
-1.416089653968811,
-1.4335907697677612,
0.5368853807449341,
0.6915289163589478,
0.6751559376716614,
0.03479323908686638,
0.630219042301178,
-1.1050461530685425,
0.7571188807487488,
-0.6964671611785889,
-1.7112051248550415,
-1.3370287418365479,
-2.4128246307373047,
-2.3619277477264404,
0.7791507244110107,
-0.3403412401676178,
-0.5548257231712341,
1.864569902420044,
-0.922519326210022,
-1.802146077156067,
1.2744923830032349,
0.1965794563293457,
-0.0819844976067543,
2.491971731185913,
0.33428624272346497,
-0.5611510872840881,
0.18875595927238464,
-0.7938593029975891,
0.8790792226791382,
-0.61235511302948,
1.460016131401062,
0.47498589754104614,
-0.9163957834243774,
1.7656720876693726,
-0.46234017610549927,
0.5827720165252686,
-0.7373144626617432,
-0.4712647795677185,
-0.9221065044403076,
0.3421124815940857,
1.9890503883361816,
-0.4057547152042389,
1.595274567604065,
-0.5340344905853271,
-1.5999027490615845,
-1.6053292751312256,
0.9090123176574707,
0.4377659261226654,
-0.809390664100647,
0.23059307038784027,
-0.29415109753608704,
-0.002269064076244831,
0.009843247942626476,
0.9634060263633728,
1.2887295484542847,
0.6827793121337891,
-0.2560925781726837,
-0.918178915977478,
0.28252488374710083,
-0.020107626914978027,
-0.6414844989776611,
-1.9097259044647217,
-0.3307602107524872,
0.1688566356897354,
0.6759554147720337,
-1.1861721277236938,
1.6403183937072754,
0.8819060921669006,
1.9485284090042114,
0.993471086025238,
-0.42115887999534607,
1.3784232139587402,
0.04789278656244278,
1.8427519798278809,
-0.5649290084838867,
0.6859831213951111,
-0.2374807894229889,
-1.1543229818344116,
0.8413030505180359,
-0.41404151916503906,
-1.8987751007080078,
-0.8962997794151306,
-0.8945291638374329,
-0.29426050186157227,
-0.6986193060874939,
1.0067899227142334,
-0.15463736653327942,
-1.4441642761230469,
0.0874752625823021,
-0.6067492961883545,
0.1564113348722458,
-1.2862416505813599,
0.3039383888244629,
0.7509483695030212,
-0.5417782068252563,
-0.010693562217056751,
-0.26998743414878845,
-1.4299802780151367,
-0.3717978596687317,
0.3786771595478058,
1.865670919418335,
-0.7760785818099976,
0.9017122387886047,
0.7741849422454834,
-0.7892712950706482,
-0.044502101838588715,
0.2918706238269806,
-0.22868333756923676,
0.7634164094924927,
-1.2697556018829346,
-0.3508021831512451,
1.1118457317352295,
-0.2675579786300659,
-0.6841400265693665,
1.4909923076629639,
0.7621686458587646,
-1.0123165845870972,
-0.2063402682542801,
-0.28377407789230347,
-0.7287466526031494,
0.02002061903476715,
-1.7197599411010742,
-0.1308334767818451,
0.18916748464107513,
-1.4313323497772217,
-0.5772808194160461,
-0.24542410671710968,
1.278432846069336,
-0.09221725910902023,
1.4198338985443115,
-0.20862512290477753,
-0.17050372064113617,
-0.5148029923439026,
-0.47696343064308167,
0.35422205924987793,
-0.2933397889137268,
-0.45082899928092957,
0.31379470229148865,
-0.8865585327148438,
0.4070313274860382,
1.4857234954833984,
0.3344835340976715,
0.21551887691020966,
0.6029400825500488,
0.8648701310157776,
0.2410649061203003,
-0.11840539425611496,
-0.9855316281318665,
-1.6766555309295654,
1.9758747816085815,
-1.437573790550232,
1.9291001558303833,
0.7156404256820679,
-0.12524700164794922,
-1.8803256750106812,
-1.8474111557006836,
1.3415278196334839,
1.37337327003479,
2.358173370361328,
0.5859602093696594,
0.40924641489982605,
-0.7942672371864319,
-0.7863867878913879,
0.03263431414961815,
-1.0749430656433105,
-0.7045812010765076,
0.33476951718330383,
2.2241814136505127,
1.6858841180801392,
-0.669337809085846,
-0.13358496129512787,
-1.237282395362854,
1.1919801235198975,
-0.10909495502710342,
0.2833099365234375,
2.031048536300659,
-0.39720118045806885,
-0.9312071204185486,
1.0237058401107788,
-2.3939383029937744,
0.16052491962909698,
1.8521803617477417,
0.06578004360198975,
0.2535136342048645,
-1.533850073814392,
-0.7223982214927673,
-0.14416176080703735,
-0.31478849053382874,
-1.336329460144043,
0.7429124116897583,
-0.2058653086423874,
-0.858354389667511,
-1.5033626556396484,
0.10398679226636887,
-1.0610677003860474,
-1.58549165725708,
0.3329576253890991,
1.8189493417739868,
2.014873743057251,
-0.9606594443321228,
1.4682813882827759,
-0.13051772117614746,
0.029291942715644836,
1.2485891580581665,
1.042343020439148,
2.9818050861358643,
2.204479217529297,
-1.1987563371658325,
0.8695241212844849,
-0.08833815902471542,
-0.5060470700263977,
1.2533458471298218,
-1.0647850036621094,
1.2943195104599,
-0.31867608428001404,
-1.2177321910858154,
-1.1978330612182617,
1.0106854438781738,
0.4468896687030792,
0.0847073644399643,
-0.45892271399497986,
1.4523884057998657,
0.04746292904019356,
1.3851754665374756,
0.6539669632911682,
-0.5181427597999573,
0.6735007762908936,
-0.5760806798934937,
-0.2752244770526886,
1.6034420728683472,
0.32482483983039856,
-1.4293098449707031,
-2.3172686100006104,
-0.20172888040542603,
-0.9120741486549377,
-0.1871284693479538,
-0.6034209132194519,
-1.0842342376708984,
1.4416694641113281,
0.5855925679206848,
-1.130336880683899,
-0.4047282934188843,
-0.22493158280849457,
-0.6996235251426697,
2.6951582431793213,
-1.4192945957183838,
-0.24885191023349762,
-0.933070957660675,
-0.39540591835975647,
1.7285829782485962,
-1.1623164415359497,
-0.10844644904136658,
-1.088763952255249,
-0.6354598999023438,
-1.3831446170806885,
-0.5660626888275146,
0.06528549641370773,
-0.8510713577270508,
0.7789840698242188,
0.045176003128290176,
-1.0432851314544678,
-0.11448191851377487,
-0.7771960496902466,
0.8590750098228455,
-0.05685415118932724,
0.492516428232193,
1.9530776739120483,
0.30660486221313477,
-0.30811959505081177,
0.6687853336334229,
1.1998367309570312,
0.5370076894760132,
-0.780632495880127,
0.18300212919712067,
-0.8122527003288269,
0.1670505404472351,
-1.2758225202560425,
0.20992371439933777,
-2.898264169692993,
0.6243829727172852,
-0.08916535973548889,
-0.1277323216199875,
-0.08035726100206375,
-1.2736934423446655,
1.0972036123275757,
2.471766471862793,
-1.2468916177749634,
0.5455711483955383,
0.3549257218837738,
1.3943939208984375,
-1.3305084705352783,
0.3816399574279785,
-0.47814416885375977,
1.9739470481872559,
0.30960696935653687,
1.1171953678131104,
-0.48006126284599304,
-1.9954217672348022,
0.5599573254585266,
-1.3563013076782227,
-1.0583996772766113,
0.6894120573997498,
-0.8985093832015991,
-0.11920538544654846,
-1.3626799583435059,
-0.10912289470434189,
-0.8735941648483276,
-1.4425634145736694,
0.7036294341087341,
0.051683418452739716,
0.46722081303596497,
-0.5367016792297363,
0.44364678859710693,
-2.160977602005005,
-1.318053126335144,
-0.34373149275779724,
-0.847748875617981,
0.37712907791137695,
-0.2830570340156555,
0.6755693554878235,
-0.19079215824604034,
0.23973877727985382,
0.2390640676021576,
1.2483271360397339,
3.383591890335083,
0.23996584117412567,
0.39800968766212463,
-0.0711953341960907,
-1.0302563905715942,
1.5385459661483765,
1.0601884126663208,
0.006762995384633541,
-0.6509681344032288,
-0.8746368885040283,
1.335006833076477,
1.8782910108566284,
1.1490509510040283,
0.29402604699134827,
-0.8494728803634644,
-0.5192463397979736,
-0.0005832891911268234,
0.13852079212665558,
0.27212026715278625,
0.8506144881248474,
-0.07412753999233246,
0.19642727077007294,
1.434875249862671,
1.3143879175186157,
-0.4601426422595978,
0.4721240997314453,
-0.97412109375,
-0.3201804459095001,
0.4705798029899597,
0.3421407639980316,
0.03525624796748161,
0.3606923520565033,
-1.03829026222229,
-0.32365286350250244,
-0.24683570861816406,
-1.0950263738632202,
-0.8572542071342468,
-0.25123676657676697,
-0.37710413336753845,
1.6626293659210205,
0.1318889558315277,
-0.5326381921768188,
-0.05462247133255005,
-0.7661336064338684,
-0.09489046037197113,
-1.0301979780197144,
0.2264251708984375,
-0.0785970464348793,
-0.031209133565425873,
0.026956699788570404,
2.0134968757629395,
-1.1221174001693726,
-2.316164255142212,
0.3067393898963928,
0.28591570258140564,
-0.40683451294898987,
0.11343786865472794,
1.530570149421692,
0.378727525472641,
1.471701979637146,
1.2612665891647339,
1.1169745922088623,
-0.672758162021637,
-1.2900879383087158,
0.6289849281311035,
1.0329316854476929,
-1.4690536260604858,
0.7396999001502991,
-0.04470805823802948,
-0.4633267819881439,
0.7495207190513611,
1.1928163766860962,
0.3685295879840851,
-1.920786738395691,
0.712855875492096,
-0.8828303217887878,
0.8714159727096558,
0.6421867609024048,
0.8770095109939575,
0.30060064792633057,
0.7349167466163635,
-1.2768571376800537,
-1.0312598943710327,
-0.7959136366844177,
-0.46582597494125366,
2.131833553314209,
-0.15336215496063232,
0.6742171049118042,
-0.09088315069675446,
-1.2393717765808105,
0.0022384310141205788,
0.7819576859474182,
0.31611308455467224,
-0.4561079144477844,
0.875980019569397,
-0.5574217438697815,
-1.032433032989502,
-1.383605718612671,
-0.5618920922279358,
-1.0152413845062256,
-1.0412921905517578,
1.1919476985931396,
0.8524652719497681,
0.32996246218681335,
1.7974188327789307,
0.37532320618629456,
0.2511754035949707,
-2.7178661823272705,
0.8883011341094971,
0.2597897946834564,
0.10762876272201538,
0.7962916493415833,
0.2233586311340332,
1.057693600654602,
-0.07638052850961685,
0.4762316942214966,
-2.309814214706421,
2.2661123275756836,
-0.20472797751426697,
0.6239701509475708,
-0.027382411062717438,
-0.07569559663534164,
1.0043195486068726,
0.5605928301811218,
0.6636860370635986,
-1.1081092357635498,
0.7643817663192749,
-0.44613415002822876,
1.1879613399505615,
0.9008074402809143,
-0.8065105676651001,
0.022732526063919067,
1.3784269094467163,
0.5376065969467163,
-0.33039653301239014,
-0.9729685187339783,
-0.7856810688972473,
1.0124034881591797,
1.7021151781082153,
-0.023915298283100128,
0.058130893856287,
0.8615013957023621,
0.37133052945137024,
-1.1831893920898438,
0.017286386340856552,
-0.7925970554351807,
-0.532732367515564,
1.5901105403900146,
2.1348390579223633,
0.003264649771153927,
-0.049239855259656906,
-0.7465805411338806,
-1.2404873371124268,
0.6708049178123474,
-0.0562109500169754,
0.20510001480579376,
0.8513686656951904,
-0.6005480885505676,
1.064515233039856,
0.5481323599815369,
0.9171093702316284,
-0.045556798577308655,
0.3940964639186859,
0.4278084635734558,
-0.28171834349632263,
-1.1694581508636475,
-0.28319841623306274,
-1.11960768699646,
-2.498671293258667,
0.3673272430896759,
-0.33972716331481934,
-1.479485034942627,
0.08162157982587814,
-1.0587533712387085,
0.9555912613868713,
-0.5878378748893738,
-1.1097686290740967,
-1.6033991575241089,
0.22559767961502075,
-0.21683113276958466,
0.8517245650291443,
-1.7007864713668823,
-0.12645862996578217,
1.1637035608291626,
0.9063510298728943,
-0.6887392401695251,
1.2134778499603271,
0.30914920568466187,
1.0639913082122803,
0.7116525769233704,
-0.33019545674324036,
0.37671127915382385,
-0.06713031977415085,
-1.354945421218872,
0.6052325367927551,
1.2228847742080688,
0.1434549242258072,
1.2575695514678955,
-0.6741775274276733,
0.025502804666757584,
0.6074467897415161,
-0.47911909222602844,
-0.4931727349758148,
-0.23179446160793304,
0.6540681719779968,
0.17031171917915344,
-0.8797949552536011,
-0.07525157928466797,
-0.15604311227798462,
-0.17599664628505707,
0.2425132542848587,
-1.5295428037643433,
-0.23680348694324493,
-0.5488781332969666,
-0.5440624356269836,
-1.3325862884521484,
0.18031717836856842,
1.3344258069992065,
-0.6880462765693665,
-0.2181335836648941,
0.5567588210105896,
0.47143790125846863,
0.45534902811050415,
0.5816407203674316,
-0.6061062812805176,
-0.31355321407318115,
-0.2752350866794586,
-0.2860493063926697,
0.345072478055954,
1.3462319374084473,
-0.3334205746650696,
-1.080517053604126,
0.7136321663856506,
-0.48044291138648987,
0.15565545856952667,
1.9595530033111572,
0.25671541690826416,
-0.8747692704200745,
0.2579399645328522,
-0.6295101046562195,
1.9621623754501343,
1.5616105794906616,
1.4392907619476318,
-0.03643288463354111,
-0.8317062854766846,
0.5909262895584106,
-0.12990599870681763,
-0.372970312833786,
0.8762050867080688,
0.45460376143455505,
-0.16842114925384521,
-1.4709720611572266,
0.5293035507202148,
1.3469215631484985,
-0.9142749309539795,
-0.8659370541572571,
0.05527770146727562,
-0.8488448262214661,
1.1248270273208618,
0.7866443991661072,
0.46246302127838135,
0.1269652545452118,
1.4443389177322388,
0.6358179450035095,
-0.5401740670204163,
0.5347525477409363,
0.3972906768321991,
-0.017517345026135445,
-2.0552170276641846,
-0.9429193735122681,
0.3117280900478363,
-0.4901999831199646,
-1.5975676774978638,
1.3012127876281738,
-1.149749517440796,
-0.9304230809211731,
0.4447634518146515,
0.2849363088607788,
1.5298655033111572,
0.35693851113319397,
1.6237996816635132,
2.0396316051483154,
0.8948055505752563,
0.14647738635540009,
1.3923211097717285,
0.04959150776267052,
-0.47846314311027527,
1.8909155130386353,
-0.3851057291030884,
0.44412168860435486,
1.1202234029769897,
-0.43140172958374023,
-1.0946520566940308,
-0.7470754384994507,
-1.1062791347503662,
-0.412635862827301,
1.2212327718734741,
0.2419155091047287,
-1.0826008319854736,
0.034883927553892136,
1.4623042345046997,
0.16915886104106903,
-0.4251134991645813,
0.6849781274795532,
0.45614269375801086,
-0.7616555094718933,
-0.09232170879840851,
-0.8447445631027222,
0.4882463812828064,
-0.18270264565944672,
-0.306866854429245,
0.36719995737075806,
0.49308010935783386,
1.1005851030349731,
-0.13084176182746887,
0.09869632124900818,
1.2751832008361816,
-1.3437541723251343,
1.6069854497909546,
-0.5605759620666504,
0.07731049507856369,
-2.5648975372314453,
1.4637893438339233,
-0.6456349492073059,
1.7208834886550903,
-2.7080371379852295,
0.36972740292549133,
-0.5225254893302917,
-0.3800389766693115,
0.3235980272293091,
-0.30528295040130615,
0.06556910276412964,
-0.14712859690189362,
-1.1077110767364502,
-0.09507405012845993,
-0.6909740567207336,
0.5394909977912903,
1.0866516828536987,
1.1182847023010254,
-1.2059029340744019,
-0.204111710190773,
-1.896122694015503,
-0.010133039206266403,
-0.8208608031272888,
0.47593167424201965,
-2.123581647872925,
-0.27184149622917175,
-1.7294975519180298,
-2.306279182434082,
-1.5142455101013184,
-0.8713654279708862,
1.073062539100647,
0.23162402212619781,
-0.9359112977981567,
1.1475563049316406,
-0.3225270211696625,
-1.872991919517517,
0.9578104019165039,
-2.2351462841033936
] |
https://github.com/huggingface/datasets/issues/5000 | Dataset Viewer issue for asapp/slue | FYI, after replacing the source files with the ZIP ones, the dataset viewer works well. Thanks again to @severo and @albertvillanova for your help! | ### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes | 518 | 24 | Dataset Viewer issue for asapp/slue
### Link
https://huggingface.co/datasets/asapp/slue/viewer/
### Description
Hi,
I wonder how to get the dataset viewer of our slue dataset to work.
Best,
Felix
### Owner
Yes
FYI, after replacing the source files with the ZIP ones, the dataset viewer works well. Thanks again to @severo and @albertvillanova for your help! | [
-1.0956212282180786,
-0.9068715572357178,
-0.9281615614891052,
1.357970118522644,
-0.3101998567581177,
-1.2488535642623901,
0.21420003473758698,
-1.042302131652832,
1.557923436164856,
-0.7289997339248657,
0.20051059126853943,
-1.6723030805587769,
-0.13557371497154236,
-0.4922751784324646,
-0.6188634037971497,
-0.9622063636779785,
-0.5208489894866943,
-0.6470904350280762,
1.0564591884613037,
2.718026876449585,
1.1652624607086182,
-1.2578679323196411,
2.7533304691314697,
0.7144972681999207,
-0.20972494781017303,
-0.9407240152359009,
0.6599131226539612,
0.04723642021417618,
-1.2336134910583496,
-0.502091109752655,
-1.1006360054016113,
-0.03429773449897766,
-0.4580545127391815,
-0.3612431585788727,
0.07637084275484085,
0.41516226530075073,
-0.05145940184593201,
-0.42061418294906616,
-0.5488753914833069,
-0.7572665810585022,
0.2620694935321808,
-0.3748084306716919,
0.8900525569915771,
-0.3133775591850281,
1.8893506526947021,
-0.5627918243408203,
0.30913659930229187,
0.633517861366272,
1.3236243724822998,
0.016948044300079346,
-0.1019858792424202,
0.1766759753227234,
0.4812656342983246,
-0.029312489554286003,
0.45369431376457214,
1.0888206958770752,
0.453127384185791,
0.6183902621269226,
0.5192543268203735,
-2.088599443435669,
1.2565267086029053,
-0.9886490106582642,
0.314126580953598,
1.4938607215881348,
-1.1384245157241821,
0.48270732164382935,
-1.693853735923767,
-0.155467227101326,
0.4847296178340912,
-2.2127575874328613,
0.27673617005348206,
-1.168378233909607,
-0.5868394374847412,
0.793546199798584,
0.33627620339393616,
-1.4312697649002075,
0.04344114661216736,
-0.5667983293533325,
1.1055877208709717,
0.5267167091369629,
1.2158939838409424,
-1.748009204864502,
0.10944117605686188,
-0.30106666684150696,
0.020629428327083588,
-1.394043207168579,
-1.4710885286331177,
0.544230580329895,
0.6249505877494812,
0.6733294725418091,
0.04366707056760788,
0.7271329164505005,
-1.110193133354187,
0.8182734847068787,
-0.7120957374572754,
-1.7175642251968384,
-1.3378459215164185,
-2.364133834838867,
-2.3392021656036377,
0.7401236891746521,
-0.4144267141819,
-0.5133329033851624,
1.9095430374145508,
-0.9335820078849792,
-1.7333180904388428,
1.2678009271621704,
0.18895097076892853,
-0.123058021068573,
2.5060293674468994,
0.2934953570365906,
-0.5426784157752991,
0.2367459237575531,
-0.7020224332809448,
0.9129623174667358,
-0.6121962070465088,
1.4378559589385986,
0.5182086229324341,
-0.9874825477600098,
1.7383134365081787,
-0.5648877620697021,
0.6001918315887451,
-0.6907980442047119,
-0.4713376462459564,
-0.9433412551879883,
0.2807915210723877,
1.8768179416656494,
-0.48043233156204224,
1.5632398128509521,
-0.5231255292892456,
-1.5454386472702026,
-1.5824251174926758,
1.0447051525115967,
0.3869537115097046,
-0.8576061725616455,
0.16684934496879578,
-0.3073689341545105,
-0.02557402290403843,
-0.004331755917519331,
0.994389533996582,
1.3097301721572876,
0.6051887273788452,
-0.2933085262775421,
-0.8596914410591125,
0.23995791375637054,
-0.03190532326698303,
-0.6887885928153992,
-1.8201625347137451,
-0.3158765733242035,
0.016073156148195267,
0.6565167903900146,
-1.167227029800415,
1.6743907928466797,
0.8866777420043945,
1.8762820959091187,
0.9831263422966003,
-0.4057469666004181,
1.3411909341812134,
-0.012545829638838768,
1.787212610244751,
-0.6067200899124146,
0.6729028224945068,
-0.30454447865486145,
-1.157463788986206,
0.9131168723106384,
-0.4114103317260742,
-1.9296112060546875,
-0.8771376013755798,
-0.8953046202659607,
-0.2924472987651825,
-0.6926698684692383,
1.0098453760147095,
-0.15913020074367523,
-1.4844526052474976,
0.057111963629722595,
-0.5597891211509705,
0.16620489954948425,
-1.3385732173919678,
0.3587239980697632,
0.7190937399864197,
-0.5242031216621399,
-0.08220873773097992,
-0.28162163496017456,
-1.3717018365859985,
-0.3702009916305542,
0.31414711475372314,
1.9225990772247314,
-0.7571255564689636,
0.9464637637138367,
0.774743378162384,
-0.7755875587463379,
-0.08684234321117401,
0.26295217871665955,
-0.2667207717895508,
0.7536935210227966,
-1.2629683017730713,
-0.3736709952354431,
1.067394733428955,
-0.18551354110240936,
-0.6607895493507385,
1.4711107015609741,
0.7554853558540344,
-1.0205758810043335,
-0.16173453629016876,
-0.27072030305862427,
-0.8044208288192749,
-0.023541919887065887,
-1.7046846151351929,
-0.13759830594062805,
0.13977240025997162,
-1.4130359888076782,
-0.6105374693870544,
-0.31617793440818787,
1.3293558359146118,
-0.028377775102853775,
1.4198663234710693,
-0.33704909682273865,
-0.25489166378974915,
-0.5135317444801331,
-0.41614359617233276,
0.3406428098678589,
-0.2530781924724579,
-0.4375534951686859,
0.29234203696250916,
-0.8344511389732361,
0.2943420112133026,
1.5801349878311157,
0.3993929326534271,
0.22282680869102478,
0.6584819555282593,
0.9291009902954102,
0.31140023469924927,
-0.08534225821495056,
-0.9671606421470642,
-1.6411668062210083,
1.950847864151001,
-1.5178041458129883,
1.9340306520462036,
0.6580057740211487,
-0.08194931596517563,
-1.8580546379089355,
-1.9128248691558838,
1.3232399225234985,
1.397136926651001,
2.342421293258667,
0.6048935651779175,
0.40594080090522766,
-0.7620230317115784,
-0.7058613300323486,
0.09627669304609299,
-1.0972750186920166,
-0.7442295551300049,
0.2641928493976593,
2.207554817199707,
1.6880519390106201,
-0.6665022373199463,
-0.15701435506343842,
-1.2376124858856201,
1.238771677017212,
-0.14435237646102905,
0.33356714248657227,
1.9317067861557007,
-0.39719146490097046,
-0.9067702889442444,
1.065850853919983,
-2.3638863563537598,
0.09003676474094391,
1.9520756006240845,
0.10251831263303757,
0.18364587426185608,
-1.4060782194137573,
-0.7735368609428406,
-0.12728896737098694,
-0.45317304134368896,
-1.3306105136871338,
0.7482643127441406,
-0.3095894157886505,
-0.7745134234428406,
-1.5338830947875977,
0.10052086412906647,
-1.0262082815170288,
-1.5942583084106445,
0.29732540249824524,
1.8430730104446411,
1.955933690071106,
-0.8585999011993408,
1.4747294187545776,
-0.1964004784822464,
0.0844891220331192,
1.3160704374313354,
1.1770013570785522,
3.1032841205596924,
2.190998077392578,
-1.2157838344573975,
0.8718799948692322,
-0.05841941386461258,
-0.49698683619499207,
1.250623345375061,
-1.0294276475906372,
1.3217649459838867,
-0.3045889437198639,
-1.2510806322097778,
-1.2069875001907349,
0.9322242736816406,
0.45243096351623535,
0.08761674165725708,
-0.38901305198669434,
1.4467463493347168,
-0.03036464750766754,
1.3278634548187256,
0.6796485781669617,
-0.5386505722999573,
0.6169755458831787,
-0.5646945238113403,
-0.30561354756355286,
1.6638076305389404,
0.3031306862831116,
-1.4432203769683838,
-2.367255687713623,
-0.19968506693840027,
-0.9053100943565369,
-0.16261924803256989,
-0.5748047828674316,
-1.047129511833191,
1.462996244430542,
0.6229173541069031,
-1.0867410898208618,
-0.40917959809303284,
-0.27031973004341125,
-0.6093873977661133,
2.687044382095337,
-1.4734721183776855,
-0.24031761288642883,
-0.9518381953239441,
-0.3958950638771057,
1.8250895738601685,
-1.1713331937789917,
-0.13285773992538452,
-1.0655686855316162,
-0.6274595856666565,
-1.3684395551681519,
-0.5670080780982971,
0.06340323388576508,
-0.8929532170295715,
0.8669324517250061,
0.028794867917895317,
-1.0885159969329834,
-0.16069088876247406,
-0.8112295866012573,
0.8244603872299194,
-0.03762944042682648,
0.5156784653663635,
2.011960029602051,
0.351319283246994,
-0.36773985624313354,
0.7042590975761414,
1.2424410581588745,
0.5693122148513794,
-0.7451169490814209,
0.17739515006542206,
-0.7626454830169678,
0.22502684593200684,
-1.261826515197754,
0.12111605703830719,
-2.8755943775177,
0.6072273850440979,
-0.08171859383583069,
-0.14238831400871277,
-0.08505583554506302,
-1.3519445657730103,
1.0752099752426147,
2.4442927837371826,
-1.2409061193466187,
0.5047470927238464,
0.3117106556892395,
1.408116102218628,
-1.3735153675079346,
0.3064305782318115,
-0.5038220286369324,
1.9706517457962036,
0.28765344619750977,
1.1270805597305298,
-0.43039679527282715,
-2.0460526943206787,
0.527681827545166,
-1.3083175420761108,
-1.0807245969772339,
0.7328273057937622,
-0.8463544249534607,
-0.04443809390068054,
-1.418272614479065,
-0.07151684910058975,
-0.856109082698822,
-1.3521324396133423,
0.7192679643630981,
0.08998409658670425,
0.4800361096858978,
-0.6024590134620667,
0.43290984630584717,
-2.0372672080993652,
-1.2660542726516724,
-0.28192058205604553,
-0.765370786190033,
0.3907800018787384,
-0.25850772857666016,
0.6998977065086365,
-0.21638178825378418,
0.24103321135044098,
0.32435497641563416,
1.256341576576233,
3.3801980018615723,
0.1507066935300827,
0.35537058115005493,
-0.12514154613018036,
-0.9888495206832886,
1.503430724143982,
1.0487301349639893,
-0.0040673259645700455,
-0.6508716344833374,
-0.9130963087081909,
1.3013325929641724,
1.8492778539657593,
1.1708720922470093,
0.22701559960842133,
-0.7808859944343567,
-0.40061676502227783,
-0.06850264966487885,
0.1697896122932434,
0.32047945261001587,
0.8510017991065979,
-0.044335104525089264,
0.14813287556171417,
1.461204171180725,
1.3164706230163574,
-0.4580516219139099,
0.5736786723136902,
-0.9070140719413757,
-0.31482502818107605,
0.4720940887928009,
0.3458852767944336,
0.0036996304988861084,
0.3424568772315979,
-0.9750311374664307,
-0.35532549023628235,
-0.35240638256073,
-1.126452088356018,
-0.7118871808052063,
-0.289925217628479,
-0.4122713804244995,
1.6702786684036255,
0.11926746368408203,
-0.5085464715957642,
-0.02285907417535782,
-0.7665575742721558,
-0.05687691271305084,
-1.1138739585876465,
0.2795417606830597,
-0.17843899130821228,
-0.056468069553375244,
0.059226490557193756,
1.9141708612442017,
-1.1354889869689941,
-2.2631099224090576,
0.3442883789539337,
0.3186473250389099,
-0.40644946694374084,
0.21217834949493408,
1.4525036811828613,
0.3897589445114136,
1.549902319908142,
1.2947295904159546,
1.072541356086731,
-0.6654786467552185,
-1.3481433391571045,
0.7276803851127625,
1.080491304397583,
-1.5026681423187256,
0.7230218052864075,
-0.04899996519088745,
-0.5711588859558105,
0.7790546417236328,
1.1560770273208618,
0.3594939410686493,
-1.9536714553833008,
0.8010978698730469,
-0.8897580504417419,
0.886692464351654,
0.6187379360198975,
0.8059783577919006,
0.3747536242008209,
0.8090212941169739,
-1.3213038444519043,
-1.1028915643692017,
-0.7145110964775085,
-0.4876847267150879,
2.070829391479492,
-0.08670780807733536,
0.6853294968605042,
-0.09677396714687347,
-1.1632707118988037,
-0.0661977007985115,
0.7306436896324158,
0.327139675617218,
-0.388514906167984,
0.8457566499710083,
-0.5657938718795776,
-1.0452624559402466,
-1.4406923055648804,
-0.5689915418624878,
-1.0747507810592651,
-0.9933358430862427,
1.1655200719833374,
0.9015665650367737,
0.2661724388599396,
1.8394688367843628,
0.3673049211502075,
0.291704922914505,
-2.644918441772461,
0.8686287999153137,
0.30356714129447937,
0.0394701287150383,
0.7486891150474548,
0.24932219088077545,
1.0553052425384521,
-0.031127948313951492,
0.5234034061431885,
-2.32913875579834,
2.2694685459136963,
-0.20876780152320862,
0.5575465559959412,
0.032275132834911346,
-0.07566173374652863,
1.0105611085891724,
0.5608201026916504,
0.5953558087348938,
-1.0845510959625244,
0.744057297706604,
-0.4975834786891937,
1.195099949836731,
0.9726293087005615,
-0.8597049117088318,
0.04407385736703873,
1.373918890953064,
0.5541393756866455,
-0.34128469228744507,
-0.9037872552871704,
-0.74654620885849,
1.0286954641342163,
1.7041542530059814,
-0.060574375092983246,
0.09057305008172989,
0.8332476019859314,
0.486947238445282,
-1.1852986812591553,
0.07980813831090927,
-0.7868202328681946,
-0.6221575736999512,
1.53669011592865,
2.0387611389160156,
-0.016367658972740173,
0.020158156752586365,
-0.7816600799560547,
-1.2148135900497437,
0.7028918862342834,
-0.1007537692785263,
0.24678145349025726,
0.8143635392189026,
-0.6041291952133179,
1.0718426704406738,
0.587998628616333,
0.8836824297904968,
0.010936662554740906,
0.3486991822719574,
0.42993244528770447,
-0.23019319772720337,
-1.0997599363327026,
-0.24653664231300354,
-1.148641586303711,
-2.5048296451568604,
0.33874568343162537,
-0.4260033667087555,
-1.4676045179367065,
0.12659016251564026,
-1.0638819932937622,
0.9218410849571228,
-0.5711605548858643,
-1.1450868844985962,
-1.5690957307815552,
0.29847750067710876,
-0.13230684399604797,
0.91048663854599,
-1.6215016841888428,
-0.059170812368392944,
1.1166552305221558,
0.8450209498405457,
-0.6714238524436951,
1.195244312286377,
0.41190847754478455,
1.080327033996582,
0.7422351837158203,
-0.32714593410491943,
0.36548203229904175,
-0.07286550104618073,
-1.3702000379562378,
0.598231315612793,
1.1876139640808105,
0.11726658046245575,
1.3419604301452637,
-0.6626754999160767,
0.07821652293205261,
0.5752193331718445,
-0.4449458420276642,
-0.5655493140220642,
-0.2571379542350769,
0.6634988188743591,
0.14653804898262024,
-0.9776603579521179,
-0.08607423305511475,
-0.13973069190979004,
-0.281995564699173,
0.23818513751029968,
-1.510140299797058,
-0.2838434875011444,
-0.5686246752738953,
-0.53342205286026,
-1.3365437984466553,
0.1363997757434845,
1.3024758100509644,
-0.6609885692596436,
-0.27386975288391113,
0.5808467268943787,
0.44585567712783813,
0.37863990664482117,
0.6361355781555176,
-0.6206632852554321,
-0.29096728563308716,
-0.30691906809806824,
-0.32040631771087646,
0.2543124258518219,
1.3174357414245605,
-0.42224615812301636,
-1.0618435144424438,
0.7297931909561157,
-0.4334554374217987,
0.11481235921382904,
1.9687470197677612,
0.21476157009601593,
-0.843151330947876,
0.28777527809143066,
-0.5926417112350464,
1.9665701389312744,
1.5986769199371338,
1.387839436531067,
-0.06510483473539352,
-0.8496012091636658,
0.5530487895011902,
-0.24550698697566986,
-0.30026835203170776,
0.8138101696968079,
0.39241260290145874,
-0.13734790682792664,
-1.5079354047775269,
0.49591708183288574,
1.347710132598877,
-0.8802447319030762,
-0.8359399437904358,
0.009371671825647354,
-0.7870537638664246,
1.036794662475586,
0.8310109972953796,
0.4058591425418854,
0.16541631519794464,
1.4852544069290161,
0.6179391741752625,
-0.4832819104194641,
0.5064794421195984,
0.45113039016723633,
0.06779011338949203,
-2.122997522354126,
-0.9728230237960815,
0.28641843795776367,
-0.39789649844169617,
-1.6329339742660522,
1.228817105293274,
-1.0946824550628662,
-0.9055023789405823,
0.46615585684776306,
0.2651973068714142,
1.4887257814407349,
0.3887067437171936,
1.5800567865371704,
2.0915987491607666,
0.9022156000137329,
0.13366980850696564,
1.3939802646636963,
0.14373955130577087,
-0.38083112239837646,
1.9067208766937256,
-0.37239861488342285,
0.433438241481781,
1.0209330320358276,
-0.46997159719467163,
-1.05842924118042,
-0.7569395303726196,
-1.166718602180481,
-0.42326125502586365,
1.2347877025604248,
0.12404027581214905,
-1.0549285411834717,
0.06360355019569397,
1.4730712175369263,
0.09935921430587769,
-0.41515305638313293,
0.7539621591567993,
0.4919027090072632,
-0.7841349840164185,
-0.08041395246982574,
-0.8414602875709534,
0.5358647704124451,
-0.1532360017299652,
-0.3308643102645874,
0.38458332419395447,
0.6048585772514343,
1.1927036046981812,
-0.11035497486591339,
0.10789162665605545,
1.3050674200057983,
-1.347511887550354,
1.5560259819030762,
-0.5988003015518188,
0.061519332230091095,
-2.5517218112945557,
1.506530523300171,
-0.6110265254974365,
1.7428516149520874,
-2.6999850273132324,
0.39077913761138916,
-0.5047547817230225,
-0.36364689469337463,
0.3661450743675232,
-0.2740740180015564,
0.07215648889541626,
-0.18159176409244537,
-1.039960265159607,
-0.03368520736694336,
-0.647788405418396,
0.5664339065551758,
1.1156961917877197,
1.2550199031829834,
-1.1657041311264038,
-0.30180051922798157,
-1.9186056852340698,
-0.009505009278655052,
-0.7920848727226257,
0.5022002458572388,
-2.1548824310302734,
-0.2025129199028015,
-1.7556315660476685,
-2.3718862533569336,
-1.4556770324707031,
-0.8453687429428101,
1.1547120809555054,
0.2909875512123108,
-0.9237539768218994,
1.1977001428604126,
-0.3181025981903076,
-1.8712517023086548,
0.9212971925735474,
-2.2267134189605713
] |
https://github.com/huggingface/datasets/issues/4996 | Dataset Viewer issue for Jean-Baptiste/wikiner_fr | The script uses `Dataset.load_from_disk`, which as you can expect, doesn't work in streaming mode.
It would probably be more practical to load the dataset locally using `Dataset.load_from_disk` first and then `push_to_hub` to upload it in Parquet on the Hub | ### Link
https://huggingface.co/datasets/Jean-Baptiste/wikiner_fr
### Description
```
Error code: StreamingRowsError
Exception: FileNotFoundError
Message: [Errno 2] No such file or directory: 'zip:/data/train::https:/huggingface.co/datasets/Jean-Baptiste/wikiner_fr/resolve/main/data.zip/state.json'
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/responses/first_rows.py", line 337, in get_first_rows_response
rows = get_rows(dataset, config, split, streaming=True, rows_max_number=rows_max_number, hf_token=hf_token)
File "/src/services/worker/src/worker/utils.py", line 123, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/responses/first_rows.py", line 77, in get_rows
rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 718, in __iter__
for key, example in self._iter():
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 708, in _iter
yield from ex_iterable
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 112, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/tmp/modules-cache/datasets_modules/datasets/Jean-Baptiste--wikiner_fr/683a580ba6ec769d508f7dfc603a651667b0ed3817b1ae5bfd45f97cc024923f/wikiner_fr.py", line 165, in _generate_examples
dataset = Dataset.load_from_disk(filepath)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1210, in load_from_disk
with open(Path(dataset_path, config.DATASET_STATE_JSON_FILENAME).as_posix(), encoding="utf-8") as state_file:
FileNotFoundError: [Errno 2] No such file or directory: 'zip:/data/train::https:/huggingface.co/datasets/Jean-Baptiste/wikiner_fr/resolve/main/data.zip/state.json'
```
Is it an error with the dataset script, or the data itself, @huggingface/datasets?
https://huggingface.co/datasets/Jean-Baptiste/wikiner_fr/tree/main
### Owner
No | 519 | 39 | Dataset Viewer issue for Jean-Baptiste/wikiner_fr
### Link
https://huggingface.co/datasets/Jean-Baptiste/wikiner_fr
### Description
```
Error code: StreamingRowsError
Exception: FileNotFoundError
Message: [Errno 2] No such file or directory: 'zip:/data/train::https:/huggingface.co/datasets/Jean-Baptiste/wikiner_fr/resolve/main/data.zip/state.json'
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/responses/first_rows.py", line 337, in get_first_rows_response
rows = get_rows(dataset, config, split, streaming=True, rows_max_number=rows_max_number, hf_token=hf_token)
File "/src/services/worker/src/worker/utils.py", line 123, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/responses/first_rows.py", line 77, in get_rows
rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 718, in __iter__
for key, example in self._iter():
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 708, in _iter
yield from ex_iterable
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 112, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/tmp/modules-cache/datasets_modules/datasets/Jean-Baptiste--wikiner_fr/683a580ba6ec769d508f7dfc603a651667b0ed3817b1ae5bfd45f97cc024923f/wikiner_fr.py", line 165, in _generate_examples
dataset = Dataset.load_from_disk(filepath)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1210, in load_from_disk
with open(Path(dataset_path, config.DATASET_STATE_JSON_FILENAME).as_posix(), encoding="utf-8") as state_file:
FileNotFoundError: [Errno 2] No such file or directory: 'zip:/data/train::https:/huggingface.co/datasets/Jean-Baptiste/wikiner_fr/resolve/main/data.zip/state.json'
```
Is it an error with the dataset script, or the data itself, @huggingface/datasets?
https://huggingface.co/datasets/Jean-Baptiste/wikiner_fr/tree/main
### Owner
No
The script uses `Dataset.load_from_disk`, which as you can expect, doesn't work in streaming mode.
It would probably be more practical to load the dataset locally using `Dataset.load_from_disk` first and then `push_to_hub` to upload it in Parquet on the Hub | [
-1.194709300994873,
-0.9089266657829285,
-0.6847754120826721,
1.4802762269973755,
-0.07269001007080078,
-1.263047695159912,
0.10963600873947144,
-0.9707092046737671,
1.4917112588882446,
-0.6878474354743958,
0.23156090080738068,
-1.7235586643218994,
-0.08529777824878693,
-0.5228946208953857,
-0.6572093367576599,
-0.903456449508667,
-0.3090541958808899,
-0.8555988669395447,
0.991245687007904,
2.4216158390045166,
1.3469749689102173,
-1.2873411178588867,
2.742387056350708,
0.6817017793655396,
-0.3576171398162842,
-1.0253969430923462,
0.5804970860481262,
0.031284820288419724,
-1.1787585020065308,
-0.4809683561325073,
-0.9696449637413025,
0.004172740504145622,
-0.5383962988853455,
-0.24249988794326782,
0.13734067976474762,
0.5225009918212891,
-0.24563711881637573,
-0.12539027631282806,
-0.6936432123184204,
-0.7922681570053101,
0.4997081756591797,
-0.3708936274051666,
0.9542800188064575,
-0.3338524103164673,
1.7379618883132935,
-0.6545057892799377,
0.4255920648574829,
0.7262317538261414,
1.306030511856079,
0.13853059709072113,
0.02437574416399002,
0.1944718360900879,
0.31717488169670105,
0.021090157330036163,
0.5687836408615112,
1.2334452867507935,
0.5984687805175781,
0.5050840377807617,
0.535228431224823,
-2.211024761199951,
1.3293201923370361,
-0.8910449743270874,
0.23293821513652802,
1.4185689687728882,
-0.9010753035545349,
0.3707062900066376,
-1.8293558359146118,
-0.10132108628749847,
0.6318705081939697,
-2.376161575317383,
0.290112167596817,
-1.3076456785202026,
-0.5533741116523743,
0.929883599281311,
0.3569723963737488,
-1.2069147825241089,
0.16833177208900452,
-0.5217353701591492,
1.083509922027588,
0.48522213101387024,
1.0445449352264404,
-1.6839441061019897,
-0.03621958568692207,
-0.12550263106822968,
0.09136131405830383,
-1.3183997869491577,
-1.6472891569137573,
0.6134236454963684,
0.5713106393814087,
0.7096933126449585,
-0.09542818367481232,
1.0287582874298096,
-1.105896234512329,
0.8144127726554871,
-0.9313751459121704,
-1.5398985147476196,
-1.4230424165725708,
-2.490145206451416,
-2.3119256496429443,
0.8561031222343445,
-0.47994911670684814,
-0.5097216367721558,
2.0069539546966553,
-0.9782670140266418,
-1.7282353639602661,
1.0155367851257324,
0.29425495862960815,
0.1516503244638443,
2.4300596714019775,
0.2747381925582886,
-0.7883004546165466,
0.42117443680763245,
-0.7091659307479858,
0.8633774518966675,
-0.3007282316684723,
1.3794158697128296,
0.5539454817771912,
-1.0359132289886475,
1.5616766214370728,
-0.4225785434246063,
0.5503562688827515,
-0.645787239074707,
-0.49275708198547363,
-0.7371060848236084,
0.24861431121826172,
1.8488144874572754,
-0.35361990332603455,
1.5195095539093018,
-0.19164280593395233,
-1.4774905443191528,
-1.4756263494491577,
0.7689847350120544,
0.4831939935684204,
-0.9172149300575256,
0.05291857197880745,
-0.49067240953445435,
0.2202167958021164,
-0.06815642863512039,
1.0971852540969849,
1.2285652160644531,
0.6132466197013855,
-0.3622967600822449,
-0.8213954567909241,
0.2358534187078476,
-0.18844720721244812,
-0.6828131675720215,
-1.8277558088302612,
-0.3182482421398163,
0.25697845220565796,
0.631498396396637,
-1.2573047876358032,
1.8334357738494873,
0.8510795831680298,
2.045790672302246,
0.9591910243034363,
-0.434323251247406,
1.4841080904006958,
-0.07774770259857178,
1.8209222555160522,
-0.5161023736000061,
0.5640029311180115,
-0.37013542652130127,
-1.15390145778656,
0.8461039066314697,
-0.3527137041091919,
-1.983881950378418,
-0.8027957677841187,
-0.7848822474479675,
-0.10719592869281769,
-0.7167394161224365,
0.8823223114013672,
-0.27115413546562195,
-1.4611380100250244,
0.031512316316366196,
-0.6727237701416016,
0.14698027074337006,
-1.3279832601547241,
0.12338446080684662,
0.6407124996185303,
-0.7023295760154724,
-0.10817936062812805,
-0.34406617283821106,
-1.2524387836456299,
-0.572262167930603,
0.4388643205165863,
1.9788005352020264,
-0.43202903866767883,
1.006650686264038,
0.9645150899887085,
-0.7432838082313538,
0.15348736941814423,
0.22352871298789978,
-0.325547456741333,
0.758868396282196,
-1.110703468322754,
-0.5235791206359863,
1.2013400793075562,
-0.2952560484409332,
-0.7566444873809814,
1.458359718322754,
0.8431230783462524,
-1.1747547388076782,
-0.36352550983428955,
-0.2732648253440857,
-0.7288686037063599,
0.06122852489352226,
-1.5029613971710205,
-0.1827300488948822,
0.3889307379722595,
-1.4278382062911987,
-0.2914220690727234,
-0.19511793553829193,
1.419982671737671,
-0.20607513189315796,
1.4323776960372925,
-0.2895902991294861,
-0.1557845175266266,
-0.2681308686733246,
-0.5663230419158936,
0.08095438778400421,
-0.21386103332042694,
-0.4997357130050659,
0.2793852388858795,
-0.9322526454925537,
0.32743266224861145,
1.4944790601730347,
0.36724162101745605,
0.0022723088040947914,
0.4740174114704132,
1.061052680015564,
0.3727061450481415,
-0.0959571897983551,
-0.8666918277740479,
-1.5389312505722046,
1.952160120010376,
-1.4072813987731934,
1.9422898292541504,
0.8872836232185364,
-0.10913695394992828,
-1.8159029483795166,
-1.7709294557571411,
1.217349648475647,
1.167778730392456,
2.3704826831817627,
0.5169776082038879,
0.3921307325363159,
-0.7603044509887695,
-0.7854227423667908,
0.37617433071136475,
-1.0374966859817505,
-0.6088422536849976,
0.23010721802711487,
2.357374429702759,
1.8579071760177612,
-0.4819762110710144,
-0.2462487816810608,
-0.9013556241989136,
1.1836626529693604,
-0.33128559589385986,
0.25177955627441406,
2.101367235183716,
-0.28582873940467834,
-0.9898146986961365,
1.2893319129943848,
-2.4005560874938965,
0.29889217019081116,
2.1330678462982178,
0.31876644492149353,
0.16984276473522186,
-1.4165457487106323,
-0.6409777402877808,
-0.34687697887420654,
-0.42421528697013855,
-1.1816045045852661,
0.5443876385688782,
-0.3405227065086365,
-0.8746470808982849,
-1.3755426406860352,
0.06147117540240288,
-1.1085048913955688,
-1.8151588439941406,
0.3525580167770386,
1.900415062904358,
2.2051563262939453,
-0.7845557928085327,
1.2991143465042114,
-0.25183823704719543,
-0.03518374264240265,
1.254175066947937,
1.357232928276062,
2.9976251125335693,
1.8511019945144653,
-1.295543909072876,
0.7443748116493225,
-0.19021417200565338,
-0.42112457752227783,
1.124666690826416,
-1.15604829788208,
1.060782551765442,
-0.18813219666481018,
-1.3004045486450195,
-1.249243974685669,
1.0902025699615479,
0.5007985234260559,
-0.08766317367553711,
-0.5804452896118164,
1.2553156614303589,
0.10339376330375671,
1.3419479131698608,
0.6610957980155945,
-0.4154542088508606,
0.4591037631034851,
-0.3682897090911865,
-0.5870444178581238,
1.6494024991989136,
0.14488232135772705,
-1.631487250328064,
-2.353869676589966,
-0.2606779634952545,
-0.8974900245666504,
-0.0729120522737503,
-0.6762176752090454,
-1.0525438785552979,
1.5871555805206299,
0.3803853690624237,
-1.1881622076034546,
-0.25901633501052856,
-0.36462002992630005,
-0.5356920957565308,
2.6292052268981934,
-1.2239729166030884,
-0.1193435937166214,
-0.9382292032241821,
-0.5449348092079163,
1.6540985107421875,
-1.2136985063552856,
-0.2358289659023285,
-1.0447217226028442,
-0.7179027199745178,
-1.2946962118148804,
-0.44681990146636963,
0.1372230052947998,
-0.90495765209198,
0.7880855798721313,
0.08348642289638519,
-1.0623981952667236,
-0.2882128953933716,
-0.8949771523475647,
1.0726780891418457,
-0.10775443911552429,
0.11080777645111084,
1.8621716499328613,
0.31637194752693176,
-0.46592816710472107,
0.7352517247200012,
1.2197984457015991,
0.6091576218605042,
-0.6174405813217163,
0.005130628123879433,
-0.6595074534416199,
0.40532565116882324,
-1.4423869848251343,
0.26924893260002136,
-2.9568591117858887,
0.7907664775848389,
-0.16194631159305573,
-0.13798704743385315,
-0.07719120383262634,
-1.272241234779358,
1.099679708480835,
2.6033127307891846,
-1.229310393333435,
0.5815426707267761,
0.44220224022865295,
1.1377040147781372,
-1.5868713855743408,
0.26521849632263184,
-0.5380510687828064,
2.0439648628234863,
0.07550357282161713,
1.2839168310165405,
-0.5179896950721741,
-2.1614725589752197,
0.7229651808738708,
-1.160612940788269,
-0.9024654030799866,
0.8299455046653748,
-0.9247452616691589,
0.3147924840450287,
-1.455710768699646,
-0.16094045341014862,
-0.8991974592208862,
-1.2854787111282349,
0.709283173084259,
0.12826962769031525,
0.4083709716796875,
-0.5079794526100159,
0.3176998794078827,
-2.146975040435791,
-1.3649849891662598,
-0.1954430639743805,
-1.012271523475647,
0.5824388265609741,
-0.4300142526626587,
0.6071295738220215,
-0.04435757175087929,
0.06205717846751213,
0.31892579793930054,
1.5055692195892334,
3.3593382835388184,
0.08399699628353119,
0.13826093077659607,
-0.07694830000400543,
-1.0359143018722534,
1.3623989820480347,
0.8765869736671448,
-0.10368119180202484,
-0.5501852035522461,
-1.0575684309005737,
1.3313955068588257,
2.0131208896636963,
1.1872578859329224,
0.21367213129997253,
-0.9388440251350403,
-0.776642382144928,
0.01983141526579857,
0.2091706246137619,
0.6132978200912476,
0.8850832581520081,
-0.1135241687297821,
0.09901095926761627,
1.396182656288147,
1.201857089996338,
-0.3151240348815918,
0.38798946142196655,
-0.987395703792572,
-0.3702617585659027,
0.3458828330039978,
0.1878858059644699,
0.03287612646818161,
0.5610347986221313,
-1.080436110496521,
-0.27611789107322693,
-0.23569166660308838,
-0.9134420156478882,
-0.6962742209434509,
-0.4315229654312134,
-0.4609943628311157,
1.6205470561981201,
0.10557694733142853,
-0.4064749479293823,
0.14282743632793427,
-0.6325016617774963,
-0.203043133020401,
-1.1525064706802368,
0.07958585023880005,
-0.06609509885311127,
-0.010635532438755035,
-0.25054168701171875,
1.6607539653778076,
-0.8332256078720093,
-2.2068850994110107,
0.18018366396427155,
0.35526177287101746,
-0.3710663616657257,
0.168100968003273,
1.8029155731201172,
0.4604245126247406,
1.3312020301818848,
1.2568342685699463,
1.0269813537597656,
-0.5774344801902771,
-1.1775388717651367,
0.7578116059303284,
1.0253064632415771,
-1.3342722654342651,
0.9617624878883362,
-0.26665839552879333,
-0.4439603388309479,
0.6728801131248474,
1.3457553386688232,
0.42410722374916077,
-1.9971327781677246,
0.970605731010437,
-1.0011420249938965,
0.7919706702232361,
0.7221555113792419,
0.8139193058013916,
0.3125644624233246,
0.9473385214805603,
-1.2452571392059326,
-1.110262393951416,
-0.7378809452056885,
-0.6251341104507446,
1.924478530883789,
-0.2048926204442978,
0.5734629034996033,
-0.21669180691242218,
-1.2037994861602783,
-0.09997585415840149,
0.7816613912582397,
0.33644741773605347,
-0.3345679044723511,
0.9309735894203186,
-0.6645511388778687,
-0.9067742824554443,
-1.3206321001052856,
-0.44206663966178894,
-0.9782714247703552,
-0.8866747617721558,
1.02059805393219,
0.6908923983573914,
0.40981122851371765,
1.9036415815353394,
0.5921804308891296,
0.3071497976779938,
-2.595153331756592,
0.9127538800239563,
0.3439038097858429,
-0.024261504411697388,
0.8566844463348389,
0.23444998264312744,
1.1959314346313477,
0.008914384990930557,
0.5596358776092529,
-2.295353889465332,
2.2505433559417725,
-0.1673186719417572,
0.6489737629890442,
0.1020967960357666,
-0.22322461009025574,
1.116328239440918,
0.6006077527999878,
0.591806948184967,
-1.1108075380325317,
0.7973883748054504,
-0.568403959274292,
1.042036533355713,
0.9523913264274597,
-0.8950125575065613,
0.08024188876152039,
1.4259161949157715,
0.4815640449523926,
-0.4218152165412903,
-0.9375295042991638,
-0.7023978233337402,
1.0017896890640259,
1.6866673231124878,
-0.05081810802221298,
0.022640779614448547,
0.8684139251708984,
0.6478345990180969,
-1.1563172340393066,
0.01273353211581707,
-0.6793631315231323,
-0.660021185874939,
1.702460527420044,
2.052516222000122,
-0.16582028567790985,
-0.2091452032327652,
-0.7106326222419739,
-1.2717580795288086,
0.6713228821754456,
-0.18214169144630432,
-0.03876417502760887,
0.7357444167137146,
-0.6760489344596863,
1.1020866632461548,
0.5109512209892273,
0.9915763735771179,
0.030790571123361588,
0.2389017790555954,
0.4011177122592926,
-0.4478738307952881,
-1.2143932580947876,
-0.4208562970161438,
-1.1572188138961792,
-2.656775951385498,
0.44328129291534424,
-0.26151734590530396,
-1.4349894523620605,
0.061661314219236374,
-1.0445293188095093,
0.9873191714286804,
-0.6137148141860962,
-1.140653371810913,
-1.4085882902145386,
0.3654530346393585,
-0.2920152246952057,
0.9565558433532715,
-1.7450907230377197,
-0.2869590222835541,
1.2247024774551392,
0.8289846777915955,
-0.5964605808258057,
0.911346971988678,
0.1995219588279724,
1.0328329801559448,
0.6966030597686768,
-0.3915349841117859,
0.6016325950622559,
0.05156956985592842,
-1.3283543586730957,
0.4401523172855377,
1.2022544145584106,
0.13942722976207733,
1.3722447156906128,
-0.41019222140312195,
0.09533566236495972,
0.4321439266204834,
-0.6814002990722656,
-0.5846701264381409,
-0.31616735458374023,
0.7434298992156982,
0.021908916532993317,
-1.1622508764266968,
-0.18828964233398438,
-0.1770377904176712,
-0.23976823687553406,
0.13530535995960236,
-1.458458662033081,
-0.2975110709667206,
-0.34055715799331665,
-0.3582254946231842,
-1.4323079586029053,
0.030098725110292435,
1.270917296409607,
-0.7949712872505188,
-0.289858341217041,
0.42506203055381775,
0.388894647359848,
0.5666791796684265,
0.5535714626312256,
-0.899869978427887,
-0.2597353458404541,
-0.33257943391799927,
-0.3554576337337494,
0.30609363317489624,
1.2212735414505005,
-0.041663289070129395,
-0.9706016778945923,
0.668648362159729,
-0.30926313996315,
0.21521946787834167,
2.009566307067871,
0.03034282475709915,
-0.7227959036827087,
0.351272314786911,
-0.7041290998458862,
1.731613278388977,
1.6533383131027222,
1.2161272764205933,
-0.13174200057983398,
-0.7560585141181946,
0.5663118362426758,
-0.2746175527572632,
-0.31309375166893005,
0.7980921864509583,
0.3860030472278595,
-0.22326330840587616,
-1.4924815893173218,
0.6385522484779358,
1.2790228128433228,
-0.8261644244194031,
-0.7970964908599854,
0.12468166649341583,
-0.9050812125205994,
1.2341187000274658,
0.5504627823829651,
0.2821442782878876,
0.2789786458015442,
1.6244162321090698,
0.7082366943359375,
-0.48747220635414124,
0.5354747176170349,
0.4611048400402069,
-0.19708700478076935,
-2.104689121246338,
-1.0496478080749512,
0.31944790482521057,
-0.4502235949039459,
-1.491060495376587,
1.354688048362732,
-1.0835373401641846,
-1.0094122886657715,
0.5917714834213257,
0.13000273704528809,
1.30157470703125,
0.36287030577659607,
1.7680691480636597,
2.073291540145874,
0.8599410653114319,
0.39213845133781433,
1.252207636833191,
-0.0368754044175148,
-0.4503369927406311,
1.861737608909607,
-0.382899671792984,
0.48729926347732544,
0.9783626198768616,
-0.4008346199989319,
-1.1232060194015503,
-0.8210973143577576,
-1.1269192695617676,
-0.6505304574966431,
1.2338966131210327,
0.11847171187400818,
-0.9814860224723816,
0.19912706315517426,
1.6018927097320557,
0.22999054193496704,
-0.149718776345253,
0.6719765663146973,
0.3925790786743164,
-0.7263961434364319,
-0.07127875089645386,
-0.8590688109397888,
0.4958953857421875,
-0.12790505588054657,
-0.30791187286376953,
0.2206270843744278,
0.5521178245544434,
1.341049075126648,
-0.0631382167339325,
0.12973901629447937,
1.0928330421447754,
-1.3609299659729004,
1.5928595066070557,
-0.5557445287704468,
0.3011990487575531,
-2.417464256286621,
1.3222945928573608,
-0.7564091086387634,
1.9449212551116943,
-2.510019063949585,
0.40528404712677,
-0.5358752012252808,
-0.5264188051223755,
0.1885673552751541,
-0.48144400119781494,
0.13053444027900696,
-0.07068581134080887,
-1.0027458667755127,
0.03540468588471413,
-0.7409100532531738,
0.5959379076957703,
1.255197525024414,
1.4639129638671875,
-1.0911428928375244,
-0.2591136395931244,
-1.8203054666519165,
-0.18281710147857666,
-0.8169830441474915,
0.3659772574901581,
-1.9173253774642944,
-0.18168193101882935,
-1.9856808185577393,
-2.321255683898926,
-1.435749888420105,
-0.9141809344291687,
1.0581417083740234,
0.21704567968845367,
-0.9872329235076904,
1.1585938930511475,
-0.3201582431793213,
-1.792646050453186,
1.064526081085205,
-2.250068426132202
] |
https://github.com/huggingface/datasets/issues/4990 | "no-token" is passed to `huggingface_hub` when token is `None` | Hi @Wauplin, thanks for raising this potential issue.
The choice of passing `"no-token"` instead of `None` was made in this PR:
- #4536
According to the PR description, the reason why it is passed is to avoid that `HfApi.dataset_info` uses the local token when no token should be used. | ## Describe the bug
In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated.
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121
## Expected results
Pass `token=None` to `huggingface_hub`.
## Actual results
`token="no-token"` is passed.
## Environment info
`huggingface_hub v0.10.0dev` | 520 | 49 | "no-token" is passed to `huggingface_hub` when token is `None`
## Describe the bug
In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated.
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121
## Expected results
Pass `token=None` to `huggingface_hub`.
## Actual results
`token="no-token"` is passed.
## Environment info
`huggingface_hub v0.10.0dev`
Hi @Wauplin, thanks for raising this potential issue.
The choice of passing `"no-token"` instead of `None` was made in this PR:
- #4536
According to the PR description, the reason why it is passed is to avoid that `HfApi.dataset_info` uses the local token when no token should be used. | [
-1.0286678075790405,
-0.8273873925209045,
-0.7381153106689453,
1.544644832611084,
-0.07745537161827087,
-1.2260316610336304,
0.17920123040676117,
-0.9486917853355408,
1.7489843368530273,
-0.7688789963722229,
0.4044065773487091,
-1.7423017024993896,
-0.0728849321603775,
-0.602232038974762,
-0.7394129037857056,
-0.8341590762138367,
-0.3924048840999603,
-0.7105423212051392,
0.9917709231376648,
2.543205499649048,
1.2076488733291626,
-1.3259867429733276,
2.6501591205596924,
0.619685709476471,
-0.2595944404602051,
-1.052456259727478,
0.44547346234321594,
0.011852881871163845,
-1.157726764678955,
-0.5051921010017395,
-0.8597598671913147,
0.0206904374063015,
-0.5784456133842468,
-0.6122077703475952,
0.060978002846241,
0.4468134641647339,
-0.2892155349254608,
-0.3832089602947235,
-0.4928954243659973,
-0.8769967555999756,
0.4473392367362976,
-0.428488552570343,
0.9952619671821594,
-0.3636334240436554,
1.879019021987915,
-0.6138942837715149,
0.38667094707489014,
0.7218245267868042,
1.4189175367355347,
0.19200922548770905,
-0.0010032202117145061,
0.30843794345855713,
0.3820209205150604,
-0.0909668430685997,
0.5078190565109253,
1.2185969352722168,
0.5501237511634827,
0.5186729431152344,
0.7100220918655396,
-2.271240234375,
1.3279314041137695,
-0.9603912830352783,
0.11989263445138931,
1.3386870622634888,
-0.8676791191101074,
0.370754599571228,
-1.8214430809020996,
-0.03454478457570076,
0.48333537578582764,
-2.2735161781311035,
0.23444361984729767,
-1.3450334072113037,
-0.48191946744918823,
1.0090720653533936,
0.23921047151088715,
-1.3694851398468018,
0.09354066103696823,
-0.3991716206073761,
1.0217152833938599,
0.46269485354423523,
1.1427175998687744,
-1.6965572834014893,
-0.17473943531513214,
-0.323463499546051,
0.15829603374004364,
-1.3363227844238281,
-1.5703651905059814,
0.5521611571311951,
0.6560167074203491,
0.5981564521789551,
-0.014197282493114471,
0.9486562013626099,
-0.9725820422172546,
0.7970921993255615,
-0.9667314291000366,
-1.7681353092193604,
-1.4450862407684326,
-2.2313220500946045,
-2.316145181655884,
0.7223082780838013,
-0.46442827582359314,
-0.5154390931129456,
1.894770622253418,
-0.9813551306724548,
-1.7192100286483765,
1.1788347959518433,
0.3817358613014221,
-0.08721646666526794,
2.4269423484802246,
0.28051790595054626,
-0.7358540892601013,
0.3587185740470886,
-0.7133884429931641,
0.768793523311615,
-0.5124692916870117,
1.3921869993209839,
0.5220064520835876,
-1.1631072759628296,
1.6097341775894165,
-0.41052407026290894,
0.5593623518943787,
-0.7702193260192871,
-0.4672054648399353,
-0.7473940849304199,
0.29944443702697754,
1.8720824718475342,
-0.417240709066391,
1.578931212425232,
-0.3497772812843323,
-1.4846930503845215,
-1.51547372341156,
0.8884207606315613,
0.4204477071762085,
-0.750781774520874,
0.11586879193782806,
-0.37494802474975586,
0.11203084886074066,
-0.11419133096933365,
1.1039531230926514,
1.200143575668335,
0.628802478313446,
-0.26630663871765137,
-0.8323969841003418,
0.2034572958946228,
-0.06624294072389603,
-0.7063099145889282,
-1.7526417970657349,
-0.37294435501098633,
0.20875459909439087,
0.5312548875808716,
-1.2370414733886719,
1.7616957426071167,
0.8371987342834473,
1.9403029680252075,
1.061739444732666,
-0.3728940784931183,
1.504725694656372,
0.060424551367759705,
1.8384358882904053,
-0.4933071434497833,
0.6222628951072693,
-0.31906455755233765,
-1.2202157974243164,
0.8213162422180176,
-0.2801937162876129,
-1.98907470703125,
-0.7973911166191101,
-0.8107927441596985,
-0.1255040317773819,
-0.7541430592536926,
0.9061399102210999,
-0.20881804823875427,
-1.3837542533874512,
0.21573306620121002,
-0.6432883739471436,
0.13776545226573944,
-1.281980037689209,
0.3304097056388855,
0.739564836025238,
-0.6347467303276062,
0.11931269615888596,
-0.23045015335083008,
-1.2892405986785889,
-0.47189968824386597,
0.27655547857284546,
1.9123843908309937,
-0.6626543998718262,
0.9278499484062195,
0.9830299615859985,
-0.6793569326400757,
0.04081781581044197,
0.3761792778968811,
-0.417384535074234,
0.7959637641906738,
-1.0469834804534912,
-0.42149287462234497,
1.1624008417129517,
-0.18059104681015015,
-0.6962947249412537,
1.4520634412765503,
0.8309786915779114,
-1.0242078304290771,
-0.1922856569290161,
-0.29462704062461853,
-0.7763807773590088,
0.04874677583575249,
-1.5756752490997314,
-0.09214431792497635,
0.2863289415836334,
-1.3882672786712646,
-0.4600164294242859,
-0.27399203181266785,
1.3496721982955933,
-0.2077329009771347,
1.3996214866638184,
-0.2816897928714752,
-0.2821475863456726,
-0.41311532258987427,
-0.38664692640304565,
0.07053617388010025,
-0.20906923711299896,
-0.720518171787262,
0.24511389434337616,
-0.7077701091766357,
0.36247655749320984,
1.4329341650009155,
0.3462754189968109,
-0.002662968821823597,
0.5101334452629089,
1.1328781843185425,
0.3004491925239563,
-0.06452985107898712,
-0.9134736061096191,
-1.4902962446212769,
2.0341410636901855,
-1.3468835353851318,
2.0176894664764404,
0.8112151026725769,
-0.011282403953373432,
-1.7350050210952759,
-1.874183177947998,
1.4199334383010864,
1.2094619274139404,
2.4062891006469727,
0.6976882219314575,
0.4408005177974701,
-0.7206699848175049,
-0.6535022258758545,
0.32465994358062744,
-1.17286217212677,
-0.6916065812110901,
0.16802449524402618,
2.3796944618225098,
1.6897363662719727,
-0.5439223647117615,
-0.17055808007717133,
-1.034777045249939,
1.3566124439239502,
-0.14776276051998138,
0.12103059142827988,
2.049363374710083,
-0.2512241303920746,
-1.0561078786849976,
1.2361289262771606,
-2.2489683628082275,
0.1913471668958664,
1.9960730075836182,
0.18569251894950867,
-0.0054134163074195385,
-1.4031691551208496,
-0.6351704597473145,
-0.2858514189720154,
-0.3845885097980499,
-1.2533771991729736,
0.44357025623321533,
-0.1770401895046234,
-0.8120242953300476,
-1.5617616176605225,
0.17762070894241333,
-1.1599524021148682,
-1.6491484642028809,
0.25253814458847046,
1.8106271028518677,
1.9103156328201294,
-0.7966359853744507,
1.505975604057312,
-0.16590289771556854,
0.1642865687608719,
1.3311667442321777,
1.3135212659835815,
3.1150829792022705,
1.8727611303329468,
-1.2610679864883423,
0.7691833972930908,
-0.24642358720302582,
-0.5350890755653381,
1.225454330444336,
-1.1578304767608643,
1.2707425355911255,
-0.19750064611434937,
-1.2410070896148682,
-1.3480634689331055,
0.9448734521865845,
0.6168861389160156,
0.0258277989923954,
-0.5161505937576294,
1.1419322490692139,
0.22249417006969452,
1.370723009109497,
0.5573864579200745,
-0.2553359866142273,
0.6905026435852051,
-0.4054136276245117,
-0.4145984649658203,
1.5435454845428467,
0.24743260443210602,
-1.3981679677963257,
-2.355661153793335,
-0.2164219468832016,
-0.9034733772277832,
-0.02691664919257164,
-0.6660606265068054,
-1.0829625129699707,
1.6819043159484863,
0.39031022787094116,
-1.2499202489852905,
-0.324928879737854,
-0.33677539229393005,
-0.553611695766449,
2.7007362842559814,
-1.401166319847107,
-0.19205214083194733,
-0.9647206664085388,
-0.5922486186027527,
1.6477563381195068,
-1.174605369567871,
-0.1410367786884308,
-0.9836627244949341,
-0.562536358833313,
-1.293016791343689,
-0.6110047101974487,
-0.028351694345474243,
-0.8222286701202393,
0.7351692318916321,
0.2866821587085724,
-1.2275612354278564,
-0.37675780057907104,
-0.9083172678947449,
0.8022948503494263,
-0.16463840007781982,
0.1867719143629074,
1.873982548713684,
0.5478258728981018,
-0.4262254238128662,
0.7074427604675293,
1.1345679759979248,
0.4823256731033325,
-0.5605564713478088,
0.22121720016002655,
-0.708440899848938,
0.18734657764434814,
-1.4074116945266724,
0.2538277506828308,
-2.8241121768951416,
0.5830692052841187,
-0.09571228176355362,
-0.06992580741643906,
-0.0025166827253997326,
-1.1944044828414917,
1.1997931003570557,
2.6056368350982666,
-1.117872953414917,
0.4094541668891907,
0.32271134853363037,
1.2230876684188843,
-1.624009609222412,
0.19951729476451874,
-0.41851553320884705,
2.120333671569824,
0.0869128406047821,
1.1958816051483154,
-0.46523451805114746,
-2.293344736099243,
0.5312825441360474,
-1.215101718902588,
-1.1231646537780762,
0.9011263251304626,
-0.830691397190094,
0.016437243670225143,
-1.4223942756652832,
-0.2057446986436844,
-0.8603827357292175,
-1.248835563659668,
0.8254616260528564,
0.033631157130002975,
0.5530920028686523,
-0.6779872179031372,
0.33897650241851807,
-2.149561882019043,
-1.4138920307159424,
-0.2866445481777191,
-0.889000415802002,
0.4693869948387146,
-0.27578333020210266,
0.6886647939682007,
-0.1594150960445404,
0.04013146087527275,
0.30486851930618286,
1.4950469732284546,
3.3538143634796143,
0.30406928062438965,
0.4435015320777893,
-0.20125479996204376,
-0.9309558272361755,
1.3782196044921875,
0.9270578026771545,
-0.1193852499127388,
-0.514779269695282,
-0.9860001802444458,
1.2683377265930176,
1.9735124111175537,
1.0545116662979126,
0.06495921313762665,
-0.8484251499176025,
-0.8027207851409912,
-0.06284233927726746,
0.20530596375465393,
0.4387000799179077,
0.8848342895507812,
0.06678988039493561,
0.08944574743509293,
1.337087631225586,
1.2125426530838013,
-0.5908194184303284,
0.445521742105484,
-0.8120591640472412,
-0.39128798246383667,
0.45840325951576233,
0.28724703192710876,
0.04007774591445923,
0.43361759185791016,
-0.9755594730377197,
-0.2765054702758789,
-0.3771710693836212,
-1.0031147003173828,
-0.7698479890823364,
-0.5135011076927185,
-0.2757846713066101,
1.6522351503372192,
-0.029304929077625275,
-0.42002904415130615,
0.005184248089790344,
-0.7903561592102051,
-0.04971381276845932,
-1.0532220602035522,
0.15711408853530884,
-0.119827039539814,
-0.08625005185604095,
-0.08041893690824509,
1.7364352941513062,
-0.9681869149208069,
-2.1232550144195557,
0.1789059042930603,
0.2884693741798401,
-0.4055429995059967,
0.1996118128299713,
1.707328200340271,
0.4539186358451843,
1.3810030221939087,
1.3458954095840454,
1.0312391519546509,
-0.7048443555831909,
-1.3256086111068726,
0.6455304622650146,
1.0190212726593018,
-1.3453909158706665,
0.8358811140060425,
0.02946004644036293,
-0.38708746433258057,
0.6919765472412109,
1.2849113941192627,
0.39305350184440613,
-1.8806668519973755,
0.68947434425354,
-0.8470920324325562,
0.7979657053947449,
0.7130857110023499,
0.7540691494941711,
0.24219979345798492,
0.7760530710220337,
-1.2236416339874268,
-1.1728535890579224,
-0.7846090197563171,
-0.6052039861679077,
1.9088276624679565,
-0.2034752070903778,
0.5187826752662659,
-0.18872037529945374,
-1.3687233924865723,
-0.09552837163209915,
0.7945557236671448,
0.43084532022476196,
-0.4781147539615631,
0.7539173364639282,
-0.6059966683387756,
-0.958760142326355,
-1.4023683071136475,
-0.4390343725681305,
-0.9874306917190552,
-0.9558958411216736,
1.0642808675765991,
0.8309597969055176,
0.27447131276130676,
1.8771657943725586,
0.6997010111808777,
0.2775614261627197,
-2.6028029918670654,
0.880795419216156,
0.44021087884902954,
-0.04225057736039162,
0.9218096733093262,
0.3210422694683075,
1.0903935432434082,
-0.004019948188215494,
0.5446985960006714,
-2.407517671585083,
2.2510509490966797,
-0.21017858386039734,
0.6634081602096558,
0.05789843946695328,
-0.2830096483230591,
1.0209623575210571,
0.4769836962223053,
0.5273675918579102,
-1.1892833709716797,
0.7433050870895386,
-0.5935355424880981,
1.151489019393921,
0.8196252584457397,
-0.8381614685058594,
0.025258153676986694,
1.3171204328536987,
0.493197500705719,
-0.5061578154563904,
-0.8562918901443481,
-0.9065847992897034,
0.9429453015327454,
1.6790125370025635,
-0.041764385998249054,
0.03437640890479088,
0.9431134462356567,
0.6620476245880127,
-1.39692223072052,
0.1320522129535675,
-0.6515801548957825,
-0.7562549114227295,
1.6304302215576172,
2.100996494293213,
-0.1353052258491516,
-0.2891625463962555,
-0.8385237455368042,
-1.1081562042236328,
0.7673407793045044,
0.08432428538799286,
0.1276426762342453,
0.6684234142303467,
-0.7681850790977478,
1.2400223016738892,
0.783805251121521,
0.9736462831497192,
0.18930989503860474,
0.3695272207260132,
0.36811140179634094,
-0.35096487402915955,
-1.1619746685028076,
-0.26800718903541565,
-1.2066220045089722,
-2.626838445663452,
0.4805820882320404,
-0.22290843725204468,
-1.4624228477478027,
0.017923690378665924,
-1.0361993312835693,
0.8487575054168701,
-0.6263334155082703,
-1.083592414855957,
-1.5145343542099,
0.1941978484392166,
-0.1189618930220604,
0.8449617624282837,
-1.5799580812454224,
-0.10456033051013947,
1.2586802244186401,
0.9835385084152222,
-0.6729725003242493,
0.9639089107513428,
0.2798655331134796,
1.136946678161621,
0.9234486222267151,
-0.3494722843170166,
0.5199425220489502,
0.02420695498585701,
-1.3182382583618164,
0.41866880655288696,
1.1535502672195435,
0.23114734888076782,
1.4443128108978271,
-0.5608099699020386,
0.05370349436998367,
0.4189378619194031,
-0.46208155155181885,
-0.5628930926322937,
-0.5730270147323608,
0.6479153037071228,
0.08375313133001328,
-0.9767441153526306,
0.15599621832370758,
-0.0946858748793602,
-0.201701819896698,
0.24295027554035187,
-1.5133203268051147,
-0.20440907776355743,
-0.3680298328399658,
-0.6188114881515503,
-1.2301409244537354,
-0.022034525871276855,
1.2902003526687622,
-0.7346870303153992,
-0.3239275813102722,
0.5405519604682922,
0.3653668165206909,
0.566548764705658,
0.5226078629493713,
-0.7146052122116089,
-0.44886866211891174,
-0.29520246386528015,
-0.33102327585220337,
0.34512799978256226,
1.3032057285308838,
-0.12839429080486298,
-0.9664341807365417,
0.7527868151664734,
-0.4104621708393097,
0.07433655858039856,
2.016326427459717,
0.08296430110931396,
-0.8472603559494019,
0.198552668094635,
-0.6171483397483826,
1.93416166305542,
1.6858737468719482,
1.3801056146621704,
-0.06304650008678436,
-0.9730060696601868,
0.7573560476303101,
-0.3177897334098816,
-0.41541361808776855,
0.9932907223701477,
0.35041141510009766,
-0.1848771721124649,
-1.4147331714630127,
0.5281513333320618,
1.382864236831665,
-0.8231096267700195,
-0.8428781628608704,
0.0922488123178482,
-0.9323147535324097,
1.10465407371521,
0.727534294128418,
0.30631303787231445,
0.23716974258422852,
1.5923304557800293,
0.7441267967224121,
-0.45968613028526306,
0.5586297512054443,
0.4610292613506317,
-0.1549551784992218,
-2.0465266704559326,
-1.076175332069397,
0.3463195562362671,
-0.45739421248435974,
-1.5588113069534302,
1.3598655462265015,
-1.2349183559417725,
-1.013343334197998,
0.5531978607177734,
0.11099262535572052,
1.471254587173462,
0.3449134826660156,
1.63467276096344,
2.093761444091797,
0.947983980178833,
0.262763649225235,
1.2621760368347168,
-0.1288507729768753,
-0.46650242805480957,
1.8561451435089111,
-0.46349987387657166,
0.4711398780345917,
1.0247046947479248,
-0.3452610969543457,
-1.0578718185424805,
-0.7989888787269592,
-1.2378275394439697,
-0.6292427778244019,
1.2614082098007202,
0.12017326802015305,
-1.1056634187698364,
0.2503916621208191,
1.608910083770752,
-0.02365974336862564,
-0.30653926730155945,
0.6485360860824585,
0.5363135933876038,
-0.8462274074554443,
-0.014615611173212528,
-0.8558688163757324,
0.48383012413978577,
-0.05906808003783226,
-0.3003274202346802,
0.33218568563461304,
0.5469269156455994,
1.3206156492233276,
-0.031603164970874786,
0.18171516060829163,
1.213297724723816,
-1.3865622282028198,
1.430655598640442,
-0.65779048204422,
0.17078173160552979,
-2.4530277252197266,
1.445594310760498,
-0.7881577014923096,
1.8607029914855957,
-2.530440330505371,
0.45009514689445496,
-0.6431475877761841,
-0.4288552701473236,
0.3314654529094696,
-0.3634706437587738,
0.19140024483203888,
-0.1851736307144165,
-1.0952799320220947,
-0.1439623236656189,
-0.739859402179718,
0.5840489864349365,
1.0774964094161987,
1.4001836776733398,
-1.1066367626190186,
-0.29218411445617676,
-1.7482513189315796,
-0.12402285635471344,
-0.7172250151634216,
0.27597618103027344,
-1.977329969406128,
-0.23538389801979065,
-1.970812439918518,
-2.3433947563171387,
-1.4571322202682495,
-0.785317599773407,
1.0039098262786865,
0.20418593287467957,
-0.9201526045799255,
1.1307412385940552,
-0.43060579895973206,
-1.842284083366394,
1.0843809843063354,
-2.0970499515533447
] |
https://github.com/huggingface/datasets/issues/4990 | "no-token" is passed to `huggingface_hub` when token is `None` | Hi @albertvillanova , thanks for finding the original issue :+1:
As of next release of `huggingface_hub`, the `token` argument will be deprecated in favor of the `use_auth_token` argument in `dataset_info` method. This change as been done by @SBrandeis in https://github.com/huggingface/huggingface_hub/pull/928. `use_auth_token` is a bit different and allow the case "don't sent the cached token by default".
If you want to strictly avoid sending the cached token from `datasets`, you can use:
```py
# token=token if token else "no-token", <- will fail because token is not valid
use_auth_token=token if token else False, # using the new `use_auth_token` parameter
```
And as a note, I am currently updating the "don't send the cached token by default"-rule to "don't send the cached token on public repos by default but use it in private ones" in https://github.com/huggingface/huggingface_hub/pull/1064. This will not change the fact that `use_auth_token=False` doesn't send the token at all.
| ## Describe the bug
In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated.
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121
## Expected results
Pass `token=None` to `huggingface_hub`.
## Actual results
`token="no-token"` is passed.
## Environment info
`huggingface_hub v0.10.0dev` | 520 | 147 | "no-token" is passed to `huggingface_hub` when token is `None`
## Describe the bug
In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated.
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121
## Expected results
Pass `token=None` to `huggingface_hub`.
## Actual results
`token="no-token"` is passed.
## Environment info
`huggingface_hub v0.10.0dev`
Hi @albertvillanova , thanks for finding the original issue :+1:
As of next release of `huggingface_hub`, the `token` argument will be deprecated in favor of the `use_auth_token` argument in `dataset_info` method. This change as been done by @SBrandeis in https://github.com/huggingface/huggingface_hub/pull/928. `use_auth_token` is a bit different and allow the case "don't sent the cached token by default".
If you want to strictly avoid sending the cached token from `datasets`, you can use:
```py
# token=token if token else "no-token", <- will fail because token is not valid
use_auth_token=token if token else False, # using the new `use_auth_token` parameter
```
And as a note, I am currently updating the "don't send the cached token by default"-rule to "don't send the cached token on public repos by default but use it in private ones" in https://github.com/huggingface/huggingface_hub/pull/1064. This will not change the fact that `use_auth_token=False` doesn't send the token at all.
| [
-1.046112060546875,
-0.8600645661354065,
-0.7056738138198853,
1.5174007415771484,
-0.10961440205574036,
-1.2408546209335327,
0.21016228199005127,
-1.0208213329315186,
1.7362996339797974,
-0.7339392900466919,
0.3778035342693329,
-1.7053749561309814,
-0.06479693204164505,
-0.6207773685455322,
-0.7442438006401062,
-0.7901045083999634,
-0.37437450885772705,
-0.7203963398933411,
1.002916932106018,
2.4659383296966553,
1.2167479991912842,
-1.3488094806671143,
2.6702077388763428,
0.6639512777328491,
-0.2618946433067322,
-1.045116662979126,
0.45974743366241455,
-0.02526506409049034,
-1.1475963592529297,
-0.4795314371585846,
-0.9071433544158936,
0.039110928773880005,
-0.6021643877029419,
-0.5768117904663086,
0.03571999818086624,
0.5128970742225647,
-0.30682650208473206,
-0.40572014451026917,
-0.5112887620925903,
-0.8571262359619141,
0.421973317861557,
-0.4071418046951294,
0.9902468919754028,
-0.34561219811439514,
1.8259152173995972,
-0.6048421859741211,
0.36757051944732666,
0.7522112131118774,
1.3919225931167603,
0.18738384544849396,
0.017689771950244904,
0.25025123357772827,
0.4373428523540497,
-0.10718900710344315,
0.5462310314178467,
1.2491459846496582,
0.584327220916748,
0.5300155282020569,
0.6988756060600281,
-2.277214527130127,
1.3200528621673584,
-0.9545058608055115,
0.13736213743686676,
1.2978750467300415,
-0.8564692735671997,
0.33350223302841187,
-1.8148972988128662,
0.009045039303600788,
0.4911288917064667,
-2.2527406215667725,
0.2683243751525879,
-1.372263789176941,
-0.4457342326641083,
0.9878876805305481,
0.22345517575740814,
-1.3344138860702515,
0.1024484932422638,
-0.3969137966632843,
1.0464191436767578,
0.47993606328964233,
1.1279376745224,
-1.6838265657424927,
-0.13108782470226288,
-0.28252094984054565,
0.19214165210723877,
-1.308260440826416,
-1.5708637237548828,
0.5653654932975769,
0.6520179510116577,
0.5832812190055847,
-0.09475710242986679,
1.0639365911483765,
-1.0183289051055908,
0.7949808239936829,
-0.9846639037132263,
-1.743540644645691,
-1.4475126266479492,
-2.1714229583740234,
-2.326307535171509,
0.6682418584823608,
-0.5163531303405762,
-0.4823226034641266,
1.9144799709320068,
-0.9851351976394653,
-1.7178349494934082,
1.143669843673706,
0.3911488354206085,
-0.04584716632962227,
2.365186929702759,
0.24229151010513306,
-0.7353478670120239,
0.3507291376590729,
-0.7434194684028625,
0.7436084747314453,
-0.4925612509250641,
1.386337399482727,
0.4534035921096802,
-1.1355057954788208,
1.5779608488082886,
-0.37366214394569397,
0.6074704527854919,
-0.7263295650482178,
-0.4674347937107086,
-0.7016008496284485,
0.2693534195423126,
1.891668438911438,
-0.42735064029693604,
1.5530481338500977,
-0.4159006178379059,
-1.4737474918365479,
-1.5398648977279663,
0.8996277451515198,
0.43617650866508484,
-0.7341502904891968,
0.09795008599758148,
-0.41443368792533875,
0.12153684347867966,
-0.204510897397995,
1.0910204648971558,
1.2739923000335693,
0.6802559494972229,
-0.2643011808395386,
-0.7630877494812012,
0.17942248284816742,
-0.08529982715845108,
-0.7084364891052246,
-1.7918555736541748,
-0.3315710127353668,
0.23817303776741028,
0.5828375220298767,
-1.1706026792526245,
1.8120908737182617,
0.8099836111068726,
1.9487755298614502,
1.034167766571045,
-0.3950308561325073,
1.5030715465545654,
0.08892737329006195,
1.7975010871887207,
-0.49263909459114075,
0.5930296182632446,
-0.3489050567150116,
-1.2242377996444702,
0.850049614906311,
-0.27555322647094727,
-1.9587253332138062,
-0.7283827662467957,
-0.7973541021347046,
-0.15718835592269897,
-0.7511894106864929,
0.8951548933982849,
-0.22375226020812988,
-1.4457836151123047,
0.1918448954820633,
-0.6292470097541809,
0.19877341389656067,
-1.2051845788955688,
0.31096890568733215,
0.7598461508750916,
-0.6544477343559265,
0.17200838029384613,
-0.19531014561653137,
-1.2262412309646606,
-0.5000417232513428,
0.3543747663497925,
1.8712611198425293,
-0.6772061586380005,
0.9269384741783142,
1.0242938995361328,
-0.7040160894393921,
0.02817242592573166,
0.3740214407444,
-0.3966090977191925,
0.7651671767234802,
-1.0533214807510376,
-0.4098058342933655,
1.1905255317687988,
-0.22368855774402618,
-0.6565488576889038,
1.4438868761062622,
0.793595016002655,
-1.0122284889221191,
-0.16790105402469635,
-0.26464852690696716,
-0.7629482746124268,
0.04784800484776497,
-1.5296316146850586,
-0.05241547152400017,
0.37036827206611633,
-1.4318821430206299,
-0.48677584528923035,
-0.2658216953277588,
1.3456215858459473,
-0.2038823664188385,
1.419287919998169,
-0.26575228571891785,
-0.23681524395942688,
-0.34376242756843567,
-0.3815164268016815,
0.06459884345531464,
-0.22337818145751953,
-0.6406230330467224,
0.20540151000022888,
-0.7521681189537048,
0.36913543939590454,
1.4405046701431274,
0.2682802677154541,
-0.05418308079242706,
0.4879358112812042,
1.1556679010391235,
0.3559105396270752,
-0.03940774127840996,
-0.9180108308792114,
-1.474975347518921,
1.9752576351165771,
-1.3690966367721558,
2.0353634357452393,
0.8094040751457214,
-0.0028391205705702305,
-1.7756284475326538,
-1.904493808746338,
1.414921760559082,
1.1618916988372803,
2.4179539680480957,
0.6613278388977051,
0.41476961970329285,
-0.7260597348213196,
-0.59694504737854,
0.3522939682006836,
-1.1083874702453613,
-0.6539956331253052,
0.20021121203899384,
2.3797123432159424,
1.677449107170105,
-0.5162835717201233,
-0.21366968750953674,
-1.037954568862915,
1.398055076599121,
-0.16649435460567474,
0.16998979449272156,
2.0141563415527344,
-0.2457539439201355,
-1.0113593339920044,
1.2683019638061523,
-2.278667688369751,
0.177936851978302,
1.990807056427002,
0.13734789192676544,
0.057602815330028534,
-1.3735876083374023,
-0.5937376618385315,
-0.244292750954628,
-0.45594078302383423,
-1.258522629737854,
0.42251890897750854,
-0.17051193118095398,
-0.7797355651855469,
-1.5415501594543457,
0.19200745224952698,
-1.1645866632461548,
-1.6406996250152588,
0.2638617157936096,
1.9136836528778076,
1.8974237442016602,
-0.8525077700614929,
1.556219458580017,
-0.21068061888217926,
0.15411116182804108,
1.3495736122131348,
1.3031889200210571,
3.1070919036865234,
1.8600796461105347,
-1.3266215324401855,
0.7486165761947632,
-0.25361353158950806,
-0.5176295042037964,
1.2309515476226807,
-1.1881840229034424,
1.270586371421814,
-0.19347074627876282,
-1.2126022577285767,
-1.347521185874939,
0.9300103783607483,
0.6118226051330566,
0.07206400483846664,
-0.52410489320755,
1.1224300861358643,
0.23124143481254578,
1.3652522563934326,
0.6089757084846497,
-0.3154056668281555,
0.7077735066413879,
-0.3584677577018738,
-0.4074538052082062,
1.5076948404312134,
0.22735755145549774,
-1.3564587831497192,
-2.3265671730041504,
-0.2128746211528778,
-0.8694717884063721,
0.009511006064713001,
-0.6834090352058411,
-1.0702588558197021,
1.6115165948867798,
0.35919439792633057,
-1.2337702512741089,
-0.3340040445327759,
-0.31691887974739075,
-0.5000098347663879,
2.6711437702178955,
-1.343993067741394,
-0.19569167494773865,
-0.9858683943748474,
-0.5931804776191711,
1.6446653604507446,
-1.2133798599243164,
-0.2132801115512848,
-1.0551873445510864,
-0.5197029709815979,
-1.3120299577713013,
-0.6371679902076721,
-0.0021948209032416344,
-0.8039499521255493,
0.7517881393432617,
0.3009602725505829,
-1.262392282485962,
-0.38606730103492737,
-0.885552167892456,
0.9062973260879517,
-0.2001541256904602,
0.16458521783351898,
1.9145265817642212,
0.43849074840545654,
-0.4264523983001709,
0.7357202172279358,
1.1034963130950928,
0.47679218649864197,
-0.5452156066894531,
0.22480078041553497,
-0.6969888806343079,
0.2626911401748657,
-1.4835948944091797,
0.22342011332511902,
-2.855194568634033,
0.6054404973983765,
-0.09115486592054367,
-0.07877317070960999,
-0.031904127448797226,
-1.304353952407837,
1.1579151153564453,
2.638021469116211,
-1.1277027130126953,
0.38916265964508057,
0.35497111082077026,
1.2205836772918701,
-1.6073094606399536,
0.20342198014259338,
-0.44925808906555176,
2.0776021480560303,
0.10861483961343765,
1.2526686191558838,
-0.44534480571746826,
-2.3583898544311523,
0.5112738609313965,
-1.194322109222412,
-1.1421611309051514,
0.9380627870559692,
-0.8184253573417664,
0.030800428241491318,
-1.414482593536377,
-0.2584069073200226,
-0.8940352201461792,
-1.239867091178894,
0.7660812735557556,
0.04707103595137596,
0.5431626439094543,
-0.7424010038375854,
0.38438621163368225,
-2.1443283557891846,
-1.3984121084213257,
-0.2562161684036255,
-0.873561680316925,
0.46502694487571716,
-0.31090959906578064,
0.629779577255249,
-0.1416652947664261,
0.03780130296945572,
0.29496628046035767,
1.4969230890274048,
3.378429889678955,
0.294295072555542,
0.36149850487709045,
-0.2314765453338623,
-0.940129816532135,
1.4107303619384766,
0.908398449420929,
-0.12025926262140274,
-0.5070400238037109,
-0.961836040019989,
1.2672396898269653,
1.9684033393859863,
1.0231819152832031,
0.04671163111925125,
-0.8383461236953735,
-0.8261570334434509,
-0.07489333301782608,
0.14403919875621796,
0.4433859586715698,
0.896894097328186,
0.12264993041753769,
0.08905206620693207,
1.3321001529693604,
1.1647189855575562,
-0.5282596945762634,
0.45228204131126404,
-0.8474279642105103,
-0.3924497365951538,
0.4533444344997406,
0.32698941230773926,
0.01294539775699377,
0.40040528774261475,
-0.9552232027053833,
-0.24494150280952454,
-0.44272518157958984,
-0.990408718585968,
-0.7399672269821167,
-0.46254563331604004,
-0.25802087783813477,
1.6286059617996216,
-0.027319863438606262,
-0.4448142647743225,
-0.017134971916675568,
-0.7521775960922241,
-0.0730520561337471,
-1.0261446237564087,
0.22000811994075775,
-0.1293083280324936,
-0.0722220242023468,
-0.11051381379365921,
1.6673709154129028,
-0.9350571632385254,
-2.056333541870117,
0.17918181419372559,
0.23209832608699799,
-0.38592106103897095,
0.21852530539035797,
1.7453570365905762,
0.4392869472503662,
1.3803138732910156,
1.3868434429168701,
1.0224336385726929,
-0.6411292552947998,
-1.2584646940231323,
0.6966492533683777,
0.9846968650817871,
-1.358580470085144,
0.8402276635169983,
-0.01696932129561901,
-0.43770524859428406,
0.7239151000976562,
1.2624152898788452,
0.41661277413368225,
-1.9552279710769653,
0.6745328307151794,
-0.9201748967170715,
0.7743707299232483,
0.7506586313247681,
0.7700758576393127,
0.23831400275230408,
0.8086116313934326,
-1.1815990209579468,
-1.1797822713851929,
-0.7171586751937866,
-0.6809191107749939,
1.9311527013778687,
-0.2460123598575592,
0.5443364977836609,
-0.23195309937000275,
-1.3717459440231323,
-0.19169405102729797,
0.8275418877601624,
0.4253450334072113,
-0.5356259942054749,
0.7236222624778748,
-0.6029040813446045,
-0.8828406929969788,
-1.3336405754089355,
-0.4364520311355591,
-1.033934473991394,
-0.9912651181221008,
0.9911004900932312,
0.8044731020927429,
0.3363814651966095,
1.8802614212036133,
0.6781994700431824,
0.31283092498779297,
-2.5815296173095703,
0.895267128944397,
0.47541630268096924,
-0.11326774954795837,
0.9271268248558044,
0.372257262468338,
1.0836617946624756,
0.04028860107064247,
0.619845986366272,
-2.4606759548187256,
2.2873551845550537,
-0.18087556958198547,
0.6419564485549927,
0.011095776222646236,
-0.33418339490890503,
1.057827115058899,
0.4564511477947235,
0.44212302565574646,
-1.1657048463821411,
0.7713808417320251,
-0.5865399837493896,
1.1352167129516602,
0.7768646478652954,
-0.8604404926300049,
0.006245410069823265,
1.3441667556762695,
0.4862181842327118,
-0.5101590752601624,
-0.8985263705253601,
-0.9479714035987854,
0.9521409869194031,
1.7072643041610718,
-0.030341099947690964,
-0.005695641040802002,
0.9120802879333496,
0.6744497418403625,
-1.3693315982818604,
0.16535834968090057,
-0.600995659828186,
-0.7478532195091248,
1.663025975227356,
2.076913356781006,
-0.16886691749095917,
-0.22141163051128387,
-0.8427205085754395,
-1.0998289585113525,
0.7130472660064697,
0.07291705906391144,
0.0824933722615242,
0.6382448673248291,
-0.7230910062789917,
1.2081234455108643,
0.7574069499969482,
0.9568197131156921,
0.13727043569087982,
0.33400043845176697,
0.3674866855144501,
-0.3854108154773712,
-1.1754103899002075,
-0.23341502249240875,
-1.166043996810913,
-2.5732839107513428,
0.4908410608768463,
-0.14426247775554657,
-1.4573047161102295,
0.06479425728321075,
-1.02682363986969,
0.8796698451042175,
-0.6558398008346558,
-1.119945764541626,
-1.5517827272415161,
0.2222055047750473,
-0.06625839322805405,
0.8738563656806946,
-1.5294430255889893,
-0.10410034656524658,
1.2376325130462646,
0.9452609419822693,
-0.7289592027664185,
0.9764885306358337,
0.2433607578277588,
1.1536517143249512,
0.9463187456130981,
-0.3231596350669861,
0.530013382434845,
0.03949309140443802,
-1.3213430643081665,
0.39789336919784546,
1.179656982421875,
0.22809191048145294,
1.4907314777374268,
-0.5333151817321777,
0.04948684945702553,
0.45704400539398193,
-0.5291165709495544,
-0.5891379714012146,
-0.5233386754989624,
0.5747728943824768,
0.0653584897518158,
-0.9761459827423096,
0.11836417764425278,
-0.11248131841421127,
-0.26372358202934265,
0.22699551284313202,
-1.5720717906951904,
-0.19139909744262695,
-0.3358007073402405,
-0.6041890382766724,
-1.2304257154464722,
0.06093626469373703,
1.3133076429367065,
-0.651118814945221,
-0.38743311166763306,
0.5479033589363098,
0.33459654450416565,
0.5011974573135376,
0.5345335006713867,
-0.734744131565094,
-0.4220016300678253,
-0.2925773561000824,
-0.38791999220848083,
0.37762269377708435,
1.339348554611206,
-0.127285435795784,
-0.9524155855178833,
0.7063396573066711,
-0.448331356048584,
0.05180903896689415,
2.0012924671173096,
0.05283248424530029,
-0.8354055285453796,
0.1784893423318863,
-0.6495872735977173,
1.921507716178894,
1.7404991388320923,
1.3872766494750977,
-0.07079819589853287,
-0.9314894676208496,
0.7556528449058533,
-0.39958035945892334,
-0.44106003642082214,
1.0450289249420166,
0.34053218364715576,
-0.21700142323970795,
-1.451262354850769,
0.5765074491500854,
1.3516823053359985,
-0.8443938493728638,
-0.8130545616149902,
0.09965652227401733,
-0.862359344959259,
1.148578405380249,
0.7217364311218262,
0.26557457447052,
0.2677162289619446,
1.5598939657211304,
0.7840860486030579,
-0.4002026915550232,
0.6276138424873352,
0.43628543615341187,
-0.17534837126731873,
-2.0835936069488525,
-1.1265822649002075,
0.3806358277797699,
-0.48523011803627014,
-1.5842927694320679,
1.4023939371109009,
-1.2148605585098267,
-1.0770955085754395,
0.5286346077919006,
0.06877382099628448,
1.429884433746338,
0.3880315124988556,
1.6207307577133179,
2.0937981605529785,
0.9311382174491882,
0.28701287508010864,
1.2325736284255981,
-0.16147136688232422,
-0.46558839082717896,
1.8453290462493896,
-0.5093308091163635,
0.5010982155799866,
1.0472588539123535,
-0.3180520236492157,
-1.037042498588562,
-0.8154379725456238,
-1.3097822666168213,
-0.6385493874549866,
1.2511887550354004,
0.07966230809688568,
-1.1021733283996582,
0.3088653087615967,
1.5897527933120728,
0.010386145673692226,
-0.2713494300842285,
0.7419319748878479,
0.49074938893318176,
-0.8750665187835693,
-0.013376926071941853,
-0.7639127373695374,
0.5199475884437561,
-0.11207480728626251,
-0.3386491537094116,
0.3933987021446228,
0.5685675740242004,
1.3397232294082642,
-0.07366791367530823,
0.0913608968257904,
1.1557505130767822,
-1.4333927631378174,
1.4743815660476685,
-0.7347925901412964,
0.21446456015110016,
-2.462476968765259,
1.4164423942565918,
-0.7954019904136658,
1.9299497604370117,
-2.5374209880828857,
0.48511406779289246,
-0.6015352010726929,
-0.47542843222618103,
0.3056674301624298,
-0.31920337677001953,
0.18403150141239166,
-0.1906416416168213,
-1.0845626592636108,
-0.13764585554599762,
-0.718648374080658,
0.6092537045478821,
1.0472296476364136,
1.4306977987289429,
-1.1608818769454956,
-0.2914305031299591,
-1.7540619373321533,
-0.1274319738149643,
-0.7395818829536438,
0.2725871801376343,
-1.9892159700393677,
-0.23504827916622162,
-1.9757094383239746,
-2.359443426132202,
-1.3966784477233887,
-0.7697069644927979,
0.9822989702224731,
0.18588441610336304,
-0.9098374247550964,
1.1766875982284546,
-0.40867891907691956,
-1.8236420154571533,
1.0379014015197754,
-2.131983757019043
] |
https://github.com/huggingface/datasets/issues/4990 | "no-token" is passed to `huggingface_hub` when token is `None` | What is current strategy in term of updating `huggingface_hub` version in `datasets` ? I don't want to break stuff in the next release so let's find a proper solution :) | ## Describe the bug
In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated.
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121
## Expected results
Pass `token=None` to `huggingface_hub`.
## Actual results
`token="no-token"` is passed.
## Environment info
`huggingface_hub v0.10.0dev` | 520 | 30 | "no-token" is passed to `huggingface_hub` when token is `None`
## Describe the bug
In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated.
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121
## Expected results
Pass `token=None` to `huggingface_hub`.
## Actual results
`token="no-token"` is passed.
## Environment info
`huggingface_hub v0.10.0dev`
What is current strategy in term of updating `huggingface_hub` version in `datasets` ? I don't want to break stuff in the next release so let's find a proper solution :) | [
-1.034340262413025,
-0.8572297096252441,
-0.7390576601028442,
1.4871692657470703,
-0.04859102517366409,
-1.250885248184204,
0.1986766755580902,
-0.9601030349731445,
1.78180730342865,
-0.7790612578392029,
0.3823046088218689,
-1.7431306838989258,
-0.07612845301628113,
-0.5852135419845581,
-0.7167830467224121,
-0.8241804242134094,
-0.3947789669036865,
-0.696048378944397,
0.9516152143478394,
2.530552864074707,
1.2160694599151611,
-1.326544165611267,
2.67702579498291,
0.6546671390533447,
-0.255266010761261,
-1.0623300075531006,
0.4186568558216095,
0.02000255137681961,
-1.1132766008377075,
-0.48713162541389465,
-0.8631095290184021,
0.04604773968458176,
-0.5791181325912476,
-0.6217874884605408,
0.033630549907684326,
0.45785292983055115,
-0.3148743510246277,
-0.3869801163673401,
-0.48452168703079224,
-0.8650329113006592,
0.44597700238227844,
-0.44197213649749756,
0.9972440004348755,
-0.38721856474876404,
1.850844383239746,
-0.5747492909431458,
0.36696603894233704,
0.7564849257469177,
1.4112435579299927,
0.1748589277267456,
0.006758729927241802,
0.30388471484184265,
0.3594728708267212,
-0.07561691105365753,
0.5140708684921265,
1.269492268562317,
0.5543835759162903,
0.4970366954803467,
0.6971607208251953,
-2.277804374694824,
1.3283841609954834,
-0.9741772413253784,
0.15626701712608337,
1.2907720804214478,
-0.8359861969947815,
0.35031718015670776,
-1.7828179597854614,
-0.031164713203907013,
0.5186195373535156,
-2.29079532623291,
0.25377920269966125,
-1.367496132850647,
-0.46368852257728577,
0.9868095517158508,
0.2161673605442047,
-1.358459234237671,
0.08884221315383911,
-0.37244683504104614,
1.0011738538742065,
0.46371039748191833,
1.1442992687225342,
-1.708486557006836,
-0.14617682993412018,
-0.308040052652359,
0.15133808553218842,
-1.3425116539001465,
-1.566335916519165,
0.4978858232498169,
0.6402900218963623,
0.6337007880210876,
0.00797859113663435,
0.9578371047973633,
-0.9748519659042358,
0.772200345993042,
-0.9579315185546875,
-1.7314077615737915,
-1.4382959604263306,
-2.224022388458252,
-2.3292229175567627,
0.7111851572990417,
-0.45194709300994873,
-0.5401597023010254,
1.9135302305221558,
-0.997189462184906,
-1.7656528949737549,
1.2197692394256592,
0.39870142936706543,
-0.04495221748948097,
2.4066638946533203,
0.26930373907089233,
-0.7537680864334106,
0.37922367453575134,
-0.7180320024490356,
0.7604798674583435,
-0.5175283551216125,
1.40171217918396,
0.5585827231407166,
-1.1248830556869507,
1.6039692163467407,
-0.4675286114215851,
0.5820898413658142,
-0.7492891550064087,
-0.47501397132873535,
-0.7687860727310181,
0.3127957880496979,
1.8415586948394775,
-0.4166123569011688,
1.585724115371704,
-0.3562637269496918,
-1.4796624183654785,
-1.515999436378479,
0.8957031965255737,
0.40724068880081177,
-0.7667372822761536,
0.10225207358598709,
-0.3826599717140198,
0.10765098035335541,
-0.14807650446891785,
1.0696358680725098,
1.2032856941223145,
0.6205133199691772,
-0.26583924889564514,
-0.8502203822135925,
0.22094105184078217,
-0.09680600464344025,
-0.6869544386863708,
-1.7830915451049805,
-0.3432358503341675,
0.252483993768692,
0.5001614093780518,
-1.2395108938217163,
1.7503381967544556,
0.8351099491119385,
1.943522572517395,
1.0346037149429321,
-0.35784780979156494,
1.515909194946289,
0.050971005111932755,
1.8615919351577759,
-0.4623311758041382,
0.6422880291938782,
-0.2766934633255005,
-1.2104151248931885,
0.830005407333374,
-0.30872130393981934,
-2.0231611728668213,
-0.799153208732605,
-0.824042797088623,
-0.10560599714517593,
-0.7943896055221558,
0.9068467020988464,
-0.22192589938640594,
-1.4255168437957764,
0.2529154419898987,
-0.6388134956359863,
0.17808383703231812,
-1.288999080657959,
0.29937198758125305,
0.742091953754425,
-0.6321845054626465,
0.09516842663288116,
-0.1928076148033142,
-1.2943192720413208,
-0.42792198061943054,
0.29738327860832214,
1.9178342819213867,
-0.6778660416603088,
0.9055442214012146,
0.9973431825637817,
-0.677313506603241,
0.08791694790124893,
0.356453001499176,
-0.36375892162323,
0.808601975440979,
-1.0373752117156982,
-0.36521169543266296,
1.186527967453003,
-0.16432324051856995,
-0.7128910422325134,
1.4614008665084839,
0.8511665463447571,
-1.024537205696106,
-0.14439962804317474,
-0.29573264718055725,
-0.7673749923706055,
0.02636396884918213,
-1.5558587312698364,
-0.07105818390846252,
0.28253573179244995,
-1.3414268493652344,
-0.4488356113433838,
-0.30025428533554077,
1.336496353149414,
-0.20425106585025787,
1.4174281358718872,
-0.3073754608631134,
-0.24890904128551483,
-0.4186944365501404,
-0.3940128982067108,
0.10931330174207687,
-0.23629839718341827,
-0.715668797492981,
0.21738368272781372,
-0.708998441696167,
0.3724561631679535,
1.4159202575683594,
0.35634350776672363,
0.026321131736040115,
0.5286284685134888,
1.1278682947158813,
0.2790227234363556,
-0.06103423237800598,
-0.8921552300453186,
-1.503812551498413,
2.0416383743286133,
-1.3367501497268677,
2.0164761543273926,
0.7941016554832458,
-0.009283185005187988,
-1.7325490713119507,
-1.8837578296661377,
1.417281985282898,
1.203675627708435,
2.3872318267822266,
0.6831187605857849,
0.43012797832489014,
-0.7701528668403625,
-0.6740309000015259,
0.2936137318611145,
-1.1627941131591797,
-0.6544600129127502,
0.17562833428382874,
2.374525785446167,
1.6922063827514648,
-0.5246458649635315,
-0.14464856684207916,
-1.0474636554718018,
1.3632526397705078,
-0.18966175615787506,
0.14234231412410736,
2.0338878631591797,
-0.28542768955230713,
-1.073695421218872,
1.2475026845932007,
-2.288342237472534,
0.17938055098056793,
1.949974536895752,
0.16694824397563934,
0.023629676550626755,
-1.3835901021957397,
-0.6470143795013428,
-0.2927604615688324,
-0.4131714105606079,
-1.2309229373931885,
0.45149698853492737,
-0.161601260304451,
-0.8095149397850037,
-1.5489106178283691,
0.20353658497333527,
-1.1225988864898682,
-1.6740587949752808,
0.27175888419151306,
1.8070486783981323,
1.9176067113876343,
-0.8384177088737488,
1.5337332487106323,
-0.1714329719543457,
0.18913663923740387,
1.3212969303131104,
1.2950047254562378,
3.1067955493927,
1.8569839000701904,
-1.2991372346878052,
0.7407739162445068,
-0.2386457771062851,
-0.5602989196777344,
1.2358053922653198,
-1.180407166481018,
1.2711442708969116,
-0.19662605226039886,
-1.2219171524047852,
-1.3534369468688965,
0.9464941620826721,
0.6199659109115601,
0.02931315079331398,
-0.5226945877075195,
1.1437859535217285,
0.18828344345092773,
1.4299452304840088,
0.5787422060966492,
-0.30101606249809265,
0.668368399143219,
-0.3545105457305908,
-0.4300716817378998,
1.5378692150115967,
0.20563991367816925,
-1.4131969213485718,
-2.356642246246338,
-0.22051900625228882,
-0.8631455898284912,
-0.04975438863039017,
-0.6671278476715088,
-1.0814129114151,
1.659868836402893,
0.3711400628089905,
-1.237823247909546,
-0.3608684241771698,
-0.3126862645149231,
-0.48508545756340027,
2.670788526535034,
-1.4131866693496704,
-0.2096303254365921,
-0.9800597429275513,
-0.5940998792648315,
1.627475380897522,
-1.170774221420288,
-0.14426417648792267,
-1.011946678161621,
-0.603778600692749,
-1.313533902168274,
-0.6414758563041687,
-0.07050758600234985,
-0.8314230442047119,
0.7146892547607422,
0.3261052668094635,
-1.211634635925293,
-0.34915128350257874,
-0.9439159631729126,
0.855374276638031,
-0.16475172340869904,
0.20639057457447052,
1.842486023902893,
0.504920482635498,
-0.42389389872550964,
0.7102754712104797,
1.1313245296478271,
0.47639000415802,
-0.5592888593673706,
0.20425094664096832,
-0.7359172701835632,
0.1958693414926529,
-1.4457043409347534,
0.22048838436603546,
-2.8685386180877686,
0.6199507713317871,
-0.1208878681063652,
-0.07780854403972626,
-0.017165619879961014,
-1.222303867340088,
1.2150236368179321,
2.5916833877563477,
-1.12089204788208,
0.4098759889602661,
0.33132076263427734,
1.2203774452209473,
-1.6148866415023804,
0.2171807587146759,
-0.43465089797973633,
2.1271133422851562,
0.09174402058124542,
1.2293612957000732,
-0.42708635330200195,
-2.276709794998169,
0.5625556707382202,
-1.2165073156356812,
-1.1325584650039673,
0.9035650491714478,
-0.8428828716278076,
0.04404998943209648,
-1.4074814319610596,
-0.22607314586639404,
-0.8533740043640137,
-1.2392878532409668,
0.8323334455490112,
0.043706752359867096,
0.5493810176849365,
-0.7021775841712952,
0.3924558460712433,
-2.159703493118286,
-1.3957427740097046,
-0.2747719883918762,
-0.8749415874481201,
0.5065808296203613,
-0.2631949186325073,
0.6437790393829346,
-0.14020484685897827,
0.036709073930978775,
0.31496697664260864,
1.4641581773757935,
3.3644776344299316,
0.3170947730541229,
0.45460981130599976,
-0.1560397446155548,
-0.943895697593689,
1.3748924732208252,
0.9068230986595154,
-0.15401813387870789,
-0.4930506944656372,
-0.968966543674469,
1.2993793487548828,
1.9661812782287598,
1.0233166217803955,
0.0777948647737503,
-0.8469280004501343,
-0.7727097272872925,
-0.05268341302871704,
0.21022090315818787,
0.42861637473106384,
0.8925174474716187,
0.057707492262125015,
0.09343162178993225,
1.3702844381332397,
1.2078648805618286,
-0.5820955634117126,
0.45980387926101685,
-0.8414599895477295,
-0.39400729537010193,
0.4890706241130829,
0.2866174578666687,
0.01295239944010973,
0.4490339457988739,
-0.9941416382789612,
-0.2553229331970215,
-0.38375839591026306,
-0.9630497097969055,
-0.804572582244873,
-0.5139455795288086,
-0.2620159685611725,
1.6555794477462769,
-0.018849538639187813,
-0.42051663994789124,
0.005125879310071468,
-0.7625226378440857,
-0.07248804718255997,
-1.0429846048355103,
0.19383026659488678,
-0.1200026199221611,
-0.07170400768518448,
-0.0965174213051796,
1.7102744579315186,
-0.9700082540512085,
-2.0850844383239746,
0.1619795560836792,
0.28294041752815247,
-0.4084233045578003,
0.1890443116426468,
1.7082570791244507,
0.4143686890602112,
1.4082142114639282,
1.3486955165863037,
1.029279112815857,
-0.675900936126709,
-1.2688937187194824,
0.6587149500846863,
1.0129441022872925,
-1.3518661260604858,
0.8152192831039429,
0.04713822156190872,
-0.446711927652359,
0.7155667543411255,
1.2806098461151123,
0.3939070403575897,
-1.8942029476165771,
0.6902525424957275,
-0.8407319784164429,
0.8147271871566772,
0.6942346096038818,
0.752331554889679,
0.25574401021003723,
0.7854282855987549,
-1.235511064529419,
-1.170544981956482,
-0.8086769580841064,
-0.6078440546989441,
1.9269089698791504,
-0.2032644897699356,
0.5313842296600342,
-0.1751396358013153,
-1.365200400352478,
-0.12244848161935806,
0.8020915985107422,
0.42871665954589844,
-0.4856221377849579,
0.7425965070724487,
-0.5838790535926819,
-0.9802413582801819,
-1.4312012195587158,
-0.3995697498321533,
-0.9838647246360779,
-0.9814457297325134,
1.0427863597869873,
0.8063708543777466,
0.25257906317710876,
1.8604707717895508,
0.7038668990135193,
0.26251718401908875,
-2.6129226684570312,
0.8981399536132812,
0.44188377261161804,
-0.06235036626458168,
0.9239752292633057,
0.33776387572288513,
1.1072629690170288,
0.0033638188615441322,
0.5539407730102539,
-2.371547222137451,
2.2145373821258545,
-0.1946064829826355,
0.6689117550849915,
0.010134109295904636,
-0.2927602529525757,
1.0046626329421997,
0.43555349111557007,
0.5367178320884705,
-1.1987755298614502,
0.7678662538528442,
-0.617026150226593,
1.1513985395431519,
0.8446395397186279,
-0.856296718120575,
0.010495665483176708,
1.3229234218597412,
0.4735083281993866,
-0.4975226819515228,
-0.8554760217666626,
-0.9292946457862854,
0.9354680180549622,
1.6756001710891724,
-0.04104185476899147,
0.02576664462685585,
0.9332920908927917,
0.6814824938774109,
-1.4171572923660278,
0.11850602924823761,
-0.6543437838554382,
-0.7346030473709106,
1.6777523756027222,
2.1180176734924316,
-0.15329645574092865,
-0.2843655049800873,
-0.8601288199424744,
-1.12030827999115,
0.7981026768684387,
0.05643896386027336,
0.09887532144784927,
0.6910245418548584,
-0.7791298031806946,
1.248548150062561,
0.7448166012763977,
0.9394550919532776,
0.17675723135471344,
0.35753926634788513,
0.3503459393978119,
-0.32194796204566956,
-1.1474322080612183,
-0.27008017897605896,
-1.1956100463867188,
-2.6172804832458496,
0.4953993558883667,
-0.18681801855564117,
-1.4705103635787964,
0.024572674185037613,
-1.0264800786972046,
0.9002718925476074,
-0.6254356503486633,
-1.0896109342575073,
-1.5258598327636719,
0.199170783162117,
-0.09714816510677338,
0.821424126625061,
-1.5228675603866577,
-0.08432447910308838,
1.2992368936538696,
0.987540602684021,
-0.6673570275306702,
1.0017898082733154,
0.3010367155075073,
1.106971025466919,
0.9170007109642029,
-0.3384009599685669,
0.5478872656822205,
0.023492738604545593,
-1.3238717317581177,
0.4593580961227417,
1.2031112909317017,
0.25776877999305725,
1.4550938606262207,
-0.5459126830101013,
0.052904970943927765,
0.40757644176483154,
-0.4888693690299988,
-0.5663580894470215,
-0.5386961102485657,
0.6864690780639648,
0.0748855471611023,
-0.9915158152580261,
0.162114217877388,
-0.1444035768508911,
-0.2165394127368927,
0.22949114441871643,
-1.5321835279464722,
-0.23734943568706512,
-0.34949150681495667,
-0.6345399618148804,
-1.219570279121399,
0.002837957814335823,
1.3124232292175293,
-0.7327966690063477,
-0.31992825865745544,
0.5548009276390076,
0.39147257804870605,
0.5733070373535156,
0.5553387999534607,
-0.7027212977409363,
-0.45176154375076294,
-0.3348069190979004,
-0.3183642327785492,
0.35969001054763794,
1.2787773609161377,
-0.11903629451990128,
-1.015957236289978,
0.7726088762283325,
-0.45456811785697937,
0.05320701748132706,
1.9831385612487793,
0.07299261540174484,
-0.8553208112716675,
0.21517598628997803,
-0.6510747075080872,
1.9613314867019653,
1.6969772577285767,
1.372230052947998,
-0.04043219983577728,
-0.9713442921638489,
0.7184694409370422,
-0.3317015767097473,
-0.4093823730945587,
1.0089226961135864,
0.40214425325393677,
-0.16409708559513092,
-1.4063518047332764,
0.5240654945373535,
1.349184274673462,
-0.8306336998939514,
-0.8178722262382507,
0.07158968597650528,
-0.904747724533081,
1.1234889030456543,
0.7406495809555054,
0.33062320947647095,
0.21010898053646088,
1.5651404857635498,
0.7558348178863525,
-0.4890782833099365,
0.5563843250274658,
0.4480597972869873,
-0.16316983103752136,
-2.045971393585205,
-1.0306698083877563,
0.3379167914390564,
-0.43234342336654663,
-1.5377432107925415,
1.3507357835769653,
-1.193474531173706,
-0.9860097169876099,
0.5022661685943604,
0.1042497456073761,
1.4608004093170166,
0.3501361608505249,
1.6286550760269165,
2.0865466594696045,
0.947006344795227,
0.23134753108024597,
1.2447149753570557,
-0.15631318092346191,
-0.43514806032180786,
1.850987195968628,
-0.4093038737773895,
0.46091321110725403,
1.0283211469650269,
-0.3649492561817169,
-1.0309125185012817,
-0.7963269352912903,
-1.2581056356430054,
-0.6125190854072571,
1.254590630531311,
0.12751668691635132,
-1.1158626079559326,
0.24469777941703796,
1.5822877883911133,
-0.01730635203421116,
-0.30909815430641174,
0.6776743531227112,
0.5179672837257385,
-0.7996596097946167,
-0.029894333332777023,
-0.8673155903816223,
0.4465964138507843,
-0.07586333155632019,
-0.28244853019714355,
0.32160529494285583,
0.5213435292243958,
1.2970482110977173,
-0.018572960048913956,
0.16858577728271484,
1.2117316722869873,
-1.398909568786621,
1.4453349113464355,
-0.6876342296600342,
0.19311273097991943,
-2.43290376663208,
1.4010332822799683,
-0.7932372689247131,
1.8736608028411865,
-2.551084041595459,
0.45425596833229065,
-0.635428249835968,
-0.3905729353427887,
0.33008795976638794,
-0.3693726062774658,
0.17201121151447296,
-0.16693465411663055,
-1.1184357404708862,
-0.15250976383686066,
-0.7380809187889099,
0.6023728847503662,
1.0575158596038818,
1.362273097038269,
-1.111645221710205,
-0.2816292643547058,
-1.7291357517242432,
-0.1503574699163437,
-0.7634651064872742,
0.2904551923274994,
-2.010549306869507,
-0.24176903069019318,
-1.9882720708847046,
-2.35965895652771,
-1.447145938873291,
-0.7416669130325317,
1.0123151540756226,
0.2062166929244995,
-0.9177704453468323,
1.1146252155303955,
-0.43338751792907715,
-1.8375521898269653,
1.1075797080993652,
-2.123505115509033
] |
https://github.com/huggingface/datasets/issues/4990 | "no-token" is passed to `huggingface_hub` when token is `None` | As soon as `token` is deprecated and hfh has a new release, we'll update `datasets` to use the new argument instead. Does it sound good to you ? | ## Describe the bug
In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated.
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121
## Expected results
Pass `token=None` to `huggingface_hub`.
## Actual results
`token="no-token"` is passed.
## Environment info
`huggingface_hub v0.10.0dev` | 520 | 28 | "no-token" is passed to `huggingface_hub` when token is `None`
## Describe the bug
In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated.
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121
## Expected results
Pass `token=None` to `huggingface_hub`.
## Actual results
`token="no-token"` is passed.
## Environment info
`huggingface_hub v0.10.0dev`
As soon as `token` is deprecated and hfh has a new release, we'll update `datasets` to use the new argument instead. Does it sound good to you ? | [
-1.0407943725585938,
-0.8523274064064026,
-0.7357872724533081,
1.4926294088363647,
-0.07060939818620682,
-1.2295480966567993,
0.16512547433376312,
-0.980373740196228,
1.7636525630950928,
-0.7856237888336182,
0.38664016127586365,
-1.7485458850860596,
-0.07560669630765915,
-0.5757558941841125,
-0.7287110686302185,
-0.8243760466575623,
-0.3818952143192291,
-0.7298161387443542,
0.9672736525535583,
2.522139072418213,
1.1844172477722168,
-1.3264451026916504,
2.651414155960083,
0.6300772428512573,
-0.23783192038536072,
-1.058742642402649,
0.41569074988365173,
0.02321590483188629,
-1.1425144672393799,
-0.46841949224472046,
-0.8930280208587646,
0.04087517783045769,
-0.6019207239151001,
-0.616435170173645,
0.05484993755817413,
0.4283931255340576,
-0.31095656752586365,
-0.3637129068374634,
-0.47559159994125366,
-0.8516314029693604,
0.4706174433231354,
-0.464875191450119,
1.010256052017212,
-0.3794459402561188,
1.8563976287841797,
-0.5985946655273438,
0.39088112115859985,
0.7191853523254395,
1.3870201110839844,
0.18449456989765167,
0.021496552973985672,
0.3133675158023834,
0.3887258470058441,
-0.09821267426013947,
0.5107347369194031,
1.2592170238494873,
0.5541617274284363,
0.5036532282829285,
0.7128547430038452,
-2.2945430278778076,
1.3287395238876343,
-0.9514371156692505,
0.1405325084924698,
1.3056927919387817,
-0.8245397806167603,
0.363107293844223,
-1.7883787155151367,
-0.03330565616488457,
0.4990236163139343,
-2.2817258834838867,
0.2490096241235733,
-1.3596199750900269,
-0.4767560362815857,
1.0139009952545166,
0.24188761413097382,
-1.3575137853622437,
0.09417491406202316,
-0.3827008306980133,
1.0015660524368286,
0.47237855195999146,
1.1487890481948853,
-1.718331217765808,
-0.18364112079143524,
-0.30821138620376587,
0.1587422788143158,
-1.3489875793457031,
-1.582023024559021,
0.5033892393112183,
0.6467267274856567,
0.6524204015731812,
-0.006073190830647945,
0.9533925652503967,
-0.9836459159851074,
0.7858582139015198,
-0.967074453830719,
-1.7237168550491333,
-1.4362022876739502,
-2.193405866622925,
-2.332843780517578,
0.7192039489746094,
-0.45264938473701477,
-0.5153211355209351,
1.8986923694610596,
-0.9939630627632141,
-1.746769666671753,
1.1972949504852295,
0.3748242259025574,
-0.08076000213623047,
2.409139633178711,
0.2862027585506439,
-0.7395187616348267,
0.3658689558506012,
-0.7246865630149841,
0.7596216201782227,
-0.523590624332428,
1.3837546110153198,
0.5421660542488098,
-1.1471755504608154,
1.591070294380188,
-0.4545886516571045,
0.5975775122642517,
-0.7603129148483276,
-0.47519320249557495,
-0.7763014435768127,
0.30148690938949585,
1.8683232069015503,
-0.42468342185020447,
1.5955133438110352,
-0.34765511751174927,
-1.478089451789856,
-1.54435133934021,
0.8894677758216858,
0.40198054909706116,
-0.7060665488243103,
0.08701850473880768,
-0.3817979097366333,
0.112583227455616,
-0.1257954090833664,
1.0672918558120728,
1.183599591255188,
0.6131042242050171,
-0.23865577578544617,
-0.8460574746131897,
0.2240343987941742,
-0.07724868506193161,
-0.6943440437316895,
-1.7737646102905273,
-0.3561592400074005,
0.22289873659610748,
0.5150954127311707,
-1.250731110572815,
1.7458336353302002,
0.8172845244407654,
1.9452186822891235,
1.0332894325256348,
-0.36989325284957886,
1.5046441555023193,
0.05579202622175217,
1.8356473445892334,
-0.47768843173980713,
0.6517314314842224,
-0.2837033271789551,
-1.212012529373169,
0.8101564049720764,
-0.3015174865722656,
-1.9950971603393555,
-0.803515613079071,
-0.8250467777252197,
-0.10298700630664825,
-0.774520754814148,
0.9076370000839233,
-0.22912228107452393,
-1.4271609783172607,
0.22520731389522552,
-0.6348333358764648,
0.1391252875328064,
-1.2547409534454346,
0.29583391547203064,
0.7381028532981873,
-0.6501151919364929,
0.122520811855793,
-0.19140459597110748,
-1.2913299798965454,
-0.4260423183441162,
0.293040931224823,
1.9417411088943481,
-0.6754696369171143,
0.9069643020629883,
1.0037765502929688,
-0.682695209980011,
0.07601649314165115,
0.36351701617240906,
-0.36951950192451477,
0.7829240560531616,
-1.062853217124939,
-0.3516637682914734,
1.2047535181045532,
-0.16134604811668396,
-0.708111047744751,
1.47758150100708,
0.8528202772140503,
-1.0182684659957886,
-0.1404941976070404,
-0.2896766662597656,
-0.7153489589691162,
0.014356075786054134,
-1.5550427436828613,
-0.0739111453294754,
0.28352096676826477,
-1.3465158939361572,
-0.47529157996177673,
-0.29416224360466003,
1.330524206161499,
-0.20476362109184265,
1.39474618434906,
-0.31091150641441345,
-0.2698516845703125,
-0.40115636587142944,
-0.3988194465637207,
0.11313687264919281,
-0.21895241737365723,
-0.7024802565574646,
0.2297261655330658,
-0.7062882781028748,
0.33821308612823486,
1.426791787147522,
0.3761621415615082,
0.030815470963716507,
0.5106385946273804,
1.1260331869125366,
0.3004589378833771,
-0.08868679404258728,
-0.9079381823539734,
-1.5084304809570312,
2.057090997695923,
-1.318415641784668,
2.047624111175537,
0.7961723208427429,
-0.008644229732453823,
-1.74337637424469,
-1.8814585208892822,
1.395519495010376,
1.2029680013656616,
2.417828321456909,
0.679587185382843,
0.4331027865409851,
-0.7710594534873962,
-0.6481724977493286,
0.31179818511009216,
-1.131698727607727,
-0.6850762367248535,
0.17105798423290253,
2.3850533962249756,
1.6840990781784058,
-0.535136878490448,
-0.1505286693572998,
-1.0585218667984009,
1.3606373071670532,
-0.18921992182731628,
0.15373483300209045,
2.0409293174743652,
-0.26754313707351685,
-1.0788204669952393,
1.2728339433670044,
-2.2476844787597656,
0.1702268123626709,
1.9573454856872559,
0.1512603759765625,
0.004031938500702381,
-1.3856571912765503,
-0.6539604067802429,
-0.28730419278144836,
-0.4053264558315277,
-1.2405611276626587,
0.44016584753990173,
-0.17772606015205383,
-0.7980184555053711,
-1.550406813621521,
0.18581336736679077,
-1.141855239868164,
-1.654486894607544,
0.26897507905960083,
1.8252224922180176,
1.896657109260559,
-0.8225923180580139,
1.5118567943572998,
-0.16302767395973206,
0.154441699385643,
1.3313624858856201,
1.3029303550720215,
3.116260528564453,
1.8423244953155518,
-1.2750216722488403,
0.75424724817276,
-0.2426946759223938,
-0.5549271702766418,
1.2285432815551758,
-1.1617242097854614,
1.2649893760681152,
-0.19478817284107208,
-1.2280840873718262,
-1.3484383821487427,
0.9516218900680542,
0.5952823758125305,
0.0508270226418972,
-0.5218629837036133,
1.1803948879241943,
0.1901559680700302,
1.3979744911193848,
0.5720738768577576,
-0.28657811880111694,
0.669960081577301,
-0.3561896085739136,
-0.42228177189826965,
1.5431121587753296,
0.22664335370063782,
-1.4053881168365479,
-2.3588614463806152,
-0.22514840960502625,
-0.8943912386894226,
-0.04449184238910675,
-0.6626665592193604,
-1.08185875415802,
1.673715591430664,
0.3847106397151947,
-1.2416150569915771,
-0.34694722294807434,
-0.33397263288497925,
-0.4987291991710663,
2.706151247024536,
-1.4252891540527344,
-0.18684647977352142,
-0.9770761132240295,
-0.5775564908981323,
1.6273642778396606,
-1.1822658777236938,
-0.14108723402023315,
-1.002146601676941,
-0.5857093930244446,
-1.3141655921936035,
-0.6123552322387695,
-0.032806720584630966,
-0.8621701002120972,
0.7162398099899292,
0.3383174240589142,
-1.2214969396591187,
-0.3708890378475189,
-0.9425595998764038,
0.8385510444641113,
-0.175002783536911,
0.20083622634410858,
1.8483773469924927,
0.5400691032409668,
-0.4414304196834564,
0.7027491927146912,
1.1286519765853882,
0.4754059612751007,
-0.5911930203437805,
0.2346400022506714,
-0.7293782830238342,
0.20501001179218292,
-1.454034686088562,
0.20406408607959747,
-2.859297275543213,
0.6101129055023193,
-0.12953710556030273,
-0.08340239524841309,
-0.007029691711068153,
-1.2051037549972534,
1.1987788677215576,
2.613910675048828,
-1.1178816556930542,
0.39941009879112244,
0.3186255991458893,
1.2307822704315186,
-1.6089065074920654,
0.19875147938728333,
-0.4089111089706421,
2.093259811401367,
0.10823365300893784,
1.2107391357421875,
-0.45763880014419556,
-2.283651113510132,
0.5341616272926331,
-1.213534951210022,
-1.1407033205032349,
0.9287264943122864,
-0.8672786355018616,
0.05001503974199295,
-1.4018614292144775,
-0.19558845460414886,
-0.8463394045829773,
-1.2576866149902344,
0.8057889938354492,
0.024510130286216736,
0.5634883046150208,
-0.7050102949142456,
0.3902587592601776,
-2.12986421585083,
-1.4109339714050293,
-0.2812955379486084,
-0.8775274157524109,
0.4985846281051636,
-0.25258156657218933,
0.6792310476303101,
-0.15762732923030853,
0.05613846331834793,
0.32506483793258667,
1.4687352180480957,
3.3528835773468018,
0.3159433603286743,
0.4513227939605713,
-0.15966226160526276,
-0.9451830387115479,
1.3733607530593872,
0.9374375343322754,
-0.14150629937648773,
-0.5135908722877502,
-0.9523234963417053,
1.2861542701721191,
1.9743520021438599,
1.0317213535308838,
0.06513164192438126,
-0.8374007940292358,
-0.7779242396354675,
-0.0358678363263607,
0.19050844013690948,
0.4323952794075012,
0.8925362825393677,
0.07381658256053925,
0.10875444859266281,
1.3550162315368652,
1.2186527252197266,
-0.5864173173904419,
0.4601299464702606,
-0.8300531506538391,
-0.3957272469997406,
0.4852472245693207,
0.2837431728839874,
0.020273618400096893,
0.44856712222099304,
-0.9863875508308411,
-0.270435094833374,
-0.37619563937187195,
-0.9847671985626221,
-0.7910696268081665,
-0.5384283065795898,
-0.2755128741264343,
1.6631968021392822,
-0.038254208862781525,
-0.40521690249443054,
0.0012814821675419807,
-0.7804731130599976,
-0.07151360809803009,
-1.0202949047088623,
0.2003994584083557,
-0.13977453112602234,
-0.08072099834680557,
-0.056020040065050125,
1.7208181619644165,
-0.9650412797927856,
-2.0813839435577393,
0.1671789437532425,
0.2577207088470459,
-0.4064157009124756,
0.20205457508563995,
1.7220045328140259,
0.4313333034515381,
1.3984624147415161,
1.3448971509933472,
1.0138722658157349,
-0.6678398847579956,
-1.2629656791687012,
0.6604013442993164,
0.9997133016586304,
-1.3484554290771484,
0.8334729671478271,
0.027639705687761307,
-0.4414627254009247,
0.699205219745636,
1.2696219682693481,
0.3926630914211273,
-1.8762258291244507,
0.6728701591491699,
-0.8300541639328003,
0.8101734519004822,
0.7139512896537781,
0.756015419960022,
0.2449733465909958,
0.7968504428863525,
-1.2354702949523926,
-1.1561568975448608,
-0.7836407423019409,
-0.6065659523010254,
1.9109162092208862,
-0.18981614708900452,
0.5214152336120605,
-0.19274626672267914,
-1.3569765090942383,
-0.11559828370809555,
0.7994786500930786,
0.4480942487716675,
-0.48606032133102417,
0.7707188725471497,
-0.5760802626609802,
-0.933274507522583,
-1.402336835861206,
-0.43407464027404785,
-1.0007110834121704,
-0.9602628350257874,
1.058341145515442,
0.806776762008667,
0.24718017876148224,
1.8650044202804565,
0.6908672451972961,
0.2878044545650482,
-2.6139914989471436,
0.9138472080230713,
0.4205836057662964,
-0.08705173432826996,
0.9340389370918274,
0.3309694826602936,
1.0861836671829224,
0.0018486175686120987,
0.5660383701324463,
-2.411515474319458,
2.241793394088745,
-0.19713236391544342,
0.6344542503356934,
0.018176112323999405,
-0.26823699474334717,
1.035109043121338,
0.44721171259880066,
0.5223655104637146,
-1.213405966758728,
0.741313099861145,
-0.604228138923645,
1.1476168632507324,
0.8534564971923828,
-0.8727768659591675,
0.022199850529432297,
1.3202149868011475,
0.46351245045661926,
-0.49387484788894653,
-0.848587691783905,
-0.9282784461975098,
0.9576439261436462,
1.7035151720046997,
-0.045404113829135895,
0.007804787717759609,
0.9490116238594055,
0.6695939898490906,
-1.4331504106521606,
0.12450379878282547,
-0.6397126317024231,
-0.7476638555526733,
1.650596261024475,
2.1233444213867188,
-0.12387257814407349,
-0.2830592691898346,
-0.8501836657524109,
-1.112821340560913,
0.809013843536377,
0.08707413077354431,
0.12285000830888748,
0.6902390122413635,
-0.7669010758399963,
1.2473382949829102,
0.7592162489891052,
0.9552046656608582,
0.17229677736759186,
0.3554284870624542,
0.3554908335208893,
-0.34962770342826843,
-1.1583563089370728,
-0.2576148211956024,
-1.203955888748169,
-2.6048531532287598,
0.5049657225608826,
-0.17351745069026947,
-1.4571138620376587,
0.015805236995220184,
-1.0542559623718262,
0.8901364803314209,
-0.6129172444343567,
-1.0940766334533691,
-1.5273562669754028,
0.2008310854434967,
-0.10845337063074112,
0.8472073674201965,
-1.5377063751220703,
-0.0987858772277832,
1.2639141082763672,
0.9906721711158752,
-0.6714723706245422,
0.9802494645118713,
0.28671589493751526,
1.119503140449524,
0.9085025191307068,
-0.3670881390571594,
0.5535367131233215,
0.041867803782224655,
-1.327280879020691,
0.42005637288093567,
1.1854475736618042,
0.24432601034641266,
1.4436345100402832,
-0.5248255133628845,
0.059987373650074005,
0.42773768305778503,
-0.48966068029403687,
-0.5688852071762085,
-0.5726220607757568,
0.6429641842842102,
0.0712023675441742,
-0.9935134053230286,
0.14398913085460663,
-0.11220159381628036,
-0.20897532999515533,
0.24849872291088104,
-1.5332084894180298,
-0.22074387967586517,
-0.3173127770423889,
-0.6026535034179688,
-1.2144938707351685,
0.005541624501347542,
1.306548833847046,
-0.7197397351264954,
-0.33383724093437195,
0.5341139435768127,
0.36958765983581543,
0.5631899833679199,
0.5428422093391418,
-0.7160752415657043,
-0.44615060091018677,
-0.3232974112033844,
-0.3147827386856079,
0.3603114187717438,
1.3247209787368774,
-0.15887583792209625,
-1.0190343856811523,
0.7655115723609924,
-0.4594440758228302,
0.08371010422706604,
1.9909931421279907,
0.06458064168691635,
-0.8439254760742188,
0.19727638363838196,
-0.6475049257278442,
1.9394035339355469,
1.7234030961990356,
1.3702969551086426,
-0.0565214604139328,
-0.9466301202774048,
0.7241608500480652,
-0.3331644535064697,
-0.39951470494270325,
1.0168083906173706,
0.3736577033996582,
-0.1906401664018631,
-1.4148880243301392,
0.5225170850753784,
1.341867446899414,
-0.8266608119010925,
-0.8307897448539734,
0.06078000366687775,
-0.9218156933784485,
1.1367886066436768,
0.7534793615341187,
0.30948033928871155,
0.20357076823711395,
1.5860278606414795,
0.7575989365577698,
-0.45815759897232056,
0.543412446975708,
0.45020994544029236,
-0.17332421243190765,
-2.0486767292022705,
-1.0592936277389526,
0.3360307812690735,
-0.4561575651168823,
-1.5466938018798828,
1.3660045862197876,
-1.1945688724517822,
-0.9889602661132812,
0.5272662043571472,
0.10489887744188309,
1.4720289707183838,
0.3670896589756012,
1.6228121519088745,
2.0842444896698,
0.9534546732902527,
0.20518282055854797,
1.2526453733444214,
-0.13743926584720612,
-0.4381349980831146,
1.8547712564468384,
-0.4521789252758026,
0.4665309190750122,
1.0019994974136353,
-0.3519066870212555,
-1.029086709022522,
-0.8018076419830322,
-1.2741986513137817,
-0.6313083171844482,
1.2556065320968628,
0.13513125479221344,
-1.1159292459487915,
0.21123088896274567,
1.5743041038513184,
-0.016514049842953682,
-0.28880149126052856,
0.6786299347877502,
0.5082484483718872,
-0.8041031360626221,
-0.03258310258388519,
-0.8389869928359985,
0.47885334491729736,
-0.07047219574451447,
-0.28886908292770386,
0.3190401792526245,
0.5289731025695801,
1.2848589420318604,
-0.028126951307058334,
0.16222254931926727,
1.2313125133514404,
-1.374271273612976,
1.4489264488220215,
-0.6750207543373108,
0.17633940279483795,
-2.451270580291748,
1.4061552286148071,
-0.7758146524429321,
1.8658233880996704,
-2.5253536701202393,
0.47022780776023865,
-0.6251137852668762,
-0.4296562671661377,
0.34733596444129944,
-0.3749466836452484,
0.18832774460315704,
-0.16762244701385498,
-1.1190742254257202,
-0.1464967280626297,
-0.7683784365653992,
0.5845879912376404,
1.0545392036437988,
1.3941172361373901,
-1.129730224609375,
-0.2963700592517853,
-1.7384668588638306,
-0.13833563029766083,
-0.7567045092582703,
0.30843567848205566,
-2.0100131034851074,
-0.2562029957771301,
-1.9691972732543945,
-2.349161148071289,
-1.4604151248931885,
-0.7521652579307556,
1.0177494287490845,
0.1873442381620407,
-0.9075978994369507,
1.1240092515945435,
-0.43460747599601746,
-1.8493133783340454,
1.0942745208740234,
-2.149322271347046
] |
https://github.com/huggingface/datasets/issues/4990 | "no-token" is passed to `huggingface_hub` when token is `None` | Hi @Wauplin, thanks for the warning about the deprecation of `token` in favor of `use_auth_token`.
Indeed, in datasets we use internally `use_auth_token`, which in this case was transformed to `token` to call `HfApi.dataset_info`:
https://github.com/huggingface/datasets/blob/1a9385d7cc8a3241b44015145ef56a230fdadc51/src/datasets/load.py#L747
Therefore, for the new hfh release, the fix will be trivial: we will pass directly `use_auth_token`.
As discussed during our meeting yesterday, due to the fact that at datasets we support multiple hfh versions, I think we should handle passing `token` or `use_auth_token` depending on the hfh version. | ## Describe the bug
In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated.
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121
## Expected results
Pass `token=None` to `huggingface_hub`.
## Actual results
`token="no-token"` is passed.
## Environment info
`huggingface_hub v0.10.0dev` | 520 | 82 | "no-token" is passed to `huggingface_hub` when token is `None`
## Describe the bug
In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated.
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753
https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121
## Expected results
Pass `token=None` to `huggingface_hub`.
## Actual results
`token="no-token"` is passed.
## Environment info
`huggingface_hub v0.10.0dev`
Hi @Wauplin, thanks for the warning about the deprecation of `token` in favor of `use_auth_token`.
Indeed, in datasets we use internally `use_auth_token`, which in this case was transformed to `token` to call `HfApi.dataset_info`:
https://github.com/huggingface/datasets/blob/1a9385d7cc8a3241b44015145ef56a230fdadc51/src/datasets/load.py#L747
Therefore, for the new hfh release, the fix will be trivial: we will pass directly `use_auth_token`.
As discussed during our meeting yesterday, due to the fact that at datasets we support multiple hfh versions, I think we should handle passing `token` or `use_auth_token` depending on the hfh version. | [
-1.0484988689422607,
-0.8428283333778381,
-0.7003964185714722,
1.4637024402618408,
-0.08118890970945358,
-1.2397005558013916,
0.238985076546669,
-1.0232794284820557,
1.728707194328308,
-0.7440153956413269,
0.34955501556396484,
-1.7263660430908203,
-0.09378643333911896,
-0.5976287722587585,
-0.7658125162124634,
-0.8029313087463379,
-0.36163267493247986,
-0.7305474877357483,
0.9895427227020264,
2.5010592937469482,
1.2128050327301025,
-1.3376741409301758,
2.6861062049865723,
0.6143801212310791,
-0.2675553858280182,
-1.0531947612762451,
0.4676930904388428,
-0.000014455057680606842,
-1.1533123254776,
-0.49162915349006653,
-0.8627721071243286,
0.04341153800487518,
-0.6131654977798462,
-0.554728627204895,
0.06747952848672867,
0.48462483286857605,
-0.2898689806461334,
-0.378689169883728,
-0.5065025091171265,
-0.8146114349365234,
0.45874112844467163,
-0.41585227847099304,
0.9928655624389648,
-0.3212355971336365,
1.8228819370269775,
-0.5822392106056213,
0.4288800060749054,
0.7240778803825378,
1.4038982391357422,
0.1916317343711853,
0.005451967939734459,
0.24758899211883545,
0.4079309105873108,
-0.08542200922966003,
0.5130196213722229,
1.2613210678100586,
0.6069080829620361,
0.5218812823295593,
0.7068735361099243,
-2.2725930213928223,
1.3095760345458984,
-0.9400100111961365,
0.15739935636520386,
1.3345900774002075,
-0.8578580617904663,
0.3315308690071106,
-1.8234602212905884,
-0.028329774737358093,
0.5067344307899475,
-2.2640719413757324,
0.2589012384414673,
-1.3724002838134766,
-0.4691929817199707,
0.9547672867774963,
0.2127930223941803,
-1.3153473138809204,
0.15699847042560577,
-0.41134610772132874,
1.048856496810913,
0.47854083776474,
1.1603180170059204,
-1.6773608922958374,
-0.11670894920825958,
-0.2584070563316345,
0.15204373002052307,
-1.2800110578536987,
-1.6129041910171509,
0.539453387260437,
0.6219290494918823,
0.6132884621620178,
-0.08923109620809555,
0.9983874559402466,
-0.9967295527458191,
0.7710630893707275,
-0.9767465591430664,
-1.735870599746704,
-1.3878402709960938,
-2.172724485397339,
-2.3074851036071777,
0.6851180791854858,
-0.49042809009552,
-0.45448315143585205,
1.9489712715148926,
-0.9841709733009338,
-1.7508207559585571,
1.149657964706421,
0.41804447770118713,
-0.037715137004852295,
2.361940860748291,
0.2840708792209625,
-0.7186791896820068,
0.35453712940216064,
-0.7276843786239624,
0.7429832220077515,
-0.5011581778526306,
1.4052659273147583,
0.47451284527778625,
-1.14220130443573,
1.5744662284851074,
-0.40905487537384033,
0.6056674122810364,
-0.7523719072341919,
-0.46902111172676086,
-0.7174082398414612,
0.2611357271671295,
1.8849482536315918,
-0.43506738543510437,
1.5423816442489624,
-0.3806092441082001,
-1.5036160945892334,
-1.5241807699203491,
0.9065648913383484,
0.4458691477775574,
-0.7464409470558167,
0.07031615823507309,
-0.41651228070259094,
0.10367470234632492,
-0.15603166818618774,
1.0786805152893066,
1.195349097251892,
0.6771113872528076,
-0.284216046333313,
-0.7887259125709534,
0.18100811541080475,
-0.10051430761814117,
-0.701387345790863,
-1.8168033361434937,
-0.32795897126197815,
0.2122986614704132,
0.571038007736206,
-1.1996654272079468,
1.7771234512329102,
0.8305709958076477,
1.9417459964752197,
1.0356065034866333,
-0.4230974316596985,
1.4791053533554077,
0.06199076026678085,
1.8044880628585815,
-0.4863332211971283,
0.6053386926651001,
-0.31281155347824097,
-1.2233986854553223,
0.8738405704498291,
-0.2804833650588989,
-1.959399700164795,
-0.7384833693504333,
-0.790271520614624,
-0.16810961067676544,
-0.7578245997428894,
0.8997175097465515,
-0.20522795617580414,
-1.4399888515472412,
0.16405662894248962,
-0.6080050468444824,
0.1940939873456955,
-1.2247340679168701,
0.3120203912258148,
0.7610815763473511,
-0.65250164270401,
0.08923642337322235,
-0.22254416346549988,
-1.2802430391311646,
-0.4810625910758972,
0.330862432718277,
1.848091959953308,
-0.6681435704231262,
0.9158219695091248,
1.0242176055908203,
-0.6901655197143555,
0.08159394562244415,
0.33420330286026,
-0.3782680928707123,
0.7727347612380981,
-1.0470468997955322,
-0.4096531867980957,
1.1828315258026123,
-0.2233661413192749,
-0.6783268451690674,
1.4573183059692383,
0.7895936965942383,
-1.0474762916564941,
-0.1777082085609436,
-0.2649634778499603,
-0.7935428619384766,
0.03106045536696911,
-1.5320600271224976,
-0.09666440635919571,
0.38215795159339905,
-1.4229722023010254,
-0.47132089734077454,
-0.29279574751853943,
1.3806862831115723,
-0.21106304228305817,
1.4273664951324463,
-0.2467634677886963,
-0.23785358667373657,
-0.371071994304657,
-0.3877774477005005,
0.1011899784207344,
-0.21934926509857178,
-0.6575451493263245,
0.19669120013713837,
-0.7279383540153503,
0.3576996922492981,
1.4490985870361328,
0.3037601709365845,
-0.037312913686037064,
0.4932180941104889,
1.1235918998718262,
0.3687262535095215,
-0.082506462931633,
-0.9139605164527893,
-1.500058650970459,
2.0085763931274414,
-1.35474693775177,
2.008511781692505,
0.8264651298522949,
0.0019100792706012726,
-1.760929822921753,
-1.8959033489227295,
1.4059998989105225,
1.1720103025436401,
2.432136297225952,
0.6286026835441589,
0.4369223117828369,
-0.6991921067237854,
-0.6102864146232605,
0.34681180119514465,
-1.0986491441726685,
-0.6485949754714966,
0.19546528160572052,
2.3630194664001465,
1.694680094718933,
-0.5640302896499634,
-0.21783453226089478,
-1.0429319143295288,
1.349419116973877,
-0.16378934681415558,
0.1738152652978897,
2.024068593978882,
-0.29889655113220215,
-1.0504993200302124,
1.2853339910507202,
-2.2773313522338867,
0.21049968898296356,
2.0037248134613037,
0.14360477030277252,
0.028644481673836708,
-1.3743047714233398,
-0.592758297920227,
-0.2972925305366516,
-0.4272613525390625,
-1.2362338304519653,
0.48308098316192627,
-0.16369110345840454,
-0.7910322546958923,
-1.548537254333496,
0.20058628916740417,
-1.1801477670669556,
-1.6781013011932373,
0.2629067301750183,
1.8981369733810425,
1.9098200798034668,
-0.8246301412582397,
1.5094525814056396,
-0.24319055676460266,
0.1601538211107254,
1.3226120471954346,
1.3003668785095215,
3.0980191230773926,
1.8191134929656982,
-1.3235540390014648,
0.7604079842567444,
-0.24462786316871643,
-0.5585622191429138,
1.1963351964950562,
-1.1195080280303955,
1.256637454032898,
-0.19263632595539093,
-1.2300771474838257,
-1.3503371477127075,
0.9400677680969238,
0.5992917418479919,
0.07896643131971359,
-0.5081716179847717,
1.1478248834609985,
0.2237790822982788,
1.3653335571289062,
0.5931236147880554,
-0.32450589537620544,
0.7074611783027649,
-0.34787216782569885,
-0.4276972711086273,
1.5209414958953857,
0.25294455885887146,
-1.3926398754119873,
-2.3789589405059814,
-0.221720352768898,
-0.880439281463623,
0.012235553935170174,
-0.6653035879135132,
-1.0672651529312134,
1.613991379737854,
0.386383593082428,
-1.2611275911331177,
-0.3437636196613312,
-0.29306474328041077,
-0.5021535754203796,
2.627959966659546,
-1.3725544214248657,
-0.15937481820583344,
-0.9851987361907959,
-0.5910308361053467,
1.6413543224334717,
-1.1790376901626587,
-0.1797371804714203,
-0.999245285987854,
-0.5582762360572815,
-1.3299598693847656,
-0.6091806888580322,
0.037382468581199646,
-0.8462082743644714,
0.7391946911811829,
0.2766031324863434,
-1.2476998567581177,
-0.35801172256469727,
-0.8904786705970764,
0.9101585149765015,
-0.20559944212436676,
0.17454522848129272,
1.9056857824325562,
0.5257980823516846,
-0.4477551281452179,
0.6998056173324585,
1.1321289539337158,
0.5047811269760132,
-0.5657294392585754,
0.1721087098121643,
-0.7520931363105774,
0.23324893414974213,
-1.5016412734985352,
0.19849906861782074,
-2.863861322402954,
0.6001590490341187,
-0.09864172339439392,
-0.06437690556049347,
0.003042863681912422,
-1.2944415807724,
1.1614376306533813,
2.637990713119507,
-1.179246425628662,
0.3967736065387726,
0.41633930802345276,
1.2159769535064697,
-1.577499508857727,
0.20125393569469452,
-0.4168848991394043,
2.063163995742798,
0.11528867483139038,
1.2516653537750244,
-0.473096638917923,
-2.2988409996032715,
0.5101970434188843,
-1.2109462022781372,
-1.1377676725387573,
0.9378356337547302,
-0.8048785328865051,
0.029058681800961494,
-1.4361647367477417,
-0.18146318197250366,
-0.8732107281684875,
-1.2612881660461426,
0.7772218585014343,
0.025056665763258934,
0.5294338464736938,
-0.7452118396759033,
0.3841384947299957,
-2.111238479614258,
-1.383445143699646,
-0.23883411288261414,
-0.8800379633903503,
0.48051345348358154,
-0.31453460454940796,
0.6687512397766113,
-0.17660897970199585,
0.033573754131793976,
0.3060801029205322,
1.4849584102630615,
3.3916122913360596,
0.30866801738739014,
0.3621818721294403,
-0.19851475954055786,
-0.9141348600387573,
1.418721318244934,
0.9356929063796997,
-0.10541227459907532,
-0.5302234292030334,
-0.9722189903259277,
1.2458184957504272,
1.994469404220581,
1.0517077445983887,
0.05089964717626572,
-0.8450496196746826,
-0.8356298208236694,
-0.04675602912902832,
0.17401300370693207,
0.4546622931957245,
0.8854035139083862,
0.07889453321695328,
0.05940482020378113,
1.2926576137542725,
1.169405460357666,
-0.5487399101257324,
0.46176600456237793,
-0.8502730131149292,
-0.4089866280555725,
0.4378802478313446,
0.3018200695514679,
0.02806861512362957,
0.4440918266773224,
-0.9757809638977051,
-0.25301045179367065,
-0.42670124769210815,
-0.9821613430976868,
-0.7619527578353882,
-0.4491453468799591,
-0.3067548871040344,
1.6224186420440674,
-0.017234932631254196,
-0.4247680902481079,
0.0175932627171278,
-0.7421517372131348,
-0.07699838280677795,
-1.025619626045227,
0.1793575882911682,
-0.14513373374938965,
-0.06881687045097351,
-0.10051169991493225,
1.6580342054367065,
-0.9527519941329956,
-2.075282096862793,
0.17929869890213013,
0.2249024361371994,
-0.41096755862236023,
0.2141493409872055,
1.7412285804748535,
0.46012917160987854,
1.4080889225006104,
1.3383947610855103,
1.015625238418579,
-0.6490192413330078,
-1.2572077512741089,
0.7251315116882324,
0.9843802452087402,
-1.3462990522384644,
0.8532532453536987,
0.04880490154027939,
-0.487971693277359,
0.7196309566497803,
1.269653081893921,
0.3987566828727722,
-1.9776417016983032,
0.6817941069602966,
-0.8770121932029724,
0.7671218514442444,
0.7432696223258972,
0.7663650512695312,
0.26269790530204773,
0.8074609637260437,
-1.1871477365493774,
-1.1716766357421875,
-0.7488425374031067,
-0.6572246551513672,
1.9422695636749268,
-0.20859764516353607,
0.5312162637710571,
-0.18129494786262512,
-1.3603298664093018,
-0.1701827198266983,
0.8074900507926941,
0.43403929471969604,
-0.5361194610595703,
0.7377616167068481,
-0.5927610993385315,
-0.9240134954452515,
-1.3452444076538086,
-0.45672595500946045,
-1.028432846069336,
-0.9796670079231262,
1.014042854309082,
0.8307097554206848,
0.35192209482192993,
1.8599683046340942,
0.679770827293396,
0.27781441807746887,
-2.5992319583892822,
0.884395956993103,
0.46742141246795654,
-0.1538008153438568,
0.9437433481216431,
0.3651689887046814,
1.1167786121368408,
0.04623278230428696,
0.6200059652328491,
-2.448564291000366,
2.2444136142730713,
-0.17815719544887543,
0.6165862083435059,
0.011933552101254463,
-0.30754244327545166,
1.0634219646453857,
0.4366229474544525,
0.47310760617256165,
-1.1875035762786865,
0.7979650497436523,
-0.5766183733940125,
1.127562403678894,
0.8173443675041199,
-0.8723867535591125,
-0.0007572183385491371,
1.3977559804916382,
0.5103834271430969,
-0.508760929107666,
-0.8550058007240295,
-0.9484442472457886,
0.927361786365509,
1.701733112335205,
-0.06530076265335083,
0.007436277344822884,
0.9228699207305908,
0.6871137619018555,
-1.3856476545333862,
0.13098154962062836,
-0.6110756993293762,
-0.7174128890037537,
1.6581146717071533,
2.0631492137908936,
-0.12535350024700165,
-0.25310397148132324,
-0.844526469707489,
-1.123617172241211,
0.7586542963981628,
0.05524907261133194,
0.10372127592563629,
0.6579819917678833,
-0.7612972259521484,
1.215795636177063,
0.7318873405456543,
0.9268493056297302,
0.12232954800128937,
0.34017664194107056,
0.36667773127555847,
-0.3635145127773285,
-1.1413646936416626,
-0.2681256830692291,
-1.2264940738677979,
-2.5814781188964844,
0.4882759749889374,
-0.1630377471446991,
-1.4784923791885376,
0.01476307213306427,
-1.0393109321594238,
0.8867241740226746,
-0.6608222723007202,
-1.0862449407577515,
-1.5610747337341309,
0.2715870440006256,
-0.08843325078487396,
0.8910176157951355,
-1.5821492671966553,
-0.11819496750831604,
1.2317558526992798,
0.9456695914268494,
-0.6592967510223389,
1.0008141994476318,
0.275387167930603,
1.1085277795791626,
0.9051087498664856,
-0.34112003445625305,
0.562634289264679,
0.029584942385554314,
-1.336240291595459,
0.40215641260147095,
1.1654415130615234,
0.2141447514295578,
1.42592453956604,
-0.5383226871490479,
0.05428307503461838,
0.44378170371055603,
-0.49281448125839233,
-0.5802488923072815,
-0.5037757158279419,
0.6131235361099243,
0.07185597717761993,
-0.9567188620567322,
0.10638351738452911,
-0.14601807296276093,
-0.25577473640441895,
0.2480871081352234,
-1.558234691619873,
-0.2408384382724762,
-0.3553581237792969,
-0.5853909254074097,
-1.2239654064178467,
0.02512097917497158,
1.3342230319976807,
-0.6678401231765747,
-0.36644265055656433,
0.5528039932250977,
0.358747273683548,
0.4872475266456604,
0.5319366455078125,
-0.7444251179695129,
-0.4144657850265503,
-0.3136450946331024,
-0.3854511082172394,
0.35414326190948486,
1.3735969066619873,
-0.12484966218471527,
-0.9586342573165894,
0.7216437458992004,
-0.44251126050949097,
0.05546566843986511,
1.9976375102996826,
0.04880698770284653,
-0.8376398086547852,
0.19874389469623566,
-0.6450681686401367,
1.9295774698257446,
1.7561062574386597,
1.3565661907196045,
-0.049665048718452454,
-0.9294156432151794,
0.7025377750396729,
-0.34937164187431335,
-0.40024200081825256,
1.0423414707183838,
0.3268706798553467,
-0.2058161199092865,
-1.445621132850647,
0.5541859865188599,
1.384751796722412,
-0.8263240456581116,
-0.7983340620994568,
0.08080844581127167,
-0.9094229340553284,
1.166609525680542,
0.7140350937843323,
0.2689376175403595,
0.2152470201253891,
1.5621345043182373,
0.7621492743492126,
-0.42100369930267334,
0.6164396405220032,
0.4619333744049072,
-0.17017686367034912,
-2.0900344848632812,
-1.098543405532837,
0.3456086814403534,
-0.4445813298225403,
-1.5859923362731934,
1.395875096321106,
-1.2220489978790283,
-1.0559085607528687,
0.5104801058769226,
0.07964031398296356,
1.4444825649261475,
0.40389806032180786,
1.6587327718734741,
2.1091418266296387,
0.9455217719078064,
0.265572726726532,
1.2719660997390747,
-0.1490110456943512,
-0.4529683291912079,
1.8574883937835693,
-0.4733651876449585,
0.4707019627094269,
1.0531507730484009,
-0.35058268904685974,
-1.0318063497543335,
-0.8070772886276245,
-1.2845714092254639,
-0.6324747204780579,
1.2642822265625,
0.10499373823404312,
-1.1123147010803223,
0.29308587312698364,
1.571218729019165,
0.026859575882554054,
-0.27702459692955017,
0.7354949116706848,
0.4827328026294708,
-0.8270451426506042,
-0.051156215369701385,
-0.7739386558532715,
0.5121189951896667,
-0.08059705793857574,
-0.30567482113838196,
0.3856205344200134,
0.5714913010597229,
1.3158634901046753,
-0.05730173736810684,
0.15003468096256256,
1.1527912616729736,
-1.4302254915237427,
1.4722816944122314,
-0.6850220561027527,
0.18809056282043457,
-2.4492695331573486,
1.4181586503982544,
-0.7421454191207886,
1.925640344619751,
-2.548584461212158,
0.45222949981689453,
-0.5974434614181519,
-0.4646003246307373,
0.3076857924461365,
-0.34651342034339905,
0.21182334423065186,
-0.1704731583595276,
-1.1006373167037964,
-0.18323752284049988,
-0.7357097268104553,
0.6151579022407532,
1.0675528049468994,
1.4032083749771118,
-1.1408381462097168,
-0.3047715425491333,
-1.7179770469665527,
-0.1505323350429535,
-0.7107855677604675,
0.26173174381256104,
-1.9879125356674194,
-0.24568834900856018,
-1.9650076627731323,
-2.3617613315582275,
-1.4257140159606934,
-0.7738998532295227,
0.9821832180023193,
0.20297397673130035,
-0.8921055197715759,
1.1743816137313843,
-0.4092833399772644,
-1.866871953010559,
1.057407259941101,
-2.1373493671417236
] |
https://github.com/huggingface/datasets/issues/4988 | Add `IterableDataset.from_generator` to the API | Thanks @hamid-vakilzadeh ! Let us know if you have some questions or if we can help | We've just added `Dataset.from_generator` to the API. It would also be cool to add `IterableDataset.from_generator` to support creating an iterable dataset from a generator.
cc @lhoestq | 522 | 16 | Add `IterableDataset.from_generator` to the API
We've just added `Dataset.from_generator` to the API. It would also be cool to add `IterableDataset.from_generator` to support creating an iterable dataset from a generator.
cc @lhoestq
Thanks @hamid-vakilzadeh ! Let us know if you have some questions or if we can help | [
-1.2697069644927979,
-0.8694445490837097,
-0.7343924641609192,
1.6409918069839478,
-0.20771387219429016,
-1.318690299987793,
0.1744633913040161,
-1.0162140130996704,
1.7428261041641235,
-0.7355060577392578,
0.5670537948608398,
-1.6230474710464478,
0.06834234297275543,
-0.40090787410736084,
-0.8183717131614685,
-0.7818079590797424,
-0.4706120491027832,
-0.6483985781669617,
1.1177905797958374,
2.370835781097412,
1.0698763132095337,
-1.2773112058639526,
2.580240249633789,
0.4386574625968933,
-0.16081175208091736,
-0.975850522518158,
0.4184705317020416,
0.08374156057834625,
-1.3518424034118652,
-0.5069956183433533,
-1.087927222251892,
-0.11917843669652939,
-0.5821542739868164,
-0.6486284732818604,
0.05335650220513344,
0.41107088327407837,
-0.10423214733600616,
-0.6385627388954163,
-0.3818908631801605,
-0.7009922862052917,
0.4405236542224884,
-0.2818204164505005,
0.9550179839134216,
-0.2983395755290985,
1.8871363401412964,
-0.5954062342643738,
0.642088770866394,
0.592728316783905,
1.412010908126831,
0.19504955410957336,
0.01558012142777443,
0.39396968483924866,
0.48078709840774536,
-0.06699878722429276,
0.48139825463294983,
0.9585317373275757,
0.45263370871543884,
0.676014244556427,
0.7305199503898621,
-2.1147661209106445,
1.4592094421386719,
-1.2068923711776733,
0.19361476600170135,
1.3967305421829224,
-1.1117300987243652,
0.24781548976898193,
-1.6747368574142456,
0.0407310351729393,
0.4005885720252991,
-2.126441478729248,
0.2757847011089325,
-1.2267173528671265,
-0.40028804540634155,
1.093724250793457,
0.45280876755714417,
-1.349475383758545,
0.06744331866502762,
-0.2681141495704651,
0.7538455724716187,
0.4434472322463989,
1.1557233333587646,
-1.613744854927063,
0.1807594746351242,
-0.4946676790714264,
0.2200496792793274,
-1.2227962017059326,
-1.4689552783966064,
0.6179174780845642,
0.5974025130271912,
0.5939214825630188,
-0.1381923258304596,
1.010603427886963,
-0.7429141998291016,
0.7853347659111023,
-0.9811151027679443,
-1.6641719341278076,
-1.277796745300293,
-2.20751953125,
-2.3415367603302,
0.7737395763397217,
-0.4258006513118744,
-0.5740668773651123,
1.8464854955673218,
-1.1973646879196167,
-1.779241919517517,
1.2019332647323608,
0.11358090490102768,
0.013630300760269165,
2.374802350997925,
0.0405425988137722,
-0.5249465703964233,
0.39002692699432373,
-0.7273711562156677,
0.8413155674934387,
-0.4697743058204651,
1.4700307846069336,
0.4275980293750763,
-0.984796941280365,
1.6941325664520264,
-0.1822342872619629,
0.6552882790565491,
-0.6014511585235596,
-0.6226006746292114,
-0.8207627534866333,
0.2902814447879791,
2.009097099304199,
-0.2326638251543045,
1.5524543523788452,
-0.5275247693061829,
-1.7592582702636719,
-1.5548464059829712,
0.9968538880348206,
0.4144728481769562,
-0.7047699093818665,
0.08560660481452942,
-0.15007273852825165,
0.06745225191116333,
0.027447791770100594,
1.1281875371932983,
1.3093018531799316,
0.7889677286148071,
-0.3688221275806427,
-0.8882087469100952,
0.1251465529203415,
-0.06985041499137878,
-0.8833624720573425,
-1.6674857139587402,
-0.4667396545410156,
-0.05753525346517563,
0.8001586198806763,
-1.2466673851013184,
1.6969048976898193,
1.0077944993972778,
1.9207295179367065,
0.9895776510238647,
-0.362046480178833,
1.5292730331420898,
0.025219963863492012,
1.9885632991790771,
-0.47088587284088135,
0.5741750597953796,
-0.45772260427474976,
-1.1713151931762695,
0.7135624885559082,
-0.3026621341705322,
-2.001701831817627,
-0.9292399287223816,
-0.9533939957618713,
-0.1666398048400879,
-0.6475390791893005,
1.0168673992156982,
-0.3771166205406189,
-1.4695895910263062,
0.2289975881576538,
-0.5798754692077637,
0.2804041802883148,
-1.332964539527893,
0.4993581175804138,
0.7703957557678223,
-0.7027670741081238,
0.1640012264251709,
-0.2651228606700897,
-1.2542475461959839,
-0.5618588924407959,
0.25769731402397156,
1.8758398294448853,
-0.7537620663642883,
0.9235953688621521,
0.9824328422546387,
-0.7354835867881775,
-0.1483333706855774,
0.3491472601890564,
-0.11787117272615433,
0.7316103577613831,
-1.0464686155319214,
-0.4574880599975586,
1.406858205795288,
-0.16650597751140594,
-0.5753045082092285,
1.6054275035858154,
0.7244144678115845,
-0.8886595368385315,
-0.079426109790802,
-0.2641652226448059,
-0.7518225908279419,
0.019893387332558632,
-1.5504781007766724,
-0.043123211711645126,
0.21892619132995605,
-1.5199350118637085,
-0.44054898619651794,
-0.26138535141944885,
1.1151988506317139,
-0.15763472020626068,
1.3328717947006226,
-0.10004709661006927,
-0.3121492862701416,
-0.27828338742256165,
-0.20393647253513336,
0.18231157958507538,
-0.2301429659128189,
-0.7193232774734497,
0.29033732414245605,
-0.6702097058296204,
0.4990130066871643,
1.503644585609436,
0.29338616132736206,
0.0069018336944282055,
0.515167236328125,
1.047205924987793,
0.25526657700538635,
0.0003172322176396847,
-0.8752029538154602,
-1.5611059665679932,
1.937652349472046,
-1.4615474939346313,
1.8957704305648804,
0.5751850605010986,
-0.17598523199558258,
-1.679522156715393,
-1.632466435432434,
1.3686732053756714,
1.3019286394119263,
2.261324405670166,
0.6535473465919495,
0.24286270141601562,
-0.7627084851264954,
-0.597532331943512,
0.2402196228504181,
-0.9795300960540771,
-0.9030418992042542,
0.24894604086875916,
2.306474447250366,
1.6754190921783447,
-0.4613303542137146,
-0.1066679060459137,
-1.1884721517562866,
1.2931510210037231,
-0.23339447379112244,
0.32691946625709534,
1.8870638608932495,
-0.25261279940605164,
-1.2604550123214722,
1.2972888946533203,
-2.2683510780334473,
0.16179825365543365,
2.059589385986328,
0.4030388593673706,
0.07220477610826492,
-1.5579109191894531,
-0.7423526644706726,
-0.18129339814186096,
-0.42295628786087036,
-1.286340594291687,
0.4258444011211395,
-0.24579063057899475,
-0.7137660384178162,
-1.4438090324401855,
0.23882238566875458,
-1.1081541776657104,
-1.4985953569412231,
0.27611905336380005,
1.8488444089889526,
1.7656583786010742,
-0.5034101605415344,
1.3782918453216553,
-0.13527099788188934,
0.2467690110206604,
1.2699270248413086,
1.0895142555236816,
3.0006065368652344,
2.1509511470794678,
-1.2059177160263062,
0.8331875801086426,
-0.1963888555765152,
-0.6561835408210754,
1.2157635688781738,
-1.255999207496643,
1.3981109857559204,
-0.08641989529132843,
-1.0566096305847168,
-1.179010033607483,
0.9174684882164001,
0.4443417191505432,
0.033515699207782745,
-0.4992044270038605,
1.2163325548171997,
0.0076632010750472546,
1.2613426446914673,
0.4860607385635376,
-0.29237574338912964,
0.6855138540267944,
-0.47327920794487,
-0.4644130766391754,
1.5407848358154297,
0.18325023353099823,
-1.3273447751998901,
-2.250216484069824,
-0.15429504215717316,
-0.8821287155151367,
-0.06478649377822876,
-0.6116082668304443,
-0.9350684285163879,
1.6599628925323486,
0.3926922082901001,
-1.286286473274231,
-0.15661856532096863,
-0.30898991227149963,
-0.6743890643119812,
2.6950883865356445,
-1.285549521446228,
-0.2822851240634918,
-0.9746125936508179,
-0.7673248052597046,
1.704247236251831,
-1.2007085084915161,
-0.3718838095664978,
-1.0317128896713257,
-0.4783814251422882,
-1.2905268669128418,
-0.4836992025375366,
0.14630916714668274,
-0.9517890810966492,
0.8614000678062439,
0.17031648755073547,
-1.2327452898025513,
-0.5550845861434937,
-0.7860829830169678,
0.8814120888710022,
0.002219246234744787,
0.286185085773468,
1.8413766622543335,
0.46826910972595215,
-0.31461137533187866,
0.5326663851737976,
1.155710220336914,
0.5677125453948975,
-0.627676784992218,
0.32709410786628723,
-0.7040367722511292,
0.3366334140300751,
-1.3047325611114502,
0.42217668890953064,
-2.7710635662078857,
0.4442974030971527,
-0.13132993876934052,
-0.16709770262241364,
-0.17248199880123138,
-1.4781036376953125,
1.1758567094802856,
2.644426107406616,
-1.1903938055038452,
0.6011444330215454,
0.16758993268013,
1.1769580841064453,
-1.5817033052444458,
0.39435744285583496,
-0.5408653616905212,
2.1291069984436035,
0.2965324819087982,
1.0822641849517822,
-0.4605311453342438,
-2.323289394378662,
0.5757954716682434,
-1.2475006580352783,
-1.2525352239608765,
0.7427282929420471,
-1.0011557340621948,
0.023132096976041794,
-1.2905511856079102,
-0.17869853973388672,
-0.7716451287269592,
-1.2586333751678467,
0.7927715182304382,
0.3249552845954895,
0.5322286486625671,
-0.6219349503517151,
0.5159976482391357,
-2.3648133277893066,
-1.5300372838974,
-0.24638402462005615,
-0.9872863292694092,
0.486866295337677,
-0.41541749238967896,
0.5232542157173157,
-0.13885460793972015,
0.0005957833491265774,
0.36687108874320984,
1.4891246557235718,
3.3104300498962402,
0.21276812255382538,
0.5014153122901917,
-0.16374212503433228,
-0.8923786282539368,
1.5157794952392578,
1.0702139139175415,
-0.031899627298116684,
-0.5556966066360474,
-0.9221323132514954,
1.055944561958313,
2.0447115898132324,
0.9022921323776245,
-0.05581887066364288,
-0.7449201941490173,
-0.759204089641571,
-0.015818174928426743,
0.1218637004494667,
0.3627306818962097,
0.8745000958442688,
0.21926765143871307,
0.1039293110370636,
1.2241755723953247,
1.146610975265503,
-0.3711748421192169,
0.43994829058647156,
-0.7365692853927612,
-0.44866007566452026,
0.507026731967926,
0.4388192594051361,
-0.14154833555221558,
0.3838029205799103,
-0.9247651696205139,
-0.21622151136398315,
-0.29368963837623596,
-1.0308786630630493,
-0.8855751752853394,
-0.4039410948753357,
-0.34550759196281433,
1.7271721363067627,
-0.09751519560813904,
-0.7311326265335083,
-0.1390673816204071,
-0.7095328569412231,
0.08150415867567062,
-1.078425407409668,
0.17005325853824615,
-0.14364230632781982,
-0.04388575255870819,
0.022183673456311226,
1.9263012409210205,
-1.1608374118804932,
-2.2286691665649414,
0.2325689196586609,
0.15317797660827637,
-0.29505831003189087,
0.2064647227525711,
1.4551721811294556,
0.3724523186683655,
1.5385040044784546,
1.3599119186401367,
1.0795756578445435,
-0.7722941637039185,
-1.4875379800796509,
0.747459352016449,
0.7853246927261353,
-1.2925044298171997,
0.7140331268310547,
0.14476299285888672,
-0.3571953773498535,
0.6088945865631104,
1.05354642868042,
0.43116021156311035,
-2.0080902576446533,
0.696437656879425,
-0.943024754524231,
0.9086982607841492,
0.8390111327171326,
0.8500708341598511,
0.21366596221923828,
0.8746861815452576,
-1.1599295139312744,
-1.1340917348861694,
-0.7377288937568665,
-0.8943435549736023,
1.9308412075042725,
-0.42294347286224365,
0.6605914235115051,
-0.0925804153084755,
-1.1751970052719116,
-0.16149578988552094,
0.8044732213020325,
0.49103620648384094,
-0.47992807626724243,
0.5345562100410461,
-0.7029629349708557,
-1.1853808164596558,
-1.467460036277771,
-0.7605894207954407,
-1.0125778913497925,
-0.819040060043335,
1.0152690410614014,
0.7537915110588074,
0.2072349637746811,
1.8721596002578735,
0.5665198564529419,
0.2522943913936615,
-2.688524007797241,
0.8544900417327881,
0.2796177566051483,
0.11694790422916412,
0.7803634405136108,
0.4848940670490265,
0.898157000541687,
-0.05184570699930191,
0.5211746096611023,
-2.350827932357788,
2.427252769470215,
-0.40115347504615784,
0.7292423844337463,
-0.10740841925144196,
-0.22473210096359253,
1.066526174545288,
0.5778663754463196,
0.6415182948112488,
-1.2200331687927246,
0.6349979043006897,
-0.7040292024612427,
1.2938843965530396,
0.7132672667503357,
-0.692255437374115,
-0.04363565891981125,
1.3745759725570679,
0.481499046087265,
-0.5339717864990234,
-1.1106582880020142,
-0.9629512429237366,
0.9906353950500488,
1.6333119869232178,
-0.08220468461513519,
0.010284222662448883,
0.980763852596283,
0.6382418870925903,
-1.2520008087158203,
-0.016055040061473846,
-0.7803093194961548,
-0.8758504390716553,
1.6459628343582153,
2.145637035369873,
-0.08175098896026611,
-0.17756806313991547,
-0.8399986028671265,
-0.9826405644416809,
0.7280782461166382,
0.17015381157398224,
0.09551072865724564,
0.5869990587234497,
-0.5852068066596985,
1.1369308233261108,
0.8933526277542114,
1.058099389076233,
0.22366367280483246,
0.2851206064224243,
0.2618247866630554,
-0.13361503183841705,
-1.0815240144729614,
-0.12035796046257019,
-1.0858154296875,
-2.648986339569092,
0.5088117122650146,
-0.2958000600337982,
-1.523188829421997,
0.20013757050037384,
-1.1603955030441284,
0.8394507169723511,
-0.5406595468521118,
-1.1008025407791138,
-1.4536269903182983,
0.04732122644782066,
-0.07452007383108139,
0.8485391736030579,
-1.76604163646698,
-0.057630348950624466,
1.0900704860687256,
1.0872763395309448,
-0.7430880665779114,
1.091445803642273,
0.19944992661476135,
1.1142722368240356,
1.0568252801895142,
-0.3189484179019928,
0.4482702910900116,
0.09800601750612259,
-1.2353003025054932,
0.4519767463207245,
1.0885224342346191,
0.12006311863660812,
1.4774292707443237,
-0.6654376983642578,
0.013658104464411736,
0.5885741114616394,
-0.505946934223175,
-0.41176679730415344,
-0.7869585752487183,
0.7452457547187805,
0.07523683458566666,
-0.824273943901062,
0.14900580048561096,
-0.1911199688911438,
0.006780166644603014,
0.04310708865523338,
-1.5488884449005127,
-0.2812545895576477,
-0.3409552276134491,
-0.6043412089347839,
-1.268343210220337,
-0.11188434064388275,
1.373634934425354,
-0.7695806622505188,
-0.10529462993144989,
0.39872604608535767,
0.40443113446235657,
0.5205199122428894,
0.7000596523284912,
-0.7970014214515686,
-0.32619544863700867,
-0.14108732342720032,
-0.31696730852127075,
0.4527314603328705,
1.4896094799041748,
-0.2701224982738495,
-1.0441714525222778,
0.6064847707748413,
-0.2594474256038666,
-0.007873651571571827,
1.941068172454834,
0.02828284539282322,
-0.6608080863952637,
0.30361828207969666,
-0.8096666932106018,
1.9326413869857788,
1.7063077688217163,
1.3005149364471436,
-0.2263062745332718,
-1.1259573698043823,
0.7255245447158813,
-0.36744752526283264,
-0.4175522029399872,
0.8307963609695435,
0.31896471977233887,
-0.19348885118961334,
-1.2806689739227295,
0.6038144826889038,
1.2972129583358765,
-0.8808362483978271,
-0.8513047099113464,
0.1213306412100792,
-0.7324691414833069,
1.1011817455291748,
0.6928564310073853,
0.3768192231655121,
0.22722651064395905,
1.5914123058319092,
0.617592990398407,
-0.4763319194316864,
0.747469425201416,
0.42133235931396484,
-0.07958713918924332,
-2.051607847213745,
-1.2212159633636475,
0.3220575749874115,
-0.4923947751522064,
-1.5391755104064941,
1.374746322631836,
-1.0426750183105469,
-0.8643507361412048,
0.6724959015846252,
0.21582064032554626,
1.733973741531372,
0.36899566650390625,
1.6016085147857666,
2.038814067840576,
0.9321390986442566,
0.2707044184207916,
1.3579859733581543,
-0.12802493572235107,
-0.4349200129508972,
1.8735918998718262,
-0.5666067600250244,
0.48824068903923035,
1.0949811935424805,
-0.19939211010932922,
-1.0263534784317017,
-0.7809275984764099,
-1.3139623403549194,
-0.7720683813095093,
1.0725775957107544,
0.07952942699193954,
-1.2278426885604858,
0.23812009394168854,
1.611674427986145,
0.06494776159524918,
-0.2243126928806305,
0.5673976540565491,
0.36618268489837646,
-0.8223465085029602,
-0.1736181229352951,
-0.9987261295318604,
0.503754734992981,
-0.4716112017631531,
-0.4236519932746887,
0.27349182963371277,
0.5570173859596252,
1.1414318084716797,
-0.030946506187319756,
0.10219336301088333,
1.340804100036621,
-1.5247728824615479,
1.417932391166687,
-0.7386218905448914,
0.2525666058063507,
-2.3648054599761963,
1.3888648748397827,
-0.7672426104545593,
1.840356469154358,
-2.72009539604187,
0.41322529315948486,
-0.648216187953949,
-0.5827683806419373,
0.4353896379470825,
-0.29161036014556885,
0.20325571298599243,
-0.27582013607025146,
-1.1065727472305298,
0.0012461994774639606,
-0.6740655899047852,
0.48313048481941223,
0.8734878897666931,
1.2843732833862305,
-0.9108384251594543,
-0.39778175950050354,
-1.79156494140625,
-0.09389672428369522,
-0.5509065985679626,
0.5069116353988647,
-1.926301121711731,
-0.2654880881309509,
-1.930871844291687,
-2.257174015045166,
-1.2943487167358398,
-0.6216315031051636,
1.1421254873275757,
0.25190073251724243,
-0.6753992438316345,
0.9807799458503723,
-0.1950557678937912,
-1.9084841012954712,
1.054041862487793,
-2.138490676879883
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | Hi! I think you can use the newly-added `from_generator` method for that:
```python
from datasets import Dataset
def gen():
for idx in len(torch_dataset):
yield torch_dataset[idx] # this has to be a dictionary
## or if it's an IterableDataset
# for ex in torch_dataset:
# yield ex
dset = Dataset.from_generator(gen)
``` | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 50 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
Hi! I think you can use the newly-added `from_generator` method for that:
```python
from datasets import Dataset
def gen():
for idx in len(torch_dataset):
yield torch_dataset[idx] # this has to be a dictionary
## or if it's an IterableDataset
# for ex in torch_dataset:
# yield ex
dset = Dataset.from_generator(gen)
``` | [
-1.1193097829818726,
-0.8667363524436951,
-0.7408115863800049,
1.4722185134887695,
-0.20886550843715668,
-1.2309952974319458,
0.2481490820646286,
-1.1076936721801758,
1.757943868637085,
-0.876316487789154,
0.3777748644351959,
-1.7148374319076538,
0.06892246007919312,
-0.533190906047821,
-0.7995288968086243,
-0.990098774433136,
-0.4541342556476593,
-0.618131160736084,
0.9591826796531677,
2.482046604156494,
1.1452409029006958,
-1.382868766784668,
2.496936798095703,
0.7217744588851929,
-0.11814381927251816,
-1.1030848026275635,
0.526888906955719,
0.21835857629776,
-1.2631779909133911,
-0.3034360110759735,
-0.9461925625801086,
-0.16624894738197327,
-0.5646422505378723,
-0.6580835580825806,
-0.07756383717060089,
0.44585293531417847,
-0.27837085723876953,
-0.46393799781799316,
-0.4154357612133026,
-0.8051895499229431,
0.46481433510780334,
-0.39293116331100464,
0.9719021916389465,
-0.35767897963523865,
1.857934832572937,
-0.6330967545509338,
0.49811041355133057,
0.7290024161338806,
1.3167088031768799,
0.2116493582725525,
-0.04003024473786354,
0.23428818583488464,
0.39969706535339355,
0.03866373375058174,
0.3911215662956238,
1.105085015296936,
0.6492509245872498,
0.5368515849113464,
0.7154991030693054,
-2.3001255989074707,
1.2285528182983398,
-1.087186336517334,
0.3874833583831787,
1.289923906326294,
-0.9757000207901001,
0.3165301978588104,
-1.7578911781311035,
-0.13166408240795135,
0.5830821990966797,
-2.1653575897216797,
0.23112447559833527,
-1.361264944076538,
-0.49505162239074707,
1.0317230224609375,
0.356438547372818,
-1.253501057624817,
0.24109850823879242,
-0.3522690236568451,
0.9196890592575073,
0.4587754011154175,
1.125992774963379,
-1.7032124996185303,
0.08193403482437134,
-0.4688911736011505,
0.16329608857631683,
-1.3347638845443726,
-1.4080718755722046,
0.6460390686988831,
0.6772194504737854,
0.5769290328025818,
-0.10691548883914948,
0.969079315662384,
-1.0628167390823364,
0.7655445337295532,
-1.0807803869247437,
-1.783840298652649,
-1.4278415441513062,
-2.1751034259796143,
-2.472459554672241,
0.7478586435317993,
-0.4078812301158905,
-0.5161911845207214,
2.003490686416626,
-1.0659912824630737,
-1.760762333869934,
1.1587611436843872,
0.2688537836074829,
-0.035666752606630325,
2.346090316772461,
0.0977390930056572,
-0.6551423072814941,
0.43299487233161926,
-0.7656072378158569,
0.7441044449806213,
-0.19541679322719574,
1.3112645149230957,
0.5385631322860718,
-1.1402783393859863,
1.6154823303222656,
-0.3164471685886383,
0.5137381553649902,
-0.7121351957321167,
-0.4954109191894531,
-0.772135853767395,
0.22412271797657013,
1.7872503995895386,
-0.29431435465812683,
1.6037379503250122,
-0.357877641916275,
-1.5156099796295166,
-1.5590940713882446,
0.9105549454689026,
0.3605036437511444,
-0.755952000617981,
0.027444764971733093,
-0.3008033335208893,
0.12466083467006683,
-0.12421784549951553,
1.1838347911834717,
1.14725923538208,
0.7186399102210999,
-0.4128401279449463,
-0.8155398368835449,
0.13487058877944946,
-0.011344867758452892,
-0.8193092346191406,
-1.7221417427062988,
-0.371660977602005,
0.07496210932731628,
0.6075080037117004,
-1.1465240716934204,
1.758496642112732,
0.8187397122383118,
1.8249322175979614,
1.0329715013504028,
-0.41945958137512207,
1.4716987609863281,
0.045658938586711884,
1.8882132768630981,
-0.5376482605934143,
0.692567765712738,
-0.317830353975296,
-1.1427468061447144,
0.9000718593597412,
-0.256710410118103,
-2.1107099056243896,
-0.9038785696029663,
-0.7934566736221313,
-0.14673840999603271,
-0.8260348439216614,
1.008070945739746,
-0.22080907225608826,
-1.5204875469207764,
0.2945803105831146,
-0.6361086964607239,
0.17618127167224884,
-1.14768385887146,
0.33553463220596313,
0.7319351434707642,
-0.616539716720581,
0.07224839180707932,
-0.2733100354671478,
-1.3342078924179077,
-0.36743223667144775,
0.2361794263124466,
1.817297339439392,
-0.7688447833061218,
0.9267126321792603,
1.0127089023590088,
-0.7309421896934509,
-0.06636005640029907,
0.25138649344444275,
-0.2515373229980469,
0.8732956051826477,
-1.0147136449813843,
-0.4758935868740082,
1.170870065689087,
-0.11945491284132004,
-0.6962087154388428,
1.5346230268478394,
0.6721754670143127,
-0.8896485567092896,
-0.16528882086277008,
-0.18940263986587524,
-0.7313659191131592,
0.045235775411129,
-1.6570534706115723,
0.0033604074269533157,
0.3972448408603668,
-1.5082216262817383,
-0.44540566205978394,
-0.20571587979793549,
1.2057865858078003,
-0.22277630865573883,
1.3519201278686523,
-0.23767192661762238,
-0.3076291084289551,
-0.38806650042533875,
-0.32032981514930725,
0.15817609429359436,
-0.15578390657901764,
-0.6563786864280701,
0.31359556317329407,
-0.8013956546783447,
0.5023851990699768,
1.2609230279922485,
0.34365323185920715,
0.14137712121009827,
0.53452068567276,
1.0482854843139648,
0.311544269323349,
-0.07138674706220627,
-0.8418944478034973,
-1.6311553716659546,
2.1158056259155273,
-1.3749730587005615,
2.0060465335845947,
0.6698592901229858,
-0.06346242129802704,
-1.8121815919876099,
-1.7936838865280151,
1.4123741388320923,
1.203873872756958,
2.3315722942352295,
0.6240413188934326,
0.39442935585975647,
-0.8191079497337341,
-0.5576320290565491,
0.32241612672805786,
-1.0349317789077759,
-0.6720309853553772,
0.21887239813804626,
2.3854377269744873,
1.728662371635437,
-0.4506388306617737,
-0.1667574644088745,
-1.0994408130645752,
1.3601975440979004,
-0.25408655405044556,
0.29585838317871094,
2.0368432998657227,
-0.36470749974250793,
-1.1415274143218994,
1.3714313507080078,
-2.3211376667022705,
0.015450145117938519,
1.9606797695159912,
0.153524249792099,
-0.033693578094244,
-1.4014359712600708,
-0.6108738780021667,
-0.3494483530521393,
-0.43636053800582886,
-1.3248554468154907,
0.46556171774864197,
-0.20652449131011963,
-0.7018899917602539,
-1.4266879558563232,
0.17227831482887268,
-1.1176449060440063,
-1.6707489490509033,
0.304211288690567,
1.7526620626449585,
1.8594870567321777,
-0.7361668944358826,
1.508058786392212,
-0.33379802107810974,
0.28593766689300537,
1.2175610065460205,
1.1475797891616821,
3.0787925720214844,
2.002887725830078,
-1.2673531770706177,
0.7539109587669373,
-0.20061910152435303,
-0.5712016820907593,
1.362305760383606,
-1.192609190940857,
1.344610333442688,
-0.16180852055549622,
-1.2560136318206787,
-1.3279896974563599,
1.0117123126983643,
0.3957153260707855,
0.11623033881187439,
-0.6127793192863464,
1.2411288022994995,
0.06922012567520142,
1.2868781089782715,
0.5370409488677979,
-0.3582957088947296,
0.6136441230773926,
-0.5107050538063049,
-0.4596300423145294,
1.4982115030288696,
0.23008908331394196,
-1.3025912046432495,
-2.3868229389190674,
-0.2612052261829376,
-0.861639678478241,
-0.10952437669038773,
-0.528937578201294,
-1.0205280780792236,
1.75139582157135,
0.3682653307914734,
-1.345761775970459,
-0.1955357789993286,
-0.26206284761428833,
-0.6307059526443481,
2.7373249530792236,
-1.3592346906661987,
-0.18521234393119812,
-1.079131007194519,
-0.7313078045845032,
1.7378578186035156,
-1.153484582901001,
-0.1528891623020172,
-1.0059666633605957,
-0.6561865210533142,
-1.4264988899230957,
-0.637109100818634,
0.02491038292646408,
-0.9806234836578369,
0.8128331899642944,
0.1753143072128296,
-1.1161609888076782,
-0.34652429819107056,
-0.7926658987998962,
0.8532634973526001,
-0.12869228422641754,
0.34575366973876953,
1.9813858270645142,
0.5210400223731995,
-0.4030407667160034,
0.6085265874862671,
1.0884276628494263,
0.7632442116737366,
-0.7507069706916809,
0.35754987597465515,
-0.8031590580940247,
0.24334882199764252,
-1.3015803098678589,
0.280497282743454,
-2.765690803527832,
0.5350795984268188,
-0.07418082654476166,
-0.0587364099919796,
0.030327454209327698,
-1.2393369674682617,
1.1092329025268555,
2.5784451961517334,
-1.2081915140151978,
0.4166245460510254,
0.3144669532775879,
1.1612548828125,
-1.4654338359832764,
0.37828975915908813,
-0.4452518820762634,
2.155928373336792,
0.28938376903533936,
1.1115964651107788,
-0.4235004186630249,
-2.1883835792541504,
0.6367952227592468,
-1.3528718948364258,
-1.3718675374984741,
0.8502289652824402,
-0.9670299291610718,
0.11759650707244873,
-1.4560065269470215,
-0.19312259554862976,
-0.8902810215950012,
-1.2553932666778564,
0.8033282160758972,
0.11293283104896545,
0.5030994415283203,
-0.5796195864677429,
0.35958755016326904,
-2.1984148025512695,
-1.405146837234497,
-0.30481117963790894,
-0.9443175792694092,
0.4314365088939667,
-0.1939549595117569,
0.682643711566925,
-0.13716521859169006,
0.02361156791448593,
0.31486305594444275,
1.3879499435424805,
3.3771941661834717,
0.3496904969215393,
0.3536021113395691,
-0.12308148294687271,
-0.966532826423645,
1.4803658723831177,
0.8905866742134094,
-0.04729605093598366,
-0.5526828765869141,
-0.9781792759895325,
1.156182885169983,
2.031181573867798,
1.0570034980773926,
-0.021768473088741302,
-0.7095271944999695,
-0.6412201523780823,
0.05464253947138786,
0.22741787135601044,
0.4203735888004303,
0.8434332013130188,
0.08446869254112244,
0.18664348125457764,
1.475691795349121,
1.2638424634933472,
-0.3748856782913208,
0.32021042704582214,
-0.8404470086097717,
-0.5864481329917908,
0.631130039691925,
0.2951407730579376,
0.051506299525499344,
0.4258365333080292,
-1.075722336769104,
-0.3310023248195648,
-0.44407346844673157,
-0.9918245077133179,
-0.7039957046508789,
-0.4860478937625885,
-0.41749659180641174,
1.598391056060791,
-0.10389203578233719,
-0.47742071747779846,
-0.08052290230989456,
-0.7469490766525269,
-0.10494561493396759,
-1.0751360654830933,
0.2660471200942993,
-0.07393462210893631,
-0.10173054784536362,
-0.05620281398296356,
1.7962090969085693,
-0.9895654320716858,
-1.9741926193237305,
0.24756981432437897,
0.2379114180803299,
-0.3610287308692932,
0.2548242211341858,
1.5474967956542969,
0.45782163739204407,
1.3665741682052612,
1.313307523727417,
0.9865058064460754,
-0.6553264260292053,
-1.3383091688156128,
0.625780463218689,
0.9337531328201294,
-1.3355810642242432,
0.8998221158981323,
0.10411405563354492,
-0.521084189414978,
0.6021521091461182,
1.1271334886550903,
0.3854638338088989,
-2.0147252082824707,
0.7014914751052856,
-0.8549936413764954,
0.7407017350196838,
0.6993380188941956,
0.7503964900970459,
0.15474627912044525,
0.846089243888855,
-1.231984257698059,
-1.0701417922973633,
-0.7915316820144653,
-0.5143094658851624,
1.9829260110855103,
-0.2916860282421112,
0.7576897144317627,
-0.16514235734939575,
-1.349161982536316,
-0.08752024918794632,
0.7280004024505615,
0.40368056297302246,
-0.648630678653717,
0.8171025514602661,
-0.40817371010780334,
-1.0643196105957031,
-1.350782036781311,
-0.4463391602039337,
-1.0715738534927368,
-0.8491503596305847,
1.1479167938232422,
0.8049033284187317,
0.17777730524539948,
1.7826370000839233,
0.5753369927406311,
0.18579702079296112,
-2.6969542503356934,
0.8689311146736145,
0.19557878375053406,
-0.07778970897197723,
0.8073051571846008,
0.34234175086021423,
0.9751981496810913,
-0.11737214028835297,
0.5530531406402588,
-2.357060432434082,
2.2158854007720947,
-0.14896664023399353,
0.6367315649986267,
-0.03935057669878006,
-0.20124070346355438,
1.0617053508758545,
0.5938083529472351,
0.6105133891105652,
-1.0292670726776123,
0.5827857851982117,
-0.5360676050186157,
1.2199910879135132,
0.969581663608551,
-0.7885193228721619,
-0.16330423951148987,
1.3996963500976562,
0.5236515998840332,
-0.3726698160171509,
-0.8968255519866943,
-0.8790039420127869,
0.9280287623405457,
1.6571990251541138,
-0.08289162069559097,
-0.14142002165317535,
1.0580885410308838,
0.7395155429840088,
-1.3111180067062378,
0.10435650497674942,
-0.7698203325271606,
-0.6188662052154541,
1.7076575756072998,
2.1505796909332275,
-0.13400104641914368,
-0.21262528002262115,
-0.7933375835418701,
-1.0574215650558472,
0.8772722482681274,
-0.10745970904827118,
0.08840103447437286,
0.7068266272544861,
-0.6363425850868225,
1.1249430179595947,
0.8719303011894226,
1.0342252254486084,
0.249797984957695,
0.3494804799556732,
0.31653669476509094,
-0.24122394621372223,
-1.191040277481079,
-0.1675586998462677,
-1.0227391719818115,
-2.529221296310425,
0.5251802206039429,
-0.31752151250839233,
-1.399932622909546,
0.026894137263298035,
-1.082179307937622,
0.9410548210144043,
-0.6268314719200134,
-1.1117042303085327,
-1.585530161857605,
0.25454601645469666,
0.06391378492116928,
0.9777233004570007,
-1.6145384311676025,
0.08234701305627823,
1.1896504163742065,
0.8763604164123535,
-0.6935077905654907,
0.9919367432594299,
0.2930116057395935,
1.098865032196045,
0.8458758592605591,
-0.3699847161769867,
0.5815137028694153,
0.16867129504680634,
-1.304815649986267,
0.46491971611976624,
1.0141456127166748,
0.14820276200771332,
1.4378182888031006,
-0.6186987161636353,
0.03199272230267525,
0.47820010781288147,
-0.5610918402671814,
-0.38103336095809937,
-0.6406537890434265,
0.8006344437599182,
0.11619533598423004,
-0.8242108225822449,
0.045024432241916656,
-0.021154647693037987,
-0.19900284707546234,
0.17152397334575653,
-1.4391148090362549,
-0.16548500955104828,
-0.3666241466999054,
-0.7335934638977051,
-1.2219382524490356,
-0.12022573500871658,
1.4003586769104004,
-0.8267665505409241,
-0.08103664964437485,
0.4952377676963806,
0.371853232383728,
0.5795068740844727,
0.5819094777107239,
-0.5275758504867554,
-0.3957516551017761,
-0.2959086000919342,
-0.2942459285259247,
0.31624943017959595,
1.3722209930419922,
-0.22014594078063965,
-1.0912320613861084,
0.8192639946937561,
-0.39602622389793396,
-0.0036791106685996056,
1.981316089630127,
0.058888617902994156,
-0.8020963072776794,
0.36137863993644714,
-0.6216369867324829,
1.8637417554855347,
1.7631876468658447,
1.3757421970367432,
-0.10338307172060013,
-0.9863747954368591,
0.5881566405296326,
-0.3795073926448822,
-0.46402838826179504,
0.8499364256858826,
0.39948010444641113,
-0.05730761960148811,
-1.3164868354797363,
0.7673738598823547,
1.3522052764892578,
-0.9867729544639587,
-0.8699237704277039,
0.27803874015808105,
-0.8024865388870239,
1.11654794216156,
0.7445164918899536,
0.3937334716320038,
0.2673456072807312,
1.4808241128921509,
0.7184873819351196,
-0.40499141812324524,
0.523892879486084,
0.5247633457183838,
-0.03824931010603905,
-2.0007998943328857,
-1.0949981212615967,
0.3231678009033203,
-0.5309094190597534,
-1.6103882789611816,
1.3297216892242432,
-1.3040522336959839,
-0.8709697127342224,
0.5614604353904724,
0.07297740131616592,
1.5186171531677246,
0.3522469103336334,
1.576993465423584,
2.13576078414917,
0.8901349902153015,
0.34580540657043457,
1.4225045442581177,
-0.0487607978284359,
-0.522333562374115,
1.7560174465179443,
-0.4213655889034271,
0.5731707811355591,
1.1317088603973389,
-0.1995036005973816,
-0.9727880358695984,
-0.7576280236244202,
-1.3090553283691406,
-0.5835065245628357,
1.2288340330123901,
0.10600157082080841,
-1.165166974067688,
0.22539584338665009,
1.4935901165008545,
0.01229959074407816,
-0.3176098167896271,
0.5899192690849304,
0.2749826908111572,
-0.8101651072502136,
-0.13775840401649475,
-0.9175567626953125,
0.46492844820022583,
-0.2562544047832489,
-0.18613918125629425,
0.3254184126853943,
0.45917218923568726,
1.3016964197158813,
0.012332807295024395,
0.1928800642490387,
1.2082059383392334,
-1.4404100179672241,
1.507395625114441,
-0.6198588013648987,
0.22219450771808624,
-2.3629016876220703,
1.3271883726119995,
-0.7413542866706848,
1.7989461421966553,
-2.708791971206665,
0.3954530656337738,
-0.5649559497833252,
-0.39723047614097595,
0.2705997824668884,
-0.3793919086456299,
0.14700862765312195,
-0.14516113698482513,
-1.1267703771591187,
0.02303668111562729,
-0.7983726263046265,
0.5752811431884766,
1.0027929544448853,
1.2383389472961426,
-1.2953457832336426,
-0.4554559886455536,
-1.7400579452514648,
-0.20028048753738403,
-0.6364766955375671,
0.3694307506084442,
-1.9894359111785889,
-0.0674217939376831,
-1.8997026681900024,
-2.5727620124816895,
-1.3772943019866943,
-0.7878212928771973,
1.097585916519165,
0.05958661809563637,
-0.84547358751297,
1.006131887435913,
-0.3444673418998718,
-1.9790607690811157,
1.1603761911392212,
-2.1129438877105713
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | Maybe `Dataset.from_list` can work as well no ?
```python
from datasets import Dataset
dset = Dataset.from_list(torch_dataset)
``` | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 17 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
Maybe `Dataset.from_list` can work as well no ?
```python
from datasets import Dataset
dset = Dataset.from_list(torch_dataset)
``` | [
-1.0819419622421265,
-0.8804657459259033,
-0.7152329683303833,
1.4810476303100586,
-0.2653998136520386,
-1.2336766719818115,
0.27769726514816284,
-1.1059556007385254,
1.7844395637512207,
-0.9225749969482422,
0.4119645357131958,
-1.7433644533157349,
0.06003236398100853,
-0.5681083798408508,
-0.7597638964653015,
-1.0191540718078613,
-0.4215303957462311,
-0.6387455463409424,
0.8946991562843323,
2.4652769565582275,
1.0865440368652344,
-1.300100564956665,
2.494784116744995,
0.7262409925460815,
-0.13998667895793915,
-1.104459524154663,
0.5682466626167297,
0.2622758150100708,
-1.2441270351409912,
-0.266028493642807,
-0.9801182150840759,
-0.1463824212551117,
-0.5562832355499268,
-0.7089055776596069,
-0.07768682390451431,
0.4213688373565674,
-0.2976190745830536,
-0.4331188499927521,
-0.42003339529037476,
-0.7932204008102417,
0.47362595796585083,
-0.4047291576862335,
0.9869089722633362,
-0.37075331807136536,
1.895473599433899,
-0.622673511505127,
0.4735969007015228,
0.7400205731391907,
1.2783385515213013,
0.18669749796390533,
-0.04911879822611809,
0.17893505096435547,
0.4273236393928528,
0.06570063531398773,
0.3730572462081909,
1.0671160221099854,
0.5747888684272766,
0.5906234979629517,
0.7750167846679688,
-2.332096815109253,
1.3010950088500977,
-1.074742078781128,
0.414485901594162,
1.2633347511291504,
-0.9328819513320923,
0.30312374234199524,
-1.7241730690002441,
-0.1251078099012375,
0.5588632822036743,
-2.1621172428131104,
0.23458078503608704,
-1.4406256675720215,
-0.5419683456420898,
0.9800190329551697,
0.41448816657066345,
-1.2224379777908325,
0.24105823040008545,
-0.3094601035118103,
0.8657095432281494,
0.5189956426620483,
1.0904628038406372,
-1.7025508880615234,
0.09987619519233704,
-0.5178182125091553,
0.1533900946378708,
-1.3761721849441528,
-1.3840012550354004,
0.6645793318748474,
0.7146245837211609,
0.6289622783660889,
-0.16395649313926697,
0.9804741144180298,
-1.0168848037719727,
0.7291858792304993,
-1.042133092880249,
-1.7515336275100708,
-1.3507314920425415,
-2.1212637424468994,
-2.510765790939331,
0.7216010093688965,
-0.4231257736682892,
-0.5026229023933411,
1.9921400547027588,
-1.088714361190796,
-1.7896308898925781,
1.1725778579711914,
0.22708606719970703,
-0.07804128527641296,
2.3448657989501953,
0.12874068319797516,
-0.599356472492218,
0.39875513315200806,
-0.7514778971672058,
0.7907872796058655,
-0.08866278827190399,
1.3113906383514404,
0.5819370150566101,
-1.1911197900772095,
1.6855946779251099,
-0.2501719295978546,
0.48339834809303284,
-0.6886003613471985,
-0.5267302393913269,
-0.7477176785469055,
0.156087264418602,
1.7625033855438232,
-0.29802945256233215,
1.5912885665893555,
-0.40448087453842163,
-1.53218674659729,
-1.580049753189087,
0.9011862277984619,
0.3815753161907196,
-0.7176817655563354,
-0.017858659848570824,
-0.2751978039741516,
0.11832211911678314,
-0.09983305633068085,
1.285800814628601,
1.1845130920410156,
0.7524096369743347,
-0.4071883261203766,
-0.7547093629837036,
0.1074526235461235,
-0.010796120390295982,
-0.8597769141197205,
-1.7716280221939087,
-0.4001757800579071,
0.07166577130556107,
0.6519333720207214,
-1.076935887336731,
1.744025707244873,
0.8615915775299072,
1.7971476316452026,
1.0287622213363647,
-0.41542506217956543,
1.3953131437301636,
-0.011149875819683075,
1.89859938621521,
-0.5536633729934692,
0.710559070110321,
-0.3590488135814667,
-1.1003142595291138,
0.9258370995521545,
-0.17631761729717255,
-2.034327268600464,
-0.9555754065513611,
-0.7615162134170532,
-0.1766553670167923,
-0.8036201000213623,
1.0165680646896362,
-0.2656971514225006,
-1.5503591299057007,
0.28634557127952576,
-0.5974465608596802,
0.13632932305335999,
-1.117983102798462,
0.30634602904319763,
0.7258978486061096,
-0.6545321345329285,
0.04895951598882675,
-0.24729833006858826,
-1.3486089706420898,
-0.41426923871040344,
0.1714584082365036,
1.856109619140625,
-0.7778840661048889,
0.9457042217254639,
1.0031027793884277,
-0.8008025884628296,
-0.09772273153066635,
0.24611523747444153,
-0.2608870565891266,
0.7895653247833252,
-1.0100419521331787,
-0.418285995721817,
1.1523910760879517,
-0.08952203392982483,
-0.678080677986145,
1.6004136800765991,
0.6785434484481812,
-0.8849286437034607,
-0.1260991096496582,
-0.20896227657794952,
-0.6566420793533325,
0.014483644627034664,
-1.6348412036895752,
-0.03109923005104065,
0.3586655855178833,
-1.4409080743789673,
-0.4981357455253601,
-0.21072779595851898,
1.2369787693023682,
-0.20288661122322083,
1.257738471031189,
-0.19125814735889435,
-0.3921752870082855,
-0.41337376832962036,
-0.26962652802467346,
0.1595318615436554,
-0.11272045969963074,
-0.6655281782150269,
0.37023767828941345,
-0.8316967487335205,
0.4701738655567169,
1.2427988052368164,
0.31200987100601196,
0.13008522987365723,
0.5302770733833313,
1.0369693040847778,
0.32628491520881653,
-0.028074640780687332,
-0.8474717140197754,
-1.6242371797561646,
2.059561252593994,
-1.4101219177246094,
1.957271695137024,
0.605121910572052,
-0.035171616822481155,
-1.8423855304718018,
-1.8116276264190674,
1.4227489233016968,
1.2268092632293701,
2.323484420776367,
0.6393540501594543,
0.31337130069732666,
-0.7723907828330994,
-0.5322240591049194,
0.32786086201667786,
-1.0797938108444214,
-0.6357536315917969,
0.23261868953704834,
2.3230693340301514,
1.6892566680908203,
-0.5537625551223755,
-0.1451053023338318,
-1.120210886001587,
1.2770124673843384,
-0.19736996293067932,
0.2542523145675659,
2.0729846954345703,
-0.45271623134613037,
-1.2070809602737427,
1.4155535697937012,
-2.279819965362549,
-0.004521331284195185,
1.9429327249526978,
0.0802241712808609,
-0.05138228088617325,
-1.3732112646102905,
-0.6625122427940369,
-0.3099675476551056,
-0.5196371078491211,
-1.3668668270111084,
0.5375325083732605,
-0.2429870218038559,
-0.7285374402999878,
-1.4523299932479858,
0.1444266438484192,
-1.1003698110580444,
-1.6592508554458618,
0.4017760455608368,
1.759013295173645,
1.8536208868026733,
-0.6524828672409058,
1.5189003944396973,
-0.32792773842811584,
0.27754807472229004,
1.2312591075897217,
1.1728893518447876,
3.041077136993408,
1.9997613430023193,
-1.2058789730072021,
0.8021601438522339,
-0.18198245763778687,
-0.5732423663139343,
1.3990585803985596,
-1.1716405153274536,
1.3507816791534424,
-0.19885917007923126,
-1.2531065940856934,
-1.3687020540237427,
1.005867838859558,
0.38105902075767517,
0.13009481132030487,
-0.5487792491912842,
1.2707897424697876,
0.07113965600728989,
1.2435358762741089,
0.5311327576637268,
-0.3497196137905121,
0.658652126789093,
-0.5452218055725098,
-0.44413724541664124,
1.4871097803115845,
0.26783058047294617,
-1.2938169240951538,
-2.400290012359619,
-0.2646200358867645,
-0.8594589233398438,
-0.08907394856214523,
-0.4852471947669983,
-1.0069975852966309,
1.767854928970337,
0.38536766171455383,
-1.3920578956604004,
-0.15500508248806,
-0.25939568877220154,
-0.6042430400848389,
2.7177224159240723,
-1.331976294517517,
-0.18908630311489105,
-1.0837808847427368,
-0.7437466979026794,
1.7654978036880493,
-1.1812280416488647,
-0.133090540766716,
-1.0154987573623657,
-0.5724042057991028,
-1.4670014381408691,
-0.6111961007118225,
0.027247335761785507,
-1.028598666191101,
0.8217211961746216,
0.11094421148300171,
-1.0536680221557617,
-0.38848137855529785,
-0.8287602066993713,
0.8630728125572205,
-0.10929743945598602,
0.34535008668899536,
1.9991626739501953,
0.5556550025939941,
-0.40659528970718384,
0.5243471264839172,
1.0765689611434937,
0.7696664333343506,
-0.7554997205734253,
0.3917238414287567,
-0.7582047581672668,
0.18496032059192657,
-1.3400921821594238,
0.2859605550765991,
-2.7971432209014893,
0.5583835244178772,
-0.037731267511844635,
-0.10822568833827972,
0.03455208241939545,
-1.262191653251648,
1.1010686159133911,
2.5669143199920654,
-1.2140079736709595,
0.354907363653183,
0.24175164103507996,
1.164974570274353,
-1.3668086528778076,
0.3837437331676483,
-0.44012582302093506,
2.122601270675659,
0.28903302550315857,
1.0530831813812256,
-0.3830930292606354,
-2.1596992015838623,
0.6667398810386658,
-1.3183236122131348,
-1.3550986051559448,
0.8447432518005371,
-0.9290804862976074,
0.10445477068424225,
-1.4310259819030762,
-0.13798674941062927,
-0.9234743714332581,
-1.2275296449661255,
0.8642261624336243,
0.1503923088312149,
0.5121167898178101,
-0.5915161371231079,
0.37038084864616394,
-2.155494213104248,
-1.400416612625122,
-0.30960404872894287,
-0.9329679012298584,
0.4812813699245453,
-0.14001518487930298,
0.651397705078125,
-0.18983641266822815,
0.07424969971179962,
0.34124955534935,
1.4564188718795776,
3.3906259536743164,
0.29623663425445557,
0.3495541512966156,
-0.09785984456539154,
-1.0239604711532593,
1.496534824371338,
0.9838428497314453,
0.04390227422118187,
-0.5900898575782776,
-1.0081843137741089,
1.0449645519256592,
2.0393753051757812,
1.0861927270889282,
-0.042088981717824936,
-0.7347348928451538,
-0.6474780440330505,
0.10046935081481934,
0.2630494236946106,
0.4447548985481262,
0.8454276919364929,
0.13621768355369568,
0.1740957498550415,
1.4810893535614014,
1.257046103477478,
-0.3461402654647827,
0.31742289662361145,
-0.845835268497467,
-0.598652184009552,
0.7002722024917603,
0.2988600432872772,
0.07775066047906876,
0.4034283757209778,
-1.1246751546859741,
-0.3219471871852875,
-0.4167068600654602,
-1.0406748056411743,
-0.7118815183639526,
-0.550667405128479,
-0.47481799125671387,
1.5220853090286255,
-0.16264738142490387,
-0.4688565135002136,
-0.08957523852586746,
-0.7813253998756409,
-0.13280674815177917,
-1.0527238845825195,
0.28638795018196106,
-0.10377554595470428,
-0.11345583200454712,
-0.06322669237852097,
1.7795023918151855,
-0.9435814023017883,
-1.937625765800476,
0.3107599914073944,
0.22803007066249847,
-0.38729068636894226,
0.3078751266002655,
1.4940619468688965,
0.5012582540512085,
1.382001519203186,
1.2829152345657349,
0.9835556149482727,
-0.5851098299026489,
-1.3140166997909546,
0.5659535527229309,
0.8564075827598572,
-1.3505946397781372,
0.9511560201644897,
0.10511346161365509,
-0.5126226544380188,
0.6615812182426453,
1.1369307041168213,
0.38106569647789,
-2.0026979446411133,
0.6775453090667725,
-0.8104609847068787,
0.7342039346694946,
0.6973789930343628,
0.7819415330886841,
0.12543651461601257,
0.8583593964576721,
-1.2027779817581177,
-1.0774803161621094,
-0.7760332822799683,
-0.5001201629638672,
1.9381548166275024,
-0.24025557935237885,
0.8037157654762268,
-0.21822498738765717,
-1.3208956718444824,
-0.0955602154135704,
0.740492582321167,
0.40917474031448364,
-0.7036457061767578,
0.7989702224731445,
-0.3791501522064209,
-1.027319312095642,
-1.361891508102417,
-0.47199517488479614,
-1.129871129989624,
-0.8303402662277222,
1.154117226600647,
0.7581498026847839,
0.1862536519765854,
1.7477469444274902,
0.507900595664978,
0.19609829783439636,
-2.6956746578216553,
0.8570408225059509,
0.1461953967809677,
-0.04286420717835426,
0.8455304503440857,
0.34670770168304443,
1.0288150310516357,
-0.18520542979240417,
0.599005937576294,
-2.353698492050171,
2.2381415367126465,
-0.16786599159240723,
0.5764140486717224,
-0.010786578990519047,
-0.16548627614974976,
1.0340200662612915,
0.5764977931976318,
0.6316360235214233,
-1.064188003540039,
0.5399795174598694,
-0.5527315139770508,
1.2181376218795776,
0.9553417563438416,
-0.7283526062965393,
-0.17535296082496643,
1.4185247421264648,
0.5672093033790588,
-0.30832499265670776,
-0.7748864889144897,
-0.9604012370109558,
0.8551221489906311,
1.6677836179733276,
-0.16925349831581116,
-0.20849865674972534,
1.0220738649368286,
0.7466776371002197,
-1.364604115486145,
0.06929415464401245,
-0.7780738472938538,
-0.5354430079460144,
1.6954269409179688,
2.1327176094055176,
-0.1462819129228592,
-0.18672718107700348,
-0.8082922697067261,
-0.9502076506614685,
0.8759210705757141,
-0.07198315858840942,
0.07682059705257416,
0.718722403049469,
-0.6279836893081665,
1.1537282466888428,
0.8568294644355774,
1.0230822563171387,
0.30868667364120483,
0.4862072765827179,
0.3572710156440735,
-0.2579813003540039,
-1.2581764459609985,
-0.20770633220672607,
-0.9936250448226929,
-2.5403528213500977,
0.5438594818115234,
-0.423420786857605,
-1.408745288848877,
0.0009203683584928513,
-1.146972894668579,
0.8894280791282654,
-0.6410117149353027,
-1.078824520111084,
-1.571236252784729,
0.239504873752594,
0.0921841487288475,
1.0471760034561157,
-1.6225844621658325,
0.13494348526000977,
1.228461503982544,
0.8885440826416016,
-0.7498373985290527,
1.0105483531951904,
0.35389167070388794,
1.100521206855774,
0.8404726982116699,
-0.4167735278606415,
0.5896816849708557,
0.14853166043758392,
-1.276365876197815,
0.4309631586074829,
1.003529667854309,
0.16370157897472382,
1.3596621751785278,
-0.6338722109794617,
0.03569434955716133,
0.48439186811447144,
-0.613220751285553,
-0.41094768047332764,
-0.6341835856437683,
0.7786076068878174,
0.13046889007091522,
-0.8496385812759399,
0.06923598796129227,
0.005358663387596607,
-0.2270839810371399,
0.1792386919260025,
-1.4115917682647705,
-0.21581517159938812,
-0.3981727063655853,
-0.7377744317054749,
-1.2494250535964966,
-0.1315937340259552,
1.3624874353408813,
-0.7988722324371338,
-0.009875885210931301,
0.4655386209487915,
0.3269188106060028,
0.5774164795875549,
0.5988596081733704,
-0.5165100693702698,
-0.41595515608787537,
-0.32040518522262573,
-0.3682355582714081,
0.3281881809234619,
1.4039357900619507,
-0.258281409740448,
-1.1289823055267334,
0.8797533512115479,
-0.3805323839187622,
0.007977594621479511,
2.0221962928771973,
-0.000055410899221897125,
-0.8391116261482239,
0.3305718004703522,
-0.5967358946800232,
1.862335443496704,
1.7723571062088013,
1.3778026103973389,
-0.08676174283027649,
-0.9414664506912231,
0.515448272228241,
-0.38389852643013,
-0.46064242720603943,
0.8568845987319946,
0.37381279468536377,
-0.05041912943124771,
-1.2577226161956787,
0.807479977607727,
1.4000122547149658,
-0.9819473624229431,
-0.8457266092300415,
0.2658733129501343,
-0.771378219127655,
1.071142554283142,
0.7862750887870789,
0.4298088252544403,
0.313139945268631,
1.4250181913375854,
0.6528595089912415,
-0.3815750479698181,
0.5409071445465088,
0.48541316390037537,
-0.02236444130539894,
-2.040117025375366,
-1.1005388498306274,
0.3216801583766937,
-0.5782619714736938,
-1.6556620597839355,
1.3220890760421753,
-1.3287076950073242,
-0.9058960676193237,
0.5877512693405151,
0.07849685102701187,
1.5582724809646606,
0.3913038372993469,
1.5879658460617065,
2.1434378623962402,
0.8710291981697083,
0.3411707878112793,
1.4969028234481812,
-0.037555355578660965,
-0.5363376140594482,
1.7429625988006592,
-0.4507714509963989,
0.5732410550117493,
1.1429120302200317,
-0.08073300123214722,
-0.8909530639648438,
-0.7880098223686218,
-1.277215838432312,
-0.598490834236145,
1.2336353063583374,
0.10652321577072144,
-1.2145010232925415,
0.22662869095802307,
1.4677790403366089,
0.007160891778767109,
-0.310050368309021,
0.6231175065040588,
0.27865251898765564,
-0.799881100654602,
-0.15974335372447968,
-0.9233919382095337,
0.4731513261795044,
-0.2910901606082916,
-0.20894020795822144,
0.32661211490631104,
0.4369547665119171,
1.3331787586212158,
0.003203372471034527,
0.22732791304588318,
1.2322735786437988,
-1.404650092124939,
1.5281684398651123,
-0.5570252537727356,
0.22393254935741425,
-2.4087324142456055,
1.3700454235076904,
-0.7479369640350342,
1.7781943082809448,
-2.725588083267212,
0.3949846923351288,
-0.451057493686676,
-0.42267224192619324,
0.2055787742137909,
-0.3363809883594513,
0.12332265079021454,
-0.16899509727954865,
-1.0991414785385132,
0.0739767849445343,
-0.8032807111740112,
0.5308685898780823,
1.0124753713607788,
1.2457044124603271,
-1.3184419870376587,
-0.475668340921402,
-1.7851219177246094,
-0.2200280874967575,
-0.600736677646637,
0.40592843294143677,
-1.995835542678833,
-0.14545413851737976,
-1.8637657165527344,
-2.6245341300964355,
-1.389993667602539,
-0.8423459529876709,
1.1413323879241943,
0.04117779806256294,
-0.8200371265411377,
0.983580470085144,
-0.3382808268070221,
-2.0574443340301514,
1.1622172594070435,
-2.086350440979004
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | > ```python
> from datasets import Dataset
>
> def gen():
> for idx in len(torch_dataset):
> yield torch_dataset[idx] # this has to be a dictionary
> ## or if it's an IterableDataset
> # for ex in torch_dataset:
> # yield ex
>
> dset = Dataset.from_generator(gen)
> ```
I try to use `Dataset.from_generator()` method, and it returns an error:
```bash
AttributeError: type object 'Dataset' has no attribute 'from_generator'
```
And I think it maybe the version of my datasets package is out-of-date, so I update it
```bash
pip install --upgrade datasets
```
But after that, the code still return the above Error. | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 104 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
> ```python
> from datasets import Dataset
>
> def gen():
> for idx in len(torch_dataset):
> yield torch_dataset[idx] # this has to be a dictionary
> ## or if it's an IterableDataset
> # for ex in torch_dataset:
> # yield ex
>
> dset = Dataset.from_generator(gen)
> ```
I try to use `Dataset.from_generator()` method, and it returns an error:
```bash
AttributeError: type object 'Dataset' has no attribute 'from_generator'
```
And I think it maybe the version of my datasets package is out-of-date, so I update it
```bash
pip install --upgrade datasets
```
But after that, the code still return the above Error. | [
-1.0986385345458984,
-0.8905044794082642,
-0.7479374408721924,
1.5090380907058716,
-0.19297318160533905,
-1.2313283681869507,
0.23278293013572693,
-1.0862199068069458,
1.7796626091003418,
-0.8341298699378967,
0.3588135838508606,
-1.749660849571228,
0.0036673899739980698,
-0.5636751651763916,
-0.7618715167045593,
-0.9802190065383911,
-0.44918981194496155,
-0.7047940492630005,
0.96573406457901,
2.468970537185669,
1.1702899932861328,
-1.3686679601669312,
2.5216164588928223,
0.6883941292762756,
-0.14790382981300354,
-1.0602798461914062,
0.5323215126991272,
0.1267174333333969,
-1.2686578035354614,
-0.34915071725845337,
-0.8974457383155823,
-0.116575688123703,
-0.6491096615791321,
-0.6726294159889221,
-0.06280717253684998,
0.4388642907142639,
-0.30086925625801086,
-0.459421843290329,
-0.41047775745391846,
-0.8203268647193909,
0.4425724148750305,
-0.3697761297225952,
0.9913895130157471,
-0.3284670114517212,
1.8184452056884766,
-0.5880545973777771,
0.4506909251213074,
0.7190749645233154,
1.3218133449554443,
0.2668136656284332,
-0.07550573348999023,
0.26238375902175903,
0.3697480261325836,
0.00006162095814943314,
0.41342446208000183,
1.1350061893463135,
0.625278651714325,
0.5432839393615723,
0.743422269821167,
-2.307610273361206,
1.263723611831665,
-1.0360231399536133,
0.3992571532726288,
1.2817972898483276,
-0.9174264669418335,
0.30593782663345337,
-1.7726545333862305,
-0.07463739812374115,
0.574560821056366,
-2.1963419914245605,
0.20918618142604828,
-1.389496922492981,
-0.4787530303001404,
1.025002360343933,
0.36606499552726746,
-1.2464091777801514,
0.18622952699661255,
-0.3147827684879303,
0.9193867444992065,
0.43859896063804626,
1.1351794004440308,
-1.7842072248458862,
0.08009853959083557,
-0.45183613896369934,
0.20766335725784302,
-1.2509783506393433,
-1.4538061618804932,
0.6191290616989136,
0.7259592413902283,
0.5954539179801941,
-0.1511915773153305,
0.9913550615310669,
-0.960901141166687,
0.6650615930557251,
-0.9816014766693115,
-1.7671362161636353,
-1.3745402097702026,
-2.140886068344116,
-2.4674816131591797,
0.7046562433242798,
-0.4910534620285034,
-0.513566792011261,
2.0318732261657715,
-1.024266242980957,
-1.813927412033081,
1.1291784048080444,
0.32159921526908875,
-0.06525793671607971,
2.358844041824341,
0.12357152998447418,
-0.6872026324272156,
0.4550454318523407,
-0.7509974241256714,
0.7672345042228699,
-0.17157334089279175,
1.3600988388061523,
0.49834442138671875,
-1.1404166221618652,
1.607911467552185,
-0.3450213074684143,
0.5649397969245911,
-0.6957642436027527,
-0.48284924030303955,
-0.7253130674362183,
0.21458902955055237,
1.8024450540542603,
-0.29036596417427063,
1.614019751548767,
-0.3337022364139557,
-1.553627610206604,
-1.5882575511932373,
0.9346259832382202,
0.3531941771507263,
-0.7594021558761597,
0.07360504567623138,
-0.3438430726528168,
0.09189917147159576,
-0.04861286282539368,
1.1930960416793823,
1.2179747819900513,
0.7291426658630371,
-0.36126700043678284,
-0.8565189242362976,
0.13778536021709442,
-0.01759779453277588,
-0.7877891659736633,
-1.7462437152862549,
-0.3805890679359436,
0.051474347710609436,
0.5792999863624573,
-1.1280930042266846,
1.7124584913253784,
0.821600079536438,
1.8944939374923706,
1.030850887298584,
-0.43995144963264465,
1.461010217666626,
0.08006134629249573,
1.8884284496307373,
-0.5226260423660278,
0.6484835743904114,
-0.3728427290916443,
-1.1407568454742432,
0.9154834747314453,
-0.25302162766456604,
-2.0331003665924072,
-0.8439578413963318,
-0.8007176518440247,
-0.14839360117912292,
-0.8111356496810913,
0.9536407589912415,
-0.20503531396389008,
-1.5005680322647095,
0.30379074811935425,
-0.6851855516433716,
0.1510944813489914,
-1.2088371515274048,
0.32985565066337585,
0.7285937666893005,
-0.627236008644104,
0.10679495334625244,
-0.30946633219718933,
-1.336230993270874,
-0.45068487524986267,
0.25575149059295654,
1.850298285484314,
-0.7394219636917114,
0.970547616481781,
1.0435082912445068,
-0.77793949842453,
-0.05533850938081741,
0.2765328586101532,
-0.2660316228866577,
0.8567018508911133,
-1.0665634870529175,
-0.42431944608688354,
1.178359031677246,
-0.12144730985164642,
-0.6451260447502136,
1.498145580291748,
0.632855236530304,
-0.9191810488700867,
-0.13399861752986908,
-0.16066312789916992,
-0.7196706533432007,
0.07183384895324707,
-1.6638883352279663,
-0.02518581412732601,
0.38822081685066223,
-1.5128722190856934,
-0.5196739435195923,
-0.22958768904209137,
1.2044720649719238,
-0.1708909422159195,
1.3159213066101074,
-0.2726188004016876,
-0.24988561868667603,
-0.4082266688346863,
-0.3576132655143738,
0.12292826175689697,
-0.20871588587760925,
-0.6243655681610107,
0.32469600439071655,
-0.7953196167945862,
0.4487225413322449,
1.3121905326843262,
0.30033010244369507,
0.07071156799793243,
0.478026807308197,
1.1032166481018066,
0.3724086284637451,
-0.06852123886346817,
-0.851635754108429,
-1.5922601222991943,
2.0936496257781982,
-1.3999173641204834,
1.9519184827804565,
0.6723586320877075,
-0.025757011026144028,
-1.7458869218826294,
-1.8192068338394165,
1.4591091871261597,
1.2023234367370605,
2.356677770614624,
0.6813063025474548,
0.3777819871902466,
-0.8336526155471802,
-0.5567224621772766,
0.3135696053504944,
-0.9959935545921326,
-0.7380411028862,
0.23709462583065033,
2.3983139991760254,
1.7041569948196411,
-0.49222826957702637,
-0.16531573235988617,
-1.055263638496399,
1.3597251176834106,
-0.25783973932266235,
0.25455620884895325,
2.0236363410949707,
-0.34084758162498474,
-1.1826074123382568,
1.3550459146499634,
-2.291728973388672,
0.049105774611234665,
1.9825392961502075,
0.13398036360740662,
0.042696308344602585,
-1.3875715732574463,
-0.6417953372001648,
-0.2752271592617035,
-0.42645248770713806,
-1.3266972303390503,
0.5007529854774475,
-0.19932614266872406,
-0.6637741923332214,
-1.4868789911270142,
0.2149255871772766,
-1.0707238912582397,
-1.661541223526001,
0.2350575178861618,
1.8310507535934448,
1.9255672693252563,
-0.715932309627533,
1.5365785360336304,
-0.33414560556411743,
0.21067297458648682,
1.1876187324523926,
1.1506788730621338,
3.0804927349090576,
1.9990543127059937,
-1.249098300933838,
0.7083912491798401,
-0.15339669585227966,
-0.5945135354995728,
1.3933755159378052,
-1.1898969411849976,
1.314116358757019,
-0.24059425294399261,
-1.259040355682373,
-1.315822958946228,
0.9645219445228577,
0.43328508734703064,
0.0793798565864563,
-0.5818558931350708,
1.2093238830566406,
0.04010412096977234,
1.2381411790847778,
0.5075257420539856,
-0.3572469651699066,
0.6380265951156616,
-0.470065712928772,
-0.4931621849536896,
1.5051939487457275,
0.23782701790332794,
-1.3085713386535645,
-2.3676376342773438,
-0.24567003548145294,
-0.896888792514801,
-0.03147928789258003,
-0.5505329370498657,
-1.0358219146728516,
1.6920053958892822,
0.3879353404045105,
-1.2907869815826416,
-0.23789545893669128,
-0.2977958023548126,
-0.6276318430900574,
2.6647226810455322,
-1.3200252056121826,
-0.17980708181858063,
-1.0114697217941284,
-0.7095844149589539,
1.6946007013320923,
-1.156168818473816,
-0.17977294325828552,
-1.0514425039291382,
-0.6021431088447571,
-1.3762446641921997,
-0.632355272769928,
0.040286220610141754,
-0.9452604055404663,
0.8052316904067993,
0.21341904997825623,
-1.1695232391357422,
-0.31878161430358887,
-0.8742026090621948,
0.8724029064178467,
-0.1623656302690506,
0.3067295551300049,
1.9851700067520142,
0.5078586339950562,
-0.3906826078891754,
0.6502938866615295,
1.1106685400009155,
0.7076467871665955,
-0.7080800533294678,
0.34707286953926086,
-0.7450874447822571,
0.2361259162425995,
-1.338455319404602,
0.24997130036354065,
-2.8094303607940674,
0.6039204001426697,
-0.0035903113894164562,
-0.019816141575574875,
0.05509621277451515,
-1.2684942483901978,
1.096358060836792,
2.5833849906921387,
-1.2497498989105225,
0.4310525059700012,
0.32247209548950195,
1.1850717067718506,
-1.511444091796875,
0.31269708275794983,
-0.44803521037101746,
2.1959967613220215,
0.1989210546016693,
1.1192594766616821,
-0.39081087708473206,
-2.3253512382507324,
0.5647833943367004,
-1.3265345096588135,
-1.3150781393051147,
0.8222231268882751,
-0.9659008383750916,
0.01366119273006916,
-1.4596827030181885,
-0.1880776733160019,
-0.8469231724739075,
-1.1928120851516724,
0.8473014235496521,
0.06494790315628052,
0.4972459673881531,
-0.6107887029647827,
0.3742944598197937,
-2.2005579471588135,
-1.4376647472381592,
-0.2773391008377075,
-0.957160234451294,
0.4570688009262085,
-0.24828873574733734,
0.7227959632873535,
-0.20668594539165497,
0.010891098529100418,
0.34787410497665405,
1.3981900215148926,
3.381201982498169,
0.2834921181201935,
0.3305332362651825,
-0.12431606650352478,
-0.9638910293579102,
1.4501219987869263,
0.8889144062995911,
-0.1092115193605423,
-0.5155688524246216,
-1.0310537815093994,
1.1697365045547485,
2.0585949420928955,
1.054752230644226,
-0.013777357526123524,
-0.7751540541648865,
-0.6486737132072449,
0.04482179880142212,
0.23235160112380981,
0.4443105161190033,
0.8068041205406189,
0.15632881224155426,
0.18850238621234894,
1.3853574991226196,
1.193947196006775,
-0.3461124897003174,
0.3802932798862457,
-0.8241294622421265,
-0.5714638233184814,
0.666517972946167,
0.2602695822715759,
0.04736248776316643,
0.39112475514411926,
-1.021507978439331,
-0.28776612877845764,
-0.4436640441417694,
-0.9648890495300293,
-0.7164614796638489,
-0.48965582251548767,
-0.34563031792640686,
1.6116787195205688,
-0.12708783149719238,
-0.541867196559906,
-0.04470332711935043,
-0.7359177470207214,
-0.0815003365278244,
-1.0905117988586426,
0.24037492275238037,
-0.16464269161224365,
-0.07448123395442963,
-0.057474520057439804,
1.7061787843704224,
-0.9461022615432739,
-1.9876933097839355,
0.2273208647966385,
0.315206378698349,
-0.4199463427066803,
0.2653571665287018,
1.6176812648773193,
0.4908004403114319,
1.411567211151123,
1.36153244972229,
1.0639493465423584,
-0.6599791646003723,
-1.3017404079437256,
0.595377504825592,
0.9163621664047241,
-1.262616515159607,
0.9182656407356262,
0.0960826426744461,
-0.5420029163360596,
0.575860857963562,
1.1962575912475586,
0.4439636468887329,
-2.028475284576416,
0.7299776673316956,
-0.8535063862800598,
0.7852526307106018,
0.6790036559104919,
0.822238028049469,
0.1151040643453598,
0.7951651215553284,
-1.2123756408691406,
-1.07506263256073,
-0.7486637830734253,
-0.5814299583435059,
1.9206727743148804,
-0.24477948248386383,
0.6746662259101868,
-0.19981855154037476,
-1.3791571855545044,
-0.06504786014556885,
0.731938898563385,
0.43385061621665955,
-0.6473051309585571,
0.7929494976997375,
-0.44959017634391785,
-1.0730435848236084,
-1.3655107021331787,
-0.43134617805480957,
-1.080841302871704,
-0.8968262672424316,
1.122911810874939,
0.7899307608604431,
0.20985424518585205,
1.759001612663269,
0.617372453212738,
0.1481490284204483,
-2.6581382751464844,
0.917527437210083,
0.2365531176328659,
-0.08497437834739685,
0.8229613304138184,
0.3854713439941406,
1.0292844772338867,
-0.09925250709056854,
0.5871419310569763,
-2.302764654159546,
2.2435672283172607,
-0.1286712884902954,
0.622093915939331,
0.024845898151397705,
-0.20322063565254211,
0.9952616691589355,
0.5339794158935547,
0.5740782022476196,
-1.1158170700073242,
0.6627225875854492,
-0.5501288771629333,
1.1663011312484741,
0.9195302128791809,
-0.8158089518547058,
-0.09706749022006989,
1.403224229812622,
0.5068070888519287,
-0.41091641783714294,
-0.896156370639801,
-0.872134804725647,
0.963861346244812,
1.6601852178573608,
-0.09018494188785553,
-0.08129248023033142,
0.9667516946792603,
0.7176002264022827,
-1.3360896110534668,
0.09585480391979218,
-0.7129335403442383,
-0.6430341005325317,
1.6845037937164307,
2.071291208267212,
-0.15601736307144165,
-0.20633465051651,
-0.8189430832862854,
-1.1038843393325806,
0.8502647876739502,
-0.028899116441607475,
0.030650999397039413,
0.7120344042778015,
-0.6283642053604126,
1.1551518440246582,
0.8827323913574219,
0.9786188006401062,
0.2629612982273102,
0.3658829927444458,
0.3842635154724121,
-0.26574113965034485,
-1.1676976680755615,
-0.17739278078079224,
-1.0261378288269043,
-2.5170860290527344,
0.5304412841796875,
-0.2992194592952728,
-1.3905658721923828,
-0.03805980831384659,
-1.042847990989685,
0.960447371006012,
-0.6126097440719604,
-1.087039589881897,
-1.5293810367584229,
0.23099012672901154,
0.026552218943834305,
0.9437217116355896,
-1.6189138889312744,
0.036298010498285294,
1.1850500106811523,
0.9378602504730225,
-0.814045250415802,
0.9846361875534058,
0.28498169779777527,
1.0391124486923218,
0.9143909811973572,
-0.38902536034584045,
0.5830650329589844,
0.1538139134645462,
-1.2977652549743652,
0.44247207045555115,
1.033792495727539,
0.1794290989637375,
1.357314109802246,
-0.606151819229126,
-0.04722994938492775,
0.41447097063064575,
-0.4447762966156006,
-0.4213063716888428,
-0.6583234071731567,
0.6883119344711304,
0.07036474347114563,
-0.8560284376144409,
0.08193473517894745,
0.019372479990124702,
-0.13151845335960388,
0.18686014413833618,
-1.4990125894546509,
-0.16392846405506134,
-0.3823545575141907,
-0.6448594331741333,
-1.2202332019805908,
-0.1636723130941391,
1.4558645486831665,
-0.7528582811355591,
-0.12425360083580017,
0.5249388217926025,
0.3537507653236389,
0.5420722961425781,
0.5564590692520142,
-0.5358545780181885,
-0.3772149384021759,
-0.2947148382663727,
-0.3784681558609009,
0.3085571527481079,
1.3587390184402466,
-0.19883935153484344,
-1.0587694644927979,
0.7708585858345032,
-0.3575309216976166,
0.03713252767920494,
1.9489421844482422,
0.07633829116821289,
-0.8601324558258057,
0.31712642312049866,
-0.6147006154060364,
1.872071623802185,
1.7953498363494873,
1.3867478370666504,
-0.12090285122394562,
-1.036759853363037,
0.6049306392669678,
-0.36871519684791565,
-0.5138140916824341,
0.867021918296814,
0.38559213280677795,
-0.0725754052400589,
-1.3434971570968628,
0.7750163078308105,
1.366804838180542,
-0.9374037384986877,
-0.9001067876815796,
0.2176956981420517,
-0.802839994430542,
1.0389018058776855,
0.7244720458984375,
0.38443997502326965,
0.2448759377002716,
1.5584930181503296,
0.700623095035553,
-0.4168870449066162,
0.5773329138755798,
0.4823050796985626,
-0.07176412642002106,
-1.9964885711669922,
-1.1995984315872192,
0.3042410612106323,
-0.514903724193573,
-1.6137900352478027,
1.3212758302688599,
-1.2920070886611938,
-0.9075121283531189,
0.5685657858848572,
0.09578073024749756,
1.528320550918579,
0.33221685886383057,
1.5746862888336182,
2.166802167892456,
0.8755455017089844,
0.3764668107032776,
1.3804988861083984,
-0.07562223076820374,
-0.4822191596031189,
1.785573124885559,
-0.4165128171443939,
0.5466922521591187,
1.1711596250534058,
-0.22758789360523224,
-1.001832127571106,
-0.8253210783004761,
-1.3417375087738037,
-0.6691320538520813,
1.1825158596038818,
0.10688701272010803,
-1.2055765390396118,
0.3168380856513977,
1.5623795986175537,
0.041339803487062454,
-0.3296933174133301,
0.6668031811714172,
0.34623950719833374,
-0.8671122789382935,
-0.10204790532588959,
-0.9931483268737793,
0.486894428730011,
-0.2622377872467041,
-0.2317488193511963,
0.3507506847381592,
0.4236460030078888,
1.3516907691955566,
0.07760827243328094,
0.15410859882831573,
1.188375473022461,
-1.3584344387054443,
1.5090469121932983,
-0.6546790599822998,
0.24241095781326294,
-2.338082790374756,
1.3752247095108032,
-0.7254192233085632,
1.8240927457809448,
-2.690138101577759,
0.43518903851509094,
-0.5453525185585022,
-0.40250110626220703,
0.2578677237033844,
-0.36184608936309814,
0.17023782432079315,
-0.16770680248737335,
-1.1369116306304932,
-0.015354212373495102,
-0.738200843334198,
0.5768603086471558,
1.0658767223358154,
1.3226007223129272,
-1.2022936344146729,
-0.4377819001674652,
-1.783058524131775,
-0.17747685313224792,
-0.5545271635055542,
0.35677459836006165,
-1.9247660636901855,
-0.1628294438123703,
-1.8844661712646484,
-2.567998170852661,
-1.310278296470642,
-0.78693026304245,
1.0869334936141968,
0.055731091648340225,
-0.8540427088737488,
1.1136143207550049,
-0.3703329861164093,
-1.9553829431533813,
1.1640174388885498,
-2.1018269062042236
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | > ```python
> dset = Dataset.from_list(torch_dataset)
> ```
It seems that Dataset also has no `from_list` method 😂
```bash
AttributeError: type object 'Dataset' has no attribute 'from_list'
``` | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 28 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
> ```python
> dset = Dataset.from_list(torch_dataset)
> ```
It seems that Dataset also has no `from_list` method 😂
```bash
AttributeError: type object 'Dataset' has no attribute 'from_list'
``` | [
-1.0700931549072266,
-0.8391731977462769,
-0.7403194308280945,
1.5276795625686646,
-0.2510944604873657,
-1.236032247543335,
0.2801584005355835,
-1.116274356842041,
1.801811695098877,
-0.902756929397583,
0.40659621357917786,
-1.7481292486190796,
0.04424349218606949,
-0.6209927797317505,
-0.7937051653862,
-1.0021623373031616,
-0.40752217173576355,
-0.6510754227638245,
0.9059988856315613,
2.4268524646759033,
1.116957426071167,
-1.335426688194275,
2.493537187576294,
0.7491481900215149,
-0.13736891746520996,
-1.1111620664596558,
0.5536423921585083,
0.1832270473241806,
-1.2052743434906006,
-0.2963108420372009,
-0.9279756546020508,
-0.16520465910434723,
-0.6325350403785706,
-0.7249416708946228,
-0.06782343983650208,
0.4389498233795166,
-0.3105919659137726,
-0.443915456533432,
-0.4019743800163269,
-0.7892449498176575,
0.4674386978149414,
-0.40668362379074097,
0.9937633275985718,
-0.35738229751586914,
1.8762928247451782,
-0.6212292909622192,
0.4183875322341919,
0.7441900372505188,
1.2937953472137451,
0.21052031219005585,
-0.03521612286567688,
0.19787214696407318,
0.39393505454063416,
0.07318076491355896,
0.3817029297351837,
1.082472324371338,
0.5899658203125,
0.5913293957710266,
0.7790601849555969,
-2.3392958641052246,
1.2697513103485107,
-1.0820584297180176,
0.3809830844402313,
1.2426197528839111,
-0.8855878710746765,
0.31132057309150696,
-1.7402353286743164,
-0.0819581151008606,
0.5801761746406555,
-2.1510190963745117,
0.25580692291259766,
-1.4388965368270874,
-0.5283592343330383,
0.9806915521621704,
0.38099855184555054,
-1.2433034181594849,
0.24062630534172058,
-0.2840879261493683,
0.8912059664726257,
0.48608604073524475,
1.0817019939422607,
-1.7612682580947876,
0.10906369984149933,
-0.5252527594566345,
0.18951842188835144,
-1.3281002044677734,
-1.3857543468475342,
0.635239839553833,
0.7285935878753662,
0.6089962720870972,
-0.15027454495429993,
0.9822207689285278,
-1.0042827129364014,
0.7171388268470764,
-1.0693126916885376,
-1.7831330299377441,
-1.3836946487426758,
-2.081024169921875,
-2.4786248207092285,
0.6807032227516174,
-0.44648393988609314,
-0.5013721585273743,
1.9955267906188965,
-1.0448216199874878,
-1.7926476001739502,
1.1442902088165283,
0.2748427093029022,
-0.057145677506923676,
2.3407230377197266,
0.1070283055305481,
-0.6270712614059448,
0.39291006326675415,
-0.7531187534332275,
0.7816482782363892,
-0.12254577875137329,
1.3027710914611816,
0.5644701719284058,
-1.1627877950668335,
1.6967997550964355,
-0.2910711169242859,
0.5256432294845581,
-0.6917962431907654,
-0.5108391642570496,
-0.737877368927002,
0.1872512698173523,
1.7779934406280518,
-0.2857182025909424,
1.5842701196670532,
-0.40235164761543274,
-1.5154926776885986,
-1.5833820104599,
0.9153367877006531,
0.3375251591205597,
-0.7454702854156494,
0.019039304926991463,
-0.3107479214668274,
0.13772909343242645,
-0.13930551707744598,
1.3169928789138794,
1.173764705657959,
0.7376149892807007,
-0.3788329064846039,
-0.7730165123939514,
0.11337028443813324,
0.01739528961479664,
-0.8562221527099609,
-1.7967185974121094,
-0.3904072940349579,
0.08664321899414062,
0.6334375143051147,
-1.067744493484497,
1.7202599048614502,
0.8195949792861938,
1.8351315259933472,
1.014854907989502,
-0.41054779291152954,
1.4369146823883057,
-0.0046636550687253475,
1.9298814535140991,
-0.5608342289924622,
0.6867986917495728,
-0.3782302439212799,
-1.117233395576477,
0.9424290657043457,
-0.2096802443265915,
-2.0393948554992676,
-0.9180223345756531,
-0.7907445430755615,
-0.16536031663417816,
-0.8316019177436829,
0.9952174425125122,
-0.2638823390007019,
-1.5377947092056274,
0.2900424599647522,
-0.6143504977226257,
0.14214372634887695,
-1.1356191635131836,
0.3040388226509094,
0.748533308506012,
-0.6349632740020752,
0.07903227210044861,
-0.25458624958992004,
-1.3335870504379272,
-0.4277525842189789,
0.18170087039470673,
1.8776026964187622,
-0.7619069814682007,
0.9230547547340393,
1.0073621273040771,
-0.7638508677482605,
-0.08742260932922363,
0.22722366452217102,
-0.2700502276420593,
0.7819362878799438,
-1.0553412437438965,
-0.44706058502197266,
1.1597378253936768,
-0.0805182158946991,
-0.6940931081771851,
1.5610873699188232,
0.6931825876235962,
-0.9018529653549194,
-0.12929017841815948,
-0.22911788523197174,
-0.655426025390625,
0.05160439386963844,
-1.6462841033935547,
-0.048509031534194946,
0.3808337450027466,
-1.4561258554458618,
-0.49313613772392273,
-0.2225169986486435,
1.217362880706787,
-0.22458545863628387,
1.2769724130630493,
-0.21600577235221863,
-0.3549695611000061,
-0.38007739186286926,
-0.31123778223991394,
0.15305021405220032,
-0.11701758205890656,
-0.6874377727508545,
0.30939212441444397,
-0.7917273044586182,
0.4608270823955536,
1.245490550994873,
0.26135706901550293,
0.12480075657367706,
0.5127432346343994,
1.0649702548980713,
0.31153640151023865,
0.014033067971467972,
-0.8718373775482178,
-1.586029052734375,
2.0509960651397705,
-1.419429898262024,
1.9824557304382324,
0.6240527629852295,
-0.01916429027915001,
-1.797608494758606,
-1.8127856254577637,
1.4641202688217163,
1.2181187868118286,
2.310485601425171,
0.6752417683601379,
0.3180588185787201,
-0.8345514535903931,
-0.526930034160614,
0.34192773699760437,
-1.0526325702667236,
-0.6580691337585449,
0.2418173849582672,
2.3475265502929688,
1.686859130859375,
-0.5312064290046692,
-0.18077373504638672,
-1.090700387954712,
1.301475167274475,
-0.2229965627193451,
0.276563823223114,
2.0596249103546143,
-0.4151287078857422,
-1.1785598993301392,
1.395094394683838,
-2.280532121658325,
0.009600354358553886,
1.9555870294570923,
0.08446995913982391,
-0.01310297753661871,
-1.3634852170944214,
-0.6740169525146484,
-0.2881501019001007,
-0.48918306827545166,
-1.344653844833374,
0.48998650908470154,
-0.2194153219461441,
-0.7307145595550537,
-1.465654969215393,
0.19764883816242218,
-1.1071531772613525,
-1.637307047843933,
0.31637462973594666,
1.8137390613555908,
1.880751371383667,
-0.7007066011428833,
1.5454245805740356,
-0.33710744976997375,
0.2693844139575958,
1.2309142351150513,
1.186423659324646,
3.0501229763031006,
1.9684475660324097,
-1.1994857788085938,
0.7543216943740845,
-0.1826777160167694,
-0.6021707057952881,
1.4072279930114746,
-1.201380968093872,
1.321728229522705,
-0.22961589694023132,
-1.193359613418579,
-1.3662731647491455,
0.9778324365615845,
0.3933485746383667,
0.11397616565227509,
-0.5621223449707031,
1.2622482776641846,
0.05106978863477707,
1.253690242767334,
0.5420384407043457,
-0.34120699763298035,
0.6438305974006653,
-0.5231082439422607,
-0.449535071849823,
1.4840515851974487,
0.24889886379241943,
-1.2490811347961426,
-2.38293194770813,
-0.25061100721359253,
-0.8744711875915527,
-0.08542542159557343,
-0.4692535400390625,
-1.0257854461669922,
1.7819135189056396,
0.3397579491138458,
-1.362669587135315,
-0.17929188907146454,
-0.2646086812019348,
-0.5875136256217957,
2.7275712490081787,
-1.3279259204864502,
-0.20570437610149384,
-1.0666388273239136,
-0.7287836670875549,
1.7750380039215088,
-1.1663235425949097,
-0.12113475799560547,
-1.033067226409912,
-0.5670953989028931,
-1.4886423349380493,
-0.5714145302772522,
0.027768339961767197,
-0.9786189794540405,
0.8469135165214539,
0.20280808210372925,
-1.1161822080612183,
-0.4027610719203949,
-0.8345766663551331,
0.8586442470550537,
-0.16147667169570923,
0.3468250036239624,
2.0129523277282715,
0.5262813568115234,
-0.40051743388175964,
0.5687747001647949,
1.0768764019012451,
0.7498857378959656,
-0.7343146204948425,
0.4248751103878021,
-0.721215009689331,
0.19998881220817566,
-1.378891944885254,
0.2954687774181366,
-2.788356304168701,
0.5728328227996826,
-0.02061465010046959,
-0.0976862758398056,
0.04494353383779526,
-1.2685540914535522,
1.0922263860702515,
2.5925755500793457,
-1.2241748571395874,
0.3458249568939209,
0.25505322217941284,
1.1928801536560059,
-1.4538028240203857,
0.3584190607070923,
-0.42717477679252625,
2.169006586074829,
0.27014487981796265,
1.0757782459259033,
-0.36646753549575806,
-2.242535352706909,
0.6392576098442078,
-1.3255170583724976,
-1.3555649518966675,
0.8517377972602844,
-0.9500457048416138,
0.07627096772193909,
-1.4812655448913574,
-0.17566218972206116,
-0.9494688510894775,
-1.2414408922195435,
0.8806877732276917,
0.13026487827301025,
0.4987715780735016,
-0.6258659362792969,
0.36861467361450195,
-2.15466570854187,
-1.4289580583572388,
-0.2836759686470032,
-0.9241567850112915,
0.4813403785228729,
-0.15001708269119263,
0.6724170446395874,
-0.1866186261177063,
0.06110161170363426,
0.3474111258983612,
1.4702924489974976,
3.4079647064208984,
0.30869603157043457,
0.3352956771850586,
-0.13297396898269653,
-0.9859747290611267,
1.465658187866211,
0.933729887008667,
-0.001026052050292492,
-0.5278642773628235,
-1.0021644830703735,
1.0892055034637451,
2.0762436389923096,
1.019705057144165,
-0.05046999454498291,
-0.7132589221000671,
-0.6513849496841431,
0.07445792853832245,
0.23275962471961975,
0.43555116653442383,
0.8080836534500122,
0.17243534326553345,
0.1588088870048523,
1.4050954580307007,
1.2283062934875488,
-0.354371577501297,
0.3032870292663574,
-0.8431338667869568,
-0.5616321563720703,
0.7216949462890625,
0.2960833013057709,
0.08652181923389435,
0.36965516209602356,
-1.098400354385376,
-0.3448938727378845,
-0.43600916862487793,
-0.9834999442100525,
-0.7340368628501892,
-0.5451886653900146,
-0.3966135084629059,
1.538266658782959,
-0.12824806571006775,
-0.48617061972618103,
-0.07478012144565582,
-0.7851950526237488,
-0.11409163475036621,
-1.026832938194275,
0.24491482973098755,
-0.14866191148757935,
-0.11751565337181091,
-0.08491739630699158,
1.7314910888671875,
-0.9391370415687561,
-1.9121438264846802,
0.2708596885204315,
0.279853492975235,
-0.41252174973487854,
0.29513171315193176,
1.5503610372543335,
0.4995328485965729,
1.4077978134155273,
1.301257848739624,
0.9990754127502441,
-0.6073119640350342,
-1.2915185689926147,
0.564432680606842,
0.8662615418434143,
-1.3467698097229004,
0.9320151209831238,
0.1053505688905716,
-0.5135226249694824,
0.6233428716659546,
1.1579607725143433,
0.4076964259147644,
-2.0275039672851562,
0.6377593874931335,
-0.8347615003585815,
0.755982518196106,
0.711066722869873,
0.7893600463867188,
0.1707969456911087,
0.8490293025970459,
-1.1592051982879639,
-1.0874335765838623,
-0.7644926309585571,
-0.5207220315933228,
1.953668236732483,
-0.2644076943397522,
0.7659751176834106,
-0.17267529666423798,
-1.3478552103042603,
-0.09227639436721802,
0.7466183304786682,
0.4561777114868164,
-0.7021071910858154,
0.8322938680648804,
-0.41098764538764954,
-1.0204228162765503,
-1.3456549644470215,
-0.4721125066280365,
-1.1097358465194702,
-0.8798908591270447,
1.0976835489273071,
0.8057533502578735,
0.18449807167053223,
1.7908684015274048,
0.5720884203910828,
0.17338192462921143,
-2.6626102924346924,
0.8689360618591309,
0.13281624019145966,
-0.0625561773777008,
0.8265572786331177,
0.37005001306533813,
1.0283892154693604,
-0.15559810400009155,
0.6067676544189453,
-2.3406870365142822,
2.235142230987549,
-0.137389674782753,
0.5789731740951538,
-0.017738299444317818,
-0.21641306579113007,
1.0030587911605835,
0.5510318279266357,
0.6000241637229919,
-1.0832045078277588,
0.5573446750640869,
-0.5689254403114319,
1.217610239982605,
0.9608356952667236,
-0.7455611824989319,
-0.1395636796951294,
1.4254111051559448,
0.5274169445037842,
-0.37633106112480164,
-0.8172938823699951,
-0.9293060302734375,
0.8676955699920654,
1.6256482601165771,
-0.14265726506710052,
-0.2065439522266388,
1.0069090127944946,
0.7364445924758911,
-1.3306236267089844,
0.09469243884086609,
-0.7344921827316284,
-0.6004465222358704,
1.7177904844284058,
2.0905394554138184,
-0.17598210275173187,
-0.17459863424301147,
-0.8287888169288635,
-0.9727227091789246,
0.856682538986206,
-0.03784482926130295,
0.04692642390727997,
0.7281336784362793,
-0.6498433351516724,
1.1530547142028809,
0.8591106534004211,
1.0133957862854004,
0.2619762718677521,
0.4915374219417572,
0.40106064081192017,
-0.30143842101097107,
-1.2296948432922363,
-0.2149319052696228,
-1.0452113151550293,
-2.529620885848999,
0.5682916641235352,
-0.3702625632286072,
-1.369510531425476,
-0.013292506337165833,
-1.1222763061523438,
0.9118664860725403,
-0.6410022974014282,
-1.0681939125061035,
-1.524431824684143,
0.2564318776130676,
0.10503816604614258,
1.0353245735168457,
-1.6278342008590698,
0.13894635438919067,
1.2373595237731934,
0.8923386931419373,
-0.7718419432640076,
1.008512020111084,
0.33572840690612793,
1.1207361221313477,
0.8920764923095703,
-0.3842102587223053,
0.5962151885032654,
0.14747585356235504,
-1.2708531618118286,
0.4529091715812683,
1.0243011713027954,
0.18227937817573547,
1.3844478130340576,
-0.5827747583389282,
0.00904843956232071,
0.4314420223236084,
-0.5901387333869934,
-0.41172078251838684,
-0.6704370379447937,
0.7751619815826416,
0.1426495909690857,
-0.8340756893157959,
0.07464545965194702,
0.00849168375134468,
-0.18789802491664886,
0.1756088137626648,
-1.4542303085327148,
-0.18838638067245483,
-0.3725089132785797,
-0.6948772072792053,
-1.2263689041137695,
-0.12474195659160614,
1.3844290971755981,
-0.7146961688995361,
-0.03146427497267723,
0.48297008872032166,
0.34809115529060364,
0.5434888601303101,
0.5518267750740051,
-0.5279843211174011,
-0.44064027070999146,
-0.2989635169506073,
-0.35971733927726746,
0.3289799392223358,
1.3760812282562256,
-0.23346900939941406,
-1.1287083625793457,
0.8338996767997742,
-0.41566774249076843,
-0.009096447378396988,
1.9645520448684692,
0.0006572054699063301,
-0.8507373332977295,
0.327377051115036,
-0.6175788640975952,
1.8795183897018433,
1.7969504594802856,
1.3572006225585938,
-0.09733977913856506,
-0.9566565155982971,
0.5644952058792114,
-0.4228275418281555,
-0.4775679409503937,
0.8363690376281738,
0.358954519033432,
-0.07850530743598938,
-1.295608401298523,
0.7817843556404114,
1.4082443714141846,
-0.9944798946380615,
-0.8827829957008362,
0.2729087769985199,
-0.7633460760116577,
1.0509568452835083,
0.7572386860847473,
0.4110175371170044,
0.299317330121994,
1.4738304615020752,
0.6883726716041565,
-0.37050896883010864,
0.5508055686950684,
0.5057876110076904,
-0.05339030548930168,
-2.044151544570923,
-1.1494683027267456,
0.3148084282875061,
-0.5484685897827148,
-1.6743255853652954,
1.3165132999420166,
-1.291152834892273,
-0.8967635631561279,
0.5684794783592224,
0.06215299293398857,
1.516595482826233,
0.39590567350387573,
1.5449036359786987,
2.1271960735321045,
0.8452164530754089,
0.35135725140571594,
1.4480513334274292,
-0.058412645012140274,
-0.5408111810684204,
1.7691351175308228,
-0.47696202993392944,
0.5955906510353088,
1.1455203294754028,
-0.10622695088386536,
-0.9543715715408325,
-0.8426907062530518,
-1.3319209814071655,
-0.6224786639213562,
1.2615982294082642,
0.0946769118309021,
-1.238978624343872,
0.2807128429412842,
1.532007098197937,
0.006357252597808838,
-0.35128816962242126,
0.6338914632797241,
0.3015850782394409,
-0.8476620316505432,
-0.09785795211791992,
-0.907837986946106,
0.4925892651081085,
-0.25934746861457825,
-0.17931737005710602,
0.3528398275375366,
0.4460243582725525,
1.341354250907898,
0.009405167773365974,
0.1997910588979721,
1.1871439218521118,
-1.3747458457946777,
1.5319347381591797,
-0.5849865078926086,
0.23615214228630066,
-2.3899996280670166,
1.3403651714324951,
-0.7310051918029785,
1.8131914138793945,
-2.6905908584594727,
0.39544081687927246,
-0.4683375060558319,
-0.4317934811115265,
0.2472354769706726,
-0.322984904050827,
0.11534549295902252,
-0.16870899498462677,
-1.102558970451355,
0.0995812863111496,
-0.7905776500701904,
0.5423648357391357,
1.0389907360076904,
1.276055097579956,
-1.3002734184265137,
-0.4403879642486572,
-1.7902626991271973,
-0.18524876236915588,
-0.5504396557807922,
0.3850274682044983,
-2.0132768154144287,
-0.15444405376911163,
-1.90049147605896,
-2.597317934036255,
-1.3788330554962158,
-0.7964051961898804,
1.0869393348693848,
0.008812803775072098,
-0.8094817996025085,
1.0065429210662842,
-0.3388315439224243,
-2.0044119358062744,
1.1575708389282227,
-2.019984722137451
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | > I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
>
> ```python
> from datasets import Dataset
> data = [[1, 2],[3, 4]]
> ds = Dataset.from_dict({"data": data})
> ds = ds.with_format("torch")
> ds[0]
> ds[:2]
> ```
>
> So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
My dummy code is like:
```python
import os
import json
from torch.utils import data
import datasets
def gen(torch_dataset):
for idx in len(torch_dataset):
yield torch_dataset[idx] # this has to be a dictionary
class MyDataset(data.Dataset):
def __init__(self, path):
self.dict = []
for line in open(path, 'r', encoding='utf-8'):
j_dict = json.loads(line)
self.dict.append(j_dict['context'])
def __getitem__(self, idx):
return self.dict[idx]
def __len__(self):
return len(self.dict)
root_path = os.path.dirname(os.path.abspath(__file__))
path = os.path.join(root_path, 'dataset', 'train.json')
torch_dataset = MyDataset(path)
dit = []
for line in open(path, 'r', encoding='utf-8'):
j_dict = json.loads(line)
dit.append(j_dict['context'])
dset1 = datasets.Dataset.from_list(dit)
print(dset1)
dset2 = datasets.Dataset.from_generator(gen)
print(dset2)
``` | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 187 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
> I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
>
> ```python
> from datasets import Dataset
> data = [[1, 2],[3, 4]]
> ds = Dataset.from_dict({"data": data})
> ds = ds.with_format("torch")
> ds[0]
> ds[:2]
> ```
>
> So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
My dummy code is like:
```python
import os
import json
from torch.utils import data
import datasets
def gen(torch_dataset):
for idx in len(torch_dataset):
yield torch_dataset[idx] # this has to be a dictionary
class MyDataset(data.Dataset):
def __init__(self, path):
self.dict = []
for line in open(path, 'r', encoding='utf-8'):
j_dict = json.loads(line)
self.dict.append(j_dict['context'])
def __getitem__(self, idx):
return self.dict[idx]
def __len__(self):
return len(self.dict)
root_path = os.path.dirname(os.path.abspath(__file__))
path = os.path.join(root_path, 'dataset', 'train.json')
torch_dataset = MyDataset(path)
dit = []
for line in open(path, 'r', encoding='utf-8'):
j_dict = json.loads(line)
dit.append(j_dict['context'])
dset1 = datasets.Dataset.from_list(dit)
print(dset1)
dset2 = datasets.Dataset.from_generator(gen)
print(dset2)
``` | [
-1.1206872463226318,
-0.9057133793830872,
-0.6827371120452881,
1.481960415840149,
-0.2570591866970062,
-1.1851669549942017,
0.25626832246780396,
-1.1402250528335571,
1.7321548461914062,
-0.8359870910644531,
0.3431728184223175,
-1.727393627166748,
-0.002270946279168129,
-0.5422256588935852,
-0.7714130878448486,
-0.9885073304176331,
-0.48094213008880615,
-0.7126272916793823,
0.9383225440979004,
2.4820621013641357,
1.1648555994033813,
-1.3970338106155396,
2.5362255573272705,
0.7472052574157715,
-0.1289263665676117,
-1.0900238752365112,
0.5719866752624512,
0.17503473162651062,
-1.2820948362350464,
-0.3127673268318176,
-0.9579795002937317,
-0.12503044307231903,
-0.5685763359069824,
-0.6042078137397766,
-0.0582142174243927,
0.40056073665618896,
-0.23964650928974152,
-0.430961936712265,
-0.5059441924095154,
-0.7700587511062622,
0.446240097284317,
-0.41193994879722595,
0.9779294729232788,
-0.28829285502433777,
1.796061396598816,
-0.6073482036590576,
0.472784161567688,
0.7479648590087891,
1.299852728843689,
0.21264488995075226,
-0.025439944118261337,
0.23296920955181122,
0.3865715563297272,
0.024116776883602142,
0.41600295901298523,
1.1678791046142578,
0.6969799399375916,
0.5073061585426331,
0.7687405943870544,
-2.2970051765441895,
1.236384391784668,
-1.0512361526489258,
0.44179028272628784,
1.270782709121704,
-0.8842478394508362,
0.34568893909454346,
-1.783259630203247,
-0.09458759427070618,
0.600817859172821,
-2.1620819568634033,
0.2300780862569809,
-1.4034004211425781,
-0.5223041772842407,
0.9637171030044556,
0.36483222246170044,
-1.2374628782272339,
0.25276821851730347,
-0.39423200488090515,
0.9107696413993835,
0.4536486268043518,
1.129588007926941,
-1.7352256774902344,
0.09486132860183716,
-0.4371938109397888,
0.20295070111751556,
-1.2574598789215088,
-1.4565919637680054,
0.6756245493888855,
0.7138343453407288,
0.588362455368042,
-0.16512459516525269,
0.9664890170097351,
-1.080862045288086,
0.7303812503814697,
-1.0532166957855225,
-1.7829104661941528,
-1.419584035873413,
-2.1341354846954346,
-2.4169178009033203,
0.6657302975654602,
-0.4498039782047272,
-0.4940400719642639,
2.0679805278778076,
-1.0310719013214111,
-1.7576513290405273,
1.1332406997680664,
0.28752273321151733,
-0.03473583236336708,
2.415257692337036,
0.12188389897346497,
-0.6437709331512451,
0.46946632862091064,
-0.7912584543228149,
0.7812949419021606,
-0.10359445959329605,
1.2958173751831055,
0.4598744511604309,
-1.080508828163147,
1.682226300239563,
-0.2747008204460144,
0.5180202722549438,
-0.6809244155883789,
-0.5002006888389587,
-0.6679961681365967,
0.16630230844020844,
1.7876116037368774,
-0.2863103151321411,
1.54806387424469,
-0.4231247901916504,
-1.5477218627929688,
-1.5734834671020508,
0.9275264143943787,
0.3893975019454956,
-0.7681814432144165,
-0.0026069479063153267,
-0.408247709274292,
0.1323641687631607,
-0.10153092443943024,
1.2364206314086914,
1.2499712705612183,
0.7543985247612,
-0.4117682874202728,
-0.8003489971160889,
0.08878592401742935,
-0.044905781745910645,
-0.8420026302337646,
-1.7522245645523071,
-0.33731985092163086,
0.04087338224053383,
0.6271273493766785,
-1.1388757228851318,
1.7479143142700195,
0.8693842887878418,
1.865470051765442,
1.0339359045028687,
-0.5139431953430176,
1.4581654071807861,
0.0975349098443985,
1.8542648553848267,
-0.5923145413398743,
0.6412861347198486,
-0.36700281500816345,
-1.1271916627883911,
0.935745120048523,
-0.1847875565290451,
-2.0514655113220215,
-0.8853492140769958,
-0.6803507208824158,
-0.2023824006319046,
-0.8307428359985352,
1.0092213153839111,
-0.2222452014684677,
-1.5171655416488647,
0.28358644247055054,
-0.6863566040992737,
0.12604443728923798,
-1.10623037815094,
0.3263531029224396,
0.7492018938064575,
-0.620534360408783,
0.09965051710605621,
-0.2826969027519226,
-1.3389720916748047,
-0.4115024209022522,
0.2359032779932022,
1.8094031810760498,
-0.728242814540863,
0.8984910249710083,
1.0811619758605957,
-0.7371841073036194,
-0.058487847447395325,
0.2294607162475586,
-0.26909542083740234,
0.8435477614402771,
-1.0086321830749512,
-0.4944492280483246,
1.1199116706848145,
-0.11761213093996048,
-0.6587657332420349,
1.5331670045852661,
0.6169651746749878,
-0.9244543313980103,
-0.21023701131343842,
-0.1326858252286911,
-0.7121953368186951,
0.05107765272259712,
-1.6620147228240967,
-0.03623645007610321,
0.44903960824012756,
-1.555628776550293,
-0.47572556138038635,
-0.2549279034137726,
1.2366023063659668,
-0.15531955659389496,
1.3478189706802368,
-0.19239094853401184,
-0.2290433645248413,
-0.39199545979499817,
-0.299051970243454,
0.14851608872413635,
-0.1724056750535965,
-0.5986247062683105,
0.3365696370601654,
-0.8551706075668335,
0.4634333550930023,
1.3502305746078491,
0.3101562261581421,
0.0831407830119133,
0.48562467098236084,
1.0384399890899658,
0.4160677492618561,
-0.08222305774688721,
-0.82391756772995,
-1.573188304901123,
2.077284812927246,
-1.437208652496338,
1.9593254327774048,
0.6942605376243591,
-0.02923477068543434,
-1.8287694454193115,
-1.8759719133377075,
1.4154703617095947,
1.161834478378296,
2.386061429977417,
0.6156141757965088,
0.3609223961830139,
-0.7803995609283447,
-0.5205467939376831,
0.33465152978897095,
-1.0213446617126465,
-0.6753865480422974,
0.2263546884059906,
2.3714661598205566,
1.696878433227539,
-0.5075570940971375,
-0.1442379355430603,
-1.0317413806915283,
1.3789856433868408,
-0.2232610583305359,
0.298465758562088,
2.0417349338531494,
-0.34307464957237244,
-1.144595742225647,
1.4253039360046387,
-2.3137593269348145,
0.025829412043094635,
1.9346474409103394,
0.09333569556474686,
0.019041240215301514,
-1.366335391998291,
-0.5978094935417175,
-0.34783950448036194,
-0.49171462655067444,
-1.3275856971740723,
0.5043864250183105,
-0.19388875365257263,
-0.7381277084350586,
-1.4976446628570557,
0.15860377252101898,
-1.126623511314392,
-1.6671708822250366,
0.3082982897758484,
1.795954942703247,
1.930185079574585,
-0.7570689916610718,
1.5453401803970337,
-0.4049714207649231,
0.1974569410085678,
1.1239532232284546,
1.1598495244979858,
3.033719778060913,
1.9829684495925903,
-1.2563467025756836,
0.7051302194595337,
-0.24689333140850067,
-0.5519132614135742,
1.3226890563964844,
-1.1898835897445679,
1.3082510232925415,
-0.1927076131105423,
-1.2594940662384033,
-1.2940305471420288,
1.0634535551071167,
0.4057758152484894,
0.09125629812479019,
-0.5738158822059631,
1.218485713005066,
0.08355774730443954,
1.2614494562149048,
0.5222675204277039,
-0.3254977762699127,
0.6234205961227417,
-0.4760543704032898,
-0.4517855644226074,
1.507304072380066,
0.20658105611801147,
-1.3126187324523926,
-2.38375186920166,
-0.25461456179618835,
-0.9041179418563843,
0.0058997878804802895,
-0.5334151983261108,
-1.0476003885269165,
1.74704909324646,
0.32722416520118713,
-1.3343881368637085,
-0.21745994687080383,
-0.29658177495002747,
-0.5585628747940063,
2.677910804748535,
-1.3381892442703247,
-0.1684955507516861,
-1.0160489082336426,
-0.6772907376289368,
1.719210147857666,
-1.1495866775512695,
-0.13581666350364685,
-0.986081063747406,
-0.5627164840698242,
-1.3822977542877197,
-0.6430745124816895,
0.04942287504673004,
-1.0242663621902466,
0.8008025288581848,
0.18632711470127106,
-1.1169445514678955,
-0.3662850260734558,
-0.8197761178016663,
0.9147237539291382,
-0.14050813019275665,
0.29633843898773193,
1.9804085493087769,
0.5033873915672302,
-0.38504862785339355,
0.6520553231239319,
1.0890032052993774,
0.766477644443512,
-0.7316303253173828,
0.2675785720348358,
-0.7451076507568359,
0.2824598550796509,
-1.3482213020324707,
0.23131494224071503,
-2.7750191688537598,
0.5693498849868774,
0.0068836091086268425,
-0.035840004682540894,
0.06309344619512558,
-1.2329717874526978,
1.116767168045044,
2.577840566635132,
-1.2277860641479492,
0.39509016275405884,
0.3282683193683624,
1.1652172803878784,
-1.3879064321517944,
0.3209802806377411,
-0.47189390659332275,
2.168200731277466,
0.2413499355316162,
1.0901707410812378,
-0.39361104369163513,
-2.262064218521118,
0.5956284403800964,
-1.3227320909500122,
-1.3069478273391724,
0.8074780702590942,
-0.988663911819458,
0.10012900084257126,
-1.5157917737960815,
-0.17728540301322937,
-0.9280173182487488,
-1.1554433107376099,
0.776104211807251,
0.12141917645931244,
0.44719308614730835,
-0.658582866191864,
0.3695949614048004,
-2.181370496749878,
-1.399362325668335,
-0.29199299216270447,
-0.9588186144828796,
0.5139039754867554,
-0.24929481744766235,
0.6901815533638,
-0.1434723436832428,
-0.004783546086400747,
0.3294110596179962,
1.3801438808441162,
3.365185260772705,
0.26807403564453125,
0.30677303671836853,
-0.16651278734207153,
-1.0202999114990234,
1.5079368352890015,
0.9307313561439514,
-0.026512347161769867,
-0.5851972103118896,
-1.029679536819458,
1.1612683534622192,
2.0693209171295166,
1.0184522867202759,
-0.046455949544906616,
-0.7682643532752991,
-0.6607740521430969,
0.06308510154485703,
0.3112756907939911,
0.4498847723007202,
0.8980816602706909,
0.07621645927429199,
0.14357520639896393,
1.461311936378479,
1.242924690246582,
-0.32686367630958557,
0.3483181297779083,
-0.8735857605934143,
-0.6177159547805786,
0.6273540258407593,
0.23940059542655945,
0.06087571009993553,
0.3887340724468231,
-1.118957281112671,
-0.32448986172676086,
-0.45565173029899597,
-0.9495113492012024,
-0.7095832228660583,
-0.42696624994277954,
-0.4056301712989807,
1.5538870096206665,
-0.09030261635780334,
-0.47593098878860474,
-0.02557528391480446,
-0.7204590439796448,
-0.13870292901992798,
-1.1004446744918823,
0.28264832496643066,
-0.10546990483999252,
-0.08573493361473083,
-0.11212603747844696,
1.7723621129989624,
-0.896599531173706,
-1.9298605918884277,
0.2353740632534027,
0.2420479655265808,
-0.3844713270664215,
0.3187761902809143,
1.5797208547592163,
0.5186007618904114,
1.3835052251815796,
1.3051396608352661,
0.9748425483703613,
-0.6078717708587646,
-1.2886403799057007,
0.6097854375839233,
0.9035419821739197,
-1.3043197393417358,
0.9199886918067932,
0.058065880089998245,
-0.5875062942504883,
0.6365274786949158,
1.1682356595993042,
0.4030791223049164,
-2.106081485748291,
0.7668472528457642,
-0.893073558807373,
0.7882078886032104,
0.686248242855072,
0.7731756567955017,
0.1358051598072052,
0.8209238052368164,
-1.202585220336914,
-1.0663812160491943,
-0.7681394815444946,
-0.5563082098960876,
1.949577808380127,
-0.3123905062675476,
0.7826671004295349,
-0.20983180403709412,
-1.368300437927246,
-0.12025412172079086,
0.7214597463607788,
0.42093414068222046,
-0.7023609280586243,
0.8416967391967773,
-0.39302659034729004,
-1.1052169799804688,
-1.3015954494476318,
-0.44993260502815247,
-1.0911444425582886,
-0.8536098003387451,
1.1232413053512573,
0.766340434551239,
0.23061546683311462,
1.7705047130584717,
0.4981553554534912,
0.17269174754619598,
-2.6938352584838867,
0.8996574282646179,
0.24502280354499817,
-0.11592455208301544,
0.8520615696907043,
0.39063745737075806,
1.027914047241211,
-0.10897123068571091,
0.5973237156867981,
-2.3502469062805176,
2.2242770195007324,
-0.09246095269918442,
0.7371405363082886,
-0.0025291689671576023,
-0.17400023341178894,
0.9758278131484985,
0.5974807143211365,
0.6370038390159607,
-1.035146951675415,
0.5529026389122009,
-0.5313074588775635,
1.2054857015609741,
0.9133830666542053,
-0.730991005897522,
-0.15281963348388672,
1.389197826385498,
0.5393901467323303,
-0.41662082076072693,
-0.8949187397956848,
-0.9234587550163269,
0.9035770893096924,
1.7303779125213623,
-0.15800657868385315,
-0.10278251022100449,
0.9556968808174133,
0.7692195773124695,
-1.337957739830017,
0.01704264059662819,
-0.7338844537734985,
-0.5771358609199524,
1.6797552108764648,
2.135040521621704,
-0.18567755818367004,
-0.17923814058303833,
-0.736167311668396,
-1.1245083808898926,
0.8608121871948242,
-0.14818012714385986,
0.14724195003509521,
0.6967275738716125,
-0.619480550289154,
1.1558082103729248,
0.7942027449607849,
1.0357635021209717,
0.23708589375019073,
0.40545645356178284,
0.3923911452293396,
-0.32255280017852783,
-1.1643842458724976,
-0.21181327104568481,
-1.0225192308425903,
-2.4954237937927246,
0.4894082248210907,
-0.3004685938358307,
-1.3806957006454468,
-0.03247978910803795,
-1.0608967542648315,
0.9494118690490723,
-0.6142719388008118,
-1.0666370391845703,
-1.5264397859573364,
0.28059351444244385,
0.10144969820976257,
1.0337523221969604,
-1.626761794090271,
0.035521652549505234,
1.1738767623901367,
0.9226170182228088,
-0.7339814901351929,
1.0154566764831543,
0.37077099084854126,
1.071734070777893,
0.8276494741439819,
-0.3480861485004425,
0.5839442610740662,
0.13019177317619324,
-1.2378661632537842,
0.37922558188438416,
1.0337218046188354,
0.15423019230365753,
1.3527085781097412,
-0.6200128197669983,
-0.042247336357831955,
0.4527212679386139,
-0.5650441646575928,
-0.3748582899570465,
-0.569878339767456,
0.7094493508338928,
0.0647682249546051,
-0.8971613049507141,
-0.022196630015969276,
-0.008432280272245407,
-0.20955631136894226,
0.16995616257190704,
-1.403563380241394,
-0.20605048537254333,
-0.4503633975982666,
-0.6549867987632751,
-1.2471725940704346,
-0.10663183778524399,
1.4382871389389038,
-0.8005374073982239,
-0.10819051414728165,
0.48140719532966614,
0.3693443834781647,
0.5820291638374329,
0.6048712134361267,
-0.5393850207328796,
-0.41886115074157715,
-0.2856404185295105,
-0.37774255871772766,
0.3128952085971832,
1.3907618522644043,
-0.200613334774971,
-1.056865930557251,
0.801354169845581,
-0.39511817693710327,
0.02111520990729332,
1.9999552965164185,
0.03924570232629776,
-0.8048627376556396,
0.3278416097164154,
-0.6052391529083252,
1.8172346353530884,
1.728316307067871,
1.4272668361663818,
-0.1647709608078003,
-0.9415956735610962,
0.5843139290809631,
-0.43474915623664856,
-0.4933628737926483,
0.7958345413208008,
0.3616483211517334,
-0.08600202947854996,
-1.3533302545547485,
0.765209436416626,
1.3852723836898804,
-0.9879147410392761,
-0.8277038931846619,
0.27549228072166443,
-0.7560890316963196,
1.1313201189041138,
0.7925299406051636,
0.3836893141269684,
0.23411855101585388,
1.4812448024749756,
0.7208894491195679,
-0.42542269825935364,
0.5638236999511719,
0.5329936146736145,
-0.09608489274978638,
-2.074016571044922,
-1.1290576457977295,
0.2672356367111206,
-0.48458391427993774,
-1.620921015739441,
1.301329255104065,
-1.3174006938934326,
-0.9597835540771484,
0.5182660222053528,
0.023437026888132095,
1.4685255289077759,
0.4033587872982025,
1.5805164575576782,
2.1765024662017822,
0.9039493799209595,
0.40592291951179504,
1.4335342645645142,
-0.07849931716918945,
-0.4968925416469574,
1.7547190189361572,
-0.4670734107494354,
0.5805451273918152,
1.1660292148590088,
-0.17439326643943787,
-0.9151110053062439,
-0.7707555890083313,
-1.3087515830993652,
-0.6374224424362183,
1.255976915359497,
0.04883420839905739,
-1.174777865409851,
0.31853342056274414,
1.5014729499816895,
0.025634825229644775,
-0.3641423285007477,
0.6539819240570068,
0.3334389925003052,
-0.7991414070129395,
-0.18402457237243652,
-0.9176324009895325,
0.46821409463882446,
-0.2884802222251892,
-0.2351185381412506,
0.3427041471004486,
0.4220025837421417,
1.3512762784957886,
0.010627868585288525,
0.18963442742824554,
1.1736584901809692,
-1.4282751083374023,
1.5343008041381836,
-0.5794177055358887,
0.23517315089702606,
-2.39471173286438,
1.3699100017547607,
-0.6963239312171936,
1.8610793352127075,
-2.7329530715942383,
0.4123031198978424,
-0.4948410391807556,
-0.3903670310974121,
0.1852066069841385,
-0.2923964858055115,
0.1223534643650055,
-0.16419439017772675,
-1.1104140281677246,
0.015910513699054718,
-0.7192865014076233,
0.5276750922203064,
0.9788430333137512,
1.2720770835876465,
-1.2501782178878784,
-0.3821781277656555,
-1.7382086515426636,
-0.19025301933288574,
-0.653472363948822,
0.31978413462638855,
-1.9976085424423218,
-0.16406133770942688,
-1.8948631286621094,
-2.567880392074585,
-1.3339784145355225,
-0.8263121247291565,
1.0989065170288086,
0.06178655847907066,
-0.8318838477134705,
1.0918104648590088,
-0.3572332262992859,
-2.0108017921447754,
1.1471070051193237,
-2.113417387008667
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | We're releasing `from_generator` and `from_list` today :)
In the meantime you can play with them by installing `datasets` from source | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 20 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
We're releasing `from_generator` and `from_list` today :)
In the meantime you can play with them by installing `datasets` from source | [
-1.101901888847351,
-0.9094791412353516,
-0.7532669901847839,
1.519528865814209,
-0.2528173327445984,
-1.2495003938674927,
0.2840871810913086,
-1.1172683238983154,
1.78923499584198,
-0.9147052764892578,
0.4522378444671631,
-1.7215992212295532,
0.07844015955924988,
-0.5788612961769104,
-0.7562344074249268,
-0.9942691922187805,
-0.4078960418701172,
-0.6746011972427368,
0.9057151079177856,
2.4662764072418213,
1.1134366989135742,
-1.3167423009872437,
2.490161895751953,
0.7234232425689697,
-0.13711979985237122,
-1.114410638809204,
0.5504299402236938,
0.271308958530426,
-1.2399725914001465,
-0.275857537984848,
-0.9794779419898987,
-0.12020691484212875,
-0.5555393099784851,
-0.6993820667266846,
-0.06956339627504349,
0.4276643693447113,
-0.2812916040420532,
-0.4344460964202881,
-0.4218771755695343,
-0.8246714472770691,
0.4704481363296509,
-0.4105215072631836,
0.9924290180206299,
-0.3734985888004303,
1.8912266492843628,
-0.5922285318374634,
0.4569784104824066,
0.731829047203064,
1.3071622848510742,
0.1665145754814148,
-0.038304202258586884,
0.17194944620132446,
0.40782204270362854,
0.05389876663684845,
0.3560968041419983,
1.091599702835083,
0.5620859861373901,
0.5696440935134888,
0.7797167897224426,
-2.3292791843414307,
1.2901955842971802,
-1.0931812524795532,
0.4347086250782013,
1.28116774559021,
-0.9396725296974182,
0.30774152278900146,
-1.7500532865524292,
-0.11465548723936081,
0.5461539030075073,
-2.151577949523926,
0.23201884329319,
-1.3849073648452759,
-0.5341123342514038,
0.9877761602401733,
0.3898436427116394,
-1.2506954669952393,
0.21677114069461823,
-0.3196691572666168,
0.8636539578437805,
0.5078437328338623,
1.0682504177093506,
-1.6919238567352295,
0.09507931023836136,
-0.5066742897033691,
0.16626501083374023,
-1.3783657550811768,
-1.384998083114624,
0.6428451538085938,
0.6838958859443665,
0.5890771746635437,
-0.1577288806438446,
0.9891979098320007,
-1.0467077493667603,
0.7440860271453857,
-1.0260154008865356,
-1.738294243812561,
-1.346958041191101,
-2.1363089084625244,
-2.475677251815796,
0.706273078918457,
-0.43726983666419983,
-0.5249140858650208,
2.0179476737976074,
-1.0927149057388306,
-1.7699228525161743,
1.188283085823059,
0.2476317584514618,
-0.06218567118048668,
2.3623461723327637,
0.11434230208396912,
-0.5861682295799255,
0.3903356194496155,
-0.7759649753570557,
0.7907847762107849,
-0.15323522686958313,
1.3116657733917236,
0.5486921072006226,
-1.1852078437805176,
1.6820645332336426,
-0.249648779630661,
0.47311145067214966,
-0.7033495903015137,
-0.5285869836807251,
-0.7608718276023865,
0.1834564507007599,
1.760141372680664,
-0.29784366488456726,
1.547585368156433,
-0.40029868483543396,
-1.4885550737380981,
-1.5792222023010254,
0.9125856757164001,
0.3845139741897583,
-0.7031236886978149,
-0.013289480470120907,
-0.28025928139686584,
0.1243012547492981,
-0.1277618110179901,
1.2570955753326416,
1.1959402561187744,
0.7464630007743835,
-0.3986205458641052,
-0.7827172875404358,
0.08884125202894211,
-0.02682206965982914,
-0.8359473347663879,
-1.7703003883361816,
-0.40236136317253113,
0.04723874479532242,
0.6552562117576599,
-1.1072193384170532,
1.736577033996582,
0.8492879867553711,
1.8408539295196533,
1.0348576307296753,
-0.4263129234313965,
1.4539765119552612,
0.0038623670116066933,
1.8937710523605347,
-0.5834082365036011,
0.7062309980392456,
-0.3413538932800293,
-1.1096608638763428,
0.9534440636634827,
-0.199024960398674,
-2.0339088439941406,
-0.9508361220359802,
-0.7898439764976501,
-0.17277735471725464,
-0.7846755385398865,
1.0299744606018066,
-0.2785298526287079,
-1.5400670766830444,
0.30795660614967346,
-0.5994873046875,
0.12485621869564056,
-1.113122582435608,
0.3214629292488098,
0.7231723666191101,
-0.6196537017822266,
0.060405462980270386,
-0.27059391140937805,
-1.3210179805755615,
-0.40537893772125244,
0.20408369600772858,
1.855453610420227,
-0.7845625877380371,
0.9417971968650818,
1.0386159420013428,
-0.7891951203346252,
-0.06178233399987221,
0.23750047385692596,
-0.31640809774398804,
0.8087866306304932,
-1.000632405281067,
-0.4746502935886383,
1.1421351432800293,
-0.09636537730693817,
-0.6905269026756287,
1.5857847929000854,
0.6749010682106018,
-0.8895768523216248,
-0.12697187066078186,
-0.23809392750263214,
-0.6730428338050842,
0.04096259921789169,
-1.64909827709198,
-0.031929731369018555,
0.36320939660072327,
-1.4447489976882935,
-0.47053173184394836,
-0.20187318325042725,
1.2581045627593994,
-0.1835583597421646,
1.290101408958435,
-0.2052265703678131,
-0.3683742582798004,
-0.38536304235458374,
-0.27883878350257874,
0.16769136488437653,
-0.13813015818595886,
-0.6662295460700989,
0.37398773431777954,
-0.8176153898239136,
0.4629899859428406,
1.2597339153289795,
0.32292255759239197,
0.13941293954849243,
0.5485727787017822,
1.0306442975997925,
0.33076635003089905,
-0.023975543677806854,
-0.8606391549110413,
-1.6179319620132446,
2.069901704788208,
-1.4024708271026611,
1.9863488674163818,
0.6517815589904785,
-0.0292741060256958,
-1.820186972618103,
-1.810489535331726,
1.4505735635757446,
1.2268879413604736,
2.305267333984375,
0.6486009955406189,
0.33384862542152405,
-0.7853760719299316,
-0.5417007803916931,
0.335293173789978,
-1.0844663381576538,
-0.6272933483123779,
0.23200483620166779,
2.3353936672210693,
1.6781713962554932,
-0.5260602235794067,
-0.1579095870256424,
-1.1097718477249146,
1.29507577419281,
-0.20031271874904633,
0.29396113753318787,
2.064465045928955,
-0.42666199803352356,
-1.2004154920578003,
1.397195816040039,
-2.297461748123169,
-0.0017188973724842072,
1.9279109239578247,
0.09961244463920593,
-0.03736152499914169,
-1.3656333684921265,
-0.6637636423110962,
-0.3328293263912201,
-0.5146187543869019,
-1.3459502458572388,
0.5077683329582214,
-0.24837267398834229,
-0.7641122937202454,
-1.4798486232757568,
0.15386883914470673,
-1.1379796266555786,
-1.6630700826644897,
0.4090534746646881,
1.7729805707931519,
1.868444800376892,
-0.6675125956535339,
1.5532976388931274,
-0.3189506530761719,
0.24186527729034424,
1.2102216482162476,
1.1882109642028809,
3.027538299560547,
1.9941234588623047,
-1.2153748273849487,
0.7798286080360413,
-0.1689603477716446,
-0.5841830372810364,
1.3463175296783447,
-1.1706583499908447,
1.358725666999817,
-0.1577163189649582,
-1.2004915475845337,
-1.3780102729797363,
1.0187361240386963,
0.36391088366508484,
0.11654433608055115,
-0.545062780380249,
1.2819768190383911,
0.08040236681699753,
1.2405017614364624,
0.5189094543457031,
-0.3403574526309967,
0.6257896423339844,
-0.510329008102417,
-0.46768078207969666,
1.501855731010437,
0.2082681804895401,
-1.3118449449539185,
-2.422354221343994,
-0.2518051862716675,
-0.8210455775260925,
-0.06757855415344238,
-0.49119454622268677,
-1.0181832313537598,
1.8043603897094727,
0.3668287396430969,
-1.3782086372375488,
-0.18634119629859924,
-0.28944575786590576,
-0.6188059449195862,
2.693424701690674,
-1.3379203081130981,
-0.2086292803287506,
-1.062043309211731,
-0.7050178647041321,
1.7331476211547852,
-1.1991398334503174,
-0.11443981528282166,
-1.0017344951629639,
-0.5417816638946533,
-1.4286222457885742,
-0.6176044940948486,
0.031091000884771347,
-1.0306841135025024,
0.8138312101364136,
0.14483128488063812,
-1.0589053630828857,
-0.4044971466064453,
-0.8187230229377747,
0.8580003380775452,
-0.10490691661834717,
0.35107263922691345,
1.9887762069702148,
0.5689009428024292,
-0.41535529494285583,
0.5800849199295044,
1.085545301437378,
0.7704877853393555,
-0.7315011620521545,
0.41090622544288635,
-0.7495996952056885,
0.19479982554912567,
-1.3235331773757935,
0.3019483685493469,
-2.820664405822754,
0.5448018312454224,
-0.04076355695724487,
-0.07775862514972687,
0.05926692485809326,
-1.26775062084198,
1.1314791440963745,
2.5685930252075195,
-1.184140682220459,
0.3445248603820801,
0.23592577874660492,
1.1580299139022827,
-1.4132635593414307,
0.4115208387374878,
-0.4197647273540497,
2.0918068885803223,
0.2696901559829712,
1.0520823001861572,
-0.416896253824234,
-2.1651418209075928,
0.6586700081825256,
-1.3219822645187378,
-1.3333693742752075,
0.8204096555709839,
-0.9518339037895203,
0.11023034900426865,
-1.4509514570236206,
-0.14968235790729523,
-0.920284628868103,
-1.2189501523971558,
0.8457524180412292,
0.17931395769119263,
0.46957072615623474,
-0.6031996607780457,
0.3827136158943176,
-2.1257872581481934,
-1.4031273126602173,
-0.29581543803215027,
-0.9168809652328491,
0.4787995219230652,
-0.1889304518699646,
0.6766084432601929,
-0.19311942160129547,
0.0680687427520752,
0.32496896386146545,
1.434730052947998,
3.385664939880371,
0.30273544788360596,
0.38239791989326477,
-0.09900834411382675,
-0.9961384534835815,
1.5196216106414795,
0.9886448383331299,
0.04142432659864426,
-0.5814222693443298,
-1.011405348777771,
1.0643892288208008,
2.059521198272705,
1.0567208528518677,
-0.026598075404763222,
-0.7274039387702942,
-0.6741458773612976,
0.06762758642435074,
0.2630705237388611,
0.4488784372806549,
0.8718916773796082,
0.11207211762666702,
0.14809775352478027,
1.4977167844772339,
1.2859160900115967,
-0.3889450430870056,
0.29574865102767944,
-0.8490186929702759,
-0.5704290866851807,
0.6830225586891174,
0.30446797609329224,
0.05995930731296539,
0.39809393882751465,
-1.0892287492752075,
-0.35381609201431274,
-0.4194130003452301,
-1.0195611715316772,
-0.6904109120368958,
-0.5216584205627441,
-0.4530813992023468,
1.5681062936782837,
-0.09847167134284973,
-0.4348873496055603,
-0.11070932447910309,
-0.7863019108772278,
-0.06823740899562836,
-1.100419521331787,
0.2863365411758423,
-0.12064353376626968,
-0.09066452085971832,
-0.06482516974210739,
1.7926268577575684,
-0.9437611699104309,
-1.9667441844940186,
0.30159083008766174,
0.2156955450773239,
-0.39174023270606995,
0.3091655373573303,
1.520430088043213,
0.5190582871437073,
1.3847209215164185,
1.2777067422866821,
0.9612315893173218,
-0.5883820056915283,
-1.3251205682754517,
0.5856527090072632,
0.8473595380783081,
-1.3835411071777344,
0.9452758431434631,
0.13238844275474548,
-0.5128699541091919,
0.648199200630188,
1.1440848112106323,
0.39379316568374634,
-2.0559587478637695,
0.6996971368789673,
-0.834092915058136,
0.7912631034851074,
0.7105818390846252,
0.7361235618591309,
0.15381884574890137,
0.841405987739563,
-1.1915900707244873,
-1.0893439054489136,
-0.770175039768219,
-0.5227480530738831,
1.933008074760437,
-0.25228646397590637,
0.7976998090744019,
-0.20972338318824768,
-1.3331788778305054,
-0.12096498906612396,
0.6727797389030457,
0.3961811065673828,
-0.6840155720710754,
0.8007407188415527,
-0.4157809019088745,
-1.0632350444793701,
-1.3771986961364746,
-0.4705701172351837,
-1.1269444227218628,
-0.8426629900932312,
1.1622182130813599,
0.754430890083313,
0.17510995268821716,
1.770937442779541,
0.5118623375892639,
0.18170584738254547,
-2.693722724914551,
0.8617699146270752,
0.20794598758220673,
-0.05196394398808479,
0.8366269469261169,
0.36454859375953674,
1.0594521760940552,
-0.16203826665878296,
0.5537052750587463,
-2.370236396789551,
2.24056077003479,
-0.14212310314178467,
0.6227073669433594,
-0.010950017720460892,
-0.17651526629924774,
1.0667725801467896,
0.5723680853843689,
0.6234652996063232,
-1.056261420249939,
0.5402039885520935,
-0.5638640522956848,
1.24439537525177,
0.971333384513855,
-0.7225282192230225,
-0.16147254407405853,
1.4074265956878662,
0.5926430225372314,
-0.3602285385131836,
-0.7813898921012878,
-0.9426974654197693,
0.8216500878334045,
1.6713297367095947,
-0.1243574395775795,
-0.14844027161598206,
1.0058016777038574,
0.7441183924674988,
-1.3391752243041992,
0.05370192974805832,
-0.763146162033081,
-0.5820173621177673,
1.7074681520462036,
2.150347948074341,
-0.16616734862327576,
-0.22210609912872314,
-0.815707266330719,
-0.9741862416267395,
0.849414050579071,
-0.12805499136447906,
0.10006054490804672,
0.6688829660415649,
-0.6469772458076477,
1.125707983970642,
0.858912467956543,
1.0088800191879272,
0.28761085867881775,
0.4836767017841339,
0.36750948429107666,
-0.3059775233268738,
-1.2314015626907349,
-0.19698062539100647,
-1.019322156906128,
-2.572129726409912,
0.57076495885849,
-0.4188895523548126,
-1.4065412282943726,
-0.013750803656876087,
-1.1393215656280518,
0.933375895023346,
-0.6116058826446533,
-1.082768201828003,
-1.5264289379119873,
0.21352562308311462,
0.05284017324447632,
1.0070973634719849,
-1.6345082521438599,
0.1292637437582016,
1.260758876800537,
0.8852807879447937,
-0.7357519865036011,
1.0171345472335815,
0.33634042739868164,
1.123428463935852,
0.8130963444709778,
-0.39309972524642944,
0.5671590566635132,
0.15110214054584503,
-1.2678964138031006,
0.4229145050048828,
0.9960825443267822,
0.12858806550502777,
1.4068965911865234,
-0.5953500270843506,
0.04395347461104393,
0.45921406149864197,
-0.5690081119537354,
-0.45390021800994873,
-0.6101161241531372,
0.8173543214797974,
0.10034239292144775,
-0.8686701059341431,
0.08946327865123749,
0.012606313452124596,
-0.23402699828147888,
0.13678419589996338,
-1.441118836402893,
-0.2243003398180008,
-0.4104883670806885,
-0.7132079601287842,
-1.2658179998397827,
-0.1001632884144783,
1.3488717079162598,
-0.7323874235153198,
-0.0408715084195137,
0.426127552986145,
0.3327367901802063,
0.5698481798171997,
0.6273961663246155,
-0.5173660516738892,
-0.4585478603839874,
-0.2927803695201874,
-0.35793793201446533,
0.35089853405952454,
1.3915700912475586,
-0.2393464297056198,
-1.0837448835372925,
0.8108506202697754,
-0.3821371793746948,
-0.0003827884793281555,
2.018099546432495,
0.003962806425988674,
-0.8233857154846191,
0.33400124311447144,
-0.6287040114402771,
1.8626196384429932,
1.7512199878692627,
1.38357412815094,
-0.12549567222595215,
-0.9309006333351135,
0.5456597805023193,
-0.3940656781196594,
-0.4652010500431061,
0.8424873352050781,
0.3866911232471466,
-0.03080618381500244,
-1.2835358381271362,
0.7475761771202087,
1.3668339252471924,
-0.9864243268966675,
-0.8631688952445984,
0.29587027430534363,
-0.7327989935874939,
1.0617244243621826,
0.7818816900253296,
0.4180949032306671,
0.3185727894306183,
1.4148880243301392,
0.6641287207603455,
-0.4180627763271332,
0.5560447573661804,
0.4782857298851013,
-0.044930536299943924,
-2.0276856422424316,
-1.1207953691482544,
0.30901622772216797,
-0.5588701367378235,
-1.6534864902496338,
1.3075824975967407,
-1.2900948524475098,
-0.9081966280937195,
0.5718145370483398,
0.0673738494515419,
1.5366791486740112,
0.3726077675819397,
1.5628488063812256,
2.1374340057373047,
0.8693604469299316,
0.34762337803840637,
1.4987514019012451,
-0.03445649519562721,
-0.5668256282806396,
1.7802776098251343,
-0.465384840965271,
0.5534317493438721,
1.1518388986587524,
-0.07340732961893082,
-0.9098820686340332,
-0.7943702936172485,
-1.2483774423599243,
-0.5990251898765564,
1.2498323917388916,
0.13949641585350037,
-1.1984769105911255,
0.2233700156211853,
1.467529296875,
0.004529053345322609,
-0.33660808205604553,
0.5747390389442444,
0.30821236968040466,
-0.7894734144210815,
-0.1700456589460373,
-0.8952422738075256,
0.49102485179901123,
-0.29379963874816895,
-0.22706878185272217,
0.333076536655426,
0.4434249997138977,
1.3391107320785522,
-0.005714904982596636,
0.23268423974514008,
1.2367045879364014,
-1.4333000183105469,
1.52395498752594,
-0.5543956756591797,
0.24073654413223267,
-2.3599090576171875,
1.3702720403671265,
-0.7380792498588562,
1.817725419998169,
-2.7026636600494385,
0.3752833306789398,
-0.48055484890937805,
-0.43868502974510193,
0.22358104586601257,
-0.36772850155830383,
0.1363038569688797,
-0.18189705908298492,
-1.0782792568206787,
0.06646426767110825,
-0.7777950763702393,
0.528103768825531,
1.001068115234375,
1.2194489240646362,
-1.2737245559692383,
-0.4738001525402069,
-1.7632883787155151,
-0.23074309527873993,
-0.5814179182052612,
0.38924363255500793,
-2.0301382541656494,
-0.19127964973449707,
-1.8793010711669922,
-2.5671801567077637,
-1.3696154356002808,
-0.8488145470619202,
1.1429990530014038,
0.03436360880732536,
-0.8070971369743347,
0.9658307433128357,
-0.32519999146461487,
-2.0307955741882324,
1.134871006011963,
-2.0777928829193115
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | > We're releasing `from_generator` and `from_list` today :) In the meantime you can play with them by installing `datasets` from source
Thanks a lot for your work! | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 27 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
> We're releasing `from_generator` and `from_list` today :) In the meantime you can play with them by installing `datasets` from source
Thanks a lot for your work! | [
-1.0886808633804321,
-0.9088345766067505,
-0.7630176544189453,
1.489237904548645,
-0.23602691292762756,
-1.2480088472366333,
0.25902897119522095,
-1.1271474361419678,
1.7960338592529297,
-0.8957173824310303,
0.46469220519065857,
-1.724325180053711,
0.08996986597776413,
-0.5651800632476807,
-0.7729220390319824,
-0.9866809248924255,
-0.3991256058216095,
-0.6560516357421875,
0.9033106565475464,
2.4838292598724365,
1.1143478155136108,
-1.3374605178833008,
2.4960389137268066,
0.7463423013687134,
-0.1465112864971161,
-1.1036423444747925,
0.5630680918693542,
0.2464083731174469,
-1.244341492652893,
-0.2955339252948761,
-0.9700070023536682,
-0.12929172813892365,
-0.5629247426986694,
-0.6948713660240173,
-0.0815543532371521,
0.4297614097595215,
-0.2773365080356598,
-0.4294191598892212,
-0.44394081830978394,
-0.8171969652175903,
0.4566263258457184,
-0.40889111161231995,
0.9803856611251831,
-0.3710291087627411,
1.8872268199920654,
-0.6053956151008606,
0.45594072341918945,
0.7321495413780212,
1.3101873397827148,
0.19632087647914886,
-0.0466032512485981,
0.15572944283485413,
0.42321404814720154,
0.03455152362585068,
0.34721553325653076,
1.0625877380371094,
0.574479341506958,
0.5825249552726746,
0.7766821384429932,
-2.3240432739257812,
1.298248052597046,
-1.0825480222702026,
0.42881134152412415,
1.289555311203003,
-0.939629316329956,
0.3122556209564209,
-1.7351710796356201,
-0.11693117767572403,
0.5466870665550232,
-2.1624562740325928,
0.23409511148929596,
-1.3629977703094482,
-0.5233699679374695,
0.9688822031021118,
0.36674126982688904,
-1.250437617301941,
0.2207416146993637,
-0.31385892629623413,
0.9044641852378845,
0.5051218271255493,
1.0677061080932617,
-1.697662591934204,
0.09951376914978027,
-0.500767707824707,
0.16996069252490997,
-1.3791837692260742,
-1.3808389902114868,
0.647274911403656,
0.6963199377059937,
0.5814896821975708,
-0.11231689155101776,
0.985889196395874,
-1.0385936498641968,
0.7495889663696289,
-1.0164562463760376,
-1.7380257844924927,
-1.3448907136917114,
-2.1387553215026855,
-2.4963183403015137,
0.7141129374504089,
-0.43031594157218933,
-0.5237833261489868,
2.013267755508423,
-1.0881853103637695,
-1.7683684825897217,
1.1905426979064941,
0.2402612566947937,
-0.06770532578229904,
2.3623931407928467,
0.11452505737543106,
-0.5925503969192505,
0.3848356306552887,
-0.7682861089706421,
0.8041947484016418,
-0.15364328026771545,
1.321452021598816,
0.5427889823913574,
-1.1728752851486206,
1.683196783065796,
-0.27449831366539,
0.4730971157550812,
-0.7086994647979736,
-0.5369418263435364,
-0.7475835680961609,
0.19140742719173431,
1.7792731523513794,
-0.3028651177883148,
1.5606955289840698,
-0.4136063754558563,
-1.5016895532608032,
-1.5789575576782227,
0.9005516171455383,
0.38001516461372375,
-0.7370681762695312,
0.01053182128816843,
-0.2539767920970917,
0.11407377570867538,
-0.12740185856819153,
1.2603832483291626,
1.2042860984802246,
0.7437589168548584,
-0.38692185282707214,
-0.7796452045440674,
0.09394611418247223,
-0.016982946544885635,
-0.8434423208236694,
-1.7791012525558472,
-0.39810192584991455,
0.04557330906391144,
0.667691707611084,
-1.1102771759033203,
1.7423851490020752,
0.8428599238395691,
1.8316771984100342,
1.019882321357727,
-0.4189756512641907,
1.450154423713684,
-0.0021081985905766487,
1.8935236930847168,
-0.5709003210067749,
0.713452935218811,
-0.35711875557899475,
-1.1198192834854126,
0.929266095161438,
-0.1994212120771408,
-2.021052598953247,
-0.9157288074493408,
-0.794241189956665,
-0.18515974283218384,
-0.8060725331306458,
1.0251240730285645,
-0.2647203505039215,
-1.5403695106506348,
0.3266567885875702,
-0.5988302826881409,
0.1525646299123764,
-1.1237356662750244,
0.3320420980453491,
0.7283754944801331,
-0.6126915216445923,
0.056066568940877914,
-0.2533480226993561,
-1.3307595252990723,
-0.43476083874702454,
0.18441233038902283,
1.843870997428894,
-0.757834255695343,
0.9294565320014954,
1.016562581062317,
-0.7621002793312073,
-0.09053416550159454,
0.2713729739189148,
-0.3092878460884094,
0.8042150735855103,
-1.014988660812378,
-0.46370363235473633,
1.1491825580596924,
-0.08892354369163513,
-0.6728787422180176,
1.5858721733093262,
0.6864393353462219,
-0.8799775242805481,
-0.1198994442820549,
-0.2288811206817627,
-0.6718177199363708,
0.030419975519180298,
-1.6494604349136353,
-0.016109690070152283,
0.35337549448013306,
-1.4527534246444702,
-0.4789687991142273,
-0.1900179535150528,
1.237623929977417,
-0.19365553557872772,
1.2880611419677734,
-0.21865786612033844,
-0.36410605907440186,
-0.3916779160499573,
-0.24834825098514557,
0.1540621668100357,
-0.13912788033485413,
-0.6641021370887756,
0.37835028767585754,
-0.8214840292930603,
0.4769265949726105,
1.2771068811416626,
0.30999287962913513,
0.1433759480714798,
0.5234780311584473,
1.034059762954712,
0.326300710439682,
-0.014266298152506351,
-0.8522780537605286,
-1.5942223072052002,
2.087470531463623,
-1.4144811630249023,
1.9721102714538574,
0.6660703420639038,
-0.01472960039973259,
-1.822090983390808,
-1.8082929849624634,
1.4551255702972412,
1.2335443496704102,
2.2976696491241455,
0.6480520367622375,
0.3281325697898865,
-0.7908406257629395,
-0.5312600135803223,
0.3395148515701294,
-1.090287446975708,
-0.6408652067184448,
0.22423025965690613,
2.321821928024292,
1.6943575143814087,
-0.5261470675468445,
-0.15716730058193207,
-1.101798415184021,
1.2962418794631958,
-0.19993863999843597,
0.2716220021247864,
2.0393598079681396,
-0.42795702815055847,
-1.2082914113998413,
1.4051828384399414,
-2.3090529441833496,
-0.012228590436279774,
1.9481563568115234,
0.10030821710824966,
-0.03132178634405136,
-1.3664650917053223,
-0.6716627478599548,
-0.3242148756980896,
-0.49583905935287476,
-1.3414121866226196,
0.5177532434463501,
-0.23214563727378845,
-0.7418308854103088,
-1.4883953332901,
0.16190995275974274,
-1.141528844833374,
-1.6627159118652344,
0.4016912877559662,
1.751705527305603,
1.871102213859558,
-0.6763132810592651,
1.5533140897750854,
-0.3200119137763977,
0.25114697217941284,
1.2221328020095825,
1.1814371347427368,
3.047640085220337,
1.991633653640747,
-1.2087390422821045,
0.7541742324829102,
-0.16563814878463745,
-0.564310610294342,
1.3562132120132446,
-1.1708029508590698,
1.3642667531967163,
-0.1552172750234604,
-1.192234992980957,
-1.3894137144088745,
0.9954262971878052,
0.3834790289402008,
0.11284956336021423,
-0.5462960004806519,
1.2658870220184326,
0.08177094161510468,
1.2437129020690918,
0.5110424757003784,
-0.3447284996509552,
0.6259068846702576,
-0.5237541198730469,
-0.4579027593135834,
1.4988363981246948,
0.23808208107948303,
-1.3041691780090332,
-2.4017293453216553,
-0.2596357762813568,
-0.8276214003562927,
-0.08570287376642227,
-0.4938903748989105,
-1.0432707071304321,
1.778591275215149,
0.3891529142856598,
-1.3753050565719604,
-0.21925051510334015,
-0.27907100319862366,
-0.6307736039161682,
2.694936513900757,
-1.3692748546600342,
-0.20735624432563782,
-1.080804467201233,
-0.7037885785102844,
1.731316089630127,
-1.2172150611877441,
-0.1355932652950287,
-1.0232207775115967,
-0.546388566493988,
-1.441979169845581,
-0.6067821383476257,
0.026974201202392578,
-1.0207011699676514,
0.7923291921615601,
0.1713941991329193,
-1.0646986961364746,
-0.40514034032821655,
-0.8269751071929932,
0.8527187705039978,
-0.1089249700307846,
0.34683260321617126,
1.9824267625808716,
0.5368455648422241,
-0.41129228472709656,
0.5696819424629211,
1.0931106805801392,
0.7557806372642517,
-0.7297059893608093,
0.3931681215763092,
-0.7603468894958496,
0.20513048768043518,
-1.3299074172973633,
0.3018496036529541,
-2.796907663345337,
0.5551555156707764,
-0.03740430623292923,
-0.09620624035596848,
0.06270425021648407,
-1.2808531522750854,
1.1386802196502686,
2.5843141078948975,
-1.1855496168136597,
0.35800886154174805,
0.22310799360275269,
1.1706876754760742,
-1.417384147644043,
0.38731813430786133,
-0.4090709984302521,
2.115895986557007,
0.25689026713371277,
1.0641769170761108,
-0.4220178723335266,
-2.2019498348236084,
0.652866005897522,
-1.3228923082351685,
-1.337337851524353,
0.8109654188156128,
-0.9300041794776917,
0.06560157239437103,
-1.4543572664260864,
-0.14284126460552216,
-0.9438913464546204,
-1.2141286134719849,
0.8529573082923889,
0.15327811241149902,
0.4724515974521637,
-0.6282573938369751,
0.3731660842895508,
-2.1302077770233154,
-1.4032566547393799,
-0.282546728849411,
-0.9046858549118042,
0.471270352602005,
-0.19398917257785797,
0.6575193405151367,
-0.19993403553962708,
0.06995446234941483,
0.3306237459182739,
1.4482752084732056,
3.3952646255493164,
0.30615803599357605,
0.4049476385116577,
-0.10813198238611221,
-0.976883590221405,
1.5124601125717163,
0.971060037612915,
0.04426821321249008,
-0.5786837339401245,
-1.0175832509994507,
1.0854474306106567,
2.028496265411377,
1.0430140495300293,
-0.0199905838817358,
-0.720513105392456,
-0.656475841999054,
0.052876878529787064,
0.2579331398010254,
0.4194921553134918,
0.8778583407402039,
0.11281013488769531,
0.14550447463989258,
1.4872956275939941,
1.2714495658874512,
-0.36632680892944336,
0.2980365753173828,
-0.8371134400367737,
-0.5784229636192322,
0.6916261911392212,
0.32874080538749695,
0.07290126383304596,
0.40000542998313904,
-1.0695500373840332,
-0.34617024660110474,
-0.4316324293613434,
-1.0130573511123657,
-0.679074227809906,
-0.5169275999069214,
-0.4250570237636566,
1.5692335367202759,
-0.10661899298429489,
-0.4591260850429535,
-0.08987259864807129,
-0.805090069770813,
-0.08247308433055878,
-1.0890341997146606,
0.2596540153026581,
-0.129686176776886,
-0.10592985898256302,
-0.049137651920318604,
1.775403618812561,
-0.932155966758728,
-1.9601324796676636,
0.3067103326320648,
0.21583443880081177,
-0.3964693546295166,
0.2825256288051605,
1.5128655433654785,
0.49289223551750183,
1.377074956893921,
1.291282296180725,
0.9705588817596436,
-0.6057055592536926,
-1.3168516159057617,
0.5876553654670715,
0.8458493947982788,
-1.3791526556015015,
0.9380373954772949,
0.13267244398593903,
-0.5180572867393494,
0.6586572527885437,
1.1508010625839233,
0.38435202836990356,
-2.0269787311553955,
0.6995501518249512,
-0.8473590612411499,
0.790461003780365,
0.7169002294540405,
0.7449902296066284,
0.1567229926586151,
0.8472974896430969,
-1.1975890398025513,
-1.0880684852600098,
-0.7626112699508667,
-0.5412181615829468,
1.9425137042999268,
-0.25384923815727234,
0.7933964133262634,
-0.2106158584356308,
-1.3258349895477295,
-0.13123413920402527,
0.6856502890586853,
0.4080778956413269,
-0.6759815216064453,
0.7815495133399963,
-0.43869686126708984,
-1.0553268194198608,
-1.3810925483703613,
-0.49015215039253235,
-1.1080782413482666,
-0.8433861136436462,
1.1628016233444214,
0.7540929913520813,
0.16657961905002594,
1.781010627746582,
0.5172264575958252,
0.1686028093099594,
-2.683473825454712,
0.8517635464668274,
0.19621150195598602,
-0.05506018549203873,
0.8562367558479309,
0.3649304211139679,
1.0374752283096313,
-0.16832734644412994,
0.5651416778564453,
-2.3669626712799072,
2.2656447887420654,
-0.13723067939281464,
0.6142508387565613,
-0.01617640256881714,
-0.18330560624599457,
1.0457998514175415,
0.5804895758628845,
0.6199992895126343,
-1.0583343505859375,
0.5449337363243103,
-0.5546747446060181,
1.2414559125900269,
0.9342354536056519,
-0.72346431016922,
-0.1530209481716156,
1.3909584283828735,
0.574929416179657,
-0.3735702633857727,
-0.8042314052581787,
-0.9325125813484192,
0.8171876668930054,
1.6872836351394653,
-0.12202028930187225,
-0.1529262214899063,
1.0000851154327393,
0.7482983469963074,
-1.3415528535842896,
0.0544864721596241,
-0.7602598667144775,
-0.5940638184547424,
1.7037323713302612,
2.130474328994751,
-0.1408080756664276,
-0.2152269035577774,
-0.803558886051178,
-0.9836112856864929,
0.8639407753944397,
-0.1034107655286789,
0.11298099905252457,
0.6701006293296814,
-0.6577417254447937,
1.137800931930542,
0.895214855670929,
1.005676031112671,
0.27160829305648804,
0.50075763463974,
0.3658497929573059,
-0.298395574092865,
-1.2442694902420044,
-0.1945103108882904,
-1.0339183807373047,
-2.5696232318878174,
0.5540066361427307,
-0.41318291425704956,
-1.4128206968307495,
-0.014327889308333397,
-1.1211658716201782,
0.9328619837760925,
-0.6261013746261597,
-1.0868784189224243,
-1.5269761085510254,
0.24032598733901978,
0.06722705811262131,
1.0373789072036743,
-1.6048988103866577,
0.1394396275281906,
1.2409534454345703,
0.9040820598602295,
-0.7504186630249023,
1.0283632278442383,
0.3259914815425873,
1.1337116956710815,
0.8438157439231873,
-0.40656033158302307,
0.5562608242034912,
0.16553182899951935,
-1.2697066068649292,
0.419427752494812,
1.0026769638061523,
0.15044201910495758,
1.3874496221542358,
-0.6138080358505249,
0.04968086630105972,
0.4630093574523926,
-0.5444396734237671,
-0.4370327293872833,
-0.5954006910324097,
0.8079808950424194,
0.1354455053806305,
-0.8630349040031433,
0.07218430191278458,
-0.011592202819883823,
-0.23731569945812225,
0.15370039641857147,
-1.4530060291290283,
-0.2333681583404541,
-0.4188928008079529,
-0.7057737112045288,
-1.2592664957046509,
-0.11350034177303314,
1.3604979515075684,
-0.7348814606666565,
-0.02802792564034462,
0.4174919128417969,
0.33914321660995483,
0.5695139765739441,
0.6369473934173584,
-0.5212201476097107,
-0.4752437472343445,
-0.2983599901199341,
-0.35728660225868225,
0.32410910725593567,
1.3846782445907593,
-0.24328429996967316,
-1.0727832317352295,
0.8165092468261719,
-0.37844154238700867,
0.022620178759098053,
1.9987647533416748,
0.013782289810478687,
-0.8540928363800049,
0.3235500752925873,
-0.5903713703155518,
1.87486732006073,
1.761248230934143,
1.3678961992263794,
-0.10680815577507019,
-0.940150260925293,
0.5563680529594421,
-0.3796554207801819,
-0.4662342965602875,
0.8447220921516418,
0.36795175075531006,
-0.05791466310620308,
-1.2908060550689697,
0.7419368028640747,
1.359861135482788,
-0.9893253445625305,
-0.8633823394775391,
0.2846299707889557,
-0.7272534370422363,
1.0602339506149292,
0.7792602777481079,
0.40490230917930603,
0.3290072977542877,
1.4425231218338013,
0.6566341519355774,
-0.4162660241127014,
0.5721598863601685,
0.46357956528663635,
-0.05227282643318176,
-2.0309295654296875,
-1.11420738697052,
0.2864789664745331,
-0.5648395419120789,
-1.6432446241378784,
1.3166530132293701,
-1.3106250762939453,
-0.9067582488059998,
0.579759418964386,
0.08140701800584793,
1.5361268520355225,
0.38332006335258484,
1.5686640739440918,
2.1442224979400635,
0.8517393469810486,
0.34145480394363403,
1.4884121417999268,
-0.03005143254995346,
-0.5361729860305786,
1.7946804761886597,
-0.46829497814178467,
0.5737505555152893,
1.1629631519317627,
-0.08747950196266174,
-0.8950350880622864,
-0.8017361164093018,
-1.250540852546692,
-0.6054499745368958,
1.2428580522537231,
0.13255545496940613,
-1.1891659498214722,
0.2241646945476532,
1.489385724067688,
-0.024780772626399994,
-0.33632805943489075,
0.5721270442008972,
0.3207426071166992,
-0.7929781079292297,
-0.15017671883106232,
-0.9221993684768677,
0.49420103430747986,
-0.2740505039691925,
-0.21705655753612518,
0.34530138969421387,
0.45541706681251526,
1.3336793184280396,
-0.004876625258475542,
0.21253547072410583,
1.2426239252090454,
-1.4365392923355103,
1.5014610290527344,
-0.5518711805343628,
0.21513356268405914,
-2.3673555850982666,
1.3662396669387817,
-0.7355020046234131,
1.8256235122680664,
-2.7100112438201904,
0.3785969316959381,
-0.4722621738910675,
-0.4420125186443329,
0.2287348359823227,
-0.3697340488433838,
0.1491522341966629,
-0.18059246242046356,
-1.0854567289352417,
0.06195360794663429,
-0.7767263054847717,
0.5250113010406494,
1.008493185043335,
1.2162293195724487,
-1.2739447355270386,
-0.4615213871002197,
-1.7733854055404663,
-0.20253579318523407,
-0.5798748135566711,
0.3778071105480194,
-2.0197606086730957,
-0.19291134178638458,
-1.8818621635437012,
-2.571695566177368,
-1.3850728273391724,
-0.8405749201774597,
1.1209253072738647,
0.044974710792303085,
-0.8065715432167053,
0.9830031991004944,
-0.3270307779312134,
-2.0187582969665527,
1.1221939325332642,
-2.07574725151062
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | > > I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
> > ```python
> > from datasets import Dataset
> > data = [[1, 2],[3, 4]]
> > ds = Dataset.from_dict({"data": data})
> > ds = ds.with_format("torch")
> > ds[0]
> > ds[:2]
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
>
> My dummy code is like:
>
> ```python
> import os
> import json
> from torch.utils import data
> import datasets
>
> def gen(torch_dataset):
> for idx in len(torch_dataset):
> yield torch_dataset[idx] # this has to be a dictionary
>
> class MyDataset(data.Dataset):
> def __init__(self, path):
> self.dict = []
> for line in open(path, 'r', encoding='utf-8'):
> j_dict = json.loads(line)
> self.dict.append(j_dict['context'])
>
> def __getitem__(self, idx):
> return self.dict[idx]
>
> def __len__(self):
> return len(self.dict)
>
> root_path = os.path.dirname(os.path.abspath(__file__))
> path = os.path.join(root_path, 'dataset', 'train.json')
> torch_dataset = MyDataset(path)
>
> dit = []
> for line in open(path, 'r', encoding='utf-8'):
> j_dict = json.loads(line)
> dit.append(j_dict['context'])
> dset1 = datasets.Dataset.from_list(dit)
> print(dset1)
> dset2 = datasets.Dataset.from_generator(gen)
> print(dset2)
> ```
Hi, when I am using this code to build my own dataset, ` datasets.Dataset.from_generator(gen)` report `TypeError: cannot pickle generator object` whre MyDataset returns a dict like {'image': bytes, 'text': string}. How can I resolve this? Thanks a lot! | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 294 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
> > I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
> > ```python
> > from datasets import Dataset
> > data = [[1, 2],[3, 4]]
> > ds = Dataset.from_dict({"data": data})
> > ds = ds.with_format("torch")
> > ds[0]
> > ds[:2]
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
>
> My dummy code is like:
>
> ```python
> import os
> import json
> from torch.utils import data
> import datasets
>
> def gen(torch_dataset):
> for idx in len(torch_dataset):
> yield torch_dataset[idx] # this has to be a dictionary
>
> class MyDataset(data.Dataset):
> def __init__(self, path):
> self.dict = []
> for line in open(path, 'r', encoding='utf-8'):
> j_dict = json.loads(line)
> self.dict.append(j_dict['context'])
>
> def __getitem__(self, idx):
> return self.dict[idx]
>
> def __len__(self):
> return len(self.dict)
>
> root_path = os.path.dirname(os.path.abspath(__file__))
> path = os.path.join(root_path, 'dataset', 'train.json')
> torch_dataset = MyDataset(path)
>
> dit = []
> for line in open(path, 'r', encoding='utf-8'):
> j_dict = json.loads(line)
> dit.append(j_dict['context'])
> dset1 = datasets.Dataset.from_list(dit)
> print(dset1)
> dset2 = datasets.Dataset.from_generator(gen)
> print(dset2)
> ```
Hi, when I am using this code to build my own dataset, ` datasets.Dataset.from_generator(gen)` report `TypeError: cannot pickle generator object` whre MyDataset returns a dict like {'image': bytes, 'text': string}. How can I resolve this? Thanks a lot! | [
-1.0731046199798584,
-0.8873218894004822,
-0.6973720192909241,
1.447274088859558,
-0.25153714418411255,
-1.2062679529190063,
0.26585566997528076,
-1.1699409484863281,
1.7464354038238525,
-0.7947514653205872,
0.32341596484184265,
-1.7542656660079956,
-0.10649681836366653,
-0.49301135540008545,
-0.7704162001609802,
-1.0567491054534912,
-0.46668243408203125,
-0.7734934687614441,
0.8807733654975891,
2.4886865615844727,
1.1998002529144287,
-1.3490742444992065,
2.4750921726226807,
0.7328210473060608,
-0.20053885877132416,
-1.0536351203918457,
0.6106725931167603,
0.16021686792373657,
-1.293067455291748,
-0.3665481507778168,
-0.8966617584228516,
-0.1167009025812149,
-0.6721423864364624,
-0.618280291557312,
-0.07966743409633636,
0.3298044204711914,
-0.2401699423789978,
-0.3151852488517761,
-0.5080583691596985,
-0.7757222056388855,
0.34104034304618835,
-0.4271375834941864,
0.9488465785980225,
-0.3071649372577667,
1.6727555990219116,
-0.6364365220069885,
0.4929629862308502,
0.756268322467804,
1.2259472608566284,
0.2987336218357086,
-0.08440469205379486,
0.19759894907474518,
0.3954252600669861,
-0.022189456969499588,
0.35283422470092773,
1.082202672958374,
0.6418724656105042,
0.5388965010643005,
0.7511364817619324,
-2.3255109786987305,
1.2281690835952759,
-0.9567686915397644,
0.40114766359329224,
1.2526850700378418,
-0.8065049052238464,
0.3668551743030548,
-1.8112289905548096,
-0.07191218435764313,
0.6550485491752625,
-2.279600143432617,
0.17659899592399597,
-1.5164631605148315,
-0.5497233271598816,
0.8283120393753052,
0.36352723836898804,
-1.2378941774368286,
0.1275256723165512,
-0.3625088930130005,
0.8901653289794922,
0.4978439509868622,
1.1170291900634766,
-1.8603864908218384,
0.09588364511728287,
-0.43670037388801575,
0.2718868553638458,
-1.1587234735488892,
-1.5060861110687256,
0.754070520401001,
0.7641688585281372,
0.5734777450561523,
-0.10756126791238785,
0.8966209292411804,
-0.9446011781692505,
0.6309933662414551,
-0.9688783884048462,
-1.8270658254623413,
-1.3674285411834717,
-2.061332941055298,
-2.3739426136016846,
0.5913649201393127,
-0.6192933320999146,
-0.4833192825317383,
2.0725388526916504,
-1.07273530960083,
-1.840564489364624,
1.1174497604370117,
0.2958039939403534,
-0.06134243309497833,
2.462693929672241,
0.14638327062129974,
-0.5957353711128235,
0.4582037031650543,
-0.7471188902854919,
0.7878007292747498,
-0.08596549183130264,
1.285585880279541,
0.3977324366569519,
-1.0389578342437744,
1.7334098815917969,
-0.31500229239463806,
0.5230754017829895,
-0.6831325888633728,
-0.529605507850647,
-0.6394325494766235,
0.10810324549674988,
1.8181953430175781,
-0.27298659086227417,
1.6370803117752075,
-0.36858877539634705,
-1.554599642753601,
-1.6540720462799072,
0.933417558670044,
0.3994735777378082,
-0.8791133761405945,
0.10140993446111679,
-0.4477715790271759,
0.12245692312717438,
-0.02020098641514778,
1.2415298223495483,
1.3624383211135864,
0.7651520371437073,
-0.3717755973339081,
-0.8112135529518127,
0.06320824474096298,
0.03453513979911804,
-0.8418759703636169,
-1.7782056331634521,
-0.30135247111320496,
-0.0012900438159704208,
0.6797858476638794,
-1.1011452674865723,
1.6780675649642944,
0.842143714427948,
1.9178436994552612,
1.0517492294311523,
-0.5379951000213623,
1.4366761445999146,
0.12449836730957031,
1.7999783754348755,
-0.6262534856796265,
0.6456643342971802,
-0.40544840693473816,
-1.0421488285064697,
0.9501499533653259,
-0.20593148469924927,
-1.9067152738571167,
-0.7864858508110046,
-0.7192288041114807,
-0.23357750475406647,
-0.8485497236251831,
1.0034044981002808,
-0.13613048195838928,
-1.417677640914917,
0.41029417514801025,
-0.7543998956680298,
0.061364300549030304,
-1.163245439529419,
0.4080958068370819,
0.75303053855896,
-0.5818491578102112,
0.07044317573308945,
-0.3550986647605896,
-1.3796696662902832,
-0.4612867534160614,
0.13348308205604553,
1.8454039096832275,
-0.6406089067459106,
0.9256346225738525,
1.0092742443084717,
-0.7447376251220703,
-0.09082178771495819,
0.26817816495895386,
-0.205190047621727,
0.8063851594924927,
-1.0600031614303589,
-0.35883405804634094,
1.1065560579299927,
-0.1374601125717163,
-0.605137050151825,
1.4647141695022583,
0.5180178284645081,
-0.9318066239356995,
-0.19410739839076996,
-0.12907971441745758,
-0.6336884498596191,
0.08372396230697632,
-1.7713953256607056,
-0.017871595919132233,
0.4007169008255005,
-1.6026145219802856,
-0.5571356415748596,
-0.24419423937797546,
1.2316488027572632,
-0.08624958246946335,
1.2614327669143677,
-0.15653204917907715,
-0.1290656179189682,
-0.44439613819122314,
-0.3078749477863312,
0.07085929811000824,
-0.24990896880626678,
-0.5329999923706055,
0.36463022232055664,
-0.9036734104156494,
0.381101131439209,
1.4168198108673096,
0.24266737699508667,
0.04820164293050766,
0.41151294112205505,
0.9747002124786377,
0.4158659875392914,
-0.1686820536851883,
-0.8671698570251465,
-1.550816297531128,
2.1198432445526123,
-1.4910826683044434,
1.946841835975647,
0.6324998140335083,
-0.08145184814929962,
-1.7935808897018433,
-2.0236260890960693,
1.41318678855896,
1.1521984338760376,
2.342088460922241,
0.7154136300086975,
0.36680832505226135,
-0.6917862296104431,
-0.5104575157165527,
0.2566629946231842,
-0.9911073446273804,
-0.7761827111244202,
0.24915143847465515,
2.365194082260132,
1.594089150428772,
-0.6399811506271362,
-0.06244474649429321,
-0.9762173295021057,
1.3169218301773071,
-0.16124722361564636,
0.26760101318359375,
2.016374349594116,
-0.3738051652908325,
-1.2417083978652954,
1.4250850677490234,
-2.2591774463653564,
-0.02872643992304802,
1.9309858083724976,
0.01018122211098671,
0.09467068314552307,
-1.279176115989685,
-0.6609702110290527,
-0.35884204506874084,
-0.5095515251159668,
-1.3205718994140625,
0.5301635265350342,
-0.15117822587490082,
-0.7095102071762085,
-1.5336881875991821,
0.19529736042022705,
-0.9964144229888916,
-1.6651374101638794,
0.2450600266456604,
1.8465529680252075,
1.97589111328125,
-0.8004570007324219,
1.5311074256896973,
-0.5299748182296753,
0.05390891432762146,
1.0508579015731812,
1.1420875787734985,
3.0564370155334473,
2.0259296894073486,
-1.257258415222168,
0.7130652070045471,
-0.19868230819702148,
-0.5505046844482422,
1.4201678037643433,
-1.1683704853057861,
1.2261749505996704,
-0.27926188707351685,
-1.3129096031188965,
-1.3275108337402344,
0.9893466830253601,
0.349376380443573,
0.04804821312427521,
-0.6114551424980164,
1.293039083480835,
0.007836539298295975,
1.330920934677124,
0.4787742495536804,
-0.3306271433830261,
0.6775495409965515,
-0.5159839391708374,
-0.39084652066230774,
1.5516408681869507,
0.26111355423927307,
-1.32708740234375,
-2.453014612197876,
-0.2565494477748871,
-0.9404400587081909,
0.0924481749534607,
-0.5388851761817932,
-1.162589192390442,
1.7417875528335571,
0.37205228209495544,
-1.246720552444458,
-0.3061324954032898,
-0.3208220601081848,
-0.5186054110527039,
2.634369373321533,
-1.356927752494812,
-0.13332878053188324,
-1.020768404006958,
-0.6671424508094788,
1.6643108129501343,
-1.227601408958435,
-0.11496517807245255,
-1.0356727838516235,
-0.49433761835098267,
-1.3921329975128174,
-0.5545397996902466,
0.06219649314880371,
-1.0171942710876465,
0.7513972520828247,
0.2560662627220154,
-1.1721495389938354,
-0.2524029612541199,
-0.855091392993927,
0.8626771569252014,
-0.1565667688846588,
0.38725996017456055,
2.0232982635498047,
0.4817221462726593,
-0.3875121474266052,
0.6354194283485413,
1.1154569387435913,
0.6967117190361023,
-0.765569269657135,
0.1896131932735443,
-0.7491625547409058,
0.3656449019908905,
-1.367063045501709,
0.1376495659351349,
-2.789768695831299,
0.6540446281433105,
0.04551400989294052,
0.036335110664367676,
0.14122620224952698,
-1.2999320030212402,
1.1349345445632935,
2.6385622024536133,
-1.2330235242843628,
0.4191966950893402,
0.3083803951740265,
1.1706223487854004,
-1.3562310934066772,
0.29679185152053833,
-0.48534950613975525,
2.3338749408721924,
0.25189125537872314,
1.1000010967254639,
-0.3291481137275696,
-2.3892624378204346,
0.6028149127960205,
-1.2204262018203735,
-1.3280504941940308,
0.7895116209983826,
-0.9817479848861694,
-0.11086248606443405,
-1.5566142797470093,
-0.0988914743065834,
-0.9183431267738342,
-1.0858522653579712,
0.9107417464256287,
0.04864010214805603,
0.47092753648757935,
-0.670773446559906,
0.38771429657936096,
-2.2124249935150146,
-1.3743995428085327,
-0.2737562358379364,
-0.9636814594268799,
0.5017220973968506,
-0.20347221195697784,
0.7823348045349121,
-0.20313353836536407,
0.041313014924526215,
0.40648153424263,
1.3471721410751343,
3.3965418338775635,
0.208571657538414,
0.28692424297332764,
-0.24577781558036804,
-0.9987064599990845,
1.4948899745941162,
0.8969812393188477,
-0.04464806616306305,
-0.5473705530166626,
-1.0164523124694824,
1.176035761833191,
2.1008777618408203,
0.942492663860321,
0.011409835889935493,
-0.8820165395736694,
-0.5586115121841431,
0.051543280482292175,
0.389406681060791,
0.4512477219104767,
0.9008166193962097,
0.10983775556087494,
0.20914582908153534,
1.3517805337905884,
1.2475767135620117,
-0.22053088247776031,
0.5021732449531555,
-0.8782153129577637,
-0.6115143895149231,
0.7138693928718567,
0.27679887413978577,
0.0803399533033371,
0.36130672693252563,
-0.9964068531990051,
-0.31011468172073364,
-0.4050280749797821,
-0.8634669780731201,
-0.7343016266822815,
-0.3752918839454651,
-0.29872873425483704,
1.5699354410171509,
-0.18563881516456604,
-0.4547573924064636,
0.030391978099942207,
-0.7252421379089355,
-0.14545319974422455,
-1.1651276350021362,
0.26350897550582886,
-0.14963649213314056,
-0.0468701496720314,
-0.04604388773441315,
1.6773426532745361,
-0.8620718121528625,
-1.8855324983596802,
0.28747180104255676,
0.3928866386413574,
-0.5416979789733887,
0.3455100953578949,
1.664168119430542,
0.5264256000518799,
1.4483741521835327,
1.320604681968689,
1.0586925745010376,
-0.63783860206604,
-1.1853653192520142,
0.5340339541435242,
0.8322833180427551,
-1.241888403892517,
0.9729135632514954,
0.08611438423395157,
-0.6280086636543274,
0.5008837580680847,
1.12788724899292,
0.4810653328895569,
-2.0501089096069336,
0.84761643409729,
-0.8163880705833435,
0.8463229537010193,
0.634223461151123,
0.9159575700759888,
0.1595151573419571,
0.8267439007759094,
-1.2073888778686523,
-0.9897854924201965,
-0.7936479449272156,
-0.4641586244106293,
1.8472148180007935,
-0.2338409423828125,
0.6674028635025024,
-0.25813761353492737,
-1.3380829095840454,
-0.130391463637352,
0.7063339352607727,
0.4422408640384674,
-0.6620942950248718,
0.8064718842506409,
-0.3298375606536865,
-1.0948071479797363,
-1.2555209398269653,
-0.42224830389022827,
-1.0381194353103638,
-0.8824642896652222,
1.1697872877120972,
0.7726355195045471,
0.28943100571632385,
1.7851475477218628,
0.35536879301071167,
0.12785780429840088,
-2.7196805477142334,
0.9437029957771301,
0.21709947288036346,
-0.19298119843006134,
0.9455166459083557,
0.5154321193695068,
1.0768243074417114,
-0.15932661294937134,
0.6211411356925964,
-2.292912006378174,
2.204576253890991,
-0.10586510598659515,
0.7560955882072449,
0.07084362208843231,
-0.057732775807380676,
0.8338545560836792,
0.5802947282791138,
0.6001538634300232,
-1.0452096462249756,
0.6758947372436523,
-0.5316176414489746,
1.166646957397461,
0.9109703898429871,
-0.7495273947715759,
-0.05832973122596741,
1.3385025262832642,
0.5491111278533936,
-0.4501435160636902,
-0.914817750453949,
-0.7697508335113525,
0.884079098701477,
1.7263473272323608,
-0.16291707754135132,
-0.11645552515983582,
0.8051235675811768,
0.7315699458122253,
-1.35257089138031,
0.027786793187260628,
-0.66060870885849,
-0.6048660278320312,
1.6392977237701416,
1.9950125217437744,
-0.10225760191679001,
-0.15639115869998932,
-0.7594754695892334,
-1.1760082244873047,
0.9411762952804565,
-0.10017958283424377,
0.14592809975147247,
0.6921953558921814,
-0.5770895481109619,
1.1748498678207397,
0.7296557426452637,
1.0861530303955078,
0.2598905861377716,
0.5249541997909546,
0.5261685848236084,
-0.28306981921195984,
-1.053305983543396,
-0.2029537409543991,
-1.1044232845306396,
-2.490400552749634,
0.5962486863136292,
-0.44403666257858276,
-1.2937123775482178,
-0.15621306002140045,
-0.9789451360702515,
0.9566731452941895,
-0.6872230768203735,
-0.9333868622779846,
-1.465616226196289,
0.1979171186685562,
0.03859525918960571,
1.082619071006775,
-1.56838059425354,
0.045405805110931396,
1.1313445568084717,
0.9752439260482788,
-0.8055722713470459,
1.0766156911849976,
0.46085643768310547,
1.0542305707931519,
0.8642262816429138,
-0.41375961899757385,
0.5724302530288696,
0.12778358161449432,
-1.1968283653259277,
0.3479849696159363,
1.0463155508041382,
0.2792559862136841,
1.241898536682129,
-0.6841368079185486,
-0.13963128626346588,
0.43988922238349915,
-0.4104780852794647,
-0.35457879304885864,
-0.5786096453666687,
0.6888353228569031,
0.08444918692111969,
-1.0183302164077759,
-0.08101969212293625,
-0.09161361306905746,
-0.08900634944438934,
0.19485631585121155,
-1.4290965795516968,
-0.15345165133476257,
-0.5291816592216492,
-0.5194143056869507,
-1.2441260814666748,
-0.2325453758239746,
1.5380737781524658,
-0.783963680267334,
-0.030082544311881065,
0.46425384283065796,
0.330208957195282,
0.5366924405097961,
0.5837132930755615,
-0.5079593658447266,
-0.444183886051178,
-0.4057480990886688,
-0.4393083453178406,
0.3115423917770386,
1.3058747053146362,
-0.2073044627904892,
-1.1240661144256592,
0.7396095395088196,
-0.3545088768005371,
0.035002581775188446,
1.9782358407974243,
0.04854770749807358,
-0.828262209892273,
0.20412728190422058,
-0.46652641892433167,
1.8015093803405762,
1.7319998741149902,
1.4280246496200562,
-0.18730340898036957,
-1.0009386539459229,
0.6376363635063171,
-0.4043492078781128,
-0.5155541300773621,
0.6992164254188538,
0.43130195140838623,
-0.11347651481628418,
-1.4753042459487915,
0.7505786418914795,
1.3469619750976562,
-1.0342553853988647,
-0.8227916955947876,
0.1712755560874939,
-0.6822866201400757,
1.0167500972747803,
0.8366517424583435,
0.40193405747413635,
0.26391011476516724,
1.5252290964126587,
0.6484517455101013,
-0.49205201864242554,
0.5635620355606079,
0.441121369600296,
-0.12176951766014099,
-2.00455379486084,
-1.217943787574768,
0.23915979266166687,
-0.38350698351860046,
-1.5717332363128662,
1.3641575574874878,
-1.3746360540390015,
-0.9589285850524902,
0.4576541781425476,
0.11425483971834183,
1.4741487503051758,
0.3607009947299957,
1.6895831823349,
2.195502519607544,
0.8997842669487,
0.373879998922348,
1.457482099533081,
-0.11479231715202332,
-0.4503972828388214,
1.7115015983581543,
-0.4219264090061188,
0.5776948928833008,
1.2522715330123901,
-0.21080440282821655,
-0.8652144074440002,
-0.892720639705658,
-1.356173038482666,
-0.7196372747421265,
1.2573223114013672,
0.03364329785108566,
-1.2135944366455078,
0.3535555303096771,
1.6107174158096313,
-0.009723573923110962,
-0.402362585067749,
0.6486842036247253,
0.40127548575401306,
-0.7965674996376038,
-0.2009308636188507,
-1.0276366472244263,
0.5207193493843079,
-0.2731228470802307,
-0.25109153985977173,
0.3280070424079895,
0.35168933868408203,
1.3758742809295654,
0.10070547461509705,
0.16393661499023438,
1.2299449443817139,
-1.2946054935455322,
1.5015214681625366,
-0.5413881540298462,
0.1841968595981598,
-2.3430638313293457,
1.4472724199295044,
-0.6685395836830139,
1.8273308277130127,
-2.7139530181884766,
0.42504456639289856,
-0.47384583950042725,
-0.27198055386543274,
0.15537354350090027,
-0.25519201159477234,
0.22081099450588226,
-0.2720642387866974,
-1.0799320936203003,
-0.04972162842750549,
-0.6982312202453613,
0.5540573000907898,
0.9416735768318176,
1.303888201713562,
-1.236528754234314,
-0.32959380745887756,
-1.7897816896438599,
-0.18649502098560333,
-0.6415110230445862,
0.24116554856300354,
-1.9580436944961548,
-0.22771333158016205,
-1.9035567045211792,
-2.6229567527770996,
-1.3226126432418823,
-0.7539828419685364,
1.0409128665924072,
-0.0044634295627474785,
-0.8448363542556763,
1.1615610122680664,
-0.3426758348941803,
-2.0037760734558105,
1.1976819038391113,
-2.101398468017578
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | Hi ! Right now generator functions are expected to be picklable, so that `datasets` can hash it and use the hash to cache the resulting Dataset on disk. Maybe this can be improved.
In the meantime, can you check that you're not using unpickable objects. In your case it looks like you're using a generator object that is unpickable. It might come from an opened file, e.g. this doesn't work:
```python
with open(...) as f:
def gen():
for x in f:
yield json.loads(x)
ds = Dataset.from_generator(gen)
```
but this does work:
```python
def gen():
with open(...) as f:
for x in f:
yield json.loads(x)
ds = Dataset.from_generator(gen)
``` | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 108 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
Hi ! Right now generator functions are expected to be picklable, so that `datasets` can hash it and use the hash to cache the resulting Dataset on disk. Maybe this can be improved.
In the meantime, can you check that you're not using unpickable objects. In your case it looks like you're using a generator object that is unpickable. It might come from an opened file, e.g. this doesn't work:
```python
with open(...) as f:
def gen():
for x in f:
yield json.loads(x)
ds = Dataset.from_generator(gen)
```
but this does work:
```python
def gen():
with open(...) as f:
for x in f:
yield json.loads(x)
ds = Dataset.from_generator(gen)
``` | [
-1.1443943977355957,
-0.9350056052207947,
-0.7200566530227661,
1.503461480140686,
-0.24434605240821838,
-1.1561760902404785,
0.21755129098892212,
-1.0741461515426636,
1.7690997123718262,
-0.8318342566490173,
0.39194628596305847,
-1.6955242156982422,
0.040442269295454025,
-0.5411162972450256,
-0.8196680545806885,
-0.9477030634880066,
-0.48847493529319763,
-0.7497109174728394,
0.9674878716468811,
2.508284330368042,
1.1371431350708008,
-1.3863811492919922,
2.54681658744812,
0.6562138795852661,
-0.11600466817617416,
-1.1210391521453857,
0.4967343807220459,
0.11857404559850693,
-1.2920193672180176,
-0.3355068266391754,
-1.0007801055908203,
-0.12756267189979553,
-0.5678138732910156,
-0.6963832378387451,
0.010981435887515545,
0.3963853418827057,
-0.27706846594810486,
-0.47787797451019287,
-0.4578729271888733,
-0.7956300377845764,
0.5070643424987793,
-0.4021342992782593,
0.9307898283004761,
-0.3187263011932373,
1.8416088819503784,
-0.588310956954956,
0.5273745059967041,
0.7164240479469299,
1.3454267978668213,
0.25836479663848877,
-0.04424423351883888,
0.33053717017173767,
0.4472346603870392,
0.05520809814333916,
0.46335670351982117,
1.1369130611419678,
0.6323978304862976,
0.4769955277442932,
0.7434534430503845,
-2.3082213401794434,
1.256858468055725,
-1.1091628074645996,
0.3874683082103729,
1.2377636432647705,
-0.9918231964111328,
0.3066651225090027,
-1.742821216583252,
-0.08395419269800186,
0.5804185271263123,
-2.169139862060547,
0.19486433267593384,
-1.3399180173873901,
-0.4489399790763855,
1.1079405546188354,
0.3958970904350281,
-1.289062261581421,
0.16890136897563934,
-0.3019437789916992,
0.9173555374145508,
0.37204939126968384,
1.143217921257019,
-1.6891603469848633,
0.027435079216957092,
-0.4489072859287262,
0.15974868834018707,
-1.2471460103988647,
-1.3938032388687134,
0.584635853767395,
0.6897379755973816,
0.5378257036209106,
-0.1410345733165741,
1.0392035245895386,
-1.0250048637390137,
0.7419907450675964,
-1.0074036121368408,
-1.7606068849563599,
-1.4418054819107056,
-2.160215139389038,
-2.4220829010009766,
0.7716656923294067,
-0.4463954269886017,
-0.5292246341705322,
2.020602226257324,
-1.0331004858016968,
-1.7844069004058838,
1.167559027671814,
0.30140337347984314,
-0.06036633998155594,
2.366577386856079,
0.15562288463115692,
-0.6846855878829956,
0.4515113830566406,
-0.7628809809684753,
0.7747283577919006,
-0.21925267577171326,
1.3681946992874146,
0.5089946985244751,
-1.093772053718567,
1.6197807788848877,
-0.2654745280742645,
0.48875004053115845,
-0.6521642804145813,
-0.46234193444252014,
-0.7495625615119934,
0.26037004590034485,
1.8331607580184937,
-0.31887486577033997,
1.5220155715942383,
-0.3297263979911804,
-1.5253974199295044,
-1.5803903341293335,
0.876655638217926,
0.42909368872642517,
-0.703149139881134,
0.024179957807064056,
-0.3231028616428375,
0.11632401496171951,
-0.07457423955202103,
1.1849844455718994,
1.2633781433105469,
0.7736601233482361,
-0.3804931938648224,
-0.8867110013961792,
0.15700146555900574,
-0.06537410616874695,
-0.7690163254737854,
-1.7571722269058228,
-0.40450114011764526,
0.035889070481061935,
0.5799488425254822,
-1.171742558479309,
1.6778159141540527,
0.8586561679840088,
1.826215386390686,
1.044036865234375,
-0.4102657437324524,
1.523064136505127,
0.0648212879896164,
1.9078165292739868,
-0.5332067608833313,
0.6631798148155212,
-0.3506401777267456,
-1.1856797933578491,
0.8936377763748169,
-0.24795180559158325,
-2.0996155738830566,
-0.854318380355835,
-0.7356248497962952,
-0.17532441020011902,
-0.8046191930770874,
0.9497036337852478,
-0.24597325921058655,
-1.5366461277008057,
0.335212767124176,
-0.6969684362411499,
0.13264235854148865,
-1.141727328300476,
0.34994301199913025,
0.7442835569381714,
-0.6648655533790588,
0.11601241677999496,
-0.2755327820777893,
-1.318463683128357,
-0.409678190946579,
0.20885831117630005,
1.7979466915130615,
-0.8002526164054871,
0.9456003904342651,
1.059000849723816,
-0.7660149931907654,
-0.026023700833320618,
0.28163594007492065,
-0.3130965232849121,
0.857865035533905,
-1.0097298622131348,
-0.46956974267959595,
1.1974692344665527,
-0.10626695305109024,
-0.6730185151100159,
1.470625400543213,
0.6501781940460205,
-0.924389123916626,
-0.16879841685295105,
-0.15396051108837128,
-0.7102041244506836,
0.02930688112974167,
-1.6724891662597656,
-0.039929188787937164,
0.4005579948425293,
-1.5515353679656982,
-0.49451395869255066,
-0.22074821591377258,
1.2723252773284912,
-0.2040218561887741,
1.4284354448318481,
-0.27504363656044006,
-0.21452710032463074,
-0.3910573720932007,
-0.29342570900917053,
0.1740340143442154,
-0.1485000103712082,
-0.6198023557662964,
0.3828398883342743,
-0.8052126169204712,
0.4914010167121887,
1.2804430723190308,
0.35472530126571655,
0.06224546208977699,
0.5500403046607971,
1.083984375,
0.42266783118247986,
-0.05313706025481224,
-0.8308748602867126,
-1.6127302646636963,
2.1508336067199707,
-1.4088056087493896,
2.017571449279785,
0.6476225256919861,
-0.022195523604750633,
-1.7721794843673706,
-1.8348792791366577,
1.447487473487854,
1.1853854656219482,
2.353726387023926,
0.6474795937538147,
0.39067819714546204,
-0.813184380531311,
-0.54759681224823,
0.38978859782218933,
-1.098633885383606,
-0.679398775100708,
0.18086494505405426,
2.4173994064331055,
1.7024279832839966,
-0.4584076404571533,
-0.16341164708137512,
-1.0656096935272217,
1.393839955329895,
-0.1958230584859848,
0.21977604925632477,
2.0239052772521973,
-0.2690047323703766,
-1.1731187105178833,
1.3784223794937134,
-2.283536195755005,
0.05714159831404686,
1.9730757474899292,
0.18443697690963745,
0.021345295011997223,
-1.4346587657928467,
-0.6025437116622925,
-0.2550898790359497,
-0.4563911557197571,
-1.3139686584472656,
0.530585765838623,
-0.19445772469043732,
-0.7868999242782593,
-1.4703811407089233,
0.15893690288066864,
-1.1125080585479736,
-1.663145899772644,
0.2866145074367523,
1.756126046180725,
1.9119811058044434,
-0.7199705839157104,
1.5492632389068604,
-0.3101547956466675,
0.25528275966644287,
1.1940834522247314,
1.1351242065429688,
3.083820104598999,
1.994747519493103,
-1.2820206880569458,
0.6897436380386353,
-0.17410945892333984,
-0.52602219581604,
1.2862040996551514,
-1.2216218709945679,
1.3426698446273804,
-0.1703052818775177,
-1.224767804145813,
-1.2651935815811157,
1.033629059791565,
0.43771883845329285,
0.07525618374347687,
-0.5536020994186401,
1.1980098485946655,
0.11233819276094437,
1.2342103719711304,
0.46436285972595215,
-0.2851164638996124,
0.6795682311058044,
-0.48472440242767334,
-0.474111944437027,
1.5158334970474243,
0.24299973249435425,
-1.2787150144577026,
-2.2959914207458496,
-0.25208044052124023,
-0.9005101323127747,
-0.013241192325949669,
-0.4645988941192627,
-0.9542871713638306,
1.7223179340362549,
0.36388397216796875,
-1.3493622541427612,
-0.24485467374324799,
-0.27821773290634155,
-0.6365970373153687,
2.7040092945098877,
-1.3318517208099365,
-0.19903096556663513,
-1.0150408744812012,
-0.6718430519104004,
1.6705442667007446,
-1.1561452150344849,
-0.15123042464256287,
-1.04424250125885,
-0.6184268593788147,
-1.3472037315368652,
-0.710128903388977,
0.03613317757844925,
-0.9811131954193115,
0.7636284232139587,
0.1950773149728775,
-1.178757667541504,
-0.40669184923171997,
-0.815938413143158,
0.8219280242919922,
-0.053332023322582245,
0.2696738541126251,
1.9473258256912231,
0.4635259211063385,
-0.4269872009754181,
0.6342166066169739,
1.0915448665618896,
0.710572361946106,
-0.642920970916748,
0.40509262681007385,
-0.7514825463294983,
0.24331319332122803,
-1.3111456632614136,
0.25411170721054077,
-2.777543544769287,
0.5982949137687683,
-0.012377159669995308,
-0.028956636786460876,
-0.029521092772483826,
-1.208006739616394,
1.1145511865615845,
2.625019073486328,
-1.1822445392608643,
0.41846439242362976,
0.29241254925727844,
1.1442060470581055,
-1.4626015424728394,
0.35453280806541443,
-0.4518328011035919,
2.1894516944885254,
0.2575334906578064,
1.115609049797058,
-0.4415417015552521,
-2.239971399307251,
0.6502683162689209,
-1.3360342979431152,
-1.2844170331954956,
0.8007520437240601,
-0.9112681746482849,
0.03282514214515686,
-1.3902419805526733,
-0.15265771746635437,
-0.818260908126831,
-1.1859699487686157,
0.7417851090431213,
0.11811741441488266,
0.48802149295806885,
-0.5902986526489258,
0.4034344553947449,
-2.1725616455078125,
-1.408856749534607,
-0.3087959587574005,
-0.9613832235336304,
0.4399457275867462,
-0.2313835620880127,
0.7261449098587036,
-0.20937518775463104,
-0.03548954799771309,
0.3962728679180145,
1.3699778318405151,
3.3714990615844727,
0.26593655347824097,
0.358772337436676,
-0.10592498630285263,
-0.9737803339958191,
1.4667173624038696,
0.9164678454399109,
-0.14567607641220093,
-0.5983372330665588,
-1.0622928142547607,
1.1323379278182983,
2.0398125648498535,
1.039644718170166,
-0.02196981944143772,
-0.7306099534034729,
-0.730050265789032,
0.07596807181835175,
0.1754121035337448,
0.48495516180992126,
0.8853342533111572,
0.09124306589365005,
0.1384126842021942,
1.477644920349121,
1.2344473600387573,
-0.38454416394233704,
0.2905864715576172,
-0.8012624979019165,
-0.5771580934524536,
0.6116930842399597,
0.2833610475063324,
0.03338591754436493,
0.3811025321483612,
-1.0585592985153198,
-0.3162994384765625,
-0.40629711747169495,
-1.0274344682693481,
-0.7648587226867676,
-0.43528738617897034,
-0.420712947845459,
1.6319515705108643,
-0.026162222027778625,
-0.46463704109191895,
-0.05701899901032448,
-0.7522065043449402,
-0.034405093640089035,
-1.0459275245666504,
0.30057016015052795,
-0.08821234107017517,
-0.09896191954612732,
-0.0852329358458519,
1.7955975532531738,
-0.9127423167228699,
-2.0048201084136963,
0.2778832018375397,
0.20962506532669067,
-0.37683627009391785,
0.30004987120628357,
1.5368332862854004,
0.5594949722290039,
1.3824198246002197,
1.3620425462722778,
0.9896676540374756,
-0.6217179298400879,
-1.310566782951355,
0.6608963012695312,
0.9532579183578491,
-1.4072076082229614,
0.8153217434883118,
0.11188741773366928,
-0.44429513812065125,
0.6079203486442566,
1.2008633613586426,
0.4171653687953949,
-2.008587121963501,
0.730624258518219,
-0.8578939437866211,
0.7155574560165405,
0.6615909934043884,
0.6913955211639404,
0.07236350327730179,
0.8302676677703857,
-1.2063175439834595,
-1.0741703510284424,
-0.7600694894790649,
-0.5981018543243408,
2.003990411758423,
-0.2906965911388397,
0.6969723105430603,
-0.2006518393754959,
-1.4589062929153442,
-0.10044170171022415,
0.6783113479614258,
0.32620275020599365,
-0.6339229941368103,
0.789221465587616,
-0.4878612458705902,
-1.1447993516921997,
-1.398160457611084,
-0.4691044092178345,
-1.0910961627960205,
-0.8369948267936707,
1.1084794998168945,
0.7448042035102844,
0.20605488121509552,
1.7899746894836426,
0.6025810241699219,
0.16180947422981262,
-2.7186965942382812,
0.9226797223091125,
0.24278879165649414,
-0.07238645851612091,
0.8572412729263306,
0.3185366988182068,
0.9680398106575012,
-0.1626526415348053,
0.5905439853668213,
-2.3368232250213623,
2.281860113143921,
-0.12486067414283752,
0.6999011635780334,
0.07465436309576035,
-0.2114684283733368,
0.9838689565658569,
0.5901235938072205,
0.6712719798088074,
-1.0513163805007935,
0.546419084072113,
-0.6090604066848755,
1.2446010112762451,
0.9426446557044983,
-0.7446496486663818,
-0.14067047834396362,
1.3508970737457275,
0.46916577219963074,
-0.3614301383495331,
-0.8899603486061096,
-1.0035749673843384,
0.9317421913146973,
1.717882752418518,
-0.14249220490455627,
-0.030768580734729767,
1.01093590259552,
0.7059577107429504,
-1.3717842102050781,
0.03440088778734207,
-0.8150390982627869,
-0.6375983953475952,
1.6902283430099487,
2.163456439971924,
-0.17251215875148773,
-0.28232505917549133,
-0.7797403335571289,
-1.163315773010254,
0.8495106101036072,
-0.08305488526821136,
0.15034717321395874,
0.7097663283348083,
-0.5813419818878174,
1.1279233694076538,
0.9006885290145874,
0.9951397180557251,
0.23206152021884918,
0.3433200716972351,
0.28146815299987793,
-0.3081628680229187,
-1.2073991298675537,
-0.19233113527297974,
-0.9647931456565857,
-2.5778818130493164,
0.4885185658931732,
-0.27701544761657715,
-1.408758282661438,
0.028797127306461334,
-1.0425289869308472,
0.9177438616752625,
-0.6082379817962646,
-1.0932090282440186,
-1.5245569944381714,
0.20356564223766327,
0.0068130893632769585,
0.9697123169898987,
-1.6064096689224243,
0.06057296320796013,
1.246419906616211,
0.9356585741043091,
-0.7284547090530396,
0.9982831478118896,
0.2951187789440155,
1.0772901773452759,
0.896543562412262,
-0.3394432067871094,
0.5856346487998962,
0.15529067814350128,
-1.2967013120651245,
0.41007277369499207,
1.0758863687515259,
0.09253541380167007,
1.4317736625671387,
-0.6348294019699097,
0.007436164654791355,
0.41829997301101685,
-0.5960649847984314,
-0.4034583866596222,
-0.5862258672714233,
0.7742726802825928,
0.040623247623443604,
-0.8857103586196899,
0.11616341024637222,
0.024120092391967773,
-0.13352593779563904,
0.1286308318376541,
-1.4720155000686646,
-0.1563141644001007,
-0.32697606086730957,
-0.6836461424827576,
-1.209168553352356,
-0.1499657779932022,
1.351328730583191,
-0.8463894128799438,
-0.1004580706357956,
0.4304298460483551,
0.31417137384414673,
0.5894410014152527,
0.5877671241760254,
-0.5402183532714844,
-0.43890380859375,
-0.2561645209789276,
-0.3408133387565613,
0.3409704864025116,
1.404409408569336,
-0.0923154428601265,
-1.0116417407989502,
0.8329907059669495,
-0.3833470344543457,
0.008402018807828426,
1.9398759603500366,
0.02642505243420601,
-0.8160967826843262,
0.3106996715068817,
-0.5876848697662354,
1.8479927778244019,
1.7512743473052979,
1.358789324760437,
-0.09539023041725159,
-0.9974533319473267,
0.6065525412559509,
-0.3925336003303528,
-0.5217260122299194,
0.8641318678855896,
0.34012651443481445,
-0.09496445953845978,
-1.2789216041564941,
0.7464503645896912,
1.3446636199951172,
-0.9211004376411438,
-0.8907343745231628,
0.23984304070472717,
-0.7905381917953491,
1.0743910074234009,
0.7459507584571838,
0.4057050347328186,
0.21210148930549622,
1.5059547424316406,
0.7360811829566956,
-0.4196377098560333,
0.556904673576355,
0.49576783180236816,
-0.10793077200651169,
-2.070486545562744,
-1.1220873594284058,
0.28788039088249207,
-0.553712010383606,
-1.6262338161468506,
1.323886752128601,
-1.2923132181167603,
-0.9143585562705994,
0.5265812873840332,
0.046406153589487076,
1.514344334602356,
0.3310922682285309,
1.580295443534851,
2.1245017051696777,
0.9047471284866333,
0.37972480058670044,
1.4168895483016968,
-0.06840641051530838,
-0.511602520942688,
1.7596522569656372,
-0.45207610726356506,
0.5660837292671204,
1.1325836181640625,
-0.1834106296300888,
-0.9094474911689758,
-0.788923978805542,
-1.2572835683822632,
-0.684815526008606,
1.1589281558990479,
0.10196884721517563,
-1.200598955154419,
0.26503029465675354,
1.5174208879470825,
0.08232343196868896,
-0.3012547194957733,
0.6301286220550537,
0.3467704951763153,
-0.7938201427459717,
-0.1100398376584053,
-0.9340438842773438,
0.41316020488739014,
-0.3097213804721832,
-0.28986799716949463,
0.32184821367263794,
0.39343079924583435,
1.2969553470611572,
0.0063180262222886086,
0.14701254665851593,
1.1610019207000732,
-1.3993231058120728,
1.5298473834991455,
-0.6087023019790649,
0.26374801993370056,
-2.3262221813201904,
1.340084195137024,
-0.7653229832649231,
1.8038208484649658,
-2.683413505554199,
0.43665486574172974,
-0.5539661049842834,
-0.41875696182250977,
0.22373738884925842,
-0.38424912095069885,
0.14800509810447693,
-0.15401171147823334,
-1.198875904083252,
-0.05682246387004852,
-0.7315574288368225,
0.5617461800575256,
0.9987374544143677,
1.2980003356933594,
-1.1955900192260742,
-0.4338056445121765,
-1.766398310661316,
-0.20130044221878052,
-0.6020844578742981,
0.3975702226161957,
-1.9736322164535522,
-0.15279000997543335,
-1.9003236293792725,
-2.452502489089966,
-1.3288851976394653,
-0.8670223355293274,
1.1207566261291504,
0.0646381601691246,
-0.7868350148200989,
1.042850375175476,
-0.3640636205673218,
-2.026865243911743,
1.1041843891143799,
-2.1270477771759033
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | > Hi ! Right now generator functions are expected to be picklable, so that `datasets` can hash it and use the hash to cache the resulting Dataset on disk. Maybe this can be improved.
>
> In the meantime, can you check that you're not using unpickable objects. In your case it looks like you're using a generator object that is unpickable. It might come from an opened file, e.g. this doesn't work:
>
> ```python
> with open(...) as f:
>
> def gen():
> for x in f:
> yield json.loads(x)
>
> ds = Dataset.from_generator(gen)
> ```
>
> but this does work:
>
> ```python
> def gen():
> with open(...) as f:
> for x in f:
> yield json.loads(x)
>
> ds = Dataset.from_generator(gen)
> ```
Thanks a lot! That's the reason why I have encountered this issue. Sorry for bothering you again with another problem, since my dataset is large and I use IterableDataset.from_generator which has no attribute with_transform, how can I equip it with some customed preprocessings like Dataset.from_generator? Should I move the preprocessing to the my torch Dataset? | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 187 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
> Hi ! Right now generator functions are expected to be picklable, so that `datasets` can hash it and use the hash to cache the resulting Dataset on disk. Maybe this can be improved.
>
> In the meantime, can you check that you're not using unpickable objects. In your case it looks like you're using a generator object that is unpickable. It might come from an opened file, e.g. this doesn't work:
>
> ```python
> with open(...) as f:
>
> def gen():
> for x in f:
> yield json.loads(x)
>
> ds = Dataset.from_generator(gen)
> ```
>
> but this does work:
>
> ```python
> def gen():
> with open(...) as f:
> for x in f:
> yield json.loads(x)
>
> ds = Dataset.from_generator(gen)
> ```
Thanks a lot! That's the reason why I have encountered this issue. Sorry for bothering you again with another problem, since my dataset is large and I use IterableDataset.from_generator which has no attribute with_transform, how can I equip it with some customed preprocessings like Dataset.from_generator? Should I move the preprocessing to the my torch Dataset? | [
-1.1631988286972046,
-0.9504877328872681,
-0.7290260195732117,
1.4529674053192139,
-0.2592502236366272,
-1.2029248476028442,
0.19706344604492188,
-1.1539463996887207,
1.7459142208099365,
-0.7874570488929749,
0.33349111676216125,
-1.708804965019226,
-0.022222936153411865,
-0.47396212816238403,
-0.8288286328315735,
-0.937940776348114,
-0.48787951469421387,
-0.8390206694602966,
0.9392642974853516,
2.485013961791992,
1.1705471277236938,
-1.3603148460388184,
2.5574698448181152,
0.6825644969940186,
-0.17416782677173615,
-1.1131168603897095,
0.5563761591911316,
0.06477523595094681,
-1.3275797367095947,
-0.3980553448200226,
-0.9864779710769653,
-0.1095261499285698,
-0.6335533857345581,
-0.6576290726661682,
0.00838293507695198,
0.33986321091651917,
-0.23692865669727325,
-0.387118935585022,
-0.4874837100505829,
-0.7738049626350403,
0.4527398943901062,
-0.4111357629299164,
0.9589543342590332,
-0.323001891374588,
1.7431319952011108,
-0.5765847563743591,
0.5227726697921753,
0.7809675335884094,
1.3126317262649536,
0.27323517203330994,
-0.03930983692407608,
0.26888424158096313,
0.49231064319610596,
0.051595307886600494,
0.3991784155368805,
1.1145524978637695,
0.6073480844497681,
0.49204111099243164,
0.7398982644081116,
-2.288804292678833,
1.2507007122039795,
-1.020184874534607,
0.3849291205406189,
1.2339019775390625,
-0.9045096635818481,
0.31291887164115906,
-1.7983647584915161,
-0.0329226478934288,
0.6191168427467346,
-2.2371416091918945,
0.19506752490997314,
-1.3819787502288818,
-0.483624130487442,
1.0198235511779785,
0.35904037952423096,
-1.2614980936050415,
0.11408795416355133,
-0.3505980372428894,
0.8957110047340393,
0.4367806017398834,
1.1369397640228271,
-1.7390934228897095,
0.04224433749914169,
-0.40694916248321533,
0.2028850018978119,
-1.1801774501800537,
-1.458225965499878,
0.62802654504776,
0.6910787224769592,
0.5439144968986511,
-0.13888254761695862,
1.0201505422592163,
-0.976358950138092,
0.7107440829277039,
-0.9627605080604553,
-1.7649586200714111,
-1.4229391813278198,
-2.139801263809204,
-2.3428757190704346,
0.6933594942092896,
-0.5382134914398193,
-0.49491357803344727,
2.0488076210021973,
-1.0899112224578857,
-1.8029041290283203,
1.1296495199203491,
0.2381521761417389,
-0.02470732107758522,
2.3658480644226074,
0.16472116112709045,
-0.6520949602127075,
0.4300156831741333,
-0.7376402020454407,
0.810857892036438,
-0.20227040350437164,
1.3553695678710938,
0.42082154750823975,
-1.0180968046188354,
1.6525709629058838,
-0.31588372588157654,
0.5193524956703186,
-0.6507726907730103,
-0.5210961699485779,
-0.736153244972229,
0.24020206928253174,
1.8489598035812378,
-0.2858414053916931,
1.5844429731369019,
-0.3342004418373108,
-1.5733067989349365,
-1.6445298194885254,
0.8871275782585144,
0.4562390148639679,
-0.7940689325332642,
0.0793958455324173,
-0.425498902797699,
0.08900466561317444,
-0.06366612762212753,
1.1749968528747559,
1.3038699626922607,
0.8193391561508179,
-0.34677934646606445,
-0.8582748174667358,
0.1227131336927414,
-0.02475414052605629,
-0.8009998798370361,
-1.7768117189407349,
-0.3871612846851349,
0.016840346157550812,
0.664283037185669,
-1.1555031538009644,
1.6779335737228394,
0.889079749584198,
1.9180699586868286,
1.0677897930145264,
-0.43315285444259644,
1.4827160835266113,
0.1277935802936554,
1.8396698236465454,
-0.5490273833274841,
0.6586458683013916,
-0.40737903118133545,
-1.143867015838623,
0.904016375541687,
-0.27127474546432495,
-2.0080268383026123,
-0.7680405378341675,
-0.7848063707351685,
-0.20100513100624084,
-0.7977299094200134,
0.9255147576332092,
-0.2326725423336029,
-1.458051085472107,
0.3465603291988373,
-0.6922299265861511,
0.1176549643278122,
-1.1383711099624634,
0.38350731134414673,
0.7263199687004089,
-0.6645193099975586,
0.12351109087467194,
-0.3114539682865143,
-1.3457086086273193,
-0.4574865400791168,
0.2089320421218872,
1.8130648136138916,
-0.7550894021987915,
0.9592615962028503,
1.0207667350769043,
-0.7358224391937256,
-0.04410150647163391,
0.3374159336090088,
-0.2735958695411682,
0.8040132522583008,
-1.0765105485916138,
-0.41783785820007324,
1.1945722103118896,
-0.1701035052537918,
-0.6062394380569458,
1.42827308177948,
0.5952363014221191,
-0.9458504319190979,
-0.18939761817455292,
-0.13458102941513062,
-0.6982056498527527,
0.02101995423436165,
-1.708971619606018,
-0.027962947264313698,
0.3741328716278076,
-1.6075756549835205,
-0.5409225821495056,
-0.2120443880558014,
1.2537147998809814,
-0.09549412131309509,
1.3571045398712158,
-0.25753238797187805,
-0.17617294192314148,
-0.37225955724716187,
-0.2870398163795471,
0.14719106256961823,
-0.22126850485801697,
-0.5781276226043701,
0.30297228693962097,
-0.8599958419799805,
0.3975931406021118,
1.405527949333191,
0.3190993666648865,
0.013193905353546143,
0.5015774965286255,
1.06769597530365,
0.4453731179237366,
-0.08365330845117569,
-0.857054591178894,
-1.5374131202697754,
2.141643524169922,
-1.4876751899719238,
1.9805525541305542,
0.6634171009063721,
-0.0828234925866127,
-1.8175894021987915,
-1.9014322757720947,
1.3716474771499634,
1.1576855182647705,
2.339553117752075,
0.6731274724006653,
0.39469000697135925,
-0.779748260974884,
-0.5302696228027344,
0.37353259325027466,
-1.0414283275604248,
-0.7487800121307373,
0.14841890335083008,
2.4048702716827393,
1.6689281463623047,
-0.5481699705123901,
-0.13916978240013123,
-1.0084471702575684,
1.367368221282959,
-0.17178218066692352,
0.2670745253562927,
2.0152533054351807,
-0.28936901688575745,
-1.2060608863830566,
1.373974323272705,
-2.2701542377471924,
0.10515270382165909,
1.945099115371704,
0.16446223855018616,
0.10637315362691879,
-1.3995156288146973,
-0.5996372699737549,
-0.26033395528793335,
-0.4544949233531952,
-1.3054085969924927,
0.5567874312400818,
-0.23914773762226105,
-0.7789168357849121,
-1.512900471687317,
0.17329886555671692,
-1.0713945627212524,
-1.6728856563568115,
0.2769356369972229,
1.8225584030151367,
1.9716756343841553,
-0.7490543723106384,
1.524339199066162,
-0.38978758454322815,
0.14792980253696442,
1.176947832107544,
1.1492315530776978,
3.095892906188965,
2.009458541870117,
-1.2957674264907837,
0.6807746291160583,
-0.15511168539524078,
-0.51091068983078,
1.2843348979949951,
-1.1925336122512817,
1.2683732509613037,
-0.2234271913766861,
-1.2398678064346313,
-1.2171610593795776,
1.0279182195663452,
0.40298113226890564,
0.05605599284172058,
-0.554349422454834,
1.2499572038650513,
0.037847600877285004,
1.2875639200210571,
0.485943078994751,
-0.3349926769733429,
0.684924304485321,
-0.4680525064468384,
-0.4429830014705658,
1.5453462600708008,
0.2630351185798645,
-1.3200006484985352,
-2.3237740993499756,
-0.2415303736925125,
-0.8887014389038086,
0.07012977451086044,
-0.49333351850509644,
-1.0356621742248535,
1.6768815517425537,
0.36387497186660767,
-1.3000298738479614,
-0.28306013345718384,
-0.30510273575782776,
-0.5835892558097839,
2.6489975452423096,
-1.3364444971084595,
-0.19984908401966095,
-0.9840211272239685,
-0.6473580002784729,
1.6538163423538208,
-1.210779070854187,
-0.18991351127624512,
-1.0641193389892578,
-0.5717381834983826,
-1.3617151975631714,
-0.6488760113716125,
0.06220662593841553,
-0.9494900703430176,
0.7989781498908997,
0.28140881657600403,
-1.1563057899475098,
-0.338956743478775,
-0.8343364596366882,
0.8541507720947266,
-0.0936373844742775,
0.30086684226989746,
1.960318684577942,
0.4352213144302368,
-0.4004683792591095,
0.6427015662193298,
1.1286154985427856,
0.6661668419837952,
-0.6853362321853638,
0.2636149823665619,
-0.7526564002037048,
0.3218137323856354,
-1.3345160484313965,
0.2167832851409912,
-2.8086042404174805,
0.664303183555603,
0.008653152734041214,
-0.0036909026093780994,
0.029909798875451088,
-1.3051061630249023,
1.0785080194473267,
2.623073101043701,
-1.1811739206314087,
0.4614093005657196,
0.32137030363082886,
1.1546510457992554,
-1.474958896636963,
0.3339730501174927,
-0.48163217306137085,
2.278975248336792,
0.24400119483470917,
1.180469036102295,
-0.40589091181755066,
-2.3737692832946777,
0.6117227077484131,
-1.256097435951233,
-1.2586781978607178,
0.7674043774604797,
-0.9492197632789612,
-0.05855818837881088,
-1.4792025089263916,
-0.15062323212623596,
-0.8570038676261902,
-1.144194483757019,
0.8038918972015381,
0.1291402280330658,
0.4944878816604614,
-0.6504965424537659,
0.39498329162597656,
-2.1854183673858643,
-1.4006989002227783,
-0.2595008909702301,
-0.9517987966537476,
0.4561048448085785,
-0.26655685901641846,
0.7439836263656616,
-0.21927200257778168,
-0.006594336591660976,
0.44179046154022217,
1.378532886505127,
3.3978402614593506,
0.2141007035970688,
0.31689608097076416,
-0.20004110038280487,
-0.9613879323005676,
1.4406542778015137,
0.8890817165374756,
-0.15637093782424927,
-0.586362898349762,
-1.0728814601898193,
1.1523833274841309,
2.0692410469055176,
0.9551056027412415,
0.011799322441220284,
-0.8019906282424927,
-0.6625025272369385,
0.031993359327316284,
0.229544535279274,
0.5096403360366821,
0.8891311287879944,
0.08589499443769455,
0.1607830822467804,
1.4267021417617798,
1.2197495698928833,
-0.2905525267124176,
0.3906390070915222,
-0.8037583231925964,
-0.5765002369880676,
0.6009405851364136,
0.32916146516799927,
0.02692575566470623,
0.3609931766986847,
-1.0230506658554077,
-0.278243750333786,
-0.40778887271881104,
-0.9754701852798462,
-0.7513405084609985,
-0.3700246512889862,
-0.32641205191612244,
1.6143176555633545,
-0.0382421538233757,
-0.49648550152778625,
-0.0202198289334774,
-0.71468585729599,
-0.07562633603811264,
-1.079770803451538,
0.29979920387268066,
-0.13859790563583374,
-0.06726130843162537,
-0.06331516802310944,
1.7252522706985474,
-0.8910900950431824,
-1.9731205701828003,
0.3055097460746765,
0.2813888490200043,
-0.41986408829689026,
0.3249638080596924,
1.611804723739624,
0.5599038004875183,
1.4062999486923218,
1.3965165615081787,
1.0185198783874512,
-0.6395907998085022,
-1.247746229171753,
0.60298752784729,
0.8882442712783813,
-1.3801268339157104,
0.8373416662216187,
0.09142937511205673,
-0.5229316353797913,
0.5834821462631226,
1.1800047159194946,
0.47096726298332214,
-2.050940752029419,
0.825835108757019,
-0.8485278487205505,
0.7913978695869446,
0.6752608418464661,
0.840589702129364,
0.13384856283664703,
0.8305150866508484,
-1.1859890222549438,
-1.0565922260284424,
-0.7743675708770752,
-0.619041383266449,
1.9682239294052124,
-0.27191299200057983,
0.6377832889556885,
-0.2274658977985382,
-1.3979384899139404,
-0.14619329571723938,
0.6629561185836792,
0.32374557852745056,
-0.5892235636711121,
0.7408490777015686,
-0.5024627447128296,
-1.1332420110702515,
-1.3580641746520996,
-0.44884809851646423,
-1.080480933189392,
-0.8858258724212646,
1.1051301956176758,
0.7444918155670166,
0.2740546762943268,
1.8325467109680176,
0.5392165184020996,
0.164920836687088,
-2.726977586746216,
0.926689863204956,
0.24176596105098724,
-0.118573397397995,
0.916415810585022,
0.3969253599643707,
1.0134097337722778,
-0.1215285137295723,
0.5995864272117615,
-2.318518877029419,
2.272891044616699,
-0.1626228541135788,
0.7338336706161499,
0.053661420941352844,
-0.17537173628807068,
0.9770047068595886,
0.6006654500961304,
0.6367740035057068,
-1.022621989250183,
0.6382074952125549,
-0.5888290405273438,
1.177873134613037,
0.9246675968170166,
-0.7678749561309814,
-0.048533037304878235,
1.3341864347457886,
0.4932026267051697,
-0.4539121389389038,
-0.9138806462287903,
-0.9113351702690125,
0.9109653830528259,
1.7650681734085083,
-0.13613925874233246,
-0.025104694068431854,
0.8659105896949768,
0.6980863809585571,
-1.3304634094238281,
0.05972035974264145,
-0.7546820044517517,
-0.6708346605300903,
1.657855749130249,
2.0719285011291504,
-0.13027726113796234,
-0.20035240054130554,
-0.7523190975189209,
-1.2051094770431519,
0.8596047759056091,
-0.06507755815982819,
0.1317000687122345,
0.6454547047615051,
-0.5884591341018677,
1.1359310150146484,
0.8413852453231812,
1.026796817779541,
0.23289860785007477,
0.4024278223514557,
0.36705267429351807,
-0.2910022735595703,
-1.1079565286636353,
-0.2113173007965088,
-1.0301969051361084,
-2.521604299545288,
0.5635441541671753,
-0.2981186509132385,
-1.3950501680374146,
-0.03828301653265953,
-0.9888102412223816,
0.9473193883895874,
-0.6235259175300598,
-1.0053904056549072,
-1.5006178617477417,
0.17492268979549408,
-0.03693963587284088,
0.9954260587692261,
-1.6004780530929565,
0.03415266424417496,
1.191003441810608,
0.982765793800354,
-0.7421278953552246,
1.041930913925171,
0.37255287170410156,
1.080247163772583,
0.9031333327293396,
-0.3845278024673462,
0.5535059571266174,
0.15958788990974426,
-1.2776234149932861,
0.4001883566379547,
1.0869282484054565,
0.16977453231811523,
1.408937931060791,
-0.6399731040000916,
-0.05967317521572113,
0.4257504940032959,
-0.49069705605506897,
-0.3447900712490082,
-0.5389617681503296,
0.718730628490448,
0.04073881357908249,
-0.9310523867607117,
0.028421079739928246,
-0.06504378467798233,
-0.11885359138250351,
0.14445531368255615,
-1.5152597427368164,
-0.15732885897159576,
-0.4145469665527344,
-0.5640665292739868,
-1.211703896522522,
-0.1750359833240509,
1.443069338798523,
-0.7798120975494385,
-0.1238933727145195,
0.473415344953537,
0.3307825028896332,
0.5519942045211792,
0.5720124244689941,
-0.5632023811340332,
-0.43259957432746887,
-0.3007015883922577,
-0.3989775776863098,
0.3089672029018402,
1.3548566102981567,
-0.11696914583444595,
-1.0192573070526123,
0.7452311515808105,
-0.35778868198394775,
0.012116067111492157,
1.9100335836410522,
0.046800315380096436,
-0.7922110557556152,
0.273110032081604,
-0.5562904477119446,
1.8087869882583618,
1.7497451305389404,
1.348050832748413,
-0.11771682649850845,
-1.0049028396606445,
0.609656572341919,
-0.3767803907394409,
-0.48287534713745117,
0.7891989350318909,
0.39634114503860474,
-0.1206628680229187,
-1.3752937316894531,
0.7639871835708618,
1.299336314201355,
-0.9703701734542847,
-0.8505223989486694,
0.15164010226726532,
-0.7283160090446472,
1.0462766885757446,
0.748345673084259,
0.4388689696788788,
0.22258740663528442,
1.55922269821167,
0.7168214321136475,
-0.47138142585754395,
0.6053119897842407,
0.443783164024353,
-0.12195630371570587,
-2.0578532218933105,
-1.1811062097549438,
0.30944401025772095,
-0.4575181305408478,
-1.5973857641220093,
1.3658899068832397,
-1.3065866231918335,
-0.925798773765564,
0.49236738681793213,
0.09454944729804993,
1.4598302841186523,
0.3696543574333191,
1.6220698356628418,
2.189924478530884,
0.9077466726303101,
0.3829730153083801,
1.418057918548584,
-0.08144321292638779,
-0.47567087411880493,
1.7705684900283813,
-0.44260725378990173,
0.5568384528160095,
1.1984692811965942,
-0.25451427698135376,
-0.9086306691169739,
-0.8428212404251099,
-1.2766486406326294,
-0.7276235222816467,
1.167716383934021,
0.045006297528743744,
-1.211195468902588,
0.3059816360473633,
1.5719236135482788,
0.07491061836481094,
-0.3070131242275238,
0.641150176525116,
0.38265544176101685,
-0.782495379447937,
-0.15819749236106873,
-0.9554481506347656,
0.4654651880264282,
-0.3418399393558502,
-0.3504113554954529,
0.341450035572052,
0.3617103695869446,
1.327830195426941,
0.015509059652686119,
0.08984697610139847,
1.2108265161514282,
-1.367040991783142,
1.5020678043365479,
-0.6099318861961365,
0.21673348546028137,
-2.335622787475586,
1.3764704465866089,
-0.7326937317848206,
1.8449738025665283,
-2.677097797393799,
0.4325528144836426,
-0.5604203939437866,
-0.3939206004142761,
0.2342708855867386,
-0.31023484468460083,
0.1795157939195633,
-0.2294827699661255,
-1.1401182413101196,
-0.019684037193655968,
-0.7025048732757568,
0.5786883234977722,
1.005824089050293,
1.343489408493042,
-1.187280297279358,
-0.3847595155239105,
-1.7739464044570923,
-0.18169105052947998,
-0.6359052658081055,
0.33643534779548645,
-1.9535802602767944,
-0.1873038113117218,
-1.9146690368652344,
-2.4719128608703613,
-1.3305188417434692,
-0.8018212914466858,
1.086901307106018,
0.06281791627407074,
-0.8178160786628723,
1.1238393783569336,
-0.3453049063682556,
-1.9765545129776,
1.1027138233184814,
-2.1399717330932617
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | Iterable datasets are lazy: exactly like `with_transform` they apply processing on the fly when accessing the examples.
Therefore you can use `my_iterable_dataset.map()` instead :) | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 24 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
Iterable datasets are lazy: exactly like `with_transform` they apply processing on the fly when accessing the examples.
Therefore you can use `my_iterable_dataset.map()` instead :) | [
-1.0979992151260376,
-0.8721796274185181,
-0.743871808052063,
1.4899303913116455,
-0.24049684405326843,
-1.2420858144760132,
0.25729799270629883,
-1.1108418703079224,
1.7897132635116577,
-0.879438579082489,
0.424517422914505,
-1.7089043855667114,
0.08861035108566284,
-0.5164329409599304,
-0.8118734955787659,
-0.9748015999794006,
-0.4392634928226471,
-0.6635657548904419,
0.9025741815567017,
2.519249439239502,
1.078872561454773,
-1.3547146320343018,
2.518934965133667,
0.6820741295814514,
-0.10351286083459854,
-1.1137160062789917,
0.6000956296920776,
0.22297509014606476,
-1.2305806875228882,
-0.2998350262641907,
-0.9683449864387512,
-0.1689804345369339,
-0.5490009784698486,
-0.6948607563972473,
-0.060053832828998566,
0.38333821296691895,
-0.2508068084716797,
-0.4411204159259796,
-0.4021158218383789,
-0.7941589951515198,
0.4988458752632141,
-0.4076247215270996,
0.9918860793113708,
-0.39016783237457275,
1.9032008647918701,
-0.5805777311325073,
0.47804614901542664,
0.7522847652435303,
1.3386926651000977,
0.1989283561706543,
-0.07128102332353592,
0.20593325793743134,
0.43137094378471375,
0.05966326594352722,
0.35299843549728394,
1.0557304620742798,
0.6130541563034058,
0.5484538078308105,
0.7631742358207703,
-2.328130006790161,
1.2927377223968506,
-1.0951972007751465,
0.40183547139167786,
1.28654146194458,
-0.9298297762870789,
0.26966455578804016,
-1.7447270154953003,
-0.1180870458483696,
0.5558519959449768,
-2.1571476459503174,
0.21826595067977905,
-1.3850373029708862,
-0.5267696976661682,
0.9892234206199646,
0.3846205472946167,
-1.253509521484375,
0.2212170511484146,
-0.316927969455719,
0.9033621549606323,
0.5081774592399597,
1.1332942247390747,
-1.7105835676193237,
0.09730497747659683,
-0.4689837396144867,
0.1607378125190735,
-1.3515673875808716,
-1.4164237976074219,
0.6737581491470337,
0.6453730463981628,
0.5567407608032227,
-0.09906605631113052,
0.943921685218811,
-1.027465581893921,
0.7593469023704529,
-1.0385996103286743,
-1.7717982530593872,
-1.3782448768615723,
-2.138148307800293,
-2.476578712463379,
0.7117640972137451,
-0.425976037979126,
-0.4466645121574402,
2.0364465713500977,
-1.109000563621521,
-1.7398499250411987,
1.1652750968933105,
0.18455885350704193,
-0.060348570346832275,
2.343029737472534,
0.1070241928100586,
-0.614346444606781,
0.3872342109680176,
-0.7425280213356018,
0.7871140241622925,
-0.12967340648174286,
1.3250410556793213,
0.5667835474014282,
-1.1449052095413208,
1.6670429706573486,
-0.2900356352329254,
0.48233696818351746,
-0.6425220966339111,
-0.5235539078712463,
-0.7490670680999756,
0.23813945055007935,
1.7985564470291138,
-0.3152031898498535,
1.5956982374191284,
-0.40673232078552246,
-1.5224612951278687,
-1.5535567998886108,
0.9343092441558838,
0.44118520617485046,
-0.7220875024795532,
-0.004334995523095131,
-0.28672122955322266,
0.0875430479645729,
-0.1288699209690094,
1.2401530742645264,
1.162819266319275,
0.7594460844993591,
-0.39756661653518677,
-0.8170310854911804,
0.12802951037883759,
-0.010486056096851826,
-0.8542150855064392,
-1.77120840549469,
-0.4115641415119171,
0.030452808365225792,
0.6911851167678833,
-1.1550443172454834,
1.7347068786621094,
0.8459662795066833,
1.8308629989624023,
1.0358476638793945,
-0.41727113723754883,
1.4238747358322144,
-0.013335371389985085,
1.901452898979187,
-0.5165490508079529,
0.6752499938011169,
-0.35276296734809875,
-1.1475023031234741,
0.9016377925872803,
-0.21744991838932037,
-2.0670790672302246,
-0.9352065324783325,
-0.7816346287727356,
-0.1602557748556137,
-0.8157975673675537,
1.0472980737686157,
-0.2818424701690674,
-1.5223020315170288,
0.29265692830085754,
-0.6064040064811707,
0.09245514124631882,
-1.132819414138794,
0.32751843333244324,
0.7266132235527039,
-0.6664946675300598,
0.047945186495780945,
-0.23679210245609283,
-1.3393288850784302,
-0.40067699551582336,
0.17329266667366028,
1.8733574151992798,
-0.7728771567344666,
0.9374518990516663,
1.034277319908142,
-0.760808527469635,
-0.09843699634075165,
0.24556834995746613,
-0.306064635515213,
0.8166021704673767,
-0.998992919921875,
-0.44595783948898315,
1.164871335029602,
-0.11312852054834366,
-0.6730687618255615,
1.5627080202102661,
0.6559972167015076,
-0.9106873273849487,
-0.14003445208072662,
-0.20522278547286987,
-0.662011981010437,
0.029303358867764473,
-1.6607519388198853,
-0.02691742777824402,
0.3785620629787445,
-1.4899276494979858,
-0.4856128692626953,
-0.17934565246105194,
1.2229429483413696,
-0.16582290828227997,
1.2994098663330078,
-0.21206535398960114,
-0.342889666557312,
-0.40600287914276123,
-0.2832593023777008,
0.14163073897361755,
-0.10678327083587646,
-0.6850417852401733,
0.3713514804840088,
-0.847379207611084,
0.46838441491127014,
1.2590314149856567,
0.33540230989456177,
0.11187722533941269,
0.5325623154640198,
1.0374763011932373,
0.3495517075061798,
-0.01817632094025612,
-0.8546708822250366,
-1.6284488439559937,
2.108457088470459,
-1.4045170545578003,
1.982113003730774,
0.659348726272583,
-0.05652759224176407,
-1.8284915685653687,
-1.8121492862701416,
1.4355792999267578,
1.193678855895996,
2.316004514694214,
0.6373010873794556,
0.3118903934955597,
-0.7553366422653198,
-0.5085281133651733,
0.3704286813735962,
-1.0711393356323242,
-0.6487733125686646,
0.22009608149528503,
2.3491504192352295,
1.6737135648727417,
-0.48517632484436035,
-0.1433974951505661,
-1.0824958086013794,
1.283945918083191,
-0.15215933322906494,
0.26199284195899963,
2.031871795654297,
-0.3850318491458893,
-1.224164366722107,
1.3952523469924927,
-2.2906723022460938,
0.03831174969673157,
1.9513226747512817,
0.12265419960021973,
-0.049384139478206635,
-1.409279465675354,
-0.6131799221038818,
-0.3302774131298065,
-0.5047504305839539,
-1.3193421363830566,
0.5520636439323425,
-0.23361244797706604,
-0.7923818826675415,
-1.4262135028839111,
0.1417771875858307,
-1.1516950130462646,
-1.6841157674789429,
0.40840286016464233,
1.7520660161972046,
1.9164183139801025,
-0.6729364395141602,
1.5204120874404907,
-0.31681978702545166,
0.2541655898094177,
1.1955064535140991,
1.1648821830749512,
3.0473389625549316,
2.001051902770996,
-1.2383227348327637,
0.7502991557121277,
-0.19552265107631683,
-0.554793655872345,
1.3356565237045288,
-1.1603877544403076,
1.3589781522750854,
-0.19483627378940582,
-1.223340392112732,
-1.3381661176681519,
1.0208542346954346,
0.39367321133613586,
0.12494818866252899,
-0.5346558690071106,
1.2767916917800903,
0.06554089486598969,
1.2324554920196533,
0.5362157821655273,
-0.3309558033943176,
0.6031826734542847,
-0.5263853073120117,
-0.4795650243759155,
1.5024155378341675,
0.23695261776447296,
-1.34796941280365,
-2.418450117111206,
-0.2629089057445526,
-0.8345698118209839,
-0.04774406552314758,
-0.49796465039253235,
-1.031490445137024,
1.7623014450073242,
0.3508692681789398,
-1.3823108673095703,
-0.1966354101896286,
-0.33896031975746155,
-0.6485476493835449,
2.705444574356079,
-1.3696266412734985,
-0.16973666846752167,
-1.0669615268707275,
-0.736566960811615,
1.7112277746200562,
-1.2184406518936157,
-0.11052750051021576,
-0.9818360209465027,
-0.5889725089073181,
-1.447568416595459,
-0.6235194802284241,
0.053018420934677124,
-1.0173521041870117,
0.796902596950531,
0.17171406745910645,
-1.0599781274795532,
-0.3713056445121765,
-0.8129775524139404,
0.8229393362998962,
-0.09949684143066406,
0.3308148682117462,
1.9795353412628174,
0.561381995677948,
-0.3860793113708496,
0.5671455264091492,
1.1093376874923706,
0.7775906324386597,
-0.7305743098258972,
0.37029513716697693,
-0.7550181150436401,
0.2134959101676941,
-1.2925704717636108,
0.28212863206863403,
-2.7699108123779297,
0.5738969445228577,
-0.04782453179359436,
-0.095784030854702,
0.04653658717870712,
-1.2172980308532715,
1.111896276473999,
2.606001377105713,
-1.2203634977340698,
0.3902837932109833,
0.2689688801765442,
1.1452702283859253,
-1.3840172290802002,
0.3701244294643402,
-0.45052534341812134,
2.1091394424438477,
0.28666186332702637,
1.0736589431762695,
-0.4395795166492462,
-2.141427516937256,
0.7176877856254578,
-1.3257334232330322,
-1.3746538162231445,
0.8276278972625732,
-0.9347276091575623,
0.08552483469247818,
-1.4465290307998657,
-0.1490849256515503,
-0.9311664700508118,
-1.2364445924758911,
0.7933648824691772,
0.17667286098003387,
0.49227702617645264,
-0.6075578331947327,
0.3701174557209015,
-2.1620733737945557,
-1.4179269075393677,
-0.29336071014404297,
-0.9702312350273132,
0.49479663372039795,
-0.1839221566915512,
0.6771697998046875,
-0.17497609555721283,
0.04580029100179672,
0.37133193016052246,
1.3818739652633667,
3.455091953277588,
0.30477169156074524,
0.34588441252708435,
-0.13963714241981506,
-1.033228874206543,
1.5099728107452393,
1.007378339767456,
0.0015229443088173866,
-0.5880742073059082,
-0.9771136045455933,
1.0911600589752197,
2.0571236610412598,
1.0419737100601196,
-0.029461268335580826,
-0.7510526776313782,
-0.6283568739891052,
0.08996807783842087,
0.25098901987075806,
0.46583420038223267,
0.8955312967300415,
0.08238909393548965,
0.16506466269493103,
1.4651376008987427,
1.2681430578231812,
-0.36395618319511414,
0.29681557416915894,
-0.8136762976646423,
-0.554450511932373,
0.7059903144836426,
0.30567750334739685,
0.05640602111816406,
0.4535837173461914,
-1.0824989080429077,
-0.3530395030975342,
-0.42581379413604736,
-1.0316098928451538,
-0.6652094125747681,
-0.4968149662017822,
-0.44552040100097656,
1.5467323064804077,
-0.11196660995483398,
-0.4422796368598938,
-0.09013506770133972,
-0.7904651761054993,
-0.1255241185426712,
-1.0620005130767822,
0.2953658401966095,
-0.10896278917789459,
-0.11641203612089157,
-0.0760887935757637,
1.8202497959136963,
-0.9415081143379211,
-1.9601765871047974,
0.30851760506629944,
0.2283465415239334,
-0.3987995982170105,
0.29848727583885193,
1.4910576343536377,
0.5334731936454773,
1.3577615022659302,
1.2977144718170166,
0.9499413371086121,
-0.604252278804779,
-1.326647162437439,
0.5766216516494751,
0.8533574342727661,
-1.4139331579208374,
0.8807554244995117,
0.08534575253725052,
-0.5180851221084595,
0.6946904063224792,
1.1646702289581299,
0.4019988775253296,
-1.9996490478515625,
0.6964390873908997,
-0.801014244556427,
0.7857008576393127,
0.6907838582992554,
0.7501552700996399,
0.13890662789344788,
0.8325241208076477,
-1.2160789966583252,
-1.070450782775879,
-0.7794772386550903,
-0.5579818487167358,
1.9474472999572754,
-0.2241521030664444,
0.7719441652297974,
-0.18158037960529327,
-1.3208576440811157,
-0.14148429036140442,
0.6754549741744995,
0.3691803812980652,
-0.622328519821167,
0.8173909187316895,
-0.4277326762676239,
-1.0745609998703003,
-1.3983615636825562,
-0.4619544446468353,
-1.0768882036209106,
-0.8396972417831421,
1.1637901067733765,
0.7457084059715271,
0.20948339998722076,
1.7698994874954224,
0.4973829984664917,
0.15606898069381714,
-2.7146966457366943,
0.8495858907699585,
0.2043551653623581,
-0.06252538412809372,
0.8565642833709717,
0.33329543471336365,
1.0223742723464966,
-0.1442219763994217,
0.6173303723335266,
-2.3666374683380127,
2.264723539352417,
-0.16555018723011017,
0.6383167505264282,
-0.009999508038163185,
-0.15216577053070068,
1.005849838256836,
0.6249250173568726,
0.6356433033943176,
-1.0809433460235596,
0.5759502649307251,
-0.5811092257499695,
1.254201054573059,
0.9624127149581909,
-0.7551462054252625,
-0.17582590878009796,
1.3940221071243286,
0.5612969994544983,
-0.3478166460990906,
-0.821263313293457,
-0.9228594899177551,
0.8674113154411316,
1.7239521741867065,
-0.15077698230743408,
-0.14206495881080627,
0.9974555373191833,
0.7026928663253784,
-1.3306605815887451,
0.04116120934486389,
-0.7659277319908142,
-0.6293284893035889,
1.686585783958435,
2.1532840728759766,
-0.13450506329536438,
-0.19400304555892944,
-0.7976373434066772,
-0.9885393381118774,
0.860698938369751,
-0.085698202252388,
0.10398630052804947,
0.6641886830329895,
-0.6297309994697571,
1.1372363567352295,
0.8856512904167175,
1.0255206823349,
0.23432409763336182,
0.43344539403915405,
0.3193713128566742,
-0.2610868215560913,
-1.2207411527633667,
-0.2266048938035965,
-1.004872441291809,
-2.556642532348633,
0.5142759084701538,
-0.4004710614681244,
-1.428863763809204,
-0.009012125432491302,
-1.1135531663894653,
0.9120778441429138,
-0.606711745262146,
-1.046986699104309,
-1.535473346710205,
0.2583158314228058,
0.055584318935871124,
1.0380170345306396,
-1.6453381776809692,
0.06641288101673126,
1.2337658405303955,
0.9223118424415588,
-0.7160791158676147,
1.031455397605896,
0.3360264003276825,
1.072656512260437,
0.8080484867095947,
-0.4206193685531616,
0.5842573642730713,
0.19627390801906586,
-1.257216215133667,
0.44332948327064514,
1.0152459144592285,
0.14289630949497223,
1.4059914350509644,
-0.5915337204933167,
0.04373069107532501,
0.476586252450943,
-0.6037189364433289,
-0.4157885015010834,
-0.6419526934623718,
0.8116808533668518,
0.1310509741306305,
-0.8574854731559753,
0.06725388765335083,
-0.060790546238422394,
-0.19821961224079132,
0.1889311522245407,
-1.4248234033584595,
-0.26168063282966614,
-0.41263359785079956,
-0.6760700345039368,
-1.2496262788772583,
-0.1442631036043167,
1.3832021951675415,
-0.7938409447669983,
-0.013302682898938656,
0.4371111989021301,
0.3693143427371979,
0.5878391265869141,
0.6174031496047974,
-0.5172502398490906,
-0.4479405879974365,
-0.3414463698863983,
-0.35627275705337524,
0.3110797107219696,
1.3911762237548828,
-0.22185784578323364,
-1.091673493385315,
0.8395705819129944,
-0.3439211845397949,
0.03227868676185608,
1.9551812410354614,
0.02434082143008709,
-0.8052733540534973,
0.3185800313949585,
-0.6204637289047241,
1.877496600151062,
1.672281265258789,
1.406535267829895,
-0.12715432047843933,
-0.9315222501754761,
0.5463369488716125,
-0.3531700074672699,
-0.43833234906196594,
0.8223732113838196,
0.3784365653991699,
-0.07301924377679825,
-1.308126449584961,
0.7283552289009094,
1.3587279319763184,
-0.9989487528800964,
-0.8292130827903748,
0.23943276703357697,
-0.7475669384002686,
1.1173330545425415,
0.7455446124076843,
0.43863385915756226,
0.3113628029823303,
1.4476438760757446,
0.653957724571228,
-0.42255911231040955,
0.5292066931724548,
0.45860373973846436,
-0.05283241719007492,
-2.055999517440796,
-1.0939662456512451,
0.31797870993614197,
-0.5288291573524475,
-1.6350784301757812,
1.3128048181533813,
-1.2894442081451416,
-0.883584201335907,
0.5819223523139954,
0.04205223172903061,
1.535767912864685,
0.3711394667625427,
1.5830585956573486,
2.115679979324341,
0.8822042942047119,
0.3447503447532654,
1.5031386613845825,
-0.010600095614790916,
-0.5113574266433716,
1.7351775169372559,
-0.44173291325569153,
0.5419285893440247,
1.1379612684249878,
-0.14029821753501892,
-0.8954742550849915,
-0.8037270307540894,
-1.2854360342025757,
-0.5955272316932678,
1.188903570175171,
0.10227544605731964,
-1.2250250577926636,
0.19391141831874847,
1.4996894598007202,
0.005923617631196976,
-0.2799829840660095,
0.5665407776832581,
0.2807031571865082,
-0.7730733752250671,
-0.18374545872211456,
-0.9155716300010681,
0.46309155225753784,
-0.2598436772823334,
-0.22755534946918488,
0.3060160279273987,
0.44167599081993103,
1.3138328790664673,
-0.052908413112163544,
0.20010536909103394,
1.274104356765747,
-1.4187673330307007,
1.5004726648330688,
-0.5403203964233398,
0.20681388676166534,
-2.350672483444214,
1.335846185684204,
-0.7229794859886169,
1.8291492462158203,
-2.724008798599243,
0.3753041625022888,
-0.5039552450180054,
-0.42096179723739624,
0.19522996246814728,
-0.34441348910331726,
0.14850370585918427,
-0.20501430332660675,
-1.0961987972259521,
0.011828633025288582,
-0.8020968437194824,
0.5346007943153381,
1.031803846359253,
1.2593927383422852,
-1.252534031867981,
-0.4457131028175354,
-1.760330080986023,
-0.2020469605922699,
-0.57811039686203,
0.37549182772636414,
-2.038078546524048,
-0.13397467136383057,
-1.9256672859191895,
-2.5373218059539795,
-1.3980729579925537,
-0.8264471888542175,
1.150030255317688,
0.04203758388757706,
-0.8084828853607178,
0.9777035713195801,
-0.30509763956069946,
-1.9685580730438232,
1.110530138015747,
-2.098928451538086
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | @lhoestq I am having a similar issue. Can you help me understand which kinds of generators are picklable? I previously thought that no generators are picklable so I'm intrigued to hear this. | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 32 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
@lhoestq I am having a similar issue. Can you help me understand which kinds of generators are picklable? I previously thought that no generators are picklable so I'm intrigued to hear this. | [
-1.1179723739624023,
-0.9086456298828125,
-0.7655476927757263,
1.4283957481384277,
-0.2658193111419678,
-1.1711722612380981,
0.2405492663383484,
-1.0952500104904175,
1.7330067157745361,
-0.8375466465950012,
0.4332524836063385,
-1.7115658521652222,
0.09995369613170624,
-0.5710017681121826,
-0.7789881825447083,
-0.9804614186286926,
-0.4025319814682007,
-0.6844372749328613,
0.9270966053009033,
2.580867052078247,
1.0706729888916016,
-1.3705261945724487,
2.548311710357666,
0.6784752011299133,
-0.11664362251758575,
-1.110154390335083,
0.5760039687156677,
0.2528001368045807,
-1.2300087213516235,
-0.32133299112319946,
-0.9780823588371277,
-0.1365380585193634,
-0.5301070213317871,
-0.674875795841217,
-0.05578969419002533,
0.3928113877773285,
-0.2195737063884735,
-0.4081824719905853,
-0.448947548866272,
-0.7543226480484009,
0.5426859259605408,
-0.4271337687969208,
1.0051380395889282,
-0.33673104643821716,
1.8987185955047607,
-0.5630606412887573,
0.5078345537185669,
0.7458836436271667,
1.3006129264831543,
0.19440701603889465,
-0.01847316324710846,
0.1739908754825592,
0.48004961013793945,
0.00635184720158577,
0.3425144851207733,
1.084929347038269,
0.6037237644195557,
0.554445207118988,
0.7523781657218933,
-2.2835757732391357,
1.2833611965179443,
-1.0680280923843384,
0.4236997663974762,
1.258270502090454,
-0.934288740158081,
0.3465980589389801,
-1.7472389936447144,
-0.13542895019054413,
0.5837220549583435,
-2.1726341247558594,
0.215084508061409,
-1.4054864645004272,
-0.5527665019035339,
0.9009395241737366,
0.37800437211990356,
-1.2919319868087769,
0.2047288566827774,
-0.3193797171115875,
0.89457106590271,
0.48268213868141174,
1.1274971961975098,
-1.7165484428405762,
0.06646409630775452,
-0.509548008441925,
0.15412656962871552,
-1.3434970378875732,
-1.3659371137619019,
0.6592402458190918,
0.654033362865448,
0.5548768639564514,
-0.06410067528486252,
0.901142954826355,
-1.0370827913284302,
0.8014162182807922,
-1.01315176486969,
-1.6978447437286377,
-1.394892692565918,
-2.187370777130127,
-2.492241859436035,
0.7757963538169861,
-0.3891945481300354,
-0.49398890137672424,
1.9856818914413452,
-1.0778753757476807,
-1.737229824066162,
1.2072604894638062,
0.23611018061637878,
-0.09944753348827362,
2.375110149383545,
0.14398854970932007,
-0.6241399049758911,
0.44660621881484985,
-0.7951054573059082,
0.7862473726272583,
-0.1537630259990692,
1.3510329723358154,
0.5660390853881836,
-1.131941795349121,
1.6551460027694702,
-0.2639927268028259,
0.47245436906814575,
-0.6743683815002441,
-0.5489983558654785,
-0.8248616456985474,
0.20198743045330048,
1.7759661674499512,
-0.31206852197647095,
1.6031787395477295,
-0.41310009360313416,
-1.5395519733428955,
-1.5991835594177246,
0.9266358017921448,
0.4085446894168854,
-0.7525972723960876,
0.013253672048449516,
-0.331249862909317,
0.12708885967731476,
-0.07401402294635773,
1.2166179418563843,
1.2082175016403198,
0.7438979744911194,
-0.36508074402809143,
-0.8343020081520081,
0.1285053938627243,
-0.06848987191915512,
-0.8347534537315369,
-1.8299365043640137,
-0.43765291571617126,
0.03193964064121246,
0.6816069483757019,
-1.1827770471572876,
1.691259741783142,
0.8947330117225647,
1.815698504447937,
1.0430662631988525,
-0.4169287085533142,
1.43915593624115,
-0.006558261811733246,
1.8552603721618652,
-0.5900568962097168,
0.722868800163269,
-0.3331264555454254,
-1.0711426734924316,
0.9051666259765625,
-0.1937689334154129,
-2.053135871887207,
-0.9738306999206543,
-0.7929567098617554,
-0.1921331137418747,
-0.811762809753418,
1.020952820777893,
-0.2914855480194092,
-1.4726122617721558,
0.3678942322731018,
-0.6021777987480164,
0.09982337802648544,
-1.121527075767517,
0.34333479404449463,
0.7126733660697937,
-0.6343016624450684,
0.06956611573696136,
-0.206394225358963,
-1.3355166912078857,
-0.38719162344932556,
0.138181671500206,
1.8665564060211182,
-0.7715100646018982,
0.9401150345802307,
1.0209890604019165,
-0.7641160488128662,
-0.08354483544826508,
0.29228222370147705,
-0.3067243993282318,
0.8156537413597107,
-1.0182483196258545,
-0.41751018166542053,
1.1160439252853394,
-0.11830008774995804,
-0.6341786980628967,
1.5302547216415405,
0.695751428604126,
-0.9130455851554871,
-0.14055988192558289,
-0.19224528968334198,
-0.6653884649276733,
0.029617438092827797,
-1.6607675552368164,
-0.09922830015420914,
0.3478851914405823,
-1.4677273035049438,
-0.4991176426410675,
-0.21369700133800507,
1.250361442565918,
-0.15099632740020752,
1.2953051328659058,
-0.20598390698432922,
-0.34794068336486816,
-0.41105401515960693,
-0.2885148525238037,
0.19457805156707764,
-0.1578972041606903,
-0.6717977523803711,
0.3905486762523651,
-0.8216997385025024,
0.45895349979400635,
1.2702561616897583,
0.31899502873420715,
0.13637620210647583,
0.5338038802146912,
0.9923864006996155,
0.34132981300354004,
0.005526924505829811,
-0.8251423239707947,
-1.6124036312103271,
2.121063470840454,
-1.4571770429611206,
1.9898102283477783,
0.7015535235404968,
-0.06001017242670059,
-1.8064600229263306,
-1.8530449867248535,
1.416908860206604,
1.2463786602020264,
2.333794593811035,
0.641650915145874,
0.30296018719673157,
-0.7261472344398499,
-0.5269460678100586,
0.3187701404094696,
-1.1165611743927002,
-0.6785024404525757,
0.18952403962612152,
2.35321044921875,
1.6750645637512207,
-0.5656205415725708,
-0.13012643158435822,
-1.1085635423660278,
1.2523342370986938,
-0.13541142642498016,
0.2661658823490143,
2.0948739051818848,
-0.4235609173774719,
-1.2294942140579224,
1.3811826705932617,
-2.2911570072174072,
-0.005093520972877741,
1.9152209758758545,
0.13857750594615936,
-0.08046383410692215,
-1.4317713975906372,
-0.6185801029205322,
-0.33773088455200195,
-0.5514245629310608,
-1.3395345211029053,
0.5793800354003906,
-0.24061770737171173,
-0.8146894574165344,
-1.49112069606781,
0.13491585850715637,
-1.1612330675125122,
-1.6289423704147339,
0.43465688824653625,
1.7329084873199463,
1.9517165422439575,
-0.6758067607879639,
1.516230583190918,
-0.293965220451355,
0.2765609622001648,
1.181862473487854,
1.1608785390853882,
3.047774076461792,
2.0056679248809814,
-1.2066136598587036,
0.719069242477417,
-0.22920352220535278,
-0.5735737085342407,
1.2799053192138672,
-1.1234774589538574,
1.3757102489471436,
-0.12374316900968552,
-1.192488670349121,
-1.3478955030441284,
1.02018141746521,
0.37444859743118286,
0.09989449381828308,
-0.4659133553504944,
1.2809698581695557,
0.12346958369016647,
1.2516988515853882,
0.49178650975227356,
-0.27803364396095276,
0.623879611492157,
-0.5427299737930298,
-0.45168161392211914,
1.5037453174591064,
0.27445873618125916,
-1.370237946510315,
-2.4224190711975098,
-0.2665024399757385,
-0.8601955771446228,
-0.07238950580358505,
-0.4951094388961792,
-1.0383739471435547,
1.7474654912948608,
0.3632671535015106,
-1.342606782913208,
-0.18275566399097443,
-0.29501986503601074,
-0.6342899799346924,
2.7012360095977783,
-1.3828538656234741,
-0.2281826287508011,
-1.0429363250732422,
-0.7260525822639465,
1.6954014301300049,
-1.2143173217773438,
-0.11849084496498108,
-0.9759824275970459,
-0.5979645252227783,
-1.4204485416412354,
-0.5969935059547424,
-0.004377007018774748,
-1.018641710281372,
0.740286111831665,
0.19365748763084412,
-0.9920486211776733,
-0.37392088770866394,
-0.8177058100700378,
0.7864668369293213,
-0.06813294440507889,
0.38829976320266724,
1.971937656402588,
0.5283118486404419,
-0.41232267022132874,
0.5654534697532654,
1.1077754497528076,
0.7558670043945312,
-0.7479497194290161,
0.3185333013534546,
-0.7491003274917603,
0.17047333717346191,
-1.2568122148513794,
0.3168894052505493,
-2.776491641998291,
0.5613803267478943,
-0.05776991695165634,
-0.16232825815677643,
0.03142533451318741,
-1.2230263948440552,
1.1477644443511963,
2.5736382007598877,
-1.163150668144226,
0.40437573194503784,
0.22596041858196259,
1.1740747690200806,
-1.3660105466842651,
0.4228041470050812,
-0.3963758945465088,
2.1519265174865723,
0.3491043150424957,
1.0663392543792725,
-0.4279429614543915,
-2.1841676235198975,
0.6827564239501953,
-1.3132513761520386,
-1.3423497676849365,
0.7929262518882751,
-0.9632497429847717,
0.06378397345542908,
-1.446066975593567,
-0.11744633316993713,
-0.9238948225975037,
-1.2521530389785767,
0.7786874175071716,
0.15628604590892792,
0.48820677399635315,
-0.6030170321464539,
0.346707284450531,
-2.1637535095214844,
-1.4006366729736328,
-0.2868484556674957,
-0.9249925017356873,
0.47881191968917847,
-0.13851357996463776,
0.6709150075912476,
-0.17054077982902527,
0.07230556011199951,
0.31631073355674744,
1.4387855529785156,
3.3887739181518555,
0.28802013397216797,
0.4461742341518402,
-0.13765083253383636,
-1.020939826965332,
1.5066375732421875,
0.9994136691093445,
0.028664542362093925,
-0.6243321895599365,
-1.0188937187194824,
1.1331743001937866,
2.072661876678467,
1.0858269929885864,
-0.016736527904868126,
-0.7153439521789551,
-0.6250724792480469,
0.07544956356287003,
0.29534247517585754,
0.42662346363067627,
0.9073176980018616,
0.050045765936374664,
0.15790435671806335,
1.497340202331543,
1.2954888343811035,
-0.418104350566864,
0.31322577595710754,
-0.8367081880569458,
-0.5641375184059143,
0.6451658606529236,
0.3000301420688629,
0.056044548749923706,
0.4052721858024597,
-1.0755705833435059,
-0.34526506066322327,
-0.38876911997795105,
-1.0664398670196533,
-0.7118745446205139,
-0.5021888017654419,
-0.44904157519340515,
1.57514226436615,
-0.07489118725061417,
-0.44981661438941956,
-0.07044300436973572,
-0.8290547728538513,
-0.15176603198051453,
-1.0862524509429932,
0.199452742934227,
-0.05442091077566147,
-0.09923290461301804,
-0.03601793572306633,
1.8309664726257324,
-0.9016655087471008,
-1.9966105222702026,
0.2659105360507965,
0.26421937346458435,
-0.38311412930488586,
0.29258155822753906,
1.4712697267532349,
0.5048372745513916,
1.3607065677642822,
1.2642567157745361,
0.9556439518928528,
-0.575819730758667,
-1.3479506969451904,
0.59073406457901,
0.8585931658744812,
-1.3713313341140747,
0.913037896156311,
0.052781350910663605,
-0.4975924789905548,
0.6879788637161255,
1.1610466241836548,
0.38579487800598145,
-2.0029404163360596,
0.7111537456512451,
-0.803312361240387,
0.7656927704811096,
0.6743741631507874,
0.736915647983551,
0.18253709375858307,
0.825258195400238,
-1.243985891342163,
-1.0534645318984985,
-0.8200245499610901,
-0.519726037979126,
1.9765177965164185,
-0.22096112370491028,
0.7939601540565491,
-0.18854926526546478,
-1.3301291465759277,
-0.09282020479440689,
0.6756719350814819,
0.3624925911426544,
-0.6101058721542358,
0.8130320310592651,
-0.44732004404067993,
-1.1286110877990723,
-1.4125618934631348,
-0.4188537299633026,
-1.0828791856765747,
-0.839986264705658,
1.2044677734375,
0.7189663648605347,
0.19339753687381744,
1.7957649230957031,
0.4973141849040985,
0.18321438133716583,
-2.693549394607544,
0.9059031009674072,
0.20335990190505981,
-0.05525655299425125,
0.8688508868217468,
0.3222660422325134,
1.0501344203948975,
-0.1715739518404007,
0.5429491996765137,
-2.3684308528900146,
2.2296085357666016,
-0.17353621125221252,
0.6702495217323303,
0.028993232175707817,
-0.12102995067834854,
1.008705735206604,
0.6187995672225952,
0.6630706191062927,
-1.0645290613174438,
0.5342400074005127,
-0.5623542070388794,
1.232884168624878,
1.0047978162765503,
-0.7040267586708069,
-0.14757372438907623,
1.332131028175354,
0.5547791123390198,
-0.30283915996551514,
-0.7992913722991943,
-0.941180944442749,
0.8334142565727234,
1.7244555950164795,
-0.18354980647563934,
-0.15474586188793182,
0.9798312783241272,
0.7046206593513489,
-1.3599883317947388,
0.03951098769903183,
-0.8153896927833557,
-0.6039943695068359,
1.692548394203186,
2.1863980293273926,
-0.13191121816635132,
-0.231375053524971,
-0.7783538699150085,
-1.0598781108856201,
0.8796507716178894,
-0.11400973051786423,
0.20691995322704315,
0.6993224620819092,
-0.6463223099708557,
1.1146854162216187,
0.8791182637214661,
1.04239821434021,
0.2679339647293091,
0.4430025517940521,
0.3349756598472595,
-0.23979829251766205,
-1.1830439567565918,
-0.26260074973106384,
-1.000102162361145,
-2.613929033279419,
0.5374204516410828,
-0.4268489181995392,
-1.3915132284164429,
-0.030908333137631416,
-1.1055907011032104,
0.8903481364250183,
-0.5983049273490906,
-1.0301796197891235,
-1.5521984100341797,
0.24141240119934082,
0.014527445659041405,
1.0182726383209229,
-1.6485059261322021,
0.07236620038747787,
1.2381995916366577,
0.9096938371658325,
-0.7005810737609863,
1.070292353630066,
0.3511962592601776,
1.0609419345855713,
0.7752987146377563,
-0.45483165979385376,
0.5773044228553772,
0.15760046243667603,
-1.2513961791992188,
0.45418596267700195,
1.0262110233306885,
0.16023041307926178,
1.3717472553253174,
-0.6414467096328735,
0.08026833832263947,
0.46688809990882874,
-0.5940527319908142,
-0.48011186718940735,
-0.5893154144287109,
0.8073143362998962,
0.13234101235866547,
-0.8681998252868652,
0.056559234857559204,
-0.07842396199703217,
-0.22330622375011444,
0.15618185698986053,
-1.4053508043289185,
-0.23638562858104706,
-0.4164639711380005,
-0.7270421981811523,
-1.2810450792312622,
-0.11513946205377579,
1.3621183633804321,
-0.8106780648231506,
-0.04343951493501663,
0.4195041060447693,
0.4324377477169037,
0.5788361430168152,
0.6076639890670776,
-0.5115771889686584,
-0.4482344686985016,
-0.30605319142341614,
-0.3252638578414917,
0.3255404829978943,
1.3561930656433105,
-0.2409946471452713,
-1.1160072088241577,
0.8451718688011169,
-0.3639788031578064,
0.07008209824562073,
2.009580135345459,
0.014067420735955238,
-0.8243703842163086,
0.30900564789772034,
-0.6084708571434021,
1.8745458126068115,
1.6510504484176636,
1.369554042816162,
-0.13638785481452942,
-0.9111068248748779,
0.5684083104133606,
-0.3385414183139801,
-0.45567888021469116,
0.8340675234794617,
0.3807286322116852,
-0.06051338464021683,
-1.2909886837005615,
0.7377326488494873,
1.3844518661499023,
-0.9678787589073181,
-0.8266302943229675,
0.22269973158836365,
-0.7795424461364746,
1.1134662628173828,
0.7622199058532715,
0.4713439643383026,
0.3055901825428009,
1.4740726947784424,
0.6466890573501587,
-0.4920484721660614,
0.4888204336166382,
0.47087666392326355,
-0.04480841010808945,
-2.038809061050415,
-1.0682204961776733,
0.26590850949287415,
-0.5482133626937866,
-1.6217453479766846,
1.3102810382843018,
-1.2819713354110718,
-0.950346052646637,
0.5721142888069153,
0.07041385024785995,
1.517257571220398,
0.37666353583335876,
1.576862096786499,
2.1322195529937744,
0.8733683824539185,
0.35272231698036194,
1.4697511196136475,
-0.05054287612438202,
-0.5603058934211731,
1.7873601913452148,
-0.4068402349948883,
0.5616217851638794,
1.1753721237182617,
-0.14470970630645752,
-0.8240271210670471,
-0.763302206993103,
-1.2137433290481567,
-0.5787673592567444,
1.2168447971343994,
0.1400413066148758,
-1.212731122970581,
0.2152632772922516,
1.5160489082336426,
0.031152864918112755,
-0.37051522731781006,
0.514331579208374,
0.33643609285354614,
-0.7314974665641785,
-0.16071149706840515,
-0.9812421202659607,
0.4796191453933716,
-0.3050493597984314,
-0.24864357709884644,
0.2970488667488098,
0.42241841554641724,
1.3099656105041504,
-0.05143997073173523,
0.23527124524116516,
1.2880289554595947,
-1.4272282123565674,
1.5143588781356812,
-0.5159798860549927,
0.16285498440265656,
-2.362093210220337,
1.3880937099456787,
-0.7235459685325623,
1.8177410364151,
-2.6814448833465576,
0.38312292098999023,
-0.5023866891860962,
-0.4024463891983032,
0.21538609266281128,
-0.3384014666080475,
0.13411596417427063,
-0.2098945677280426,
-1.0920398235321045,
0.0231043491512537,
-0.7696800231933594,
0.49430856108665466,
0.9933802485466003,
1.2137525081634521,
-1.253322958946228,
-0.3939615488052368,
-1.7303247451782227,
-0.21518690884113312,
-0.5974588990211487,
0.3446922302246094,
-2.0589916706085205,
-0.18098601698875427,
-1.8774436712265015,
-2.500281810760498,
-1.4227232933044434,
-0.8672443628311157,
1.1413915157318115,
0.08225057274103165,
-0.8203719854354858,
0.9794285893440247,
-0.3036772608757019,
-2.0453341007232666,
1.0997898578643799,
-2.0682849884033203
] |
https://github.com/huggingface/datasets/issues/4983 | How to convert torch.utils.data.Dataset to huggingface dataset? | Generator functions are generally picklable. E.g.
```python
import dill as pickle
def generator_fn():
for i in range(10):
yield i
pickle.dumps(generator_fn)
```
however generators are not picklable
```python
generator = generator_fn()
pickle.dumps(generator)
# TypeError: cannot pickle 'generator' object
```
Though it can happen that some generator functions are not recursively picklable if they use global objects that are not picklable:
```python
def generator_fn_not_picklable():
for i in generator:
yield i
pickle.dumps(generator_fn_not_picklable, recurse=True)
# TypeError: cannot pickle 'generator' object
```` | I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks. | 523 | 77 | How to convert torch.utils.data.Dataset to huggingface dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below:
```python
from datasets import Dataset
data = [[1, 2],[3, 4]]
ds = Dataset.from_dict({"data": data})
ds = ds.with_format("torch")
ds[0]
ds[:2]
```
So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert?
Thanks.
Generator functions are generally picklable. E.g.
```python
import dill as pickle
def generator_fn():
for i in range(10):
yield i
pickle.dumps(generator_fn)
```
however generators are not picklable
```python
generator = generator_fn()
pickle.dumps(generator)
# TypeError: cannot pickle 'generator' object
```
Though it can happen that some generator functions are not recursively picklable if they use global objects that are not picklable:
```python
def generator_fn_not_picklable():
for i in generator:
yield i
pickle.dumps(generator_fn_not_picklable, recurse=True)
# TypeError: cannot pickle 'generator' object
```` | [
-1.07389235496521,
-0.8710949420928955,
-0.7116876244544983,
1.4883493185043335,
-0.12354104965925217,
-1.2048964500427246,
0.23709765076637268,
-1.065242886543274,
1.7404485940933228,
-0.7416656613349915,
0.4834213852882385,
-1.7093095779418945,
0.04680648446083069,
-0.6373472809791565,
-0.8241724371910095,
-0.9214014410972595,
-0.42162689566612244,
-0.6855376362800598,
0.9981128573417664,
2.5376572608947754,
1.1992433071136475,
-1.4389499425888062,
2.5592212677001953,
0.6511106491088867,
-0.1602606326341629,
-1.079229712486267,
0.5078198909759521,
0.08883372694253922,
-1.229678750038147,
-0.40505439043045044,
-0.9632167816162109,
-0.13861560821533203,
-0.5809193253517151,
-0.6985744833946228,
0.0022637592628598213,
0.39572903513908386,
-0.2762681245803833,
-0.5408871173858643,
-0.5078026056289673,
-0.8117692470550537,
0.5615305304527283,
-0.42195290327072144,
0.9630638957023621,
-0.3133487105369568,
1.8579601049423218,
-0.6063488125801086,
0.5843706130981445,
0.7590519189834595,
1.4195806980133057,
0.20867303013801575,
-0.10616419464349747,
0.36902129650115967,
0.3944070339202881,
0.023121288046240807,
0.5070669651031494,
1.103025197982788,
0.6439009308815002,
0.5177193880081177,
0.7468088269233704,
-2.199631929397583,
1.1850594282150269,
-1.1234105825424194,
0.2926054298877716,
1.2211412191390991,
-0.9468557834625244,
0.30898648500442505,
-1.7435104846954346,
-0.0645257979631424,
0.5704976320266724,
-2.1981921195983887,
0.21992087364196777,
-1.339612603187561,
-0.4012152850627899,
1.1101727485656738,
0.43630364537239075,
-1.3818824291229248,
0.13063238561153412,
-0.24105167388916016,
0.9446657299995422,
0.33320754766464233,
1.1027417182922363,
-1.8169500827789307,
0.041023217141628265,
-0.4826509654521942,
0.11626563966274261,
-1.2491286993026733,
-1.4111024141311646,
0.5492042303085327,
0.6541155576705933,
0.5383672714233398,
-0.0780007541179657,
1.0535147190093994,
-1.0501340627670288,
0.7945905923843384,
-1.105081558227539,
-1.7584443092346191,
-1.4156055450439453,
-2.1551599502563477,
-2.4160423278808594,
0.8267653584480286,
-0.41829395294189453,
-0.542184054851532,
2.0249698162078857,
-1.0010075569152832,
-1.7754195928573608,
1.1468822956085205,
0.2110835164785385,
-0.07056824862957001,
2.3121531009674072,
0.1617574840784073,
-0.7432881593704224,
0.48433902859687805,
-0.7849304676055908,
0.7378206849098206,
-0.2099456489086151,
1.4305857419967651,
0.5011642575263977,
-1.190752387046814,
1.628337025642395,
-0.23179756104946136,
0.5318280458450317,
-0.677952229976654,
-0.5904710292816162,
-0.7129925489425659,
0.29702654480934143,
1.8859033584594727,
-0.31379202008247375,
1.5616868734359741,
-0.3473607003688812,
-1.5517691373825073,
-1.567724347114563,
0.9412053823471069,
0.42322924733161926,
-0.7463034987449646,
0.06322374194860458,
-0.26937270164489746,
0.06077621877193451,
-0.04143320769071579,
1.153351902961731,
1.1982611417770386,
0.7589534521102905,
-0.35515743494033813,
-0.7960675358772278,
0.16076333820819855,
-0.012221786193549633,
-0.8298695683479309,
-1.7372684478759766,
-0.48756784200668335,
-0.013518495485186577,
0.5849137902259827,
-1.2682981491088867,
1.722756266593933,
0.8235588073730469,
1.8402040004730225,
1.093214511871338,
-0.3954106867313385,
1.5183804035186768,
0.015884671360254288,
1.943930745124817,
-0.4552232027053833,
0.6929292678833008,
-0.30622398853302,
-1.2033213376998901,
0.8676620125770569,
-0.2650655210018158,
-2.1414966583251953,
-0.9092406034469604,
-0.7357544898986816,
-0.07921500504016876,
-0.7488893866539001,
0.931681752204895,
-0.24625802040100098,
-1.4733010530471802,
0.3361358940601349,
-0.7311058640480042,
0.17346356809139252,
-1.2207564115524292,
0.34768709540367126,
0.7374348044395447,
-0.6885170340538025,
0.14410215616226196,
-0.26510199904441833,
-1.2377885580062866,
-0.3470853269100189,
0.2101452797651291,
1.9106723070144653,
-0.8224613070487976,
0.9038738012313843,
1.0861177444458008,
-0.8386895656585693,
-0.046361200511455536,
0.2644447982311249,
-0.3492249548435211,
0.8729459643363953,
-1.0548863410949707,
-0.4774712026119232,
1.2521405220031738,
-0.10395592451095581,
-0.6744365096092224,
1.4545750617980957,
0.6706745028495789,
-1.006820797920227,
-0.21891723573207855,
-0.2389127016067505,
-0.7580713629722595,
0.11165352910757065,
-1.7243919372558594,
-0.010395352728664875,
0.467121422290802,
-1.511351227760315,
-0.3987725079059601,
-0.19644062221050262,
1.3375053405761719,
-0.15518590807914734,
1.3396961688995361,
-0.2371091991662979,
-0.19310306012630463,
-0.360786497592926,
-0.3038836419582367,
0.14158691465854645,
-0.20100997388362885,
-0.7272672653198242,
0.3710455596446991,
-0.688080370426178,
0.5756844282150269,
1.2377785444259644,
0.22980456054210663,
0.03211282938718796,
0.45319807529449463,
1.030198097229004,
0.3316256105899811,
-0.09537971019744873,
-0.8564569354057312,
-1.5331931114196777,
2.148505926132202,
-1.3801294565200806,
1.9796348810195923,
0.6862739324569702,
-0.013979346491396427,
-1.8134539127349854,
-1.8102295398712158,
1.436375379562378,
1.3004391193389893,
2.3064188957214355,
0.653491735458374,
0.4042576253414154,
-0.7711408138275146,
-0.6022429466247559,
0.3195163905620575,
-1.0921854972839355,
-0.7245483994483948,
0.22000916302204132,
2.3901302814483643,
1.7318007946014404,
-0.4313252866268158,
-0.174407958984375,
-1.0150830745697021,
1.2893356084823608,
-0.24285678565502167,
0.2688537538051605,
2.093923568725586,
-0.26247647404670715,
-1.252644658088684,
1.3754479885101318,
-2.3160274028778076,
0.08494024723768234,
1.9915045499801636,
0.2282581329345703,
0.06818778067827225,
-1.503908395767212,
-0.5949850082397461,
-0.23809714615345,
-0.47178903222084045,
-1.3027863502502441,
0.47163519263267517,
-0.22994135320186615,
-0.8162850141525269,
-1.4240080118179321,
0.21774309873580933,
-1.0968252420425415,
-1.6031171083450317,
0.3006933331489563,
1.8200969696044922,
1.9169787168502808,
-0.7244793176651001,
1.5836888551712036,
-0.251302033662796,
0.23205921053886414,
1.2097223997116089,
1.1209886074066162,
3.053210496902466,
2.0011658668518066,
-1.2682294845581055,
0.6687337160110474,
-0.19736626744270325,
-0.564960777759552,
1.2608425617218018,
-1.276423454284668,
1.3631629943847656,
-0.15370617806911469,
-1.1922913789749146,
-1.2744114398956299,
0.9776879549026489,
0.4617939889431,
0.05387498438358307,
-0.5127757787704468,
1.20099675655365,
0.11992895603179932,
1.2612690925598145,
0.4690414369106293,
-0.25241947174072266,
0.6299781799316406,
-0.5035114288330078,
-0.46419623494148254,
1.4478996992111206,
0.3171003460884094,
-1.2881985902786255,
-2.3428380489349365,
-0.19835010170936584,
-0.8934980630874634,
0.008245786651968956,
-0.5947420597076416,
-0.9209370613098145,
1.6771490573883057,
0.3456285297870636,
-1.3605420589447021,
-0.19950711727142334,
-0.2582281827926636,
-0.5746711492538452,
2.7171993255615234,
-1.3727871179580688,
-0.19082599878311157,
-1.0744801759719849,
-0.6680005788803101,
1.7271429300308228,
-1.165274739265442,
-0.25476357340812683,
-1.013825535774231,
-0.617839515209198,
-1.290531873703003,
-0.6493259072303772,
0.012239715084433556,
-0.9406653642654419,
0.7516782283782959,
0.2615787982940674,
-1.0914400815963745,
-0.39453956484794617,
-0.8428570628166199,
0.7963243126869202,
-0.1621522754430771,
0.28887876868247986,
1.8890454769134521,
0.4893370270729065,
-0.3635392189025879,
0.7018025517463684,
1.1210739612579346,
0.7449477314949036,
-0.6313076615333557,
0.3870159089565277,
-0.6925463080406189,
0.1907874196767807,
-1.3520822525024414,
0.3701983094215393,
-2.7273712158203125,
0.6039532423019409,
-0.04493303596973419,
-0.014406343922019005,
-0.011269372887909412,
-1.3224793672561646,
1.0796267986297607,
2.6306586265563965,
-1.2341417074203491,
0.5134258270263672,
0.26288825273513794,
1.1218668222427368,
-1.5133806467056274,
0.3164939284324646,
-0.4194416403770447,
2.211681365966797,
0.25589612126350403,
1.1314359903335571,
-0.4010655879974365,
-2.239544153213501,
0.6244570016860962,
-1.3809137344360352,
-1.3413442373275757,
0.8394948244094849,
-0.909783124923706,
0.05470579117536545,
-1.3703017234802246,
-0.1707095205783844,
-0.7962866425514221,
-1.2203454971313477,
0.7822544574737549,
0.11979183554649353,
0.4276629388332367,
-0.526046633720398,
0.3912840783596039,
-2.141451120376587,
-1.4137154817581177,
-0.28490206599235535,
-0.9740358591079712,
0.39407429099082947,
-0.19319027662277222,
0.6536156535148621,
-0.14771419763565063,
-0.0009801564738154411,
0.3677467107772827,
1.4248952865600586,
3.445537805557251,
0.23618808388710022,
0.3373318314552307,
-0.15449419617652893,
-0.9740711450576782,
1.4486186504364014,
0.8686264157295227,
-0.11481883376836777,
-0.6370183229446411,
-0.9980040192604065,
1.1209747791290283,
2.0670387744903564,
1.049299716949463,
0.0058066267520189285,
-0.7757117748260498,
-0.7177377939224243,
0.00242677703499794,
0.24815554916858673,
0.5379899144172668,
0.8753334879875183,
0.12525948882102966,
0.047834500670433044,
1.4165204763412476,
1.146215558052063,
-0.37459391355514526,
0.3490007817745209,
-0.8014275431632996,
-0.5191318988800049,
0.5353862643241882,
0.2285131961107254,
0.08019639551639557,
0.3329888880252838,
-0.9536765217781067,
-0.3416842222213745,
-0.4650728106498718,
-0.9671742916107178,
-0.7997152209281921,
-0.4243278205394745,
-0.41733473539352417,
1.6896559000015259,
-0.10983754694461823,
-0.5025282502174377,
-0.05282559245824814,
-0.6888065338134766,
-0.030017148703336716,
-1.087575078010559,
0.22345153987407684,
-0.0316900908946991,
-0.12138095498085022,
-0.02178925648331642,
1.7425332069396973,
-0.8751495480537415,
-1.9861515760421753,
0.18272975087165833,
0.2771012485027313,
-0.30966460704803467,
0.22704724967479706,
1.5390920639038086,
0.5360578298568726,
1.36209237575531,
1.3502932786941528,
0.962008535861969,
-0.5916776657104492,
-1.3314794301986694,
0.5820828676223755,
1.0067652463912964,
-1.3568942546844482,
0.7756457924842834,
0.08675624430179596,
-0.3605629503726959,
0.5541651248931885,
1.2314939498901367,
0.5314103364944458,
-1.9419336318969727,
0.7025720477104187,
-0.8500487804412842,
0.775943398475647,
0.6825337409973145,
0.6798579692840576,
0.19616441428661346,
0.7744996547698975,
-1.2144827842712402,
-1.0789328813552856,
-0.7262399196624756,
-0.6167320609092712,
2.009528636932373,
-0.31104496121406555,
0.7126871347427368,
-0.17570160329341888,
-1.4660075902938843,
-0.17151789367198944,
0.6943407654762268,
0.3897964358329773,
-0.585532546043396,
0.7530568838119507,
-0.579537570476532,
-1.0422054529190063,
-1.4273293018341064,
-0.42067545652389526,
-1.0829874277114868,
-0.8492417931556702,
1.1709017753601074,
0.7028055191040039,
0.17181842029094696,
1.755326509475708,
0.6573850512504578,
0.21756987273693085,
-2.60756254196167,
0.9064518809318542,
0.2575265169143677,
-0.150015726685524,
0.8536518812179565,
0.38363149762153625,
0.8899340629577637,
-0.17286990582942963,
0.5446332693099976,
-2.2772116661071777,
2.2844367027282715,
-0.1633288413286209,
0.6303070783615112,
0.05329184979200363,
-0.2498123049736023,
0.9937720894813538,
0.542451024055481,
0.6445149779319763,
-0.9949219822883606,
0.5549427270889282,
-0.5824822187423706,
1.2275739908218384,
0.8512871861457825,
-0.7794678807258606,
-0.0611482709646225,
1.3155544996261597,
0.468986451625824,
-0.36569473147392273,
-0.9230873584747314,
-0.9753439426422119,
0.9626129865646362,
1.6654791831970215,
-0.14993512630462646,
-0.1896166056394577,
1.0353573560714722,
0.6640577912330627,
-1.3821003437042236,
0.09068108350038528,
-0.7236501574516296,
-0.7242366671562195,
1.7179561853408813,
2.1502368450164795,
-0.17006932199001312,
-0.3866722583770752,
-0.8743518590927124,
-1.0879038572311401,
0.8710304498672485,
-0.024209627881646156,
0.059267111122608185,
0.6354655027389526,
-0.6098878979682922,
1.1881117820739746,
0.9877572655677795,
0.9469190835952759,
0.27661243081092834,
0.31016162037849426,
0.27947431802749634,
-0.2559736371040344,
-1.2000751495361328,
-0.1929018199443817,
-0.9892491698265076,
-2.6932005882263184,
0.5134375095367432,
-0.29047757387161255,
-1.3845560550689697,
0.06930501013994217,
-1.0536761283874512,
0.8938690423965454,
-0.569618284702301,
-1.0934405326843262,
-1.5658100843429565,
0.2735326588153839,
-0.005599436350166798,
0.9324746131896973,
-1.6582752466201782,
0.030253393575549126,
1.1936280727386475,
0.9347416758537292,
-0.7494242787361145,
0.8938815593719482,
0.24732939898967743,
1.0977611541748047,
0.8743563890457153,
-0.3589785099029541,
0.6228638291358948,
0.16289910674095154,
-1.3007307052612305,
0.49150919914245605,
1.031633973121643,
0.11624228954315186,
1.437695860862732,
-0.6089610457420349,
0.03366260230541229,
0.37845996022224426,
-0.5890918374061584,
-0.5076279044151306,
-0.6705076098442078,
0.7680313587188721,
0.1047433540225029,
-0.9983311295509338,
0.04590880870819092,
-0.02768649533390999,
-0.12502798438072205,
0.11248964816331863,
-1.558957815170288,
-0.18966376781463623,
-0.32406291365623474,
-0.6446958184242249,
-1.2423131465911865,
-0.1514918953180313,
1.352122187614441,
-0.7629186511039734,
-0.16098998486995697,
0.40373799204826355,
0.44283124804496765,
0.5681178569793701,
0.648577094078064,
-0.5736972093582153,
-0.4152167737483978,
-0.29841163754463196,
-0.3216668665409088,
0.3751954436302185,
1.394763708114624,
-0.1074175089597702,
-1.0709336996078491,
0.8096452951431274,
-0.4027039706707001,
0.06369174271821976,
1.9330850839614868,
0.08169057965278625,
-0.9101375937461853,
0.28332847356796265,
-0.6508949398994446,
1.8419277667999268,
1.75288724899292,
1.3380014896392822,
-0.15057046711444855,
-0.9620382189750671,
0.7168794870376587,
-0.3939046263694763,
-0.425785094499588,
0.9070756435394287,
0.4261619746685028,
-0.09313559532165527,
-1.2749004364013672,
0.7972288131713867,
1.3580756187438965,
-0.8338790535926819,
-0.9753860831260681,
0.22098377346992493,
-0.7931606769561768,
1.053852915763855,
0.7545952796936035,
0.38365185260772705,
0.28514811396598816,
1.4587523937225342,
0.7410260438919067,
-0.33781659603118896,
0.6008124947547913,
0.38736361265182495,
-0.15648624300956726,
-1.9933881759643555,
-1.1682624816894531,
0.3410192131996155,
-0.524139940738678,
-1.6364892721176147,
1.3881717920303345,
-1.2210347652435303,
-0.9121690988540649,
0.5474156141281128,
0.03647715598344803,
1.5469006299972534,
0.3750731647014618,
1.5484741926193237,
2.010530471801758,
0.8532838821411133,
0.35771363973617554,
1.338572382926941,
-0.05672962963581085,
-0.5104368329048157,
1.8196587562561035,
-0.4700475037097931,
0.5006573796272278,
1.1237832307815552,
-0.13562984764575958,
-1.0158666372299194,
-0.7959684133529663,
-1.285141944885254,
-0.7396604418754578,
1.1725846529006958,
0.08835132420063019,
-1.2170246839523315,
0.26265406608581543,
1.5812259912490845,
0.03308344632387161,
-0.30143070220947266,
0.49620872735977173,
0.25199148058891296,
-0.7965723872184753,
-0.07537832111120224,
-0.9500575661659241,
0.4833715558052063,
-0.23946955800056458,
-0.21702104806900024,
0.30081531405448914,
0.40425822138786316,
1.3090468645095825,
0.023629939183592796,
0.21655726432800293,
1.1346074342727661,
-1.473583698272705,
1.5351840257644653,
-0.6479730606079102,
0.28488633036613464,
-2.298896074295044,
1.3094780445098877,
-0.7311456799507141,
1.8109140396118164,
-2.684366226196289,
0.4251661002635956,
-0.5148147940635681,
-0.42689770460128784,
0.2677581012248993,
-0.38229891657829285,
0.1885903775691986,
-0.22192122042179108,
-1.2188446521759033,
-0.07306109368801117,
-0.7002502679824829,
0.6079158782958984,
0.9584344029426575,
1.316541075706482,
-1.0714341402053833,
-0.38840728998184204,
-1.8243474960327148,
-0.14411820471286774,
-0.5618206858634949,
0.3381361663341522,
-1.9122110605239868,
-0.14656168222427368,
-1.8991261720657349,
-2.420729637145996,
-1.2651073932647705,
-0.764380931854248,
1.1112558841705322,
0.11080129444599152,
-0.792566180229187,
1.0686874389648438,
-0.32502496242523193,
-1.9747291803359985,
1.0442612171173096,
-2.1593105792999268
] |
https://github.com/huggingface/datasets/issues/4982 | Create dataset_infos.json with VALIDATION and TEST splits | Hi again! Can you please pass the directory name containing the dataset script instead of the script name to `datasets-cli test`? | The problem is described in that [issue](https://github.com/huggingface/datasets/issues/4895#issuecomment-1247975569).
> When I try to create data_infos.json using datasets-cli test Peter.py --save_infos --all_configs I get an error:
> ValueError: Unknown split "test". Should be one of ['train'].
>
> The data_infos.json is created perfectly fine when I use only one split - datasets.Split.TRAIN
>
> You can find the code here: https://huggingface.co/datasets/sberbank-ai/Peter/tree/add_splits (add_splits branch)
I tried to clear the cache folder, than I got an another error. I run:
```
git clone https://huggingface.co/datasets/sberbank-ai/Peter
cd Peter
git checkout add_splits # switch to a add_splits branch
rm dataset_infos.json # remove local dataset_infos.json
rm -r ~/.cache/huggingface # remove cached dataset_infos.json
datasets-cli test Peter.py --save_infos --all_configs # trying to create new dataset_infos.json
```
The error message:
```
Using custom data configuration default
Testing builder 'default' (1/1)
Downloading and preparing dataset peter/default to /Users/kalinin/.cache/huggingface/datasets/peter/default/0.0.0/ef579519e140d6a40df2555996f26165f04c47557d7373709c8d7e7b4fd7465d...
Downloading data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 5160.63it/s]
Extracting data files: 0%| | 0/4 [00:00<?, ?it/s]Traceback (most recent call last):
File "/usr/local/bin/datasets-cli", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/datasets/commands/datasets_cli.py", line 39, in main
service.run()
File "/usr/local/lib/python3.9/site-packages/datasets/commands/test.py", line 137, in run
builder.download_and_prepare(
File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 1227, in _download_and_prepare
super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos)
File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 771, in _download_and_prepare
split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
File "/Users/kalinin/.cache/huggingface/modules/datasets_modules/datasets/Peter/ef579519e140d6a40df2555996f26165f04c47557d7373709c8d7e7b4fd7465d/Peter.py", line 23, in _split_generators
data_files = dl_manager.download_and_extract(_URLS)
File "/usr/local/lib/python3.9/site-packages/datasets/download/download_manager.py", line 431, in download_and_extract
return self.extract(self.download(url_or_urls))
File "/usr/local/lib/python3.9/site-packages/datasets/download/download_manager.py", line 403, in extract
extracted_paths = map_nested(
File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 393, in map_nested
mapped = [
File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 394, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 330, in _single_map_nested
return function(data_struct)
File "/usr/local/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 213, in cached_path
output_path = ExtractManager(cache_dir=download_config.cache_dir).extract(
File "/usr/local/lib/python3.9/site-packages/datasets/utils/extract.py", line 46, in extract
self.extractor.extract(input_path, output_path, extractor_format)
File "/usr/local/lib/python3.9/site-packages/datasets/utils/extract.py", line 263, in extract
with FileLock(lock_path):
File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 399, in __init__
max_filename_length = os.statvfs(os.path.dirname(lock_file)).f_namemax
FileNotFoundError: [Errno 2] No such file or directory: ''
Exception ignored in: <function BaseFileLock.__del__ at 0x11caeec10>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 328, in __del__
self.release(force=True)
File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 303, in release
with self._thread_lock:
AttributeError: 'UnixFileLock' object has no attribute '_thread_lock'
Extracting data files: 0%| | 0/4 [00:00<?, ?it/s]
```
Can you help me please?
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.9.5
- PyArrow version: 9.0.0
- Pandas version: 1.2.4
| 524 | 21 | Create dataset_infos.json with VALIDATION and TEST splits
The problem is described in that [issue](https://github.com/huggingface/datasets/issues/4895#issuecomment-1247975569).
> When I try to create data_infos.json using datasets-cli test Peter.py --save_infos --all_configs I get an error:
> ValueError: Unknown split "test". Should be one of ['train'].
>
> The data_infos.json is created perfectly fine when I use only one split - datasets.Split.TRAIN
>
> You can find the code here: https://huggingface.co/datasets/sberbank-ai/Peter/tree/add_splits (add_splits branch)
I tried to clear the cache folder, than I got an another error. I run:
```
git clone https://huggingface.co/datasets/sberbank-ai/Peter
cd Peter
git checkout add_splits # switch to a add_splits branch
rm dataset_infos.json # remove local dataset_infos.json
rm -r ~/.cache/huggingface # remove cached dataset_infos.json
datasets-cli test Peter.py --save_infos --all_configs # trying to create new dataset_infos.json
```
The error message:
```
Using custom data configuration default
Testing builder 'default' (1/1)
Downloading and preparing dataset peter/default to /Users/kalinin/.cache/huggingface/datasets/peter/default/0.0.0/ef579519e140d6a40df2555996f26165f04c47557d7373709c8d7e7b4fd7465d...
Downloading data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 5160.63it/s]
Extracting data files: 0%| | 0/4 [00:00<?, ?it/s]Traceback (most recent call last):
File "/usr/local/bin/datasets-cli", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/datasets/commands/datasets_cli.py", line 39, in main
service.run()
File "/usr/local/lib/python3.9/site-packages/datasets/commands/test.py", line 137, in run
builder.download_and_prepare(
File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare
self._download_and_prepare(
File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 1227, in _download_and_prepare
super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos)
File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 771, in _download_and_prepare
split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
File "/Users/kalinin/.cache/huggingface/modules/datasets_modules/datasets/Peter/ef579519e140d6a40df2555996f26165f04c47557d7373709c8d7e7b4fd7465d/Peter.py", line 23, in _split_generators
data_files = dl_manager.download_and_extract(_URLS)
File "/usr/local/lib/python3.9/site-packages/datasets/download/download_manager.py", line 431, in download_and_extract
return self.extract(self.download(url_or_urls))
File "/usr/local/lib/python3.9/site-packages/datasets/download/download_manager.py", line 403, in extract
extracted_paths = map_nested(
File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 393, in map_nested
mapped = [
File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 394, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 330, in _single_map_nested
return function(data_struct)
File "/usr/local/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 213, in cached_path
output_path = ExtractManager(cache_dir=download_config.cache_dir).extract(
File "/usr/local/lib/python3.9/site-packages/datasets/utils/extract.py", line 46, in extract
self.extractor.extract(input_path, output_path, extractor_format)
File "/usr/local/lib/python3.9/site-packages/datasets/utils/extract.py", line 263, in extract
with FileLock(lock_path):
File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 399, in __init__
max_filename_length = os.statvfs(os.path.dirname(lock_file)).f_namemax
FileNotFoundError: [Errno 2] No such file or directory: ''
Exception ignored in: <function BaseFileLock.__del__ at 0x11caeec10>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 328, in __del__
self.release(force=True)
File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 303, in release
with self._thread_lock:
AttributeError: 'UnixFileLock' object has no attribute '_thread_lock'
Extracting data files: 0%| | 0/4 [00:00<?, ?it/s]
```
Can you help me please?
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-x86_64-i386-64bit
- Python version: 3.9.5
- PyArrow version: 9.0.0
- Pandas version: 1.2.4
Hi again! Can you please pass the directory name containing the dataset script instead of the script name to `datasets-cli test`? | [
-1.1744518280029297,
-0.9058677554130554,
-0.7877276539802551,
1.4334475994110107,
-0.04855089634656906,
-1.3051294088363647,
-0.001339801587164402,
-1.0688763856887817,
1.5859650373458862,
-0.6689407229423523,
0.2613542675971985,
-1.6859344244003296,
0.004634535871446133,
-0.5315331220626831,
-0.7766525745391846,
-0.8819242119789124,
-0.3448767364025116,
-0.8043670654296875,
1.029653787612915,
2.52571439743042,
1.1899477243423462,
-1.3377946615219116,
2.7702386379241943,
0.6603557467460632,
-0.29199907183647156,
-0.9966821074485779,
0.6059906482696533,
0.04141715168952942,
-1.3357099294662476,
-0.4171867370605469,
-0.8808906078338623,
-0.029599197208881378,
-0.5735841989517212,
-0.49113696813583374,
0.12342371791601181,
0.37042415142059326,
-0.2358085960149765,
-0.3621964752674103,
-0.5731037855148315,
-0.6840060949325562,
0.5020105242729187,
-0.3173639178276062,
0.9332433938980103,
-0.34053346514701843,
1.7342872619628906,
-0.5755135416984558,
0.3725556433200836,
0.6487862467765808,
1.3462718725204468,
0.22476807236671448,
0.013912815600633621,
0.26588913798332214,
0.3747248649597168,
0.04231417179107666,
0.4962157905101776,
1.2313567399978638,
0.5927147269248962,
0.4736264944076538,
0.7138876914978027,
-2.200256586074829,
1.3053511381149292,
-0.8520232439041138,
0.2614319920539856,
1.3137426376342773,
-0.8806743025779724,
0.3819047510623932,
-1.8329575061798096,
-0.04131435602903366,
0.5701764822006226,
-2.3052937984466553,
0.1798267364501953,
-1.313902497291565,
-0.5177767872810364,
0.9654646515846252,
0.3312823176383972,
-1.200452446937561,
0.17906202375888824,
-0.5415957570075989,
1.0641729831695557,
0.5163649916648865,
1.209044098854065,
-1.6672378778457642,
-0.032305095344781876,
-0.222195565700531,
0.12199758738279343,
-1.3034242391586304,
-1.5695713758468628,
0.5736604928970337,
0.7018323540687561,
0.6833667159080505,
-0.08209589868783951,
0.9227582216262817,
-1.0670465230941772,
0.83132404088974,
-0.9009576439857483,
-1.7474673986434937,
-1.3987919092178345,
-2.33465313911438,
-2.3564701080322266,
0.7754089832305908,
-0.4898068904876709,
-0.439029335975647,
2.027759075164795,
-1.0373142957687378,
-1.8044828176498413,
1.0317859649658203,
0.3260284662246704,
0.03037785179913044,
2.4190163612365723,
0.2589133381843567,
-0.807908296585083,
0.5032275319099426,
-0.707006573677063,
0.7730482220649719,
-0.21898631751537323,
1.3117305040359497,
0.4962155520915985,
-0.9580575823783875,
1.6245867013931274,
-0.4436633288860321,
0.5659316182136536,
-0.6803874373435974,
-0.5172862410545349,
-0.7178493142127991,
0.25309091806411743,
1.946885347366333,
-0.3504229784011841,
1.6300352811813354,
-0.3472762703895569,
-1.6053334474563599,
-1.5513665676116943,
0.80213862657547,
0.4915566146373749,
-0.8302508592605591,
0.07939400523900986,
-0.4742824137210846,
0.11147468537092209,
0.003939858637750149,
1.0771487951278687,
1.2069594860076904,
0.7833600044250488,
-0.31591835618019104,
-0.8502822518348694,
0.2198440134525299,
-0.033745333552360535,
-0.7033904790878296,
-1.7914539575576782,
-0.27611637115478516,
0.17807500064373016,
0.7209914922714233,
-1.1663904190063477,
1.7328542470932007,
0.8682109713554382,
1.9830667972564697,
1.0586347579956055,
-0.3769826889038086,
1.438356876373291,
0.007370287552475929,
1.867265224456787,
-0.5341930985450745,
0.6122356653213501,
-0.3523344099521637,
-1.1706790924072266,
0.7924290299415588,
-0.3745580315589905,
-2.0900020599365234,
-0.7169424295425415,
-0.8027556538581848,
-0.165181502699852,
-0.73609858751297,
0.8875395655632019,
-0.25819462537765503,
-1.4568952322006226,
0.13450056314468384,
-0.6912193894386292,
0.15481050312519073,
-1.2919272184371948,
0.21039342880249023,
0.7931907773017883,
-0.694444477558136,
-0.026480432599782944,
-0.257917582988739,
-1.294062614440918,
-0.5474595427513123,
0.33187136054039,
1.9609484672546387,
-0.7254242897033691,
0.9440594911575317,
1.0203032493591309,
-0.7262157797813416,
0.10717608034610748,
0.32958072423934937,
-0.2689439058303833,
0.8500820398330688,
-1.1104539632797241,
-0.345369815826416,
1.1349595785140991,
-0.1928430050611496,
-0.6099056601524353,
1.4218363761901855,
0.8291344046592712,
-1.0681416988372803,
-0.257079541683197,
-0.08441289514303207,
-0.7867876887321472,
0.027353698387742043,
-1.572516918182373,
-0.15653817355632782,
0.30463552474975586,
-1.5241672992706299,
-0.4618421196937561,
-0.21390874683856964,
1.279172658920288,
-0.12310483306646347,
1.4020752906799316,
-0.28096309304237366,
-0.1613427847623825,
-0.33420854806900024,
-0.514747679233551,
0.18706470727920532,
-0.25694453716278076,
-0.5475224852561951,
0.25427135825157166,
-0.821198046207428,
0.2937518358230591,
1.4324285984039307,
0.34009185433387756,
0.10513036698102951,
0.4882299602031708,
1.0849475860595703,
0.41146355867385864,
-0.08390352874994278,
-0.8400978446006775,
-1.5770816802978516,
2.1019201278686523,
-1.4980137348175049,
1.9416325092315674,
0.7707205414772034,
-0.11671770364046097,
-1.813672423362732,
-1.9468215703964233,
1.3641026020050049,
1.079738736152649,
2.4167068004608154,
0.5050186514854431,
0.40850594639778137,
-0.8158723711967468,
-0.7652149796485901,
0.37325263023376465,
-0.8908562660217285,
-0.746660590171814,
0.1363876312971115,
2.4056644439697266,
1.7326953411102295,
-0.5066992044448853,
-0.2148667573928833,
-0.9045760035514832,
1.2840056419372559,
-0.15005935728549957,
0.2647193372249603,
2.0328404903411865,
-0.33426180481910706,
-1.0494678020477295,
1.323339581489563,
-2.376106023788452,
0.23786325752735138,
2.0094025135040283,
0.2817685604095459,
0.10797813534736633,
-1.4793487787246704,
-0.6497863531112671,
-0.2757377028465271,
-0.46185559034347534,
-1.2361735105514526,
0.5940120816230774,
-0.3207894265651703,
-0.9086211323738098,
-1.513819932937622,
0.0008976561948657036,
-1.1889777183532715,
-1.7358478307724,
0.35479027032852173,
1.8481491804122925,
2.090728282928467,
-0.7487385869026184,
1.4909415245056152,
-0.32493680715560913,
0.06155768781900406,
1.2143135070800781,
1.2738486528396606,
3.1260554790496826,
1.822765827178955,
-1.2738876342773438,
0.7929133772850037,
-0.12051321566104889,
-0.42599329352378845,
1.1002212762832642,
-1.146296739578247,
1.2035188674926758,
-0.2949758768081665,
-1.2714875936508179,
-1.187883973121643,
1.0531184673309326,
0.47714167833328247,
0.025559043511748314,
-0.563180685043335,
1.242190957069397,
0.06443750858306885,
1.311409592628479,
0.5887835025787354,
-0.3852038085460663,
0.573631763458252,
-0.3827968239784241,
-0.5684621930122375,
1.5165802240371704,
0.16446828842163086,
-1.4991726875305176,
-2.3283560276031494,
-0.27950695157051086,
-0.8793955445289612,
-0.024399496614933014,
-0.6261826157569885,
-1.0462065935134888,
1.5859209299087524,
0.39682769775390625,
-1.232482671737671,
-0.27316322922706604,
-0.31649088859558105,
-0.5546887516975403,
2.6462481021881104,
-1.404894232749939,
-0.14470630884170532,
-0.9310712814331055,
-0.546719491481781,
1.6117055416107178,
-1.1579381227493286,
-0.2051316648721695,
-1.0786885023117065,
-0.6603619456291199,
-1.360334873199463,
-0.5103062987327576,
0.031238971278071404,
-0.9088074564933777,
0.8079983592033386,
0.06808497756719589,
-1.0608108043670654,
-0.2574826776981354,
-0.892769455909729,
0.9484696388244629,
-0.12188877165317535,
0.23458310961723328,
1.8731322288513184,
0.35117074847221375,
-0.47012656927108765,
0.6882008910179138,
1.170470118522644,
0.6444029211997986,
-0.710740327835083,
0.14593937993049622,
-0.6423740386962891,
0.38539841771125793,
-1.356088399887085,
0.24711643159389496,
-2.875368356704712,
0.719795823097229,
-0.09637830406427383,
-0.03156638517975807,
-0.017316676676273346,
-1.3325873613357544,
1.0728007555007935,
2.575688362121582,
-1.2170052528381348,
0.5230348110198975,
0.37009426951408386,
1.1485451459884644,
-1.504611611366272,
0.23552678525447845,
-0.4511834979057312,
2.070513963699341,
0.11429626494646072,
1.2227942943572998,
-0.4898640811443329,
-2.1330535411834717,
0.6898397207260132,
-1.2632801532745361,
-1.009577989578247,
0.7908563017845154,
-0.8944114446640015,
0.18709473311901093,
-1.4337031841278076,
-0.1515844464302063,
-0.9886407852172852,
-1.2240095138549805,
0.7077584862709045,
0.147843599319458,
0.4916306436061859,
-0.5985279083251953,
0.3415834307670593,
-2.1659457683563232,
-1.379327654838562,
-0.1816326379776001,
-1.0201728343963623,
0.47218045592308044,
-0.39441218972206116,
0.6257702708244324,
-0.13160422444343567,
0.061113983392715454,
0.38367021083831787,
1.3582017421722412,
3.3712308406829834,
0.10291355103254318,
0.23342618346214294,
-0.13216732442378998,
-1.0548171997070312,
1.3834638595581055,
0.9521605968475342,
-0.16869965195655823,
-0.5758046507835388,
-1.026164174079895,
1.2990936040878296,
2.0372865200042725,
1.1339318752288818,
0.0835944414138794,
-0.8915990591049194,
-0.7901037931442261,
0.10570379346609116,
0.23991718888282776,
0.5598923563957214,
0.92793869972229,
-0.04115612804889679,
0.15645216405391693,
1.4109739065170288,
1.1632460355758667,
-0.36552369594573975,
0.4437832832336426,
-0.8936291933059692,
-0.43404722213745117,
0.43617600202560425,
0.2745211720466614,
0.011482302099466324,
0.43255436420440674,
-1.1327427625656128,
-0.20676857233047485,
-0.3602026700973511,
-0.9208107590675354,
-0.7022003531455994,
-0.4056416451931,
-0.3889281451702118,
1.5623753070831299,
0.042131438851356506,
-0.4277494251728058,
0.016643444076180458,
-0.7695088982582092,
-0.16911453008651733,
-1.0689269304275513,
0.25934138894081116,
-0.19379305839538574,
-0.04531984031200409,
-0.13478493690490723,
1.7114192247390747,
-0.9771497845649719,
-2.093616485595703,
0.2408728152513504,
0.24851901829242706,
-0.41601622104644775,
0.16407562792301178,
1.697779655456543,
0.5734117031097412,
1.3973373174667358,
1.3629368543624878,
0.9379189610481262,
-0.681567370891571,
-1.2379509210586548,
0.652991771697998,
0.9575104713439941,
-1.3339128494262695,
0.9242308139801025,
-0.16736190021038055,
-0.5915723443031311,
0.6716951727867126,
1.45054030418396,
0.39136186242103577,
-1.997747778892517,
0.8476232290267944,
-0.8982681632041931,
0.7511787414550781,
0.6423604488372803,
0.8030968308448792,
0.18269793689250946,
0.8230867385864258,
-1.2061693668365479,
-1.1249648332595825,
-0.7143152952194214,
-0.644834041595459,
1.8477822542190552,
-0.1784631460905075,
0.4784524738788605,
-0.13679736852645874,
-1.2534661293029785,
-0.13865338265895844,
0.769927978515625,
0.38098886609077454,
-0.4664882719516754,
0.8438100814819336,
-0.6317929625511169,
-1.0753068923950195,
-1.2482283115386963,
-0.45538878440856934,
-0.9874840974807739,
-0.8557628989219666,
1.0024253129959106,
0.743429958820343,
0.38061007857322693,
1.9501999616622925,
0.5933704376220703,
0.2458428591489792,
-2.66747784614563,
0.8952978253364563,
0.28573453426361084,
-0.06389451026916504,
0.8997099995613098,
0.23808923363685608,
1.1316827535629272,
0.003825322724878788,
0.5519915819168091,
-2.276392698287964,
2.2044992446899414,
-0.2092324197292328,
0.7119333744049072,
-0.015279320068657398,
-0.11823063343763351,
1.115955114364624,
0.591958224773407,
0.6030820608139038,
-1.1274428367614746,
0.8118628859519958,
-0.5786973237991333,
1.090387225151062,
0.9210203289985657,
-0.862293541431427,
0.09268776327371597,
1.288520336151123,
0.4497024416923523,
-0.4788823127746582,
-0.9859631061553955,
-0.8314452171325684,
0.9757553935050964,
1.7608122825622559,
-0.03968844935297966,
0.061173878610134125,
0.8678732514381409,
0.6753420233726501,
-1.2656891345977783,
0.06883056461811066,
-0.6650934815406799,
-0.6958596706390381,
1.7299240827560425,
2.0654213428497314,
-0.05816793441772461,
-0.08712087571620941,
-0.7579484581947327,
-1.2485544681549072,
0.8067800998687744,
-0.043245553970336914,
0.0969027429819107,
0.7114189267158508,
-0.658316433429718,
1.2500461339950562,
0.7154161334037781,
0.9944732189178467,
-0.015132270753383636,
0.30928245186805725,
0.3781713843345642,
-0.25874584913253784,
-1.1897406578063965,
-0.40210986137390137,
-1.0409104824066162,
-2.4699130058288574,
0.5079385638237,
-0.24781423807144165,
-1.4276705980300903,
0.025756960734725,
-0.992124617099762,
0.8479605317115784,
-0.6076400279998779,
-1.0080922842025757,
-1.3960120677947998,
0.29285091161727905,
-0.14305244386196136,
0.8709238767623901,
-1.6356221437454224,
-0.13388922810554504,
1.2534304857254028,
0.9302396178245544,
-0.5959874391555786,
0.9263095259666443,
0.27809885144233704,
0.9098451137542725,
0.80489182472229,
-0.3914048671722412,
0.5456587672233582,
0.14997981488704681,
-1.3077183961868286,
0.3847331404685974,
1.2174310684204102,
0.22365468740463257,
1.3919373750686646,
-0.4992324113845825,
0.02002178132534027,
0.4764899015426636,
-0.5280696153640747,
-0.452167809009552,
-0.5418168306350708,
0.67630535364151,
0.019999826326966286,
-0.9592913389205933,
-0.026403261348605156,
-0.10729552060365677,
-0.19830812513828278,
0.25277042388916016,
-1.5092700719833374,
-0.2735583484172821,
-0.4207177758216858,
-0.47820398211479187,
-1.250662922859192,
0.014066953212022781,
1.376542091369629,
-0.8110566735267639,
-0.24547478556632996,
0.4813801646232605,
0.38209494948387146,
0.5402560830116272,
0.6728190779685974,
-0.7095286846160889,
-0.32314634323120117,
-0.2945232391357422,
-0.37688547372817993,
0.23908072710037231,
1.2509942054748535,
-0.1353241354227066,
-1.0418072938919067,
0.719298779964447,
-0.44816097617149353,
0.12388227134943008,
1.954229474067688,
0.03571847826242447,
-0.7813039422035217,
0.3487917482852936,
-0.685275673866272,
1.8123595714569092,
1.7494217157363892,
1.3528389930725098,
-0.16147227585315704,
-0.9075986742973328,
0.6006885766983032,
-0.27981874346733093,
-0.32301607728004456,
0.9225655794143677,
0.4517224431037903,
-0.22601962089538574,
-1.4584475755691528,
0.5941407084465027,
1.1933985948562622,
-0.9820776581764221,
-0.746057391166687,
0.09509210288524628,
-0.8342500329017639,
1.1586641073226929,
0.7224278450012207,
0.3673962354660034,
0.259149968624115,
1.6030222177505493,
0.6848253607749939,
-0.5142427086830139,
0.45679593086242676,
0.4417459964752197,
-0.23243683576583862,
-2.055349349975586,
-1.0146217346191406,
0.32338154315948486,
-0.42277243733406067,
-1.6125226020812988,
1.3460538387298584,
-1.1912437677383423,
-0.9427356123924255,
0.5350565314292908,
0.06294380128383636,
1.3357077836990356,
0.31102147698402405,
1.7997417449951172,
2.079014778137207,
0.9457498788833618,
0.32562321424484253,
1.2861735820770264,
-0.10740666091442108,
-0.4127330183982849,
1.8204139471054077,
-0.42787808179855347,
0.5676783919334412,
1.0937072038650513,
-0.41448089480400085,
-1.0066380500793457,
-0.8196848630905151,
-1.1528596878051758,
-0.6865431070327759,
1.1801875829696655,
0.10402298718690872,
-1.1991441249847412,
0.2504258155822754,
1.547886610031128,
0.15977928042411804,
-0.17770373821258545,
0.7251777648925781,
0.43041303753852844,
-0.7159144282341003,
-0.1301702857017517,
-0.9600008130073547,
0.4703352153301239,
-0.23065301775932312,
-0.3654184639453888,
0.20501914620399475,
0.43161872029304504,
1.3229796886444092,
0.0020149974152445793,
0.07898037880659103,
1.2923579216003418,
-1.3716449737548828,
1.458739995956421,
-0.6665528416633606,
0.31487929821014404,
-2.4288830757141113,
1.4037176370620728,
-0.8364933133125305,
1.9029953479766846,
-2.6152353286743164,
0.4383265972137451,
-0.5726324915885925,
-0.4556073248386383,
0.2845653295516968,
-0.31270933151245117,
0.1763232797384262,
-0.1387367695569992,
-1.015214443206787,
-0.105903260409832,
-0.7659786939620972,
0.6168569326400757,
1.1715444326400757,
1.3341645002365112,
-1.059306025505066,
-0.27473142743110657,
-1.7841922044754028,
-0.22533787786960602,
-0.7041494846343994,
0.3474496304988861,
-1.9705971479415894,
-0.14464479684829712,
-1.9973297119140625,
-2.4118967056274414,
-1.4088561534881592,
-0.8936069011688232,
1.093572735786438,
0.207138791680336,
-0.9370869994163513,
1.0831021070480347,
-0.39246344566345215,
-1.7733407020568848,
1.0913525819778442,
-2.219703435897827
] |
https://github.com/huggingface/datasets/issues/4981 | Can't create a dataset with `float16` features | Hi @dconathan, thanks for reporting.
We rely on Arrow as a backend, and as far as I know currently support for `float16` in Arrow is not fully implemented in Python (C++), hence the `ArrowNotImplementedError` you get.
See, e.g.: https://arrow.apache.org/docs/status.html?highlight=float16#data-types | ## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
| 525 | 39 | Can't create a dataset with `float16` features
## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Hi @dconathan, thanks for reporting.
We rely on Arrow as a backend, and as far as I know currently support for `float16` in Arrow is not fully implemented in Python (C++), hence the `ArrowNotImplementedError` you get.
See, e.g.: https://arrow.apache.org/docs/status.html?highlight=float16#data-types | [
-1.2057141065597534,
-0.8102036714553833,
-0.6469262838363647,
1.4442282915115356,
-0.06382401287555695,
-1.3462415933609009,
0.1484007090330124,
-0.987706184387207,
1.736415982246399,
-0.9125480651855469,
0.4100821018218994,
-1.708981990814209,
0.15340952575206757,
-0.592488169670105,
-0.7626789212226868,
-0.6535719037055969,
-0.350750595331192,
-0.6627594232559204,
1.0949064493179321,
2.3952157497406006,
1.1264779567718506,
-1.3292369842529297,
2.738229274749756,
0.7167775630950928,
-0.25048598647117615,
-0.8322121500968933,
0.3310741186141968,
-0.018497265875339508,
-1.4933851957321167,
-0.22281292080879211,
-0.9738255143165588,
-0.082537442445755,
-0.6092232465744019,
-0.7065620422363281,
0.01456721406430006,
0.47681760787963867,
-0.2838103175163269,
-0.5111714601516724,
-0.30824750661849976,
-0.8153766989707947,
0.5825783014297485,
-0.2710755169391632,
0.8963314890861511,
-0.26543331146240234,
1.8305211067199707,
-0.5987824201583862,
0.5186917185783386,
0.5519042015075684,
1.2557138204574585,
0.27523285150527954,
-0.08149126917123795,
0.37679600715637207,
0.30449143052101135,
0.038640569895505905,
0.6001114845275879,
1.2094225883483887,
0.6394641399383545,
0.548046886920929,
0.8023760318756104,
-2.2527730464935303,
1.2925236225128174,
-0.9091762900352478,
0.2586028277873993,
1.3110747337341309,
-1.0671095848083496,
0.4480334520339966,
-1.820885419845581,
-0.1463935226202011,
0.35599035024642944,
-2.1790950298309326,
0.20643875002861023,
-1.3179492950439453,
-0.5175502300262451,
1.059051275253296,
0.3856297731399536,
-1.2109837532043457,
-0.05473187938332558,
-0.2701363265514374,
0.8937371373176575,
0.34297803044319153,
1.141288161277771,
-1.5683021545410156,
0.0358039066195488,
-0.3162389397621155,
0.33074885606765747,
-1.1871432065963745,
-1.5059150457382202,
0.5314602255821228,
0.6814435124397278,
0.5209627151489258,
-0.21233385801315308,
0.9958449602127075,
-1.0996259450912476,
0.753445029258728,
-0.9768149256706238,
-1.8402681350708008,
-1.3484992980957031,
-2.273820400238037,
-2.309849977493286,
0.7874873876571655,
-0.38892120122909546,
-0.457049697637558,
2.1458561420440674,
-1.1127265691757202,
-1.8099749088287354,
1.1121501922607422,
0.30530989170074463,
-0.16742391884326935,
2.3098092079162598,
0.16560010612010956,
-0.8644178509712219,
0.6879605650901794,
-0.8607204556465149,
0.6058557629585266,
-0.46095505356788635,
1.2703955173492432,
0.4019075930118561,
-1.0925438404083252,
1.603060245513916,
-0.34012073278427124,
0.5784502029418945,
-0.7823631763458252,
-0.3806343078613281,
-0.5661119818687439,
0.276191383600235,
1.922393560409546,
-0.18895886838436127,
1.4768688678741455,
-0.213051900267601,
-1.447535753250122,
-1.4453963041305542,
0.8043543100357056,
0.4478616714477539,
-0.7262121438980103,
0.21897153556346893,
-0.3415619432926178,
0.18356283009052277,
0.0651492029428482,
1.1236881017684937,
1.2890129089355469,
0.8241545557975769,
-0.134501650929451,
-0.856403112411499,
0.15430930256843567,
0.016446035355329514,
-0.5667880177497864,
-1.6778836250305176,
-0.2862052917480469,
0.16650938987731934,
0.5839102268218994,
-1.0973012447357178,
1.9115124940872192,
0.8817892074584961,
1.929749608039856,
1.0166898965835571,
-0.3114369809627533,
1.566706895828247,
0.1315307766199112,
1.931505560874939,
-0.195316344499588,
0.6677379608154297,
-0.48867523670196533,
-1.1955751180648804,
0.7006626129150391,
-0.23600822687149048,
-2.0200142860412598,
-0.38792070746421814,
-0.9404813647270203,
-0.1927850842475891,
-0.8753629326820374,
0.9992749691009521,
-0.1600966900587082,
-1.4400014877319336,
0.27852073311805725,
-0.6986398100852966,
0.13083909451961517,
-1.3503284454345703,
0.3553813099861145,
0.711776852607727,
-0.7274020314216614,
0.15170979499816895,
-0.3908635973930359,
-1.415213704109192,
-0.5845735669136047,
0.43895095586776733,
1.7823034524917603,
-0.8225282430648804,
1.0174930095672607,
1.034488320350647,
-0.6295213103294373,
-0.17214198410511017,
0.5164039134979248,
-0.38387131690979004,
0.9036407470703125,
-0.9919251203536987,
-0.42454472184181213,
1.1577404737472534,
-0.2491549402475357,
-0.48196882009506226,
1.3201836347579956,
0.6730047464370728,
-0.9231603145599365,
-0.1950697898864746,
-0.0984894335269928,
-0.8562514781951904,
0.027280252426862717,
-1.6041141748428345,
-0.0301269069314003,
0.38001102209091187,
-1.518783688545227,
-0.47651705145835876,
-0.019505873322486877,
1.193999171257019,
-0.042620666325092316,
1.3686373233795166,
-0.294154554605484,
-0.15942490100860596,
-0.5506359338760376,
-0.42841866612434387,
0.1143764778971672,
-0.11460472643375397,
-0.6569430828094482,
0.2823745310306549,
-0.6935862302780151,
0.2727968096733093,
1.3535659313201904,
0.24137724936008453,
0.08790840953588486,
0.5659053325653076,
1.2032358646392822,
0.35290661454200745,
-0.15582506358623505,
-0.8188050985336304,
-1.7209577560424805,
2.0148415565490723,
-1.5701956748962402,
2.007718563079834,
0.7479526400566101,
0.020224973559379578,
-1.7683296203613281,
-1.8973320722579956,
1.570533037185669,
1.1059414148330688,
2.504361867904663,
0.5614669322967529,
0.4072414040565491,
-0.8601976037025452,
-0.6163468956947327,
0.4339657425880432,
-0.8787835240364075,
-0.9233744740486145,
0.12064783275127411,
2.3708443641662598,
1.724045753479004,
-0.30686888098716736,
-0.19437843561172485,
-1.0217939615249634,
1.441123127937317,
-0.28756973147392273,
0.19946838915348053,
1.825415849685669,
-0.38852614164352417,
-1.012895107269287,
1.310981035232544,
-2.402956247329712,
0.23927822709083557,
1.965096354484558,
0.22310732305049896,
0.04683823883533478,
-1.1090056896209717,
-0.7000086903572083,
-0.09567409008741379,
-0.411144882440567,
-1.2494096755981445,
0.3339500427246094,
-0.16386404633522034,
-0.6730020046234131,
-1.415190577507019,
0.12319636344909668,
-1.1176018714904785,
-1.65180504322052,
0.2161594182252884,
1.812744140625,
2.0924594402313232,
-0.7257705330848694,
1.427860140800476,
-0.27295607328414917,
0.34444400668144226,
1.2928258180618286,
1.1683180332183838,
3.233684778213501,
1.88004732131958,
-1.2688663005828857,
0.6333036422729492,
-0.11180763691663742,
-0.5788268446922302,
1.2210906744003296,
-1.1307958364486694,
1.206499457359314,
-0.10344883054494858,
-1.2977745532989502,
-1.1770800352096558,
0.8394966125488281,
0.4561127722263336,
0.06150790676474571,
-0.4311230480670929,
0.9989525079727173,
0.19986914098262787,
1.3096530437469482,
0.5747573971748352,
-0.21298420429229736,
0.6219484806060791,
-0.31406161189079285,
-0.4517959654331207,
1.5350431203842163,
0.09987850487232208,
-1.3669288158416748,
-2.227903127670288,
-0.10960943251848221,
-0.9848096370697021,
0.0811619833111763,
-0.808560311794281,
-0.9689927697181702,
1.5610264539718628,
0.4757373631000519,
-1.001846432685852,
-0.0577225536108017,
-0.41146016120910645,
-0.6428425908088684,
2.6572108268737793,
-1.3920875787734985,
-0.37803229689598083,
-1.003403663635254,
-0.7360663414001465,
1.5718321800231934,
-1.1918275356292725,
-0.27320969104766846,
-1.027990698814392,
-0.47250816226005554,
-1.2713748216629028,
-0.5235684514045715,
0.0004901615902781487,
-0.821821391582489,
0.8180006742477417,
0.046886805444955826,
-1.3666220903396606,
-0.3373331129550934,
-1.1165155172348022,
0.770286500453949,
-0.261118084192276,
0.03650956228375435,
1.763425588607788,
0.3143196702003479,
-0.38205480575561523,
0.6910855174064636,
1.1821858882904053,
0.6172022819519043,
-0.5101861953735352,
0.4241578280925751,
-0.6328125596046448,
0.48431921005249023,
-1.2290594577789307,
0.37748226523399353,
-2.8927528858184814,
0.6523901224136353,
0.05680711939930916,
0.015918802469968796,
-0.12649211287498474,
-1.4632601737976074,
0.9285850524902344,
2.497884511947632,
-1.0259768962860107,
0.5268229246139526,
0.24032370746135712,
1.2881368398666382,
-1.6250909566879272,
0.08071019500494003,
-0.5907496809959412,
2.0828726291656494,
0.08439458906650543,
1.0573650598526,
-0.44295957684516907,
-2.441560745239258,
0.5673906207084656,
-1.2879747152328491,
-1.0711323022842407,
0.8230302929878235,
-0.813946545124054,
0.0724431648850441,
-1.1085387468338013,
-0.12882833182811737,
-0.8547903299331665,
-1.0325748920440674,
0.5946838855743408,
0.017538193613290787,
0.6415678858757019,
-0.7090683579444885,
0.29481974244117737,
-2.2778213024139404,
-1.3273545503616333,
-0.22253769636154175,
-0.891656756401062,
0.40725985169410706,
-0.3660268187522888,
0.7772086262702942,
-0.246986985206604,
-0.042720042169094086,
0.3035232722759247,
1.5349526405334473,
3.171482563018799,
0.10863368213176727,
0.4997352659702301,
-0.32284852862358093,
-1.0068498849868774,
1.5321717262268066,
0.89480060338974,
-0.25250861048698425,
-0.6065794825553894,
-1.0074725151062012,
1.2582927942276,
1.8341072797775269,
1.0702439546585083,
0.04677312448620796,
-0.8627488613128662,
-0.8102422952651978,
0.08480522781610489,
0.08250352740287781,
0.43628716468811035,
0.9817370176315308,
0.24469996988773346,
0.22664104402065277,
1.3576399087905884,
1.0627741813659668,
-0.4228273332118988,
0.43937262892723083,
-0.7727896571159363,
-0.47091227769851685,
0.5643646121025085,
0.4161296784877777,
-0.02678976207971573,
0.12066946923732758,
-1.0333678722381592,
-0.15647178888320923,
-0.2903876006603241,
-0.9082324504852295,
-0.782889187335968,
-0.4336078464984894,
-0.4211815297603607,
1.7894364595413208,
-0.051739051938056946,
-0.5941183567047119,
-0.11875678598880768,
-0.8947007656097412,
0.00029076915234327316,
-0.9612069129943848,
0.3008538782596588,
-0.14222493767738342,
-0.02247798815369606,
-0.07583066076040268,
1.68767511844635,
-0.9602358341217041,
-2.1238088607788086,
0.2213660627603531,
0.13205845654010773,
-0.31184881925582886,
-0.05469883605837822,
1.767344355583191,
0.5564374327659607,
1.454877495765686,
1.5945035219192505,
1.0522470474243164,
-0.6270792484283447,
-1.3803329467773438,
0.7530506253242493,
0.8754865527153015,
-1.328903079032898,
0.8620465993881226,
0.04267434775829315,
-0.5462637543678284,
0.44548851251602173,
1.2340409755706787,
0.47227492928504944,
-1.9922817945480347,
0.7673993110656738,
-1.1723637580871582,
0.8246990442276001,
0.8215599656105042,
0.7671186923980713,
0.08683699369430542,
0.8549911379814148,
-1.1869176626205444,
-1.0259758234024048,
-0.6206894516944885,
-0.642831563949585,
1.8916069269180298,
-0.2807987928390503,
0.4097071588039398,
-0.27569380402565,
-1.4696794748306274,
0.1296933889389038,
0.6726303696632385,
0.3085644543170929,
-0.46577906608581543,
0.6607900261878967,
-0.6844977736473083,
-1.0925155878067017,
-1.4136966466903687,
-0.5290629863739014,
-1.0943336486816406,
-0.8310781717300415,
0.9495599269866943,
0.7700260281562805,
0.36782801151275635,
1.8919826745986938,
0.747193455696106,
0.19463318586349487,
-2.6597368717193604,
0.8146683573722839,
0.3228779435157776,
-0.09269264340400696,
0.7481582164764404,
0.2763844132423401,
1.0983092784881592,
-0.1892486959695816,
0.5561435222625732,
-2.41074800491333,
2.3270444869995117,
-0.21902602910995483,
0.7662459015846252,
0.02227034792304039,
-0.06595763564109802,
1.0613594055175781,
0.5787587761878967,
0.5062431693077087,
-1.0748944282531738,
0.7977844476699829,
-0.7281500697135925,
1.2754403352737427,
0.8763114809989929,
-0.854937732219696,
0.04486791044473648,
1.2411452531814575,
0.3426274359226227,
-0.5756658315658569,
-0.9975881576538086,
-0.9847527146339417,
1.0134716033935547,
1.7628206014633179,
0.039218392223119736,
0.06502125412225723,
0.8287689089775085,
0.8072249889373779,
-1.3232580423355103,
0.01166489627212286,
-0.7083001136779785,
-0.6953635811805725,
1.772005319595337,
2.089962959289551,
-0.11975216865539551,
-0.1324416995048523,
-0.7579405307769775,
-1.3819780349731445,
0.8416464924812317,
0.16288450360298157,
0.016947977244853973,
0.7965357303619385,
-0.6684508919715881,
1.2259907722473145,
0.9452380537986755,
0.8435664176940918,
0.3870279788970947,
0.026972558349370956,
0.1481161266565323,
-0.3097626864910126,
-1.1584851741790771,
-0.24472898244857788,
-0.9901733994483948,
-2.5797436237335205,
0.4053572714328766,
-0.18773417174816132,
-1.4291157722473145,
0.12503913044929504,
-0.9556392431259155,
0.7775734066963196,
-0.4873271882534027,
-1.2463322877883911,
-1.3804281949996948,
0.12723471224308014,
-0.07441363483667374,
0.7870929837226868,
-1.5547055006027222,
-0.059063754975795746,
1.1540082693099976,
1.0261783599853516,
-0.7106896638870239,
0.8784904479980469,
0.17561349272727966,
0.9688757061958313,
1.0534014701843262,
-0.4224875569343567,
0.4261196255683899,
0.17672480642795563,
-1.338664174079895,
0.3515184819698334,
1.2891677618026733,
0.10495911538600922,
1.445071816444397,
-0.4988887906074524,
-0.054914698004722595,
0.39561325311660767,
-0.31197869777679443,
-0.5294608473777771,
-0.8092567920684814,
0.6241718530654907,
-0.20493245124816895,
-0.8367142677307129,
0.008976518176496029,
0.18443670868873596,
-0.13933229446411133,
0.24106253683567047,
-1.5629909038543701,
-0.02609943598508835,
-0.3175744414329529,
-0.7735667824745178,
-1.2748082876205444,
-0.12493057548999786,
1.3471219539642334,
-0.8288480639457703,
-0.08987870067358017,
0.521308183670044,
0.10742899030447006,
0.5091138482093811,
0.6358329653739929,
-0.6730843782424927,
-0.328605979681015,
-0.0918496698141098,
-0.42624202370643616,
0.33076709508895874,
1.4266695976257324,
-0.0951518788933754,
-0.92562335729599,
0.5769296884536743,
-0.25389376282691956,
0.12366586923599243,
1.87005615234375,
0.02262657880783081,
-0.900930643081665,
0.280077189207077,
-0.737286388874054,
1.9051867723464966,
1.7341811656951904,
1.290481448173523,
-0.05802324786782265,
-1.0521081686019897,
0.6721521615982056,
-0.4266529977321625,
-0.4338867664337158,
0.931946873664856,
0.3214496076107025,
-0.27210497856140137,
-1.3789753913879395,
0.810175359249115,
1.238814115524292,
-0.7579094767570496,
-0.9030730724334717,
0.10487837344408035,
-0.8095136880874634,
1.1328186988830566,
0.695652425289154,
0.3338395655155182,
0.3207233250141144,
1.6268439292907715,
0.8225527405738831,
-0.5233973860740662,
0.6332905292510986,
0.48786500096321106,
-0.043110255151987076,
-2.044020414352417,
-1.1679375171661377,
0.28301921486854553,
-0.5118707418441772,
-1.5161471366882324,
1.4559326171875,
-1.2521787881851196,
-0.9246218204498291,
0.5932436585426331,
0.20267458260059357,
1.4280332326889038,
0.34611809253692627,
1.654421091079712,
1.987230658531189,
0.9216572642326355,
0.4793829023838043,
1.1393455266952515,
-0.27955520153045654,
-0.3386790454387665,
1.577959418296814,
-0.5377709865570068,
0.5953943729400635,
1.0575072765350342,
-0.3226827085018158,
-1.1800367832183838,
-0.8347452878952026,
-1.2675365209579468,
-0.8967568874359131,
1.055199384689331,
0.16609686613082886,
-1.1434502601623535,
0.36741694808006287,
1.5953359603881836,
-0.05011126026511192,
-0.1681135594844818,
0.7023260593414307,
0.3615250587463379,
-0.789970338344574,
-0.05017589032649994,
-0.9731913805007935,
0.6169321537017822,
-0.3695443570613861,
-0.43549203872680664,
0.31549739837646484,
0.5456836819648743,
1.2576971054077148,
0.1753544807434082,
0.07085059583187103,
1.322940707206726,
-1.44048011302948,
1.285327672958374,
-1.0572525262832642,
0.37757131457328796,
-2.288235664367676,
1.5464906692504883,
-0.9822853803634644,
1.9516865015029907,
-2.6920526027679443,
0.459729939699173,
-0.48434144258499146,
-0.54527747631073,
0.19356200098991394,
-0.18604089319705963,
0.11841018497943878,
-0.01601380482316017,
-1.1827057600021362,
-0.10915990173816681,
-0.852577269077301,
0.5305956602096558,
1.219461441040039,
1.3059837818145752,
-0.9816039800643921,
-0.4055444896221161,
-1.6533747911453247,
-0.15525312721729279,
-0.40233364701271057,
0.19748932123184204,
-1.83524751663208,
-0.21318762004375458,
-2.0078518390655518,
-2.4672622680664062,
-1.2897881269454956,
-0.9671762585639954,
1.2972501516342163,
0.02411355823278427,
-0.8294782042503357,
1.1636199951171875,
-0.48992055654525757,
-1.8709360361099243,
1.2682799100875854,
-2.1841259002685547
] |
https://github.com/huggingface/datasets/issues/4981 | Can't create a dataset with `float16` features | Thanks for the link…. didn’t realize arrow didn’t support it yet. Should it be removed from https://huggingface.co/docs/datasets/v2.4.0/en/package_reference/main_classes#datasets.Value until Arrow supports it? | ## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
| 525 | 21 | Can't create a dataset with `float16` features
## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Thanks for the link…. didn’t realize arrow didn’t support it yet. Should it be removed from https://huggingface.co/docs/datasets/v2.4.0/en/package_reference/main_classes#datasets.Value until Arrow supports it? | [
-1.2057141065597534,
-0.8102036714553833,
-0.6469262838363647,
1.4442282915115356,
-0.06382401287555695,
-1.3462415933609009,
0.1484007090330124,
-0.987706184387207,
1.736415982246399,
-0.9125480651855469,
0.4100821018218994,
-1.708981990814209,
0.15340952575206757,
-0.592488169670105,
-0.7626789212226868,
-0.6535719037055969,
-0.350750595331192,
-0.6627594232559204,
1.0949064493179321,
2.3952157497406006,
1.1264779567718506,
-1.3292369842529297,
2.738229274749756,
0.7167775630950928,
-0.25048598647117615,
-0.8322121500968933,
0.3310741186141968,
-0.018497265875339508,
-1.4933851957321167,
-0.22281292080879211,
-0.9738255143165588,
-0.082537442445755,
-0.6092232465744019,
-0.7065620422363281,
0.01456721406430006,
0.47681760787963867,
-0.2838103175163269,
-0.5111714601516724,
-0.30824750661849976,
-0.8153766989707947,
0.5825783014297485,
-0.2710755169391632,
0.8963314890861511,
-0.26543331146240234,
1.8305211067199707,
-0.5987824201583862,
0.5186917185783386,
0.5519042015075684,
1.2557138204574585,
0.27523285150527954,
-0.08149126917123795,
0.37679600715637207,
0.30449143052101135,
0.038640569895505905,
0.6001114845275879,
1.2094225883483887,
0.6394641399383545,
0.548046886920929,
0.8023760318756104,
-2.2527730464935303,
1.2925236225128174,
-0.9091762900352478,
0.2586028277873993,
1.3110747337341309,
-1.0671095848083496,
0.4480334520339966,
-1.820885419845581,
-0.1463935226202011,
0.35599035024642944,
-2.1790950298309326,
0.20643875002861023,
-1.3179492950439453,
-0.5175502300262451,
1.059051275253296,
0.3856297731399536,
-1.2109837532043457,
-0.05473187938332558,
-0.2701363265514374,
0.8937371373176575,
0.34297803044319153,
1.141288161277771,
-1.5683021545410156,
0.0358039066195488,
-0.3162389397621155,
0.33074885606765747,
-1.1871432065963745,
-1.5059150457382202,
0.5314602255821228,
0.6814435124397278,
0.5209627151489258,
-0.21233385801315308,
0.9958449602127075,
-1.0996259450912476,
0.753445029258728,
-0.9768149256706238,
-1.8402681350708008,
-1.3484992980957031,
-2.273820400238037,
-2.309849977493286,
0.7874873876571655,
-0.38892120122909546,
-0.457049697637558,
2.1458561420440674,
-1.1127265691757202,
-1.8099749088287354,
1.1121501922607422,
0.30530989170074463,
-0.16742391884326935,
2.3098092079162598,
0.16560010612010956,
-0.8644178509712219,
0.6879605650901794,
-0.8607204556465149,
0.6058557629585266,
-0.46095505356788635,
1.2703955173492432,
0.4019075930118561,
-1.0925438404083252,
1.603060245513916,
-0.34012073278427124,
0.5784502029418945,
-0.7823631763458252,
-0.3806343078613281,
-0.5661119818687439,
0.276191383600235,
1.922393560409546,
-0.18895886838436127,
1.4768688678741455,
-0.213051900267601,
-1.447535753250122,
-1.4453963041305542,
0.8043543100357056,
0.4478616714477539,
-0.7262121438980103,
0.21897153556346893,
-0.3415619432926178,
0.18356283009052277,
0.0651492029428482,
1.1236881017684937,
1.2890129089355469,
0.8241545557975769,
-0.134501650929451,
-0.856403112411499,
0.15430930256843567,
0.016446035355329514,
-0.5667880177497864,
-1.6778836250305176,
-0.2862052917480469,
0.16650938987731934,
0.5839102268218994,
-1.0973012447357178,
1.9115124940872192,
0.8817892074584961,
1.929749608039856,
1.0166898965835571,
-0.3114369809627533,
1.566706895828247,
0.1315307766199112,
1.931505560874939,
-0.195316344499588,
0.6677379608154297,
-0.48867523670196533,
-1.1955751180648804,
0.7006626129150391,
-0.23600822687149048,
-2.0200142860412598,
-0.38792070746421814,
-0.9404813647270203,
-0.1927850842475891,
-0.8753629326820374,
0.9992749691009521,
-0.1600966900587082,
-1.4400014877319336,
0.27852073311805725,
-0.6986398100852966,
0.13083909451961517,
-1.3503284454345703,
0.3553813099861145,
0.711776852607727,
-0.7274020314216614,
0.15170979499816895,
-0.3908635973930359,
-1.415213704109192,
-0.5845735669136047,
0.43895095586776733,
1.7823034524917603,
-0.8225282430648804,
1.0174930095672607,
1.034488320350647,
-0.6295213103294373,
-0.17214198410511017,
0.5164039134979248,
-0.38387131690979004,
0.9036407470703125,
-0.9919251203536987,
-0.42454472184181213,
1.1577404737472534,
-0.2491549402475357,
-0.48196882009506226,
1.3201836347579956,
0.6730047464370728,
-0.9231603145599365,
-0.1950697898864746,
-0.0984894335269928,
-0.8562514781951904,
0.027280252426862717,
-1.6041141748428345,
-0.0301269069314003,
0.38001102209091187,
-1.518783688545227,
-0.47651705145835876,
-0.019505873322486877,
1.193999171257019,
-0.042620666325092316,
1.3686373233795166,
-0.294154554605484,
-0.15942490100860596,
-0.5506359338760376,
-0.42841866612434387,
0.1143764778971672,
-0.11460472643375397,
-0.6569430828094482,
0.2823745310306549,
-0.6935862302780151,
0.2727968096733093,
1.3535659313201904,
0.24137724936008453,
0.08790840953588486,
0.5659053325653076,
1.2032358646392822,
0.35290661454200745,
-0.15582506358623505,
-0.8188050985336304,
-1.7209577560424805,
2.0148415565490723,
-1.5701956748962402,
2.007718563079834,
0.7479526400566101,
0.020224973559379578,
-1.7683296203613281,
-1.8973320722579956,
1.570533037185669,
1.1059414148330688,
2.504361867904663,
0.5614669322967529,
0.4072414040565491,
-0.8601976037025452,
-0.6163468956947327,
0.4339657425880432,
-0.8787835240364075,
-0.9233744740486145,
0.12064783275127411,
2.3708443641662598,
1.724045753479004,
-0.30686888098716736,
-0.19437843561172485,
-1.0217939615249634,
1.441123127937317,
-0.28756973147392273,
0.19946838915348053,
1.825415849685669,
-0.38852614164352417,
-1.012895107269287,
1.310981035232544,
-2.402956247329712,
0.23927822709083557,
1.965096354484558,
0.22310732305049896,
0.04683823883533478,
-1.1090056896209717,
-0.7000086903572083,
-0.09567409008741379,
-0.411144882440567,
-1.2494096755981445,
0.3339500427246094,
-0.16386404633522034,
-0.6730020046234131,
-1.415190577507019,
0.12319636344909668,
-1.1176018714904785,
-1.65180504322052,
0.2161594182252884,
1.812744140625,
2.0924594402313232,
-0.7257705330848694,
1.427860140800476,
-0.27295607328414917,
0.34444400668144226,
1.2928258180618286,
1.1683180332183838,
3.233684778213501,
1.88004732131958,
-1.2688663005828857,
0.6333036422729492,
-0.11180763691663742,
-0.5788268446922302,
1.2210906744003296,
-1.1307958364486694,
1.206499457359314,
-0.10344883054494858,
-1.2977745532989502,
-1.1770800352096558,
0.8394966125488281,
0.4561127722263336,
0.06150790676474571,
-0.4311230480670929,
0.9989525079727173,
0.19986914098262787,
1.3096530437469482,
0.5747573971748352,
-0.21298420429229736,
0.6219484806060791,
-0.31406161189079285,
-0.4517959654331207,
1.5350431203842163,
0.09987850487232208,
-1.3669288158416748,
-2.227903127670288,
-0.10960943251848221,
-0.9848096370697021,
0.0811619833111763,
-0.808560311794281,
-0.9689927697181702,
1.5610264539718628,
0.4757373631000519,
-1.001846432685852,
-0.0577225536108017,
-0.41146016120910645,
-0.6428425908088684,
2.6572108268737793,
-1.3920875787734985,
-0.37803229689598083,
-1.003403663635254,
-0.7360663414001465,
1.5718321800231934,
-1.1918275356292725,
-0.27320969104766846,
-1.027990698814392,
-0.47250816226005554,
-1.2713748216629028,
-0.5235684514045715,
0.0004901615902781487,
-0.821821391582489,
0.8180006742477417,
0.046886805444955826,
-1.3666220903396606,
-0.3373331129550934,
-1.1165155172348022,
0.770286500453949,
-0.261118084192276,
0.03650956228375435,
1.763425588607788,
0.3143196702003479,
-0.38205480575561523,
0.6910855174064636,
1.1821858882904053,
0.6172022819519043,
-0.5101861953735352,
0.4241578280925751,
-0.6328125596046448,
0.48431921005249023,
-1.2290594577789307,
0.37748226523399353,
-2.8927528858184814,
0.6523901224136353,
0.05680711939930916,
0.015918802469968796,
-0.12649211287498474,
-1.4632601737976074,
0.9285850524902344,
2.497884511947632,
-1.0259768962860107,
0.5268229246139526,
0.24032370746135712,
1.2881368398666382,
-1.6250909566879272,
0.08071019500494003,
-0.5907496809959412,
2.0828726291656494,
0.08439458906650543,
1.0573650598526,
-0.44295957684516907,
-2.441560745239258,
0.5673906207084656,
-1.2879747152328491,
-1.0711323022842407,
0.8230302929878235,
-0.813946545124054,
0.0724431648850441,
-1.1085387468338013,
-0.12882833182811737,
-0.8547903299331665,
-1.0325748920440674,
0.5946838855743408,
0.017538193613290787,
0.6415678858757019,
-0.7090683579444885,
0.29481974244117737,
-2.2778213024139404,
-1.3273545503616333,
-0.22253769636154175,
-0.891656756401062,
0.40725985169410706,
-0.3660268187522888,
0.7772086262702942,
-0.246986985206604,
-0.042720042169094086,
0.3035232722759247,
1.5349526405334473,
3.171482563018799,
0.10863368213176727,
0.4997352659702301,
-0.32284852862358093,
-1.0068498849868774,
1.5321717262268066,
0.89480060338974,
-0.25250861048698425,
-0.6065794825553894,
-1.0074725151062012,
1.2582927942276,
1.8341072797775269,
1.0702439546585083,
0.04677312448620796,
-0.8627488613128662,
-0.8102422952651978,
0.08480522781610489,
0.08250352740287781,
0.43628716468811035,
0.9817370176315308,
0.24469996988773346,
0.22664104402065277,
1.3576399087905884,
1.0627741813659668,
-0.4228273332118988,
0.43937262892723083,
-0.7727896571159363,
-0.47091227769851685,
0.5643646121025085,
0.4161296784877777,
-0.02678976207971573,
0.12066946923732758,
-1.0333678722381592,
-0.15647178888320923,
-0.2903876006603241,
-0.9082324504852295,
-0.782889187335968,
-0.4336078464984894,
-0.4211815297603607,
1.7894364595413208,
-0.051739051938056946,
-0.5941183567047119,
-0.11875678598880768,
-0.8947007656097412,
0.00029076915234327316,
-0.9612069129943848,
0.3008538782596588,
-0.14222493767738342,
-0.02247798815369606,
-0.07583066076040268,
1.68767511844635,
-0.9602358341217041,
-2.1238088607788086,
0.2213660627603531,
0.13205845654010773,
-0.31184881925582886,
-0.05469883605837822,
1.767344355583191,
0.5564374327659607,
1.454877495765686,
1.5945035219192505,
1.0522470474243164,
-0.6270792484283447,
-1.3803329467773438,
0.7530506253242493,
0.8754865527153015,
-1.328903079032898,
0.8620465993881226,
0.04267434775829315,
-0.5462637543678284,
0.44548851251602173,
1.2340409755706787,
0.47227492928504944,
-1.9922817945480347,
0.7673993110656738,
-1.1723637580871582,
0.8246990442276001,
0.8215599656105042,
0.7671186923980713,
0.08683699369430542,
0.8549911379814148,
-1.1869176626205444,
-1.0259758234024048,
-0.6206894516944885,
-0.642831563949585,
1.8916069269180298,
-0.2807987928390503,
0.4097071588039398,
-0.27569380402565,
-1.4696794748306274,
0.1296933889389038,
0.6726303696632385,
0.3085644543170929,
-0.46577906608581543,
0.6607900261878967,
-0.6844977736473083,
-1.0925155878067017,
-1.4136966466903687,
-0.5290629863739014,
-1.0943336486816406,
-0.8310781717300415,
0.9495599269866943,
0.7700260281562805,
0.36782801151275635,
1.8919826745986938,
0.747193455696106,
0.19463318586349487,
-2.6597368717193604,
0.8146683573722839,
0.3228779435157776,
-0.09269264340400696,
0.7481582164764404,
0.2763844132423401,
1.0983092784881592,
-0.1892486959695816,
0.5561435222625732,
-2.41074800491333,
2.3270444869995117,
-0.21902602910995483,
0.7662459015846252,
0.02227034792304039,
-0.06595763564109802,
1.0613594055175781,
0.5787587761878967,
0.5062431693077087,
-1.0748944282531738,
0.7977844476699829,
-0.7281500697135925,
1.2754403352737427,
0.8763114809989929,
-0.854937732219696,
0.04486791044473648,
1.2411452531814575,
0.3426274359226227,
-0.5756658315658569,
-0.9975881576538086,
-0.9847527146339417,
1.0134716033935547,
1.7628206014633179,
0.039218392223119736,
0.06502125412225723,
0.8287689089775085,
0.8072249889373779,
-1.3232580423355103,
0.01166489627212286,
-0.7083001136779785,
-0.6953635811805725,
1.772005319595337,
2.089962959289551,
-0.11975216865539551,
-0.1324416995048523,
-0.7579405307769775,
-1.3819780349731445,
0.8416464924812317,
0.16288450360298157,
0.016947977244853973,
0.7965357303619385,
-0.6684508919715881,
1.2259907722473145,
0.9452380537986755,
0.8435664176940918,
0.3870279788970947,
0.026972558349370956,
0.1481161266565323,
-0.3097626864910126,
-1.1584851741790771,
-0.24472898244857788,
-0.9901733994483948,
-2.5797436237335205,
0.4053572714328766,
-0.18773417174816132,
-1.4291157722473145,
0.12503913044929504,
-0.9556392431259155,
0.7775734066963196,
-0.4873271882534027,
-1.2463322877883911,
-1.3804281949996948,
0.12723471224308014,
-0.07441363483667374,
0.7870929837226868,
-1.5547055006027222,
-0.059063754975795746,
1.1540082693099976,
1.0261783599853516,
-0.7106896638870239,
0.8784904479980469,
0.17561349272727966,
0.9688757061958313,
1.0534014701843262,
-0.4224875569343567,
0.4261196255683899,
0.17672480642795563,
-1.338664174079895,
0.3515184819698334,
1.2891677618026733,
0.10495911538600922,
1.445071816444397,
-0.4988887906074524,
-0.054914698004722595,
0.39561325311660767,
-0.31197869777679443,
-0.5294608473777771,
-0.8092567920684814,
0.6241718530654907,
-0.20493245124816895,
-0.8367142677307129,
0.008976518176496029,
0.18443670868873596,
-0.13933229446411133,
0.24106253683567047,
-1.5629909038543701,
-0.02609943598508835,
-0.3175744414329529,
-0.7735667824745178,
-1.2748082876205444,
-0.12493057548999786,
1.3471219539642334,
-0.8288480639457703,
-0.08987870067358017,
0.521308183670044,
0.10742899030447006,
0.5091138482093811,
0.6358329653739929,
-0.6730843782424927,
-0.328605979681015,
-0.0918496698141098,
-0.42624202370643616,
0.33076709508895874,
1.4266695976257324,
-0.0951518788933754,
-0.92562335729599,
0.5769296884536743,
-0.25389376282691956,
0.12366586923599243,
1.87005615234375,
0.02262657880783081,
-0.900930643081665,
0.280077189207077,
-0.737286388874054,
1.9051867723464966,
1.7341811656951904,
1.290481448173523,
-0.05802324786782265,
-1.0521081686019897,
0.6721521615982056,
-0.4266529977321625,
-0.4338867664337158,
0.931946873664856,
0.3214496076107025,
-0.27210497856140137,
-1.3789753913879395,
0.810175359249115,
1.238814115524292,
-0.7579094767570496,
-0.9030730724334717,
0.10487837344408035,
-0.8095136880874634,
1.1328186988830566,
0.695652425289154,
0.3338395655155182,
0.3207233250141144,
1.6268439292907715,
0.8225527405738831,
-0.5233973860740662,
0.6332905292510986,
0.48786500096321106,
-0.043110255151987076,
-2.044020414352417,
-1.1679375171661377,
0.28301921486854553,
-0.5118707418441772,
-1.5161471366882324,
1.4559326171875,
-1.2521787881851196,
-0.9246218204498291,
0.5932436585426331,
0.20267458260059357,
1.4280332326889038,
0.34611809253692627,
1.654421091079712,
1.987230658531189,
0.9216572642326355,
0.4793829023838043,
1.1393455266952515,
-0.27955520153045654,
-0.3386790454387665,
1.577959418296814,
-0.5377709865570068,
0.5953943729400635,
1.0575072765350342,
-0.3226827085018158,
-1.1800367832183838,
-0.8347452878952026,
-1.2675365209579468,
-0.8967568874359131,
1.055199384689331,
0.16609686613082886,
-1.1434502601623535,
0.36741694808006287,
1.5953359603881836,
-0.05011126026511192,
-0.1681135594844818,
0.7023260593414307,
0.3615250587463379,
-0.789970338344574,
-0.05017589032649994,
-0.9731913805007935,
0.6169321537017822,
-0.3695443570613861,
-0.43549203872680664,
0.31549739837646484,
0.5456836819648743,
1.2576971054077148,
0.1753544807434082,
0.07085059583187103,
1.322940707206726,
-1.44048011302948,
1.285327672958374,
-1.0572525262832642,
0.37757131457328796,
-2.288235664367676,
1.5464906692504883,
-0.9822853803634644,
1.9516865015029907,
-2.6920526027679443,
0.459729939699173,
-0.48434144258499146,
-0.54527747631073,
0.19356200098991394,
-0.18604089319705963,
0.11841018497943878,
-0.01601380482316017,
-1.1827057600021362,
-0.10915990173816681,
-0.852577269077301,
0.5305956602096558,
1.219461441040039,
1.3059837818145752,
-0.9816039800643921,
-0.4055444896221161,
-1.6533747911453247,
-0.15525312721729279,
-0.40233364701271057,
0.19748932123184204,
-1.83524751663208,
-0.21318762004375458,
-2.0078518390655518,
-2.4672622680664062,
-1.2897881269454956,
-0.9671762585639954,
1.2972501516342163,
0.02411355823278427,
-0.8294782042503357,
1.1636199951171875,
-0.48992055654525757,
-1.8709360361099243,
1.2682799100875854,
-2.1841259002685547
] |
https://github.com/huggingface/datasets/issues/4981 | Can't create a dataset with `float16` features | Yes, you are right: maybe we should either remove it from our docs or add a comment explaining the issue.
The thing is that in Arrow it is partially supported: you can create `float16` values, but you can't cast them from/to other types. And current implementation of `Value` always tries to perform a cast from `float64` to `float16`. | ## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
| 525 | 58 | Can't create a dataset with `float16` features
## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Yes, you are right: maybe we should either remove it from our docs or add a comment explaining the issue.
The thing is that in Arrow it is partially supported: you can create `float16` values, but you can't cast them from/to other types. And current implementation of `Value` always tries to perform a cast from `float64` to `float16`. | [
-1.2057141065597534,
-0.8102036714553833,
-0.6469262838363647,
1.4442282915115356,
-0.06382401287555695,
-1.3462415933609009,
0.1484007090330124,
-0.987706184387207,
1.736415982246399,
-0.9125480651855469,
0.4100821018218994,
-1.708981990814209,
0.15340952575206757,
-0.592488169670105,
-0.7626789212226868,
-0.6535719037055969,
-0.350750595331192,
-0.6627594232559204,
1.0949064493179321,
2.3952157497406006,
1.1264779567718506,
-1.3292369842529297,
2.738229274749756,
0.7167775630950928,
-0.25048598647117615,
-0.8322121500968933,
0.3310741186141968,
-0.018497265875339508,
-1.4933851957321167,
-0.22281292080879211,
-0.9738255143165588,
-0.082537442445755,
-0.6092232465744019,
-0.7065620422363281,
0.01456721406430006,
0.47681760787963867,
-0.2838103175163269,
-0.5111714601516724,
-0.30824750661849976,
-0.8153766989707947,
0.5825783014297485,
-0.2710755169391632,
0.8963314890861511,
-0.26543331146240234,
1.8305211067199707,
-0.5987824201583862,
0.5186917185783386,
0.5519042015075684,
1.2557138204574585,
0.27523285150527954,
-0.08149126917123795,
0.37679600715637207,
0.30449143052101135,
0.038640569895505905,
0.6001114845275879,
1.2094225883483887,
0.6394641399383545,
0.548046886920929,
0.8023760318756104,
-2.2527730464935303,
1.2925236225128174,
-0.9091762900352478,
0.2586028277873993,
1.3110747337341309,
-1.0671095848083496,
0.4480334520339966,
-1.820885419845581,
-0.1463935226202011,
0.35599035024642944,
-2.1790950298309326,
0.20643875002861023,
-1.3179492950439453,
-0.5175502300262451,
1.059051275253296,
0.3856297731399536,
-1.2109837532043457,
-0.05473187938332558,
-0.2701363265514374,
0.8937371373176575,
0.34297803044319153,
1.141288161277771,
-1.5683021545410156,
0.0358039066195488,
-0.3162389397621155,
0.33074885606765747,
-1.1871432065963745,
-1.5059150457382202,
0.5314602255821228,
0.6814435124397278,
0.5209627151489258,
-0.21233385801315308,
0.9958449602127075,
-1.0996259450912476,
0.753445029258728,
-0.9768149256706238,
-1.8402681350708008,
-1.3484992980957031,
-2.273820400238037,
-2.309849977493286,
0.7874873876571655,
-0.38892120122909546,
-0.457049697637558,
2.1458561420440674,
-1.1127265691757202,
-1.8099749088287354,
1.1121501922607422,
0.30530989170074463,
-0.16742391884326935,
2.3098092079162598,
0.16560010612010956,
-0.8644178509712219,
0.6879605650901794,
-0.8607204556465149,
0.6058557629585266,
-0.46095505356788635,
1.2703955173492432,
0.4019075930118561,
-1.0925438404083252,
1.603060245513916,
-0.34012073278427124,
0.5784502029418945,
-0.7823631763458252,
-0.3806343078613281,
-0.5661119818687439,
0.276191383600235,
1.922393560409546,
-0.18895886838436127,
1.4768688678741455,
-0.213051900267601,
-1.447535753250122,
-1.4453963041305542,
0.8043543100357056,
0.4478616714477539,
-0.7262121438980103,
0.21897153556346893,
-0.3415619432926178,
0.18356283009052277,
0.0651492029428482,
1.1236881017684937,
1.2890129089355469,
0.8241545557975769,
-0.134501650929451,
-0.856403112411499,
0.15430930256843567,
0.016446035355329514,
-0.5667880177497864,
-1.6778836250305176,
-0.2862052917480469,
0.16650938987731934,
0.5839102268218994,
-1.0973012447357178,
1.9115124940872192,
0.8817892074584961,
1.929749608039856,
1.0166898965835571,
-0.3114369809627533,
1.566706895828247,
0.1315307766199112,
1.931505560874939,
-0.195316344499588,
0.6677379608154297,
-0.48867523670196533,
-1.1955751180648804,
0.7006626129150391,
-0.23600822687149048,
-2.0200142860412598,
-0.38792070746421814,
-0.9404813647270203,
-0.1927850842475891,
-0.8753629326820374,
0.9992749691009521,
-0.1600966900587082,
-1.4400014877319336,
0.27852073311805725,
-0.6986398100852966,
0.13083909451961517,
-1.3503284454345703,
0.3553813099861145,
0.711776852607727,
-0.7274020314216614,
0.15170979499816895,
-0.3908635973930359,
-1.415213704109192,
-0.5845735669136047,
0.43895095586776733,
1.7823034524917603,
-0.8225282430648804,
1.0174930095672607,
1.034488320350647,
-0.6295213103294373,
-0.17214198410511017,
0.5164039134979248,
-0.38387131690979004,
0.9036407470703125,
-0.9919251203536987,
-0.42454472184181213,
1.1577404737472534,
-0.2491549402475357,
-0.48196882009506226,
1.3201836347579956,
0.6730047464370728,
-0.9231603145599365,
-0.1950697898864746,
-0.0984894335269928,
-0.8562514781951904,
0.027280252426862717,
-1.6041141748428345,
-0.0301269069314003,
0.38001102209091187,
-1.518783688545227,
-0.47651705145835876,
-0.019505873322486877,
1.193999171257019,
-0.042620666325092316,
1.3686373233795166,
-0.294154554605484,
-0.15942490100860596,
-0.5506359338760376,
-0.42841866612434387,
0.1143764778971672,
-0.11460472643375397,
-0.6569430828094482,
0.2823745310306549,
-0.6935862302780151,
0.2727968096733093,
1.3535659313201904,
0.24137724936008453,
0.08790840953588486,
0.5659053325653076,
1.2032358646392822,
0.35290661454200745,
-0.15582506358623505,
-0.8188050985336304,
-1.7209577560424805,
2.0148415565490723,
-1.5701956748962402,
2.007718563079834,
0.7479526400566101,
0.020224973559379578,
-1.7683296203613281,
-1.8973320722579956,
1.570533037185669,
1.1059414148330688,
2.504361867904663,
0.5614669322967529,
0.4072414040565491,
-0.8601976037025452,
-0.6163468956947327,
0.4339657425880432,
-0.8787835240364075,
-0.9233744740486145,
0.12064783275127411,
2.3708443641662598,
1.724045753479004,
-0.30686888098716736,
-0.19437843561172485,
-1.0217939615249634,
1.441123127937317,
-0.28756973147392273,
0.19946838915348053,
1.825415849685669,
-0.38852614164352417,
-1.012895107269287,
1.310981035232544,
-2.402956247329712,
0.23927822709083557,
1.965096354484558,
0.22310732305049896,
0.04683823883533478,
-1.1090056896209717,
-0.7000086903572083,
-0.09567409008741379,
-0.411144882440567,
-1.2494096755981445,
0.3339500427246094,
-0.16386404633522034,
-0.6730020046234131,
-1.415190577507019,
0.12319636344909668,
-1.1176018714904785,
-1.65180504322052,
0.2161594182252884,
1.812744140625,
2.0924594402313232,
-0.7257705330848694,
1.427860140800476,
-0.27295607328414917,
0.34444400668144226,
1.2928258180618286,
1.1683180332183838,
3.233684778213501,
1.88004732131958,
-1.2688663005828857,
0.6333036422729492,
-0.11180763691663742,
-0.5788268446922302,
1.2210906744003296,
-1.1307958364486694,
1.206499457359314,
-0.10344883054494858,
-1.2977745532989502,
-1.1770800352096558,
0.8394966125488281,
0.4561127722263336,
0.06150790676474571,
-0.4311230480670929,
0.9989525079727173,
0.19986914098262787,
1.3096530437469482,
0.5747573971748352,
-0.21298420429229736,
0.6219484806060791,
-0.31406161189079285,
-0.4517959654331207,
1.5350431203842163,
0.09987850487232208,
-1.3669288158416748,
-2.227903127670288,
-0.10960943251848221,
-0.9848096370697021,
0.0811619833111763,
-0.808560311794281,
-0.9689927697181702,
1.5610264539718628,
0.4757373631000519,
-1.001846432685852,
-0.0577225536108017,
-0.41146016120910645,
-0.6428425908088684,
2.6572108268737793,
-1.3920875787734985,
-0.37803229689598083,
-1.003403663635254,
-0.7360663414001465,
1.5718321800231934,
-1.1918275356292725,
-0.27320969104766846,
-1.027990698814392,
-0.47250816226005554,
-1.2713748216629028,
-0.5235684514045715,
0.0004901615902781487,
-0.821821391582489,
0.8180006742477417,
0.046886805444955826,
-1.3666220903396606,
-0.3373331129550934,
-1.1165155172348022,
0.770286500453949,
-0.261118084192276,
0.03650956228375435,
1.763425588607788,
0.3143196702003479,
-0.38205480575561523,
0.6910855174064636,
1.1821858882904053,
0.6172022819519043,
-0.5101861953735352,
0.4241578280925751,
-0.6328125596046448,
0.48431921005249023,
-1.2290594577789307,
0.37748226523399353,
-2.8927528858184814,
0.6523901224136353,
0.05680711939930916,
0.015918802469968796,
-0.12649211287498474,
-1.4632601737976074,
0.9285850524902344,
2.497884511947632,
-1.0259768962860107,
0.5268229246139526,
0.24032370746135712,
1.2881368398666382,
-1.6250909566879272,
0.08071019500494003,
-0.5907496809959412,
2.0828726291656494,
0.08439458906650543,
1.0573650598526,
-0.44295957684516907,
-2.441560745239258,
0.5673906207084656,
-1.2879747152328491,
-1.0711323022842407,
0.8230302929878235,
-0.813946545124054,
0.0724431648850441,
-1.1085387468338013,
-0.12882833182811737,
-0.8547903299331665,
-1.0325748920440674,
0.5946838855743408,
0.017538193613290787,
0.6415678858757019,
-0.7090683579444885,
0.29481974244117737,
-2.2778213024139404,
-1.3273545503616333,
-0.22253769636154175,
-0.891656756401062,
0.40725985169410706,
-0.3660268187522888,
0.7772086262702942,
-0.246986985206604,
-0.042720042169094086,
0.3035232722759247,
1.5349526405334473,
3.171482563018799,
0.10863368213176727,
0.4997352659702301,
-0.32284852862358093,
-1.0068498849868774,
1.5321717262268066,
0.89480060338974,
-0.25250861048698425,
-0.6065794825553894,
-1.0074725151062012,
1.2582927942276,
1.8341072797775269,
1.0702439546585083,
0.04677312448620796,
-0.8627488613128662,
-0.8102422952651978,
0.08480522781610489,
0.08250352740287781,
0.43628716468811035,
0.9817370176315308,
0.24469996988773346,
0.22664104402065277,
1.3576399087905884,
1.0627741813659668,
-0.4228273332118988,
0.43937262892723083,
-0.7727896571159363,
-0.47091227769851685,
0.5643646121025085,
0.4161296784877777,
-0.02678976207971573,
0.12066946923732758,
-1.0333678722381592,
-0.15647178888320923,
-0.2903876006603241,
-0.9082324504852295,
-0.782889187335968,
-0.4336078464984894,
-0.4211815297603607,
1.7894364595413208,
-0.051739051938056946,
-0.5941183567047119,
-0.11875678598880768,
-0.8947007656097412,
0.00029076915234327316,
-0.9612069129943848,
0.3008538782596588,
-0.14222493767738342,
-0.02247798815369606,
-0.07583066076040268,
1.68767511844635,
-0.9602358341217041,
-2.1238088607788086,
0.2213660627603531,
0.13205845654010773,
-0.31184881925582886,
-0.05469883605837822,
1.767344355583191,
0.5564374327659607,
1.454877495765686,
1.5945035219192505,
1.0522470474243164,
-0.6270792484283447,
-1.3803329467773438,
0.7530506253242493,
0.8754865527153015,
-1.328903079032898,
0.8620465993881226,
0.04267434775829315,
-0.5462637543678284,
0.44548851251602173,
1.2340409755706787,
0.47227492928504944,
-1.9922817945480347,
0.7673993110656738,
-1.1723637580871582,
0.8246990442276001,
0.8215599656105042,
0.7671186923980713,
0.08683699369430542,
0.8549911379814148,
-1.1869176626205444,
-1.0259758234024048,
-0.6206894516944885,
-0.642831563949585,
1.8916069269180298,
-0.2807987928390503,
0.4097071588039398,
-0.27569380402565,
-1.4696794748306274,
0.1296933889389038,
0.6726303696632385,
0.3085644543170929,
-0.46577906608581543,
0.6607900261878967,
-0.6844977736473083,
-1.0925155878067017,
-1.4136966466903687,
-0.5290629863739014,
-1.0943336486816406,
-0.8310781717300415,
0.9495599269866943,
0.7700260281562805,
0.36782801151275635,
1.8919826745986938,
0.747193455696106,
0.19463318586349487,
-2.6597368717193604,
0.8146683573722839,
0.3228779435157776,
-0.09269264340400696,
0.7481582164764404,
0.2763844132423401,
1.0983092784881592,
-0.1892486959695816,
0.5561435222625732,
-2.41074800491333,
2.3270444869995117,
-0.21902602910995483,
0.7662459015846252,
0.02227034792304039,
-0.06595763564109802,
1.0613594055175781,
0.5787587761878967,
0.5062431693077087,
-1.0748944282531738,
0.7977844476699829,
-0.7281500697135925,
1.2754403352737427,
0.8763114809989929,
-0.854937732219696,
0.04486791044473648,
1.2411452531814575,
0.3426274359226227,
-0.5756658315658569,
-0.9975881576538086,
-0.9847527146339417,
1.0134716033935547,
1.7628206014633179,
0.039218392223119736,
0.06502125412225723,
0.8287689089775085,
0.8072249889373779,
-1.3232580423355103,
0.01166489627212286,
-0.7083001136779785,
-0.6953635811805725,
1.772005319595337,
2.089962959289551,
-0.11975216865539551,
-0.1324416995048523,
-0.7579405307769775,
-1.3819780349731445,
0.8416464924812317,
0.16288450360298157,
0.016947977244853973,
0.7965357303619385,
-0.6684508919715881,
1.2259907722473145,
0.9452380537986755,
0.8435664176940918,
0.3870279788970947,
0.026972558349370956,
0.1481161266565323,
-0.3097626864910126,
-1.1584851741790771,
-0.24472898244857788,
-0.9901733994483948,
-2.5797436237335205,
0.4053572714328766,
-0.18773417174816132,
-1.4291157722473145,
0.12503913044929504,
-0.9556392431259155,
0.7775734066963196,
-0.4873271882534027,
-1.2463322877883911,
-1.3804281949996948,
0.12723471224308014,
-0.07441363483667374,
0.7870929837226868,
-1.5547055006027222,
-0.059063754975795746,
1.1540082693099976,
1.0261783599853516,
-0.7106896638870239,
0.8784904479980469,
0.17561349272727966,
0.9688757061958313,
1.0534014701843262,
-0.4224875569343567,
0.4261196255683899,
0.17672480642795563,
-1.338664174079895,
0.3515184819698334,
1.2891677618026733,
0.10495911538600922,
1.445071816444397,
-0.4988887906074524,
-0.054914698004722595,
0.39561325311660767,
-0.31197869777679443,
-0.5294608473777771,
-0.8092567920684814,
0.6241718530654907,
-0.20493245124816895,
-0.8367142677307129,
0.008976518176496029,
0.18443670868873596,
-0.13933229446411133,
0.24106253683567047,
-1.5629909038543701,
-0.02609943598508835,
-0.3175744414329529,
-0.7735667824745178,
-1.2748082876205444,
-0.12493057548999786,
1.3471219539642334,
-0.8288480639457703,
-0.08987870067358017,
0.521308183670044,
0.10742899030447006,
0.5091138482093811,
0.6358329653739929,
-0.6730843782424927,
-0.328605979681015,
-0.0918496698141098,
-0.42624202370643616,
0.33076709508895874,
1.4266695976257324,
-0.0951518788933754,
-0.92562335729599,
0.5769296884536743,
-0.25389376282691956,
0.12366586923599243,
1.87005615234375,
0.02262657880783081,
-0.900930643081665,
0.280077189207077,
-0.737286388874054,
1.9051867723464966,
1.7341811656951904,
1.290481448173523,
-0.05802324786782265,
-1.0521081686019897,
0.6721521615982056,
-0.4266529977321625,
-0.4338867664337158,
0.931946873664856,
0.3214496076107025,
-0.27210497856140137,
-1.3789753913879395,
0.810175359249115,
1.238814115524292,
-0.7579094767570496,
-0.9030730724334717,
0.10487837344408035,
-0.8095136880874634,
1.1328186988830566,
0.695652425289154,
0.3338395655155182,
0.3207233250141144,
1.6268439292907715,
0.8225527405738831,
-0.5233973860740662,
0.6332905292510986,
0.48786500096321106,
-0.043110255151987076,
-2.044020414352417,
-1.1679375171661377,
0.28301921486854553,
-0.5118707418441772,
-1.5161471366882324,
1.4559326171875,
-1.2521787881851196,
-0.9246218204498291,
0.5932436585426331,
0.20267458260059357,
1.4280332326889038,
0.34611809253692627,
1.654421091079712,
1.987230658531189,
0.9216572642326355,
0.4793829023838043,
1.1393455266952515,
-0.27955520153045654,
-0.3386790454387665,
1.577959418296814,
-0.5377709865570068,
0.5953943729400635,
1.0575072765350342,
-0.3226827085018158,
-1.1800367832183838,
-0.8347452878952026,
-1.2675365209579468,
-0.8967568874359131,
1.055199384689331,
0.16609686613082886,
-1.1434502601623535,
0.36741694808006287,
1.5953359603881836,
-0.05011126026511192,
-0.1681135594844818,
0.7023260593414307,
0.3615250587463379,
-0.789970338344574,
-0.05017589032649994,
-0.9731913805007935,
0.6169321537017822,
-0.3695443570613861,
-0.43549203872680664,
0.31549739837646484,
0.5456836819648743,
1.2576971054077148,
0.1753544807434082,
0.07085059583187103,
1.322940707206726,
-1.44048011302948,
1.285327672958374,
-1.0572525262832642,
0.37757131457328796,
-2.288235664367676,
1.5464906692504883,
-0.9822853803634644,
1.9516865015029907,
-2.6920526027679443,
0.459729939699173,
-0.48434144258499146,
-0.54527747631073,
0.19356200098991394,
-0.18604089319705963,
0.11841018497943878,
-0.01601380482316017,
-1.1827057600021362,
-0.10915990173816681,
-0.852577269077301,
0.5305956602096558,
1.219461441040039,
1.3059837818145752,
-0.9816039800643921,
-0.4055444896221161,
-1.6533747911453247,
-0.15525312721729279,
-0.40233364701271057,
0.19748932123184204,
-1.83524751663208,
-0.21318762004375458,
-2.0078518390655518,
-2.4672622680664062,
-1.2897881269454956,
-0.9671762585639954,
1.2972501516342163,
0.02411355823278427,
-0.8294782042503357,
1.1636199951171875,
-0.48992055654525757,
-1.8709360361099243,
1.2682799100875854,
-2.1841259002685547
] |
https://github.com/huggingface/datasets/issues/4981 | Can't create a dataset with `float16` features | Would you accept a PR to fix this? @lhoestq Do you have an idea of how hard it would be to fix? | ## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
| 525 | 22 | Can't create a dataset with `float16` features
## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Would you accept a PR to fix this? @lhoestq Do you have an idea of how hard it would be to fix? | [
-1.2057141065597534,
-0.8102036714553833,
-0.6469262838363647,
1.4442282915115356,
-0.06382401287555695,
-1.3462415933609009,
0.1484007090330124,
-0.987706184387207,
1.736415982246399,
-0.9125480651855469,
0.4100821018218994,
-1.708981990814209,
0.15340952575206757,
-0.592488169670105,
-0.7626789212226868,
-0.6535719037055969,
-0.350750595331192,
-0.6627594232559204,
1.0949064493179321,
2.3952157497406006,
1.1264779567718506,
-1.3292369842529297,
2.738229274749756,
0.7167775630950928,
-0.25048598647117615,
-0.8322121500968933,
0.3310741186141968,
-0.018497265875339508,
-1.4933851957321167,
-0.22281292080879211,
-0.9738255143165588,
-0.082537442445755,
-0.6092232465744019,
-0.7065620422363281,
0.01456721406430006,
0.47681760787963867,
-0.2838103175163269,
-0.5111714601516724,
-0.30824750661849976,
-0.8153766989707947,
0.5825783014297485,
-0.2710755169391632,
0.8963314890861511,
-0.26543331146240234,
1.8305211067199707,
-0.5987824201583862,
0.5186917185783386,
0.5519042015075684,
1.2557138204574585,
0.27523285150527954,
-0.08149126917123795,
0.37679600715637207,
0.30449143052101135,
0.038640569895505905,
0.6001114845275879,
1.2094225883483887,
0.6394641399383545,
0.548046886920929,
0.8023760318756104,
-2.2527730464935303,
1.2925236225128174,
-0.9091762900352478,
0.2586028277873993,
1.3110747337341309,
-1.0671095848083496,
0.4480334520339966,
-1.820885419845581,
-0.1463935226202011,
0.35599035024642944,
-2.1790950298309326,
0.20643875002861023,
-1.3179492950439453,
-0.5175502300262451,
1.059051275253296,
0.3856297731399536,
-1.2109837532043457,
-0.05473187938332558,
-0.2701363265514374,
0.8937371373176575,
0.34297803044319153,
1.141288161277771,
-1.5683021545410156,
0.0358039066195488,
-0.3162389397621155,
0.33074885606765747,
-1.1871432065963745,
-1.5059150457382202,
0.5314602255821228,
0.6814435124397278,
0.5209627151489258,
-0.21233385801315308,
0.9958449602127075,
-1.0996259450912476,
0.753445029258728,
-0.9768149256706238,
-1.8402681350708008,
-1.3484992980957031,
-2.273820400238037,
-2.309849977493286,
0.7874873876571655,
-0.38892120122909546,
-0.457049697637558,
2.1458561420440674,
-1.1127265691757202,
-1.8099749088287354,
1.1121501922607422,
0.30530989170074463,
-0.16742391884326935,
2.3098092079162598,
0.16560010612010956,
-0.8644178509712219,
0.6879605650901794,
-0.8607204556465149,
0.6058557629585266,
-0.46095505356788635,
1.2703955173492432,
0.4019075930118561,
-1.0925438404083252,
1.603060245513916,
-0.34012073278427124,
0.5784502029418945,
-0.7823631763458252,
-0.3806343078613281,
-0.5661119818687439,
0.276191383600235,
1.922393560409546,
-0.18895886838436127,
1.4768688678741455,
-0.213051900267601,
-1.447535753250122,
-1.4453963041305542,
0.8043543100357056,
0.4478616714477539,
-0.7262121438980103,
0.21897153556346893,
-0.3415619432926178,
0.18356283009052277,
0.0651492029428482,
1.1236881017684937,
1.2890129089355469,
0.8241545557975769,
-0.134501650929451,
-0.856403112411499,
0.15430930256843567,
0.016446035355329514,
-0.5667880177497864,
-1.6778836250305176,
-0.2862052917480469,
0.16650938987731934,
0.5839102268218994,
-1.0973012447357178,
1.9115124940872192,
0.8817892074584961,
1.929749608039856,
1.0166898965835571,
-0.3114369809627533,
1.566706895828247,
0.1315307766199112,
1.931505560874939,
-0.195316344499588,
0.6677379608154297,
-0.48867523670196533,
-1.1955751180648804,
0.7006626129150391,
-0.23600822687149048,
-2.0200142860412598,
-0.38792070746421814,
-0.9404813647270203,
-0.1927850842475891,
-0.8753629326820374,
0.9992749691009521,
-0.1600966900587082,
-1.4400014877319336,
0.27852073311805725,
-0.6986398100852966,
0.13083909451961517,
-1.3503284454345703,
0.3553813099861145,
0.711776852607727,
-0.7274020314216614,
0.15170979499816895,
-0.3908635973930359,
-1.415213704109192,
-0.5845735669136047,
0.43895095586776733,
1.7823034524917603,
-0.8225282430648804,
1.0174930095672607,
1.034488320350647,
-0.6295213103294373,
-0.17214198410511017,
0.5164039134979248,
-0.38387131690979004,
0.9036407470703125,
-0.9919251203536987,
-0.42454472184181213,
1.1577404737472534,
-0.2491549402475357,
-0.48196882009506226,
1.3201836347579956,
0.6730047464370728,
-0.9231603145599365,
-0.1950697898864746,
-0.0984894335269928,
-0.8562514781951904,
0.027280252426862717,
-1.6041141748428345,
-0.0301269069314003,
0.38001102209091187,
-1.518783688545227,
-0.47651705145835876,
-0.019505873322486877,
1.193999171257019,
-0.042620666325092316,
1.3686373233795166,
-0.294154554605484,
-0.15942490100860596,
-0.5506359338760376,
-0.42841866612434387,
0.1143764778971672,
-0.11460472643375397,
-0.6569430828094482,
0.2823745310306549,
-0.6935862302780151,
0.2727968096733093,
1.3535659313201904,
0.24137724936008453,
0.08790840953588486,
0.5659053325653076,
1.2032358646392822,
0.35290661454200745,
-0.15582506358623505,
-0.8188050985336304,
-1.7209577560424805,
2.0148415565490723,
-1.5701956748962402,
2.007718563079834,
0.7479526400566101,
0.020224973559379578,
-1.7683296203613281,
-1.8973320722579956,
1.570533037185669,
1.1059414148330688,
2.504361867904663,
0.5614669322967529,
0.4072414040565491,
-0.8601976037025452,
-0.6163468956947327,
0.4339657425880432,
-0.8787835240364075,
-0.9233744740486145,
0.12064783275127411,
2.3708443641662598,
1.724045753479004,
-0.30686888098716736,
-0.19437843561172485,
-1.0217939615249634,
1.441123127937317,
-0.28756973147392273,
0.19946838915348053,
1.825415849685669,
-0.38852614164352417,
-1.012895107269287,
1.310981035232544,
-2.402956247329712,
0.23927822709083557,
1.965096354484558,
0.22310732305049896,
0.04683823883533478,
-1.1090056896209717,
-0.7000086903572083,
-0.09567409008741379,
-0.411144882440567,
-1.2494096755981445,
0.3339500427246094,
-0.16386404633522034,
-0.6730020046234131,
-1.415190577507019,
0.12319636344909668,
-1.1176018714904785,
-1.65180504322052,
0.2161594182252884,
1.812744140625,
2.0924594402313232,
-0.7257705330848694,
1.427860140800476,
-0.27295607328414917,
0.34444400668144226,
1.2928258180618286,
1.1683180332183838,
3.233684778213501,
1.88004732131958,
-1.2688663005828857,
0.6333036422729492,
-0.11180763691663742,
-0.5788268446922302,
1.2210906744003296,
-1.1307958364486694,
1.206499457359314,
-0.10344883054494858,
-1.2977745532989502,
-1.1770800352096558,
0.8394966125488281,
0.4561127722263336,
0.06150790676474571,
-0.4311230480670929,
0.9989525079727173,
0.19986914098262787,
1.3096530437469482,
0.5747573971748352,
-0.21298420429229736,
0.6219484806060791,
-0.31406161189079285,
-0.4517959654331207,
1.5350431203842163,
0.09987850487232208,
-1.3669288158416748,
-2.227903127670288,
-0.10960943251848221,
-0.9848096370697021,
0.0811619833111763,
-0.808560311794281,
-0.9689927697181702,
1.5610264539718628,
0.4757373631000519,
-1.001846432685852,
-0.0577225536108017,
-0.41146016120910645,
-0.6428425908088684,
2.6572108268737793,
-1.3920875787734985,
-0.37803229689598083,
-1.003403663635254,
-0.7360663414001465,
1.5718321800231934,
-1.1918275356292725,
-0.27320969104766846,
-1.027990698814392,
-0.47250816226005554,
-1.2713748216629028,
-0.5235684514045715,
0.0004901615902781487,
-0.821821391582489,
0.8180006742477417,
0.046886805444955826,
-1.3666220903396606,
-0.3373331129550934,
-1.1165155172348022,
0.770286500453949,
-0.261118084192276,
0.03650956228375435,
1.763425588607788,
0.3143196702003479,
-0.38205480575561523,
0.6910855174064636,
1.1821858882904053,
0.6172022819519043,
-0.5101861953735352,
0.4241578280925751,
-0.6328125596046448,
0.48431921005249023,
-1.2290594577789307,
0.37748226523399353,
-2.8927528858184814,
0.6523901224136353,
0.05680711939930916,
0.015918802469968796,
-0.12649211287498474,
-1.4632601737976074,
0.9285850524902344,
2.497884511947632,
-1.0259768962860107,
0.5268229246139526,
0.24032370746135712,
1.2881368398666382,
-1.6250909566879272,
0.08071019500494003,
-0.5907496809959412,
2.0828726291656494,
0.08439458906650543,
1.0573650598526,
-0.44295957684516907,
-2.441560745239258,
0.5673906207084656,
-1.2879747152328491,
-1.0711323022842407,
0.8230302929878235,
-0.813946545124054,
0.0724431648850441,
-1.1085387468338013,
-0.12882833182811737,
-0.8547903299331665,
-1.0325748920440674,
0.5946838855743408,
0.017538193613290787,
0.6415678858757019,
-0.7090683579444885,
0.29481974244117737,
-2.2778213024139404,
-1.3273545503616333,
-0.22253769636154175,
-0.891656756401062,
0.40725985169410706,
-0.3660268187522888,
0.7772086262702942,
-0.246986985206604,
-0.042720042169094086,
0.3035232722759247,
1.5349526405334473,
3.171482563018799,
0.10863368213176727,
0.4997352659702301,
-0.32284852862358093,
-1.0068498849868774,
1.5321717262268066,
0.89480060338974,
-0.25250861048698425,
-0.6065794825553894,
-1.0074725151062012,
1.2582927942276,
1.8341072797775269,
1.0702439546585083,
0.04677312448620796,
-0.8627488613128662,
-0.8102422952651978,
0.08480522781610489,
0.08250352740287781,
0.43628716468811035,
0.9817370176315308,
0.24469996988773346,
0.22664104402065277,
1.3576399087905884,
1.0627741813659668,
-0.4228273332118988,
0.43937262892723083,
-0.7727896571159363,
-0.47091227769851685,
0.5643646121025085,
0.4161296784877777,
-0.02678976207971573,
0.12066946923732758,
-1.0333678722381592,
-0.15647178888320923,
-0.2903876006603241,
-0.9082324504852295,
-0.782889187335968,
-0.4336078464984894,
-0.4211815297603607,
1.7894364595413208,
-0.051739051938056946,
-0.5941183567047119,
-0.11875678598880768,
-0.8947007656097412,
0.00029076915234327316,
-0.9612069129943848,
0.3008538782596588,
-0.14222493767738342,
-0.02247798815369606,
-0.07583066076040268,
1.68767511844635,
-0.9602358341217041,
-2.1238088607788086,
0.2213660627603531,
0.13205845654010773,
-0.31184881925582886,
-0.05469883605837822,
1.767344355583191,
0.5564374327659607,
1.454877495765686,
1.5945035219192505,
1.0522470474243164,
-0.6270792484283447,
-1.3803329467773438,
0.7530506253242493,
0.8754865527153015,
-1.328903079032898,
0.8620465993881226,
0.04267434775829315,
-0.5462637543678284,
0.44548851251602173,
1.2340409755706787,
0.47227492928504944,
-1.9922817945480347,
0.7673993110656738,
-1.1723637580871582,
0.8246990442276001,
0.8215599656105042,
0.7671186923980713,
0.08683699369430542,
0.8549911379814148,
-1.1869176626205444,
-1.0259758234024048,
-0.6206894516944885,
-0.642831563949585,
1.8916069269180298,
-0.2807987928390503,
0.4097071588039398,
-0.27569380402565,
-1.4696794748306274,
0.1296933889389038,
0.6726303696632385,
0.3085644543170929,
-0.46577906608581543,
0.6607900261878967,
-0.6844977736473083,
-1.0925155878067017,
-1.4136966466903687,
-0.5290629863739014,
-1.0943336486816406,
-0.8310781717300415,
0.9495599269866943,
0.7700260281562805,
0.36782801151275635,
1.8919826745986938,
0.747193455696106,
0.19463318586349487,
-2.6597368717193604,
0.8146683573722839,
0.3228779435157776,
-0.09269264340400696,
0.7481582164764404,
0.2763844132423401,
1.0983092784881592,
-0.1892486959695816,
0.5561435222625732,
-2.41074800491333,
2.3270444869995117,
-0.21902602910995483,
0.7662459015846252,
0.02227034792304039,
-0.06595763564109802,
1.0613594055175781,
0.5787587761878967,
0.5062431693077087,
-1.0748944282531738,
0.7977844476699829,
-0.7281500697135925,
1.2754403352737427,
0.8763114809989929,
-0.854937732219696,
0.04486791044473648,
1.2411452531814575,
0.3426274359226227,
-0.5756658315658569,
-0.9975881576538086,
-0.9847527146339417,
1.0134716033935547,
1.7628206014633179,
0.039218392223119736,
0.06502125412225723,
0.8287689089775085,
0.8072249889373779,
-1.3232580423355103,
0.01166489627212286,
-0.7083001136779785,
-0.6953635811805725,
1.772005319595337,
2.089962959289551,
-0.11975216865539551,
-0.1324416995048523,
-0.7579405307769775,
-1.3819780349731445,
0.8416464924812317,
0.16288450360298157,
0.016947977244853973,
0.7965357303619385,
-0.6684508919715881,
1.2259907722473145,
0.9452380537986755,
0.8435664176940918,
0.3870279788970947,
0.026972558349370956,
0.1481161266565323,
-0.3097626864910126,
-1.1584851741790771,
-0.24472898244857788,
-0.9901733994483948,
-2.5797436237335205,
0.4053572714328766,
-0.18773417174816132,
-1.4291157722473145,
0.12503913044929504,
-0.9556392431259155,
0.7775734066963196,
-0.4873271882534027,
-1.2463322877883911,
-1.3804281949996948,
0.12723471224308014,
-0.07441363483667374,
0.7870929837226868,
-1.5547055006027222,
-0.059063754975795746,
1.1540082693099976,
1.0261783599853516,
-0.7106896638870239,
0.8784904479980469,
0.17561349272727966,
0.9688757061958313,
1.0534014701843262,
-0.4224875569343567,
0.4261196255683899,
0.17672480642795563,
-1.338664174079895,
0.3515184819698334,
1.2891677618026733,
0.10495911538600922,
1.445071816444397,
-0.4988887906074524,
-0.054914698004722595,
0.39561325311660767,
-0.31197869777679443,
-0.5294608473777771,
-0.8092567920684814,
0.6241718530654907,
-0.20493245124816895,
-0.8367142677307129,
0.008976518176496029,
0.18443670868873596,
-0.13933229446411133,
0.24106253683567047,
-1.5629909038543701,
-0.02609943598508835,
-0.3175744414329529,
-0.7735667824745178,
-1.2748082876205444,
-0.12493057548999786,
1.3471219539642334,
-0.8288480639457703,
-0.08987870067358017,
0.521308183670044,
0.10742899030447006,
0.5091138482093811,
0.6358329653739929,
-0.6730843782424927,
-0.328605979681015,
-0.0918496698141098,
-0.42624202370643616,
0.33076709508895874,
1.4266695976257324,
-0.0951518788933754,
-0.92562335729599,
0.5769296884536743,
-0.25389376282691956,
0.12366586923599243,
1.87005615234375,
0.02262657880783081,
-0.900930643081665,
0.280077189207077,
-0.737286388874054,
1.9051867723464966,
1.7341811656951904,
1.290481448173523,
-0.05802324786782265,
-1.0521081686019897,
0.6721521615982056,
-0.4266529977321625,
-0.4338867664337158,
0.931946873664856,
0.3214496076107025,
-0.27210497856140137,
-1.3789753913879395,
0.810175359249115,
1.238814115524292,
-0.7579094767570496,
-0.9030730724334717,
0.10487837344408035,
-0.8095136880874634,
1.1328186988830566,
0.695652425289154,
0.3338395655155182,
0.3207233250141144,
1.6268439292907715,
0.8225527405738831,
-0.5233973860740662,
0.6332905292510986,
0.48786500096321106,
-0.043110255151987076,
-2.044020414352417,
-1.1679375171661377,
0.28301921486854553,
-0.5118707418441772,
-1.5161471366882324,
1.4559326171875,
-1.2521787881851196,
-0.9246218204498291,
0.5932436585426331,
0.20267458260059357,
1.4280332326889038,
0.34611809253692627,
1.654421091079712,
1.987230658531189,
0.9216572642326355,
0.4793829023838043,
1.1393455266952515,
-0.27955520153045654,
-0.3386790454387665,
1.577959418296814,
-0.5377709865570068,
0.5953943729400635,
1.0575072765350342,
-0.3226827085018158,
-1.1800367832183838,
-0.8347452878952026,
-1.2675365209579468,
-0.8967568874359131,
1.055199384689331,
0.16609686613082886,
-1.1434502601623535,
0.36741694808006287,
1.5953359603881836,
-0.05011126026511192,
-0.1681135594844818,
0.7023260593414307,
0.3615250587463379,
-0.789970338344574,
-0.05017589032649994,
-0.9731913805007935,
0.6169321537017822,
-0.3695443570613861,
-0.43549203872680664,
0.31549739837646484,
0.5456836819648743,
1.2576971054077148,
0.1753544807434082,
0.07085059583187103,
1.322940707206726,
-1.44048011302948,
1.285327672958374,
-1.0572525262832642,
0.37757131457328796,
-2.288235664367676,
1.5464906692504883,
-0.9822853803634644,
1.9516865015029907,
-2.6920526027679443,
0.459729939699173,
-0.48434144258499146,
-0.54527747631073,
0.19356200098991394,
-0.18604089319705963,
0.11841018497943878,
-0.01601380482316017,
-1.1827057600021362,
-0.10915990173816681,
-0.852577269077301,
0.5305956602096558,
1.219461441040039,
1.3059837818145752,
-0.9816039800643921,
-0.4055444896221161,
-1.6533747911453247,
-0.15525312721729279,
-0.40233364701271057,
0.19748932123184204,
-1.83524751663208,
-0.21318762004375458,
-2.0078518390655518,
-2.4672622680664062,
-1.2897881269454956,
-0.9671762585639954,
1.2972501516342163,
0.02411355823278427,
-0.8294782042503357,
1.1636199951171875,
-0.48992055654525757,
-1.8709360361099243,
1.2682799100875854,
-2.1841259002685547
] |
https://github.com/huggingface/datasets/issues/4981 | Can't create a dataset with `float16` features | I think the issue comes mostly from pyarrow not supporting `float16` completely.
For example you stil can't cast from/to `float16`
```python
import numpy as np
import pyarrow as pa
pa.array(range(5)).cast(pa.float16())
# ArrowNotImplementedError: Unsupported cast from int64 to halffloat using function cast_half_float
pa.array(range(5), pa.float32()).cast(pa.float16())
# ArrowNotImplementedError: Unsupported cast from float to halffloat using function cast_half_float
pa.array(range(5), pa.float16())
# ArrowTypeError: Expected np.float16 instance
pa.array(np.arange(5, dtype=np.float16())).cast(pa.float32())
# ArrowNotImplementedError: Unsupported cast from halffloat to float using function cast_float
``` | ## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
| 525 | 75 | Can't create a dataset with `float16` features
## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
I think the issue comes mostly from pyarrow not supporting `float16` completely.
For example you stil can't cast from/to `float16`
```python
import numpy as np
import pyarrow as pa
pa.array(range(5)).cast(pa.float16())
# ArrowNotImplementedError: Unsupported cast from int64 to halffloat using function cast_half_float
pa.array(range(5), pa.float32()).cast(pa.float16())
# ArrowNotImplementedError: Unsupported cast from float to halffloat using function cast_half_float
pa.array(range(5), pa.float16())
# ArrowTypeError: Expected np.float16 instance
pa.array(np.arange(5, dtype=np.float16())).cast(pa.float32())
# ArrowNotImplementedError: Unsupported cast from halffloat to float using function cast_float
``` | [
-1.2057141065597534,
-0.8102036714553833,
-0.6469262838363647,
1.4442282915115356,
-0.06382401287555695,
-1.3462415933609009,
0.1484007090330124,
-0.987706184387207,
1.736415982246399,
-0.9125480651855469,
0.4100821018218994,
-1.708981990814209,
0.15340952575206757,
-0.592488169670105,
-0.7626789212226868,
-0.6535719037055969,
-0.350750595331192,
-0.6627594232559204,
1.0949064493179321,
2.3952157497406006,
1.1264779567718506,
-1.3292369842529297,
2.738229274749756,
0.7167775630950928,
-0.25048598647117615,
-0.8322121500968933,
0.3310741186141968,
-0.018497265875339508,
-1.4933851957321167,
-0.22281292080879211,
-0.9738255143165588,
-0.082537442445755,
-0.6092232465744019,
-0.7065620422363281,
0.01456721406430006,
0.47681760787963867,
-0.2838103175163269,
-0.5111714601516724,
-0.30824750661849976,
-0.8153766989707947,
0.5825783014297485,
-0.2710755169391632,
0.8963314890861511,
-0.26543331146240234,
1.8305211067199707,
-0.5987824201583862,
0.5186917185783386,
0.5519042015075684,
1.2557138204574585,
0.27523285150527954,
-0.08149126917123795,
0.37679600715637207,
0.30449143052101135,
0.038640569895505905,
0.6001114845275879,
1.2094225883483887,
0.6394641399383545,
0.548046886920929,
0.8023760318756104,
-2.2527730464935303,
1.2925236225128174,
-0.9091762900352478,
0.2586028277873993,
1.3110747337341309,
-1.0671095848083496,
0.4480334520339966,
-1.820885419845581,
-0.1463935226202011,
0.35599035024642944,
-2.1790950298309326,
0.20643875002861023,
-1.3179492950439453,
-0.5175502300262451,
1.059051275253296,
0.3856297731399536,
-1.2109837532043457,
-0.05473187938332558,
-0.2701363265514374,
0.8937371373176575,
0.34297803044319153,
1.141288161277771,
-1.5683021545410156,
0.0358039066195488,
-0.3162389397621155,
0.33074885606765747,
-1.1871432065963745,
-1.5059150457382202,
0.5314602255821228,
0.6814435124397278,
0.5209627151489258,
-0.21233385801315308,
0.9958449602127075,
-1.0996259450912476,
0.753445029258728,
-0.9768149256706238,
-1.8402681350708008,
-1.3484992980957031,
-2.273820400238037,
-2.309849977493286,
0.7874873876571655,
-0.38892120122909546,
-0.457049697637558,
2.1458561420440674,
-1.1127265691757202,
-1.8099749088287354,
1.1121501922607422,
0.30530989170074463,
-0.16742391884326935,
2.3098092079162598,
0.16560010612010956,
-0.8644178509712219,
0.6879605650901794,
-0.8607204556465149,
0.6058557629585266,
-0.46095505356788635,
1.2703955173492432,
0.4019075930118561,
-1.0925438404083252,
1.603060245513916,
-0.34012073278427124,
0.5784502029418945,
-0.7823631763458252,
-0.3806343078613281,
-0.5661119818687439,
0.276191383600235,
1.922393560409546,
-0.18895886838436127,
1.4768688678741455,
-0.213051900267601,
-1.447535753250122,
-1.4453963041305542,
0.8043543100357056,
0.4478616714477539,
-0.7262121438980103,
0.21897153556346893,
-0.3415619432926178,
0.18356283009052277,
0.0651492029428482,
1.1236881017684937,
1.2890129089355469,
0.8241545557975769,
-0.134501650929451,
-0.856403112411499,
0.15430930256843567,
0.016446035355329514,
-0.5667880177497864,
-1.6778836250305176,
-0.2862052917480469,
0.16650938987731934,
0.5839102268218994,
-1.0973012447357178,
1.9115124940872192,
0.8817892074584961,
1.929749608039856,
1.0166898965835571,
-0.3114369809627533,
1.566706895828247,
0.1315307766199112,
1.931505560874939,
-0.195316344499588,
0.6677379608154297,
-0.48867523670196533,
-1.1955751180648804,
0.7006626129150391,
-0.23600822687149048,
-2.0200142860412598,
-0.38792070746421814,
-0.9404813647270203,
-0.1927850842475891,
-0.8753629326820374,
0.9992749691009521,
-0.1600966900587082,
-1.4400014877319336,
0.27852073311805725,
-0.6986398100852966,
0.13083909451961517,
-1.3503284454345703,
0.3553813099861145,
0.711776852607727,
-0.7274020314216614,
0.15170979499816895,
-0.3908635973930359,
-1.415213704109192,
-0.5845735669136047,
0.43895095586776733,
1.7823034524917603,
-0.8225282430648804,
1.0174930095672607,
1.034488320350647,
-0.6295213103294373,
-0.17214198410511017,
0.5164039134979248,
-0.38387131690979004,
0.9036407470703125,
-0.9919251203536987,
-0.42454472184181213,
1.1577404737472534,
-0.2491549402475357,
-0.48196882009506226,
1.3201836347579956,
0.6730047464370728,
-0.9231603145599365,
-0.1950697898864746,
-0.0984894335269928,
-0.8562514781951904,
0.027280252426862717,
-1.6041141748428345,
-0.0301269069314003,
0.38001102209091187,
-1.518783688545227,
-0.47651705145835876,
-0.019505873322486877,
1.193999171257019,
-0.042620666325092316,
1.3686373233795166,
-0.294154554605484,
-0.15942490100860596,
-0.5506359338760376,
-0.42841866612434387,
0.1143764778971672,
-0.11460472643375397,
-0.6569430828094482,
0.2823745310306549,
-0.6935862302780151,
0.2727968096733093,
1.3535659313201904,
0.24137724936008453,
0.08790840953588486,
0.5659053325653076,
1.2032358646392822,
0.35290661454200745,
-0.15582506358623505,
-0.8188050985336304,
-1.7209577560424805,
2.0148415565490723,
-1.5701956748962402,
2.007718563079834,
0.7479526400566101,
0.020224973559379578,
-1.7683296203613281,
-1.8973320722579956,
1.570533037185669,
1.1059414148330688,
2.504361867904663,
0.5614669322967529,
0.4072414040565491,
-0.8601976037025452,
-0.6163468956947327,
0.4339657425880432,
-0.8787835240364075,
-0.9233744740486145,
0.12064783275127411,
2.3708443641662598,
1.724045753479004,
-0.30686888098716736,
-0.19437843561172485,
-1.0217939615249634,
1.441123127937317,
-0.28756973147392273,
0.19946838915348053,
1.825415849685669,
-0.38852614164352417,
-1.012895107269287,
1.310981035232544,
-2.402956247329712,
0.23927822709083557,
1.965096354484558,
0.22310732305049896,
0.04683823883533478,
-1.1090056896209717,
-0.7000086903572083,
-0.09567409008741379,
-0.411144882440567,
-1.2494096755981445,
0.3339500427246094,
-0.16386404633522034,
-0.6730020046234131,
-1.415190577507019,
0.12319636344909668,
-1.1176018714904785,
-1.65180504322052,
0.2161594182252884,
1.812744140625,
2.0924594402313232,
-0.7257705330848694,
1.427860140800476,
-0.27295607328414917,
0.34444400668144226,
1.2928258180618286,
1.1683180332183838,
3.233684778213501,
1.88004732131958,
-1.2688663005828857,
0.6333036422729492,
-0.11180763691663742,
-0.5788268446922302,
1.2210906744003296,
-1.1307958364486694,
1.206499457359314,
-0.10344883054494858,
-1.2977745532989502,
-1.1770800352096558,
0.8394966125488281,
0.4561127722263336,
0.06150790676474571,
-0.4311230480670929,
0.9989525079727173,
0.19986914098262787,
1.3096530437469482,
0.5747573971748352,
-0.21298420429229736,
0.6219484806060791,
-0.31406161189079285,
-0.4517959654331207,
1.5350431203842163,
0.09987850487232208,
-1.3669288158416748,
-2.227903127670288,
-0.10960943251848221,
-0.9848096370697021,
0.0811619833111763,
-0.808560311794281,
-0.9689927697181702,
1.5610264539718628,
0.4757373631000519,
-1.001846432685852,
-0.0577225536108017,
-0.41146016120910645,
-0.6428425908088684,
2.6572108268737793,
-1.3920875787734985,
-0.37803229689598083,
-1.003403663635254,
-0.7360663414001465,
1.5718321800231934,
-1.1918275356292725,
-0.27320969104766846,
-1.027990698814392,
-0.47250816226005554,
-1.2713748216629028,
-0.5235684514045715,
0.0004901615902781487,
-0.821821391582489,
0.8180006742477417,
0.046886805444955826,
-1.3666220903396606,
-0.3373331129550934,
-1.1165155172348022,
0.770286500453949,
-0.261118084192276,
0.03650956228375435,
1.763425588607788,
0.3143196702003479,
-0.38205480575561523,
0.6910855174064636,
1.1821858882904053,
0.6172022819519043,
-0.5101861953735352,
0.4241578280925751,
-0.6328125596046448,
0.48431921005249023,
-1.2290594577789307,
0.37748226523399353,
-2.8927528858184814,
0.6523901224136353,
0.05680711939930916,
0.015918802469968796,
-0.12649211287498474,
-1.4632601737976074,
0.9285850524902344,
2.497884511947632,
-1.0259768962860107,
0.5268229246139526,
0.24032370746135712,
1.2881368398666382,
-1.6250909566879272,
0.08071019500494003,
-0.5907496809959412,
2.0828726291656494,
0.08439458906650543,
1.0573650598526,
-0.44295957684516907,
-2.441560745239258,
0.5673906207084656,
-1.2879747152328491,
-1.0711323022842407,
0.8230302929878235,
-0.813946545124054,
0.0724431648850441,
-1.1085387468338013,
-0.12882833182811737,
-0.8547903299331665,
-1.0325748920440674,
0.5946838855743408,
0.017538193613290787,
0.6415678858757019,
-0.7090683579444885,
0.29481974244117737,
-2.2778213024139404,
-1.3273545503616333,
-0.22253769636154175,
-0.891656756401062,
0.40725985169410706,
-0.3660268187522888,
0.7772086262702942,
-0.246986985206604,
-0.042720042169094086,
0.3035232722759247,
1.5349526405334473,
3.171482563018799,
0.10863368213176727,
0.4997352659702301,
-0.32284852862358093,
-1.0068498849868774,
1.5321717262268066,
0.89480060338974,
-0.25250861048698425,
-0.6065794825553894,
-1.0074725151062012,
1.2582927942276,
1.8341072797775269,
1.0702439546585083,
0.04677312448620796,
-0.8627488613128662,
-0.8102422952651978,
0.08480522781610489,
0.08250352740287781,
0.43628716468811035,
0.9817370176315308,
0.24469996988773346,
0.22664104402065277,
1.3576399087905884,
1.0627741813659668,
-0.4228273332118988,
0.43937262892723083,
-0.7727896571159363,
-0.47091227769851685,
0.5643646121025085,
0.4161296784877777,
-0.02678976207971573,
0.12066946923732758,
-1.0333678722381592,
-0.15647178888320923,
-0.2903876006603241,
-0.9082324504852295,
-0.782889187335968,
-0.4336078464984894,
-0.4211815297603607,
1.7894364595413208,
-0.051739051938056946,
-0.5941183567047119,
-0.11875678598880768,
-0.8947007656097412,
0.00029076915234327316,
-0.9612069129943848,
0.3008538782596588,
-0.14222493767738342,
-0.02247798815369606,
-0.07583066076040268,
1.68767511844635,
-0.9602358341217041,
-2.1238088607788086,
0.2213660627603531,
0.13205845654010773,
-0.31184881925582886,
-0.05469883605837822,
1.767344355583191,
0.5564374327659607,
1.454877495765686,
1.5945035219192505,
1.0522470474243164,
-0.6270792484283447,
-1.3803329467773438,
0.7530506253242493,
0.8754865527153015,
-1.328903079032898,
0.8620465993881226,
0.04267434775829315,
-0.5462637543678284,
0.44548851251602173,
1.2340409755706787,
0.47227492928504944,
-1.9922817945480347,
0.7673993110656738,
-1.1723637580871582,
0.8246990442276001,
0.8215599656105042,
0.7671186923980713,
0.08683699369430542,
0.8549911379814148,
-1.1869176626205444,
-1.0259758234024048,
-0.6206894516944885,
-0.642831563949585,
1.8916069269180298,
-0.2807987928390503,
0.4097071588039398,
-0.27569380402565,
-1.4696794748306274,
0.1296933889389038,
0.6726303696632385,
0.3085644543170929,
-0.46577906608581543,
0.6607900261878967,
-0.6844977736473083,
-1.0925155878067017,
-1.4136966466903687,
-0.5290629863739014,
-1.0943336486816406,
-0.8310781717300415,
0.9495599269866943,
0.7700260281562805,
0.36782801151275635,
1.8919826745986938,
0.747193455696106,
0.19463318586349487,
-2.6597368717193604,
0.8146683573722839,
0.3228779435157776,
-0.09269264340400696,
0.7481582164764404,
0.2763844132423401,
1.0983092784881592,
-0.1892486959695816,
0.5561435222625732,
-2.41074800491333,
2.3270444869995117,
-0.21902602910995483,
0.7662459015846252,
0.02227034792304039,
-0.06595763564109802,
1.0613594055175781,
0.5787587761878967,
0.5062431693077087,
-1.0748944282531738,
0.7977844476699829,
-0.7281500697135925,
1.2754403352737427,
0.8763114809989929,
-0.854937732219696,
0.04486791044473648,
1.2411452531814575,
0.3426274359226227,
-0.5756658315658569,
-0.9975881576538086,
-0.9847527146339417,
1.0134716033935547,
1.7628206014633179,
0.039218392223119736,
0.06502125412225723,
0.8287689089775085,
0.8072249889373779,
-1.3232580423355103,
0.01166489627212286,
-0.7083001136779785,
-0.6953635811805725,
1.772005319595337,
2.089962959289551,
-0.11975216865539551,
-0.1324416995048523,
-0.7579405307769775,
-1.3819780349731445,
0.8416464924812317,
0.16288450360298157,
0.016947977244853973,
0.7965357303619385,
-0.6684508919715881,
1.2259907722473145,
0.9452380537986755,
0.8435664176940918,
0.3870279788970947,
0.026972558349370956,
0.1481161266565323,
-0.3097626864910126,
-1.1584851741790771,
-0.24472898244857788,
-0.9901733994483948,
-2.5797436237335205,
0.4053572714328766,
-0.18773417174816132,
-1.4291157722473145,
0.12503913044929504,
-0.9556392431259155,
0.7775734066963196,
-0.4873271882534027,
-1.2463322877883911,
-1.3804281949996948,
0.12723471224308014,
-0.07441363483667374,
0.7870929837226868,
-1.5547055006027222,
-0.059063754975795746,
1.1540082693099976,
1.0261783599853516,
-0.7106896638870239,
0.8784904479980469,
0.17561349272727966,
0.9688757061958313,
1.0534014701843262,
-0.4224875569343567,
0.4261196255683899,
0.17672480642795563,
-1.338664174079895,
0.3515184819698334,
1.2891677618026733,
0.10495911538600922,
1.445071816444397,
-0.4988887906074524,
-0.054914698004722595,
0.39561325311660767,
-0.31197869777679443,
-0.5294608473777771,
-0.8092567920684814,
0.6241718530654907,
-0.20493245124816895,
-0.8367142677307129,
0.008976518176496029,
0.18443670868873596,
-0.13933229446411133,
0.24106253683567047,
-1.5629909038543701,
-0.02609943598508835,
-0.3175744414329529,
-0.7735667824745178,
-1.2748082876205444,
-0.12493057548999786,
1.3471219539642334,
-0.8288480639457703,
-0.08987870067358017,
0.521308183670044,
0.10742899030447006,
0.5091138482093811,
0.6358329653739929,
-0.6730843782424927,
-0.328605979681015,
-0.0918496698141098,
-0.42624202370643616,
0.33076709508895874,
1.4266695976257324,
-0.0951518788933754,
-0.92562335729599,
0.5769296884536743,
-0.25389376282691956,
0.12366586923599243,
1.87005615234375,
0.02262657880783081,
-0.900930643081665,
0.280077189207077,
-0.737286388874054,
1.9051867723464966,
1.7341811656951904,
1.290481448173523,
-0.05802324786782265,
-1.0521081686019897,
0.6721521615982056,
-0.4266529977321625,
-0.4338867664337158,
0.931946873664856,
0.3214496076107025,
-0.27210497856140137,
-1.3789753913879395,
0.810175359249115,
1.238814115524292,
-0.7579094767570496,
-0.9030730724334717,
0.10487837344408035,
-0.8095136880874634,
1.1328186988830566,
0.695652425289154,
0.3338395655155182,
0.3207233250141144,
1.6268439292907715,
0.8225527405738831,
-0.5233973860740662,
0.6332905292510986,
0.48786500096321106,
-0.043110255151987076,
-2.044020414352417,
-1.1679375171661377,
0.28301921486854553,
-0.5118707418441772,
-1.5161471366882324,
1.4559326171875,
-1.2521787881851196,
-0.9246218204498291,
0.5932436585426331,
0.20267458260059357,
1.4280332326889038,
0.34611809253692627,
1.654421091079712,
1.987230658531189,
0.9216572642326355,
0.4793829023838043,
1.1393455266952515,
-0.27955520153045654,
-0.3386790454387665,
1.577959418296814,
-0.5377709865570068,
0.5953943729400635,
1.0575072765350342,
-0.3226827085018158,
-1.1800367832183838,
-0.8347452878952026,
-1.2675365209579468,
-0.8967568874359131,
1.055199384689331,
0.16609686613082886,
-1.1434502601623535,
0.36741694808006287,
1.5953359603881836,
-0.05011126026511192,
-0.1681135594844818,
0.7023260593414307,
0.3615250587463379,
-0.789970338344574,
-0.05017589032649994,
-0.9731913805007935,
0.6169321537017822,
-0.3695443570613861,
-0.43549203872680664,
0.31549739837646484,
0.5456836819648743,
1.2576971054077148,
0.1753544807434082,
0.07085059583187103,
1.322940707206726,
-1.44048011302948,
1.285327672958374,
-1.0572525262832642,
0.37757131457328796,
-2.288235664367676,
1.5464906692504883,
-0.9822853803634644,
1.9516865015029907,
-2.6920526027679443,
0.459729939699173,
-0.48434144258499146,
-0.54527747631073,
0.19356200098991394,
-0.18604089319705963,
0.11841018497943878,
-0.01601380482316017,
-1.1827057600021362,
-0.10915990173816681,
-0.852577269077301,
0.5305956602096558,
1.219461441040039,
1.3059837818145752,
-0.9816039800643921,
-0.4055444896221161,
-1.6533747911453247,
-0.15525312721729279,
-0.40233364701271057,
0.19748932123184204,
-1.83524751663208,
-0.21318762004375458,
-2.0078518390655518,
-2.4672622680664062,
-1.2897881269454956,
-0.9671762585639954,
1.2972501516342163,
0.02411355823278427,
-0.8294782042503357,
1.1636199951171875,
-0.48992055654525757,
-1.8709360361099243,
1.2682799100875854,
-2.1841259002685547
] |
https://github.com/huggingface/datasets/issues/4981 | Can't create a dataset with `float16` features | Hmm it seems like we can either:
1. try to fix pyarrow upstream
2. half-support float16 with some workaround to make sure we don't ever do casting internally
| ## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
| 525 | 28 | Can't create a dataset with `float16` features
## Describe the bug
I can't create a dataset with `float16` features.
I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error.
The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases?
Thanks!
## Steps to reproduce the bug
All of the following raise the following error with the same exact (as far as I can tell) traceback:
```python
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
```python
from datasets import Dataset, Features, Value
Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16")))
import numpy as np
Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16")))
import torch
Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16")))
```
## Expected results
A dataset with `float16` features is successfully created.
## Actual results
```python
---------------------------------------------------------------------------
ArrowNotImplementedError Traceback (most recent call last)
Cell In [14], line 1
----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16")))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split)
865 mapping = features.encode_batch(mapping)
866 mapping = {
867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col)
868 for col, data in mapping.items()
869 }
--> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping)
871 if info.features is None:
872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()})
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs)
734 @classmethod
735 def from_pydict(cls, *args, **kwargs):
736 """
737 Construct a Table from Arrow arrays or columns
738
(...)
748 :class:`datasets.table.Table`:
749 """
--> 750 return cls(pa.Table.from_pydict(*args, **kwargs))
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type)
192 # otherwise we can finally use the user's type
193 elif type is not None:
194 # We use cast_array_to_feature to support casting to custom types like Audio and Image
195 # Also, when trying type "string", we don't want to convert integers or floats to "string".
196 # We only do it if trying_type is False - since this is what the user asks for.
--> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type)
198 return out
199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str)
1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str)
1852 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs)
1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
1682 else:
-> 1683 return func(array, *args, **kwargs)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str)
1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):
1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}")
-> 1762 return array.cast(pa_type)
1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}")
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options)
387 else:
388 options = CastOptions.safe(target_type)
--> 389 return call_function("cast", [arr], options)
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()
ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Hmm it seems like we can either:
1. try to fix pyarrow upstream
2. half-support float16 with some workaround to make sure we don't ever do casting internally
| [
-1.2057141065597534,
-0.8102036714553833,
-0.6469262838363647,
1.4442282915115356,
-0.06382401287555695,
-1.3462415933609009,
0.1484007090330124,
-0.987706184387207,
1.736415982246399,
-0.9125480651855469,
0.4100821018218994,
-1.708981990814209,
0.15340952575206757,
-0.592488169670105,
-0.7626789212226868,
-0.6535719037055969,
-0.350750595331192,
-0.6627594232559204,
1.0949064493179321,
2.3952157497406006,
1.1264779567718506,
-1.3292369842529297,
2.738229274749756,
0.7167775630950928,
-0.25048598647117615,
-0.8322121500968933,
0.3310741186141968,
-0.018497265875339508,
-1.4933851957321167,
-0.22281292080879211,
-0.9738255143165588,
-0.082537442445755,
-0.6092232465744019,
-0.7065620422363281,
0.01456721406430006,
0.47681760787963867,
-0.2838103175163269,
-0.5111714601516724,
-0.30824750661849976,
-0.8153766989707947,
0.5825783014297485,
-0.2710755169391632,
0.8963314890861511,
-0.26543331146240234,
1.8305211067199707,
-0.5987824201583862,
0.5186917185783386,
0.5519042015075684,
1.2557138204574585,
0.27523285150527954,
-0.08149126917123795,
0.37679600715637207,
0.30449143052101135,
0.038640569895505905,
0.6001114845275879,
1.2094225883483887,
0.6394641399383545,
0.548046886920929,
0.8023760318756104,
-2.2527730464935303,
1.2925236225128174,
-0.9091762900352478,
0.2586028277873993,
1.3110747337341309,
-1.0671095848083496,
0.4480334520339966,
-1.820885419845581,
-0.1463935226202011,
0.35599035024642944,
-2.1790950298309326,
0.20643875002861023,
-1.3179492950439453,
-0.5175502300262451,
1.059051275253296,
0.3856297731399536,
-1.2109837532043457,
-0.05473187938332558,
-0.2701363265514374,
0.8937371373176575,
0.34297803044319153,
1.141288161277771,
-1.5683021545410156,
0.0358039066195488,
-0.3162389397621155,
0.33074885606765747,
-1.1871432065963745,
-1.5059150457382202,
0.5314602255821228,
0.6814435124397278,
0.5209627151489258,
-0.21233385801315308,
0.9958449602127075,
-1.0996259450912476,
0.753445029258728,
-0.9768149256706238,
-1.8402681350708008,
-1.3484992980957031,
-2.273820400238037,
-2.309849977493286,
0.7874873876571655,
-0.38892120122909546,
-0.457049697637558,
2.1458561420440674,
-1.1127265691757202,
-1.8099749088287354,
1.1121501922607422,
0.30530989170074463,
-0.16742391884326935,
2.3098092079162598,
0.16560010612010956,
-0.8644178509712219,
0.6879605650901794,
-0.8607204556465149,
0.6058557629585266,
-0.46095505356788635,
1.2703955173492432,
0.4019075930118561,
-1.0925438404083252,
1.603060245513916,
-0.34012073278427124,
0.5784502029418945,
-0.7823631763458252,
-0.3806343078613281,
-0.5661119818687439,
0.276191383600235,
1.922393560409546,
-0.18895886838436127,
1.4768688678741455,
-0.213051900267601,
-1.447535753250122,
-1.4453963041305542,
0.8043543100357056,
0.4478616714477539,
-0.7262121438980103,
0.21897153556346893,
-0.3415619432926178,
0.18356283009052277,
0.0651492029428482,
1.1236881017684937,
1.2890129089355469,
0.8241545557975769,
-0.134501650929451,
-0.856403112411499,
0.15430930256843567,
0.016446035355329514,
-0.5667880177497864,
-1.6778836250305176,
-0.2862052917480469,
0.16650938987731934,
0.5839102268218994,
-1.0973012447357178,
1.9115124940872192,
0.8817892074584961,
1.929749608039856,
1.0166898965835571,
-0.3114369809627533,
1.566706895828247,
0.1315307766199112,
1.931505560874939,
-0.195316344499588,
0.6677379608154297,
-0.48867523670196533,
-1.1955751180648804,
0.7006626129150391,
-0.23600822687149048,
-2.0200142860412598,
-0.38792070746421814,
-0.9404813647270203,
-0.1927850842475891,
-0.8753629326820374,
0.9992749691009521,
-0.1600966900587082,
-1.4400014877319336,
0.27852073311805725,
-0.6986398100852966,
0.13083909451961517,
-1.3503284454345703,
0.3553813099861145,
0.711776852607727,
-0.7274020314216614,
0.15170979499816895,
-0.3908635973930359,
-1.415213704109192,
-0.5845735669136047,
0.43895095586776733,
1.7823034524917603,
-0.8225282430648804,
1.0174930095672607,
1.034488320350647,
-0.6295213103294373,
-0.17214198410511017,
0.5164039134979248,
-0.38387131690979004,
0.9036407470703125,
-0.9919251203536987,
-0.42454472184181213,
1.1577404737472534,
-0.2491549402475357,
-0.48196882009506226,
1.3201836347579956,
0.6730047464370728,
-0.9231603145599365,
-0.1950697898864746,
-0.0984894335269928,
-0.8562514781951904,
0.027280252426862717,
-1.6041141748428345,
-0.0301269069314003,
0.38001102209091187,
-1.518783688545227,
-0.47651705145835876,
-0.019505873322486877,
1.193999171257019,
-0.042620666325092316,
1.3686373233795166,
-0.294154554605484,
-0.15942490100860596,
-0.5506359338760376,
-0.42841866612434387,
0.1143764778971672,
-0.11460472643375397,
-0.6569430828094482,
0.2823745310306549,
-0.6935862302780151,
0.2727968096733093,
1.3535659313201904,
0.24137724936008453,
0.08790840953588486,
0.5659053325653076,
1.2032358646392822,
0.35290661454200745,
-0.15582506358623505,
-0.8188050985336304,
-1.7209577560424805,
2.0148415565490723,
-1.5701956748962402,
2.007718563079834,
0.7479526400566101,
0.020224973559379578,
-1.7683296203613281,
-1.8973320722579956,
1.570533037185669,
1.1059414148330688,
2.504361867904663,
0.5614669322967529,
0.4072414040565491,
-0.8601976037025452,
-0.6163468956947327,
0.4339657425880432,
-0.8787835240364075,
-0.9233744740486145,
0.12064783275127411,
2.3708443641662598,
1.724045753479004,
-0.30686888098716736,
-0.19437843561172485,
-1.0217939615249634,
1.441123127937317,
-0.28756973147392273,
0.19946838915348053,
1.825415849685669,
-0.38852614164352417,
-1.012895107269287,
1.310981035232544,
-2.402956247329712,
0.23927822709083557,
1.965096354484558,
0.22310732305049896,
0.04683823883533478,
-1.1090056896209717,
-0.7000086903572083,
-0.09567409008741379,
-0.411144882440567,
-1.2494096755981445,
0.3339500427246094,
-0.16386404633522034,
-0.6730020046234131,
-1.415190577507019,
0.12319636344909668,
-1.1176018714904785,
-1.65180504322052,
0.2161594182252884,
1.812744140625,
2.0924594402313232,
-0.7257705330848694,
1.427860140800476,
-0.27295607328414917,
0.34444400668144226,
1.2928258180618286,
1.1683180332183838,
3.233684778213501,
1.88004732131958,
-1.2688663005828857,
0.6333036422729492,
-0.11180763691663742,
-0.5788268446922302,
1.2210906744003296,
-1.1307958364486694,
1.206499457359314,
-0.10344883054494858,
-1.2977745532989502,
-1.1770800352096558,
0.8394966125488281,
0.4561127722263336,
0.06150790676474571,
-0.4311230480670929,
0.9989525079727173,
0.19986914098262787,
1.3096530437469482,
0.5747573971748352,
-0.21298420429229736,
0.6219484806060791,
-0.31406161189079285,
-0.4517959654331207,
1.5350431203842163,
0.09987850487232208,
-1.3669288158416748,
-2.227903127670288,
-0.10960943251848221,
-0.9848096370697021,
0.0811619833111763,
-0.808560311794281,
-0.9689927697181702,
1.5610264539718628,
0.4757373631000519,
-1.001846432685852,
-0.0577225536108017,
-0.41146016120910645,
-0.6428425908088684,
2.6572108268737793,
-1.3920875787734985,
-0.37803229689598083,
-1.003403663635254,
-0.7360663414001465,
1.5718321800231934,
-1.1918275356292725,
-0.27320969104766846,
-1.027990698814392,
-0.47250816226005554,
-1.2713748216629028,
-0.5235684514045715,
0.0004901615902781487,
-0.821821391582489,
0.8180006742477417,
0.046886805444955826,
-1.3666220903396606,
-0.3373331129550934,
-1.1165155172348022,
0.770286500453949,
-0.261118084192276,
0.03650956228375435,
1.763425588607788,
0.3143196702003479,
-0.38205480575561523,
0.6910855174064636,
1.1821858882904053,
0.6172022819519043,
-0.5101861953735352,
0.4241578280925751,
-0.6328125596046448,
0.48431921005249023,
-1.2290594577789307,
0.37748226523399353,
-2.8927528858184814,
0.6523901224136353,
0.05680711939930916,
0.015918802469968796,
-0.12649211287498474,
-1.4632601737976074,
0.9285850524902344,
2.497884511947632,
-1.0259768962860107,
0.5268229246139526,
0.24032370746135712,
1.2881368398666382,
-1.6250909566879272,
0.08071019500494003,
-0.5907496809959412,
2.0828726291656494,
0.08439458906650543,
1.0573650598526,
-0.44295957684516907,
-2.441560745239258,
0.5673906207084656,
-1.2879747152328491,
-1.0711323022842407,
0.8230302929878235,
-0.813946545124054,
0.0724431648850441,
-1.1085387468338013,
-0.12882833182811737,
-0.8547903299331665,
-1.0325748920440674,
0.5946838855743408,
0.017538193613290787,
0.6415678858757019,
-0.7090683579444885,
0.29481974244117737,
-2.2778213024139404,
-1.3273545503616333,
-0.22253769636154175,
-0.891656756401062,
0.40725985169410706,
-0.3660268187522888,
0.7772086262702942,
-0.246986985206604,
-0.042720042169094086,
0.3035232722759247,
1.5349526405334473,
3.171482563018799,
0.10863368213176727,
0.4997352659702301,
-0.32284852862358093,
-1.0068498849868774,
1.5321717262268066,
0.89480060338974,
-0.25250861048698425,
-0.6065794825553894,
-1.0074725151062012,
1.2582927942276,
1.8341072797775269,
1.0702439546585083,
0.04677312448620796,
-0.8627488613128662,
-0.8102422952651978,
0.08480522781610489,
0.08250352740287781,
0.43628716468811035,
0.9817370176315308,
0.24469996988773346,
0.22664104402065277,
1.3576399087905884,
1.0627741813659668,
-0.4228273332118988,
0.43937262892723083,
-0.7727896571159363,
-0.47091227769851685,
0.5643646121025085,
0.4161296784877777,
-0.02678976207971573,
0.12066946923732758,
-1.0333678722381592,
-0.15647178888320923,
-0.2903876006603241,
-0.9082324504852295,
-0.782889187335968,
-0.4336078464984894,
-0.4211815297603607,
1.7894364595413208,
-0.051739051938056946,
-0.5941183567047119,
-0.11875678598880768,
-0.8947007656097412,
0.00029076915234327316,
-0.9612069129943848,
0.3008538782596588,
-0.14222493767738342,
-0.02247798815369606,
-0.07583066076040268,
1.68767511844635,
-0.9602358341217041,
-2.1238088607788086,
0.2213660627603531,
0.13205845654010773,
-0.31184881925582886,
-0.05469883605837822,
1.767344355583191,
0.5564374327659607,
1.454877495765686,
1.5945035219192505,
1.0522470474243164,
-0.6270792484283447,
-1.3803329467773438,
0.7530506253242493,
0.8754865527153015,
-1.328903079032898,
0.8620465993881226,
0.04267434775829315,
-0.5462637543678284,
0.44548851251602173,
1.2340409755706787,
0.47227492928504944,
-1.9922817945480347,
0.7673993110656738,
-1.1723637580871582,
0.8246990442276001,
0.8215599656105042,
0.7671186923980713,
0.08683699369430542,
0.8549911379814148,
-1.1869176626205444,
-1.0259758234024048,
-0.6206894516944885,
-0.642831563949585,
1.8916069269180298,
-0.2807987928390503,
0.4097071588039398,
-0.27569380402565,
-1.4696794748306274,
0.1296933889389038,
0.6726303696632385,
0.3085644543170929,
-0.46577906608581543,
0.6607900261878967,
-0.6844977736473083,
-1.0925155878067017,
-1.4136966466903687,
-0.5290629863739014,
-1.0943336486816406,
-0.8310781717300415,
0.9495599269866943,
0.7700260281562805,
0.36782801151275635,
1.8919826745986938,
0.747193455696106,
0.19463318586349487,
-2.6597368717193604,
0.8146683573722839,
0.3228779435157776,
-0.09269264340400696,
0.7481582164764404,
0.2763844132423401,
1.0983092784881592,
-0.1892486959695816,
0.5561435222625732,
-2.41074800491333,
2.3270444869995117,
-0.21902602910995483,
0.7662459015846252,
0.02227034792304039,
-0.06595763564109802,
1.0613594055175781,
0.5787587761878967,
0.5062431693077087,
-1.0748944282531738,
0.7977844476699829,
-0.7281500697135925,
1.2754403352737427,
0.8763114809989929,
-0.854937732219696,
0.04486791044473648,
1.2411452531814575,
0.3426274359226227,
-0.5756658315658569,
-0.9975881576538086,
-0.9847527146339417,
1.0134716033935547,
1.7628206014633179,
0.039218392223119736,
0.06502125412225723,
0.8287689089775085,
0.8072249889373779,
-1.3232580423355103,
0.01166489627212286,
-0.7083001136779785,
-0.6953635811805725,
1.772005319595337,
2.089962959289551,
-0.11975216865539551,
-0.1324416995048523,
-0.7579405307769775,
-1.3819780349731445,
0.8416464924812317,
0.16288450360298157,
0.016947977244853973,
0.7965357303619385,
-0.6684508919715881,
1.2259907722473145,
0.9452380537986755,
0.8435664176940918,
0.3870279788970947,
0.026972558349370956,
0.1481161266565323,
-0.3097626864910126,
-1.1584851741790771,
-0.24472898244857788,
-0.9901733994483948,
-2.5797436237335205,
0.4053572714328766,
-0.18773417174816132,
-1.4291157722473145,
0.12503913044929504,
-0.9556392431259155,
0.7775734066963196,
-0.4873271882534027,
-1.2463322877883911,
-1.3804281949996948,
0.12723471224308014,
-0.07441363483667374,
0.7870929837226868,
-1.5547055006027222,
-0.059063754975795746,
1.1540082693099976,
1.0261783599853516,
-0.7106896638870239,
0.8784904479980469,
0.17561349272727966,
0.9688757061958313,
1.0534014701843262,
-0.4224875569343567,
0.4261196255683899,
0.17672480642795563,
-1.338664174079895,
0.3515184819698334,
1.2891677618026733,
0.10495911538600922,
1.445071816444397,
-0.4988887906074524,
-0.054914698004722595,
0.39561325311660767,
-0.31197869777679443,
-0.5294608473777771,
-0.8092567920684814,
0.6241718530654907,
-0.20493245124816895,
-0.8367142677307129,
0.008976518176496029,
0.18443670868873596,
-0.13933229446411133,
0.24106253683567047,
-1.5629909038543701,
-0.02609943598508835,
-0.3175744414329529,
-0.7735667824745178,
-1.2748082876205444,
-0.12493057548999786,
1.3471219539642334,
-0.8288480639457703,
-0.08987870067358017,
0.521308183670044,
0.10742899030447006,
0.5091138482093811,
0.6358329653739929,
-0.6730843782424927,
-0.328605979681015,
-0.0918496698141098,
-0.42624202370643616,
0.33076709508895874,
1.4266695976257324,
-0.0951518788933754,
-0.92562335729599,
0.5769296884536743,
-0.25389376282691956,
0.12366586923599243,
1.87005615234375,
0.02262657880783081,
-0.900930643081665,
0.280077189207077,
-0.737286388874054,
1.9051867723464966,
1.7341811656951904,
1.290481448173523,
-0.05802324786782265,
-1.0521081686019897,
0.6721521615982056,
-0.4266529977321625,
-0.4338867664337158,
0.931946873664856,
0.3214496076107025,
-0.27210497856140137,
-1.3789753913879395,
0.810175359249115,
1.238814115524292,
-0.7579094767570496,
-0.9030730724334717,
0.10487837344408035,
-0.8095136880874634,
1.1328186988830566,
0.695652425289154,
0.3338395655155182,
0.3207233250141144,
1.6268439292907715,
0.8225527405738831,
-0.5233973860740662,
0.6332905292510986,
0.48786500096321106,
-0.043110255151987076,
-2.044020414352417,
-1.1679375171661377,
0.28301921486854553,
-0.5118707418441772,
-1.5161471366882324,
1.4559326171875,
-1.2521787881851196,
-0.9246218204498291,
0.5932436585426331,
0.20267458260059357,
1.4280332326889038,
0.34611809253692627,
1.654421091079712,
1.987230658531189,
0.9216572642326355,
0.4793829023838043,
1.1393455266952515,
-0.27955520153045654,
-0.3386790454387665,
1.577959418296814,
-0.5377709865570068,
0.5953943729400635,
1.0575072765350342,
-0.3226827085018158,
-1.1800367832183838,
-0.8347452878952026,
-1.2675365209579468,
-0.8967568874359131,
1.055199384689331,
0.16609686613082886,
-1.1434502601623535,
0.36741694808006287,
1.5953359603881836,
-0.05011126026511192,
-0.1681135594844818,
0.7023260593414307,
0.3615250587463379,
-0.789970338344574,
-0.05017589032649994,
-0.9731913805007935,
0.6169321537017822,
-0.3695443570613861,
-0.43549203872680664,
0.31549739837646484,
0.5456836819648743,
1.2576971054077148,
0.1753544807434082,
0.07085059583187103,
1.322940707206726,
-1.44048011302948,
1.285327672958374,
-1.0572525262832642,
0.37757131457328796,
-2.288235664367676,
1.5464906692504883,
-0.9822853803634644,
1.9516865015029907,
-2.6920526027679443,
0.459729939699173,
-0.48434144258499146,
-0.54527747631073,
0.19356200098991394,
-0.18604089319705963,
0.11841018497943878,
-0.01601380482316017,
-1.1827057600021362,
-0.10915990173816681,
-0.852577269077301,
0.5305956602096558,
1.219461441040039,
1.3059837818145752,
-0.9816039800643921,
-0.4055444896221161,
-1.6533747911453247,
-0.15525312721729279,
-0.40233364701271057,
0.19748932123184204,
-1.83524751663208,
-0.21318762004375458,
-2.0078518390655518,
-2.4672622680664062,
-1.2897881269454956,
-0.9671762585639954,
1.2972501516342163,
0.02411355823278427,
-0.8294782042503357,
1.1636199951171875,
-0.48992055654525757,
-1.8709360361099243,
1.2682799100875854,
-2.1841259002685547
] |
https://github.com/huggingface/datasets/issues/4980 | Make `pyarrow` optional | The whole datasets library is pretty much a wrapper to pyarrow (just take a look at some of the source for a Dataset) https://github.com/huggingface/datasets/blob/51aef08ad7053c0bfe8f9a961207b26df15850d3/src/datasets/arrow_dataset.py#L639
I think removing the pyarrow dependency would involve a complete rewrite / a different library with minimal functionality (datasets-lite ?) | **Is your feature request related to a problem? Please describe.**
Is `pyarrow` really needed for every dataset?
**Describe the solution you'd like**
It is made optional.
**Describe alternatives you've considered**
Likely, no.
| 526 | 44 | Make `pyarrow` optional
**Is your feature request related to a problem? Please describe.**
Is `pyarrow` really needed for every dataset?
**Describe the solution you'd like**
It is made optional.
**Describe alternatives you've considered**
Likely, no.
The whole datasets library is pretty much a wrapper to pyarrow (just take a look at some of the source for a Dataset) https://github.com/huggingface/datasets/blob/51aef08ad7053c0bfe8f9a961207b26df15850d3/src/datasets/arrow_dataset.py#L639
I think removing the pyarrow dependency would involve a complete rewrite / a different library with minimal functionality (datasets-lite ?) | [
-1.2612894773483276,
-0.992870569229126,
-0.7289041876792908,
1.2962689399719238,
-0.10822931677103043,
-1.3377013206481934,
0.03473470360040665,
-1.1153993606567383,
1.7776868343353271,
-0.7353009581565857,
0.20595799386501312,
-1.7250502109527588,
-0.0954071655869484,
-0.47152581810951233,
-0.7650663256645203,
-0.8673802018165588,
-0.34963494539260864,
-0.9339619874954224,
0.9132124185562134,
2.536829948425293,
1.1512157917022705,
-1.3220734596252441,
2.8293139934539795,
0.70951247215271,
-0.28377822041511536,
-1.0125997066497803,
0.48647046089172363,
0.07086092978715897,
-1.1083940267562866,
-0.5719271302223206,
-0.9413963556289673,
-0.007888960652053356,
-0.46071529388427734,
-0.5206273198127747,
0.09475227445363998,
0.40194129943847656,
-0.221183180809021,
-0.2948099970817566,
-0.5549976825714111,
-0.7462178468704224,
0.4467936158180237,
-0.4956933856010437,
0.9043124914169312,
-0.48237910866737366,
1.7638957500457764,
-0.5170068144798279,
0.37244126200675964,
0.6677464246749878,
1.451479196548462,
0.10379388928413391,
-0.008858215063810349,
0.30467769503593445,
0.351473867893219,
-0.020944375544786453,
0.43290218710899353,
1.2470142841339111,
0.5783243775367737,
0.5856552720069885,
0.577876091003418,
-2.1709072589874268,
1.3978756666183472,
-0.978958785533905,
0.1669430434703827,
1.3606237173080444,
-0.8698034882545471,
0.4322035014629364,
-1.7370117902755737,
-0.07831273972988129,
0.4919593036174774,
-2.397953987121582,
0.18433043360710144,
-1.3031164407730103,
-0.6389955282211304,
0.8811531662940979,
0.23800641298294067,
-1.3084535598754883,
0.0998503714799881,
-0.5388093590736389,
1.122439980506897,
0.48641452193260193,
1.0998510122299194,
-1.7275019884109497,
-0.10887832194566727,
-0.22306127846240997,
-0.11539246886968613,
-1.4258928298950195,
-1.570324420928955,
0.5806110501289368,
0.6029600501060486,
0.7616389989852905,
0.03479091823101044,
0.9497060775756836,
-0.9661046266555786,
0.7733423709869385,
-0.9866485595703125,
-1.562125325202942,
-1.3212909698486328,
-2.2745280265808105,
-2.141899347305298,
0.9366343021392822,
-0.477184534072876,
-0.60452800989151,
1.967560887336731,
-1.0839295387268066,
-1.804264783859253,
1.1530990600585938,
0.29917842149734497,
0.089682936668396,
2.4479541778564453,
0.29917582869529724,
-0.7538691759109497,
0.39330247044563293,
-0.6196542978286743,
0.8766340017318726,
-0.4948878586292267,
1.509737491607666,
0.5255159735679626,
-0.9591019153594971,
1.6573269367218018,
-0.4778174161911011,
0.5874207019805908,
-0.6417177319526672,
-0.6130754947662354,
-0.9299238920211792,
0.47165513038635254,
1.8832528591156006,
-0.36815035343170166,
1.5496965646743774,
-0.46115928888320923,
-1.5135669708251953,
-1.5322166681289673,
0.840369462966919,
0.5611876845359802,
-0.8775039315223694,
0.05911637842655182,
-0.4298708438873291,
0.042010143399238586,
-0.02977726422250271,
1.0669176578521729,
1.092880129814148,
0.689383327960968,
-0.3077388107776642,
-0.9128553867340088,
0.24139077961444855,
-0.02119551971554756,
-0.6811838746070862,
-1.861968994140625,
-0.3667040467262268,
0.2249404788017273,
0.604583740234375,
-1.3110414743423462,
1.6005380153656006,
0.9831194281578064,
1.966073751449585,
0.9687260985374451,
-0.27860939502716064,
1.4273957014083862,
-0.013853440061211586,
1.7881187200546265,
-0.5670197010040283,
0.7377282381057739,
-0.1992674022912979,
-1.0134186744689941,
0.7544311881065369,
-0.3542247414588928,
-2.044140100479126,
-0.8228752613067627,
-0.8506448268890381,
-0.1981344074010849,
-0.8317402005195618,
0.9233030676841736,
-0.40048500895500183,
-1.3338172435760498,
0.19377350807189941,
-0.6447052359580994,
0.14869414269924164,
-1.282578945159912,
0.3081403374671936,
0.7926318049430847,
-0.606372594833374,
-0.1269003450870514,
-0.27125856280326843,
-1.3394063711166382,
-0.48520249128341675,
0.1352856159210205,
1.9882447719573975,
-0.7370826005935669,
0.9445217847824097,
0.964340090751648,
-0.7882581353187561,
0.03069021739065647,
0.3385700285434723,
-0.2619261145591736,
0.8450020551681519,
-1.063913345336914,
-0.2361694574356079,
1.1288807392120361,
-0.11320923268795013,
-0.6113863587379456,
1.513269305229187,
0.8529329299926758,
-0.9595162868499756,
-0.11584637314081192,
-0.37138015031814575,
-0.7941102385520935,
-0.03696241229772568,
-1.5224049091339111,
-0.20533005893230438,
0.2347204089164734,
-1.3309675455093384,
-0.43828245997428894,
-0.22485728561878204,
1.2932595014572144,
-0.14079946279525757,
1.1873058080673218,
-0.2837180197238922,
-0.21914678812026978,
-0.46462419629096985,
-0.3385252058506012,
0.10413073748350143,
-0.1988767683506012,
-0.6424869298934937,
0.19505921006202698,
-0.7672818899154663,
0.3126426935195923,
1.4605456590652466,
0.6471649408340454,
0.01770845614373684,
0.5434153079986572,
1.008091926574707,
0.20556068420410156,
-0.08614096790552139,
-0.8286023139953613,
-1.5481232404708862,
1.913017749786377,
-1.5517672300338745,
1.8542964458465576,
0.8052000403404236,
-0.05462800711393356,
-1.8174577951431274,
-1.8748931884765625,
1.2663975954055786,
1.3144408464431763,
2.2949841022491455,
0.6020492911338806,
0.4090672731399536,
-0.7228029370307922,
-0.8267736434936523,
0.31686708331108093,
-1.1934053897857666,
-0.6447068452835083,
0.12603332102298737,
2.2686619758605957,
1.8453015089035034,
-0.5926722288131714,
-0.22049129009246826,
-1.0485812425613403,
1.2507561445236206,
-0.192294180393219,
0.1581634134054184,
2.013324737548828,
-0.43305703997612,
-1.077304482460022,
1.2100157737731934,
-2.2534050941467285,
0.0852062776684761,
1.9730702638626099,
0.37397685647010803,
0.10160908848047256,
-1.4739153385162354,
-0.6573435068130493,
-0.29646462202072144,
-0.3568609356880188,
-1.379477858543396,
0.5792285203933716,
-0.4040271043777466,
-0.764965832233429,
-1.5139340162277222,
0.15701858699321747,
-1.2120674848556519,
-1.6367918252944946,
0.4391506612300873,
1.9903515577316284,
2.0358822345733643,
-0.704637885093689,
1.4541599750518799,
-0.21631354093551636,
0.13252399861812592,
1.2720056772232056,
1.1754611730575562,
3.0888593196868896,
1.7781234979629517,
-1.2050087451934814,
0.6300644874572754,
-0.16095225512981415,
-0.5404991507530212,
1.1816779375076294,
-1.0861666202545166,
1.2045035362243652,
-0.12510190904140472,
-1.1596038341522217,
-1.240970253944397,
0.9459037184715271,
0.5091629028320312,
0.051798440515995026,
-0.4673907160758972,
1.2109694480895996,
0.033407509326934814,
1.3443434238433838,
0.528775691986084,
-0.41088658571243286,
0.6633250713348389,
-0.36913272738456726,
-0.46973440051078796,
1.5659565925598145,
0.2302783578634262,
-1.462027668952942,
-2.34748911857605,
-0.20633618533611298,
-0.7509849667549133,
0.06269185245037079,
-0.6243643760681152,
-1.0379891395568848,
1.6921639442443848,
0.5559866428375244,
-1.2498093843460083,
-0.2321571707725525,
-0.4136485755443573,
-0.6101220846176147,
2.6005539894104004,
-1.4157154560089111,
-0.1786360889673233,
-0.92524653673172,
-0.3889435827732086,
1.5823585987091064,
-1.2425307035446167,
-0.13882164657115936,
-0.9528214931488037,
-0.6529096364974976,
-1.3146785497665405,
-0.5570482611656189,
-0.1510854959487915,
-0.932648777961731,
0.8068689703941345,
0.20838090777397156,
-0.9811030030250549,
-0.2509758770465851,
-0.8833065629005432,
0.8159453868865967,
-0.1569804698228836,
0.2185640186071396,
1.8399096727371216,
0.4815656542778015,
-0.4425242245197296,
0.7672659754753113,
1.2126325368881226,
0.4800402820110321,
-0.6574425101280212,
0.13904909789562225,
-0.7491558790206909,
0.3532845377922058,
-1.3561886548995972,
0.23791521787643433,
-3.0689194202423096,
0.6929295063018799,
-0.12659205496311188,
-0.11626753211021423,
0.013698281720280647,
-1.3314094543457031,
1.1358656883239746,
2.6540353298187256,
-1.167810320854187,
0.451016902923584,
0.29055437445640564,
1.2086678743362427,
-1.60226309299469,
0.39448052644729614,
-0.4184715747833252,
2.015117883682251,
0.22387228906154633,
1.2027390003204346,
-0.6612599492073059,
-2.150641918182373,
0.6641594767570496,
-1.1782028675079346,
-1.2144280672073364,
0.645606517791748,
-0.9249566793441772,
0.1602594405412674,
-1.4987777471542358,
-0.09622722119092941,
-0.9191439747810364,
-1.1972919702529907,
0.8009177446365356,
0.15337343513965607,
0.37754812836647034,
-0.5604228973388672,
0.28840717673301697,
-2.1471447944641113,
-1.3895293474197388,
-0.25119176506996155,
-0.8641181588172913,
0.62306147813797,
-0.30020445585250854,
0.5933753848075867,
-0.0917934849858284,
0.15646155178546906,
0.39999306201934814,
1.404206395149231,
3.3192670345306396,
0.207252636551857,
0.3913649022579193,
-0.08985699713230133,
-0.9103435277938843,
1.3577418327331543,
1.052485704421997,
0.015120375901460648,
-0.5799887180328369,
-0.9803860187530518,
1.4086984395980835,
1.8834534883499146,
0.8894773721694946,
0.17934373021125793,
-0.7720648050308228,
-0.5880377292633057,
0.05489104986190796,
0.2856002748012543,
0.4206642508506775,
1.0159403085708618,
0.026370523497462273,
0.11584685742855072,
1.5178261995315552,
1.2505892515182495,
-0.5624142289161682,
0.49305298924446106,
-0.8770322203636169,
-0.4604565501213074,
0.4391102194786072,
0.29380884766578674,
-0.09990809857845306,
0.2852277457714081,
-0.9493770599365234,
-0.29110679030418396,
-0.19193442165851593,
-0.9836037158966064,
-0.7756863832473755,
-0.4292113482952118,
-0.43131908774375916,
1.6979998350143433,
0.06277014315128326,
-0.49714821577072144,
-0.015854237601161003,
-0.786287784576416,
-0.11115428060293198,
-1.1509214639663696,
0.2562820613384247,
-0.1275547444820404,
-0.10602487623691559,
-0.09815383702516556,
1.7952793836593628,
-0.9291201829910278,
-2.109149694442749,
0.24431507289409637,
0.3461982309818268,
-0.39852654933929443,
0.1656857430934906,
1.6559815406799316,
0.5370612144470215,
1.4981093406677246,
1.300984501838684,
0.9388462901115417,
-0.5777314305305481,
-1.2612806558609009,
0.6792116761207581,
0.8612479567527771,
-1.3439241647720337,
0.8441609144210815,
0.07803597301244736,
-0.5397735834121704,
0.7328062653541565,
1.4019886255264282,
0.457804799079895,
-1.8421456813812256,
0.847370982170105,
-0.8409445285797119,
0.7899892330169678,
0.7732782959938049,
0.8240585327148438,
0.311164528131485,
0.921917736530304,
-1.2342357635498047,
-1.2699006795883179,
-0.999387800693512,
-0.5864449143409729,
1.9485692977905273,
-0.20148737728595734,
0.608793318271637,
-0.15421690046787262,
-1.214540958404541,
-0.03308725729584694,
0.7093762755393982,
0.41839054226875305,
-0.2834450900554657,
0.7893128395080566,
-0.6427886486053467,
-1.0741361379623413,
-1.505737066268921,
-0.38128897547721863,
-0.9102057218551636,
-0.8570302724838257,
0.9734296202659607,
0.8780422210693359,
0.28713077306747437,
1.9402761459350586,
0.6112716197967529,
0.2655199468135834,
-2.6238694190979004,
0.8022889494895935,
0.2805269956588745,
0.010437468066811562,
0.9402874708175659,
0.28480345010757446,
0.9769690036773682,
0.0006008213385939598,
0.41933003067970276,
-2.3055050373077393,
2.160423755645752,
-0.35514119267463684,
0.664469838142395,
-0.05120161175727844,
-0.17304494976997375,
1.2564200162887573,
0.5056748986244202,
0.5881147980690002,
-1.0956109762191772,
0.7278737425804138,
-0.5209473371505737,
1.1896400451660156,
1.0258790254592896,
-0.7692983150482178,
0.07483118772506714,
1.3292791843414307,
0.5093743801116943,
-0.47071534395217896,
-0.8873964548110962,
-0.8692569136619568,
0.9178124666213989,
1.76421058177948,
-0.0638575479388237,
-0.03957188129425049,
0.8230399489402771,
0.6935522556304932,
-1.2583484649658203,
0.07558285444974899,
-0.732094943523407,
-0.7198308706283569,
1.719331979751587,
2.1336090564727783,
-0.06390577554702759,
-0.15710794925689697,
-0.6639332175254822,
-1.1637332439422607,
0.8178874254226685,
-0.010910154320299625,
0.09549127519130707,
0.6822082996368408,
-0.6759445667266846,
1.1759321689605713,
0.8806915879249573,
0.9543557167053223,
0.013197492808103561,
0.4786580801010132,
0.3977876901626587,
-0.2567613422870636,
-1.1150544881820679,
-0.253953218460083,
-1.194771409034729,
-2.5793099403381348,
0.42833802103996277,
-0.36600810289382935,
-1.4569193124771118,
-0.0284306388348341,
-1.1157516241073608,
0.9265593886375427,
-0.5574113130569458,
-1.0525357723236084,
-1.5847415924072266,
0.11541637033224106,
-0.08171972632408142,
0.924825131893158,
-1.5951441526412964,
-0.0656166523694992,
1.2554500102996826,
0.9410615563392639,
-0.584812343120575,
1.0360523462295532,
0.27168765664100647,
1.022849678993225,
0.8088923692703247,
-0.5175585746765137,
0.46062785387039185,
0.006713853217661381,
-1.3322734832763672,
0.5104303956031799,
1.2326292991638184,
0.19138243794441223,
1.3700190782546997,
-0.4670695960521698,
0.1103423610329628,
0.43285804986953735,
-0.6135212779045105,
-0.38775622844696045,
-0.4387016296386719,
0.8089041113853455,
0.20418009161949158,
-0.9794858694076538,
0.07265658676624298,
-0.14754821360111237,
-0.2655167877674103,
0.26660871505737305,
-1.5055861473083496,
-0.47182679176330566,
-0.4466862082481384,
-0.45662885904312134,
-1.276384949684143,
-0.02197537198662758,
1.3457541465759277,
-0.8211365342140198,
-0.2716071605682373,
0.47799351811408997,
0.47522976994514465,
0.6276874542236328,
0.6424964666366577,
-0.724262535572052,
-0.3070996105670929,
-0.3645748794078827,
-0.36013755202293396,
0.18856912851333618,
1.2063003778457642,
-0.1360030174255371,
-0.9986110329627991,
0.6520937085151672,
-0.3649950325489044,
0.0521942600607872,
1.892491102218628,
-0.020314693450927734,
-0.7915012836456299,
0.24023231863975525,
-0.7503885626792908,
1.8334624767303467,
1.5758358240127563,
1.3381133079528809,
-0.042757630348205566,
-0.7701858282089233,
0.5594538450241089,
-0.08097676187753677,
-0.3975845277309418,
0.934494137763977,
0.6452528834342957,
-0.16778606176376343,
-1.401853084564209,
0.5798728466033936,
1.2015235424041748,
-0.8700173497200012,
-0.7662926912307739,
-0.12581978738307953,
-0.799121081829071,
1.1863452196121216,
0.6810460090637207,
0.38464412093162537,
0.24680142104625702,
1.7236223220825195,
0.6143805980682373,
-0.5496484637260437,
0.4906497299671173,
0.5145860314369202,
-0.1520836353302002,
-2.2797937393188477,
-1.0807781219482422,
0.24585117399692535,
-0.3175335228443146,
-1.4666815996170044,
1.3623430728912354,
-1.032313585281372,
-0.8918717503547668,
0.5386878848075867,
0.21911635994911194,
1.5292717218399048,
0.3052101731300354,
1.6844723224639893,
2.061655044555664,
0.9709850549697876,
0.247352734208107,
1.4298834800720215,
-0.10501665621995926,
-0.371743768453598,
1.8813433647155762,
-0.3993874788284302,
0.5378322005271912,
0.9233786463737488,
-0.3447299897670746,
-1.1136114597320557,
-0.7279123067855835,
-1.1051584482192993,
-0.63770991563797,
1.160702109336853,
0.1065606027841568,
-1.2097829580307007,
0.15846681594848633,
1.5236531496047974,
0.14296504855155945,
-0.25112104415893555,
0.4203852117061615,
0.4390982687473297,
-0.6904261112213135,
-0.11089557409286499,
-1.02953040599823,
0.4724077582359314,
-0.15722611546516418,
-0.31663230061531067,
0.22873426973819733,
0.559233546257019,
1.2350234985351562,
-0.07012694329023361,
0.12499774247407913,
1.1820563077926636,
-1.4177390336990356,
1.4196385145187378,
-0.6196628212928772,
0.18709585070610046,
-2.449988603591919,
1.6089290380477905,
-0.7923229336738586,
1.9476008415222168,
-2.719158172607422,
0.4132554531097412,
-0.6111055016517639,
-0.3865745961666107,
0.323650062084198,
-0.4041479825973511,
0.18121090531349182,
-0.14453740417957306,
-1.0799973011016846,
0.03603900223970413,
-0.7787911891937256,
0.5315439105033875,
1.187112808227539,
1.3598123788833618,
-1.1474719047546387,
-0.2019818127155304,
-1.7179052829742432,
-0.1510770320892334,
-0.799819827079773,
0.3346116244792938,
-2.1351754665374756,
-0.12489714473485947,
-1.9176281690597534,
-2.269031047821045,
-1.4102500677108765,
-0.7827640175819397,
1.0661964416503906,
0.14662107825279236,
-0.8836166858673096,
1.0670433044433594,
-0.41690313816070557,
-1.7965672016143799,
1.096358060836792,
-2.220928192138672
] |
https://github.com/huggingface/datasets/issues/4980 | Make `pyarrow` optional | Thanks for the proposal, @KOLANICH. And also thanks for your answer, @dconathan.
Indeed, we are using `pyarrow` as the backend for our datasets, in order to cache them and also allow memory-mapping (using datasets larger than your RAM memory).
One way to avoid using `pyarrow` could be loading the datasets in streaming mode, by passing `streaming=True` to `load_dataset`. This way you basically get a generator for the dataset; nothing is downloaded, nor cached. | **Is your feature request related to a problem? Please describe.**
Is `pyarrow` really needed for every dataset?
**Describe the solution you'd like**
It is made optional.
**Describe alternatives you've considered**
Likely, no.
| 526 | 73 | Make `pyarrow` optional
**Is your feature request related to a problem? Please describe.**
Is `pyarrow` really needed for every dataset?
**Describe the solution you'd like**
It is made optional.
**Describe alternatives you've considered**
Likely, no.
Thanks for the proposal, @KOLANICH. And also thanks for your answer, @dconathan.
Indeed, we are using `pyarrow` as the backend for our datasets, in order to cache them and also allow memory-mapping (using datasets larger than your RAM memory).
One way to avoid using `pyarrow` could be loading the datasets in streaming mode, by passing `streaming=True` to `load_dataset`. This way you basically get a generator for the dataset; nothing is downloaded, nor cached. | [
-1.2930476665496826,
-1.0101473331451416,
-0.6830034852027893,
1.4197221994400024,
-0.22019760310649872,
-1.332237720489502,
0.10866749286651611,
-1.2173906564712524,
1.842982292175293,
-0.8363505005836487,
0.32682451605796814,
-1.7303935289382935,
0.0035818535834550858,
-0.5305736660957336,
-0.82575523853302,
-0.8510938882827759,
-0.4209515154361725,
-0.8289550542831421,
0.890676736831665,
2.4486255645751953,
1.1229950189590454,
-1.3503509759902954,
2.6861767768859863,
0.6590614318847656,
-0.13548895716667175,
-1.0343190431594849,
0.47705334424972534,
0.09394865483045578,
-1.170762300491333,
-0.5581645369529724,
-1.0144530534744263,
-0.1004912257194519,
-0.5117722153663635,
-0.5681796669960022,
0.09364228695631027,
0.3784569203853607,
-0.2682945430278778,
-0.36135223507881165,
-0.555302083492279,
-0.7373046278953552,
0.45843449234962463,
-0.4555186629295349,
0.9998656511306763,
-0.5806669592857361,
1.7791587114334106,
-0.57505863904953,
0.45609867572784424,
0.7052733898162842,
1.4679787158966064,
0.1473383754491806,
-0.1030837669968605,
0.26674801111221313,
0.3511592745780945,
0.03586538881063461,
0.4746262729167938,
0.9730349779129028,
0.5985003113746643,
0.5869883298873901,
0.6520532965660095,
-2.160447359085083,
1.3742479085922241,
-1.0744332075119019,
0.25255343317985535,
1.4347013235092163,
-0.991062343120575,
0.3473305404186249,
-1.75723397731781,
-0.11941710859537125,
0.46240150928497314,
-2.2663614749908447,
0.20414237678050995,
-1.254918098449707,
-0.5452638268470764,
0.9737080931663513,
0.3200412094593048,
-1.3563487529754639,
0.08498011529445648,
-0.4098641276359558,
0.9955450296401978,
0.4543590843677521,
1.0202709436416626,
-1.757744312286377,
-0.0298351738601923,
-0.40583860874176025,
-0.026265926659107208,
-1.346240758895874,
-1.50495445728302,
0.6554200649261475,
0.6258458495140076,
0.6010921001434326,
-0.09335776418447495,
1.005499005317688,
-1.0578386783599854,
0.8434678316116333,
-1.088727593421936,
-1.650665044784546,
-1.2896339893341064,
-2.2422735691070557,
-2.2520573139190674,
0.9879149198532104,
-0.4670654833316803,
-0.6235318183898926,
2.011800765991211,
-0.995449423789978,
-1.776868462562561,
1.1293563842773438,
0.19543510675430298,
0.040256567299366,
2.411029100418091,
0.14818546175956726,
-0.6026555299758911,
0.39443734288215637,
-0.6382359862327576,
0.8595718741416931,
-0.4242759346961975,
1.512442946434021,
0.4043407440185547,
-1.0178844928741455,
1.6879849433898926,
-0.3911859691143036,
0.596860945224762,
-0.5555254817008972,
-0.623426079750061,
-0.8629525899887085,
0.3849736452102661,
1.9503360986709595,
-0.2841249704360962,
1.4463547468185425,
-0.48661530017852783,
-1.5035114288330078,
-1.5749660730361938,
0.8945680856704712,
0.49799901247024536,
-0.7395288944244385,
0.03217622637748718,
-0.21822525560855865,
0.06671972572803497,
-0.07494031637907028,
1.134412407875061,
1.1486538648605347,
0.7794675230979919,
-0.36457815766334534,
-0.8779968619346619,
0.1359795778989792,
-0.05660688877105713,
-0.7852457761764526,
-1.8375662565231323,
-0.38985225558280945,
0.07228606939315796,
0.7060211300849915,
-1.1841151714324951,
1.6693549156188965,
1.0441515445709229,
1.913806676864624,
0.96524977684021,
-0.2335047572851181,
1.3704806566238403,
0.006584281101822853,
1.8899122476577759,
-0.5408948063850403,
0.6920977830886841,
-0.3349338173866272,
-1.046625018119812,
0.8335133194923401,
-0.32545092701911926,
-2.015817880630493,
-0.8148412108421326,
-0.9646629691123962,
-0.23927052319049835,
-0.7676671743392944,
1.0039726495742798,
-0.3244839012622833,
-1.333482265472412,
0.26072171330451965,
-0.6108691096305847,
0.15359805524349213,
-1.257714033126831,
0.3847043216228485,
0.7696185111999512,
-0.6296607851982117,
-0.08110635727643967,
-0.2916364073753357,
-1.3292995691299438,
-0.49636101722717285,
0.13228610157966614,
1.9238947629928589,
-0.7789793610572815,
0.942511260509491,
0.9773184061050415,
-0.8578351736068726,
-0.1445409655570984,
0.27100348472595215,
-0.2608610987663269,
0.8009231686592102,
-1.0556720495224,
-0.38684433698654175,
1.1311752796173096,
-0.11199650168418884,
-0.5972277522087097,
1.5958653688430786,
0.7371346950531006,
-0.9668630361557007,
-0.058079272508621216,
-0.3351968824863434,
-0.8102259635925293,
-0.004818516783416271,
-1.5592761039733887,
-0.2146366983652115,
0.2553964853286743,
-1.4574427604675293,
-0.4815681576728821,
-0.15136437118053436,
1.2101863622665405,
-0.1414041966199875,
1.2269076108932495,
-0.2350640743970871,
-0.34829050302505493,
-0.3609471023082733,
-0.2593171298503876,
0.08684473484754562,
-0.1155056431889534,
-0.6251785159111023,
0.31895536184310913,
-0.7738417983055115,
0.39877280592918396,
1.4415488243103027,
0.43456220626831055,
-0.05865173786878586,
0.5746090412139893,
0.9799287915229797,
0.20838792622089386,
-0.023142628371715546,
-0.9313989281654358,
-1.5232347249984741,
1.926900029182434,
-1.5662963390350342,
1.8574659824371338,
0.6712319850921631,
-0.058859892189502716,
-1.8151452541351318,
-1.816139817237854,
1.4368089437484741,
1.2912038564682007,
2.236875534057617,
0.6686042547225952,
0.29748114943504333,
-0.8028243780136108,
-0.7111858129501343,
0.2598876953125,
-1.127258539199829,
-0.7044108510017395,
0.030172625556588173,
2.267982244491577,
1.7821613550186157,
-0.5630031824111938,
-0.06713399291038513,
-1.048560380935669,
1.3609565496444702,
-0.15580374002456665,
0.269330769777298,
1.9722115993499756,
-0.40348824858665466,
-1.0778368711471558,
1.2451560497283936,
-2.2553138732910156,
0.1136842668056488,
2.0063979625701904,
0.41716551780700684,
0.11186818033456802,
-1.4081859588623047,
-0.6140347123146057,
-0.284326434135437,
-0.32744014263153076,
-1.4283894300460815,
0.49700480699539185,
-0.3194456398487091,
-0.716651976108551,
-1.5216161012649536,
0.18347695469856262,
-1.2137812376022339,
-1.6131771802902222,
0.34304171800613403,
1.9570671319961548,
2.040795087814331,
-0.5693355202674866,
1.5835129022598267,
-0.25593289732933044,
0.2607267498970032,
1.3350752592086792,
1.0930120944976807,
2.959623336791992,
1.9417712688446045,
-1.1708825826644897,
0.7233434915542603,
-0.10818882286548615,
-0.4875692129135132,
1.1606124639511108,
-1.0549840927124023,
1.3085999488830566,
-0.11229042708873749,
-1.0553170442581177,
-1.2747796773910522,
0.9484284520149231,
0.4460678994655609,
0.04800084978342056,
-0.43739089369773865,
1.2152609825134277,
0.08127571642398834,
1.332926630973816,
0.5446500182151794,
-0.3713911771774292,
0.6993423104286194,
-0.45480749011039734,
-0.4889989197254181,
1.6500781774520874,
0.3090347647666931,
-1.4068118333816528,
-2.2991256713867188,
-0.23552636802196503,
-0.7888904809951782,
0.08299937099218369,
-0.5157992839813232,
-0.9432374835014343,
1.6786824464797974,
0.47702109813690186,
-1.2810717821121216,
-0.25495317578315735,
-0.33081623911857605,
-0.6729241013526917,
2.707267999649048,
-1.4117064476013184,
-0.23614168167114258,
-0.967715859413147,
-0.5530914068222046,
1.6799695491790771,
-1.271559715270996,
-0.16871286928653717,
-1.0194449424743652,
-0.5647587776184082,
-1.3422571420669556,
-0.5586675405502319,
-0.050280630588531494,
-0.9732465147972107,
0.8588583469390869,
0.21746177971363068,
-1.110943078994751,
-0.4038960337638855,
-0.8526577949523926,
0.7970393300056458,
-0.08907496929168701,
0.2803765833377838,
1.8198063373565674,
0.438378244638443,
-0.42531394958496094,
0.6924676299095154,
1.1552040576934814,
0.6123703718185425,
-0.603264570236206,
0.29036885499954224,
-0.6547929048538208,
0.3514169156551361,
-1.2264844179153442,
0.2602735757827759,
-3.036407947540283,
0.5839696526527405,
-0.1042923852801323,
-0.09452071040868759,
-0.013834556564688683,
-1.3883709907531738,
1.1194769144058228,
2.6050984859466553,
-1.184988021850586,
0.4712415933609009,
0.27887797355651855,
1.2332783937454224,
-1.5219264030456543,
0.4669734537601471,
-0.34971389174461365,
2.12544846534729,
0.180221289396286,
1.127991795539856,
-0.6582817435264587,
-2.197470188140869,
0.6653067469596863,
-1.2192810773849487,
-1.3320235013961792,
0.5845727920532227,
-0.8963841199874878,
0.14836512506008148,
-1.493066430091858,
-0.13444387912750244,
-0.834322452545166,
-1.2246029376983643,
0.8378092646598816,
0.15435513854026794,
0.31452327966690063,
-0.5983564853668213,
0.34266000986099243,
-2.0913772583007812,
-1.3879812955856323,
-0.30006253719329834,
-0.8693029284477234,
0.5430660843849182,
-0.3249540328979492,
0.6439007520675659,
-0.06423044949769974,
0.1277330070734024,
0.4222942292690277,
1.414162039756775,
3.36297869682312,
0.09711144864559174,
0.5038338303565979,
-0.141444131731987,
-0.9085522294044495,
1.4045600891113281,
1.0826711654663086,
0.10877837240695953,
-0.5381708741188049,
-0.9784161448478699,
1.2799525260925293,
1.8598647117614746,
0.802208423614502,
0.1295779049396515,
-0.6845965385437012,
-0.5292942523956299,
-0.015636267140507698,
0.29396429657936096,
0.42342066764831543,
0.9672025442123413,
0.13086369633674622,
0.0754443034529686,
1.4334912300109863,
1.1810672283172607,
-0.5317537188529968,
0.3630267381668091,
-0.8415531516075134,
-0.4068220257759094,
0.5100027918815613,
0.37591809034347534,
-0.04979906231164932,
0.2111036479473114,
-0.8834934830665588,
-0.31202879548072815,
-0.13609272241592407,
-0.9940332174301147,
-0.7483748197555542,
-0.4668840169906616,
-0.4783828556537628,
1.814041018486023,
0.07310446351766586,
-0.5187613368034363,
-0.009061940014362335,
-0.7965674996376038,
0.021723100915551186,
-1.1123852729797363,
0.2965010404586792,
-0.1305578202009201,
-0.1319507658481598,
-0.06879372149705887,
1.8899972438812256,
-0.9752908945083618,
-1.96395742893219,
0.2905116081237793,
0.26980119943618774,
-0.3592704236507416,
0.19392645359039307,
1.4883402585983276,
0.5498282313346863,
1.6225597858428955,
1.4081299304962158,
0.9787555932998657,
-0.628176212310791,
-1.4291108846664429,
0.6135766506195068,
0.888368546962738,
-1.3716837167739868,
0.7419183850288391,
0.20359422266483307,
-0.46638157963752747,
0.6848441958427429,
1.3746304512023926,
0.449210524559021,
-1.9426342248916626,
0.76129150390625,
-0.884213387966156,
0.7663546800613403,
0.8091481328010559,
0.7451959252357483,
0.27939990162849426,
0.9127019047737122,
-1.1988996267318726,
-1.2359590530395508,
-0.962195873260498,
-0.656065821647644,
2.0788354873657227,
-0.2623184025287628,
0.59292072057724,
-0.07341384142637253,
-1.3246662616729736,
-0.10275403410196304,
0.6565861105918884,
0.5494632720947266,
-0.3479991853237152,
0.6704338788986206,
-0.6768591403961182,
-1.0776699781417847,
-1.5455142259597778,
-0.4158063232898712,
-0.9674692749977112,
-0.8480269908905029,
1.0033308267593384,
0.89524906873703,
0.2691921293735504,
1.935133934020996,
0.562110960483551,
0.2865564823150635,
-2.6312196254730225,
0.8492904901504517,
0.16664856672286987,
-0.020155683159828186,
0.9025622010231018,
0.3911036550998688,
0.9160251617431641,
-0.03608442842960358,
0.4977259635925293,
-2.369302749633789,
2.2294206619262695,
-0.3210286796092987,
0.6061939001083374,
-0.01607370376586914,
-0.23687699437141418,
1.229353666305542,
0.5442335605621338,
0.48705947399139404,
-1.0735900402069092,
0.5714130401611328,
-0.5870161056518555,
1.3643772602081299,
0.9447073936462402,
-0.6594095230102539,
0.013169948011636734,
1.2753595113754272,
0.5908997058868408,
-0.49371299147605896,
-1.0496259927749634,
-0.9077257513999939,
0.8683377504348755,
1.7431421279907227,
-0.1409710794687271,
-0.19303163886070251,
0.7648719549179077,
0.7293571829795837,
-1.2154459953308105,
0.16973230242729187,
-0.8309609889984131,
-0.8339096903800964,
1.5914244651794434,
2.135185956954956,
-0.14587457478046417,
-0.16381047666072845,
-0.7224801182746887,
-1.1478911638259888,
0.7631232142448425,
0.03793478012084961,
0.10042063146829605,
0.5950225591659546,
-0.6028473973274231,
1.1194658279418945,
1.0142921209335327,
0.9043717980384827,
0.0757594034075737,
0.5725476741790771,
0.34773436188697815,
-0.23430867493152618,
-1.0686192512512207,
-0.10134164243936539,
-1.181628942489624,
-2.734083652496338,
0.48313307762145996,
-0.4110758304595947,
-1.410005807876587,
-0.02656708098948002,
-1.085018277168274,
0.9586566686630249,
-0.49353355169296265,
-1.249674677848816,
-1.6362318992614746,
0.0775269865989685,
0.031253181397914886,
1.0601152181625366,
-1.6208924055099487,
0.06910990923643112,
1.226754903793335,
0.8707104325294495,
-0.6690775752067566,
1.0547574758529663,
0.29584845900535583,
1.125504493713379,
0.7737092971801758,
-0.46949470043182373,
0.49186521768569946,
-0.019385894760489464,
-1.3031585216522217,
0.5171151161193848,
1.0619858503341675,
0.12150833755731583,
1.3556697368621826,
-0.5259427428245544,
0.16235898435115814,
0.4800932705402374,
-0.5738164186477661,
-0.42618757486343384,
-0.5846005082130432,
0.8073540925979614,
0.1740681380033493,
-0.9071178436279297,
0.12736055254936218,
-0.0725124403834343,
-0.23244358599185944,
0.15871961414813995,
-1.4575238227844238,
-0.38566717505455017,
-0.4839026927947998,
-0.5574266910552979,
-1.238725185394287,
-0.07449708133935928,
1.3243292570114136,
-0.7019839882850647,
-0.1788051724433899,
0.4279090464115143,
0.4348791241645813,
0.569186270236969,
0.6758031249046326,
-0.7424542903900146,
-0.3661787509918213,
-0.3019862174987793,
-0.3488336205482483,
0.2480406016111374,
1.3175305128097534,
-0.12857775390148163,
-1.0412447452545166,
0.6466414928436279,
-0.38250982761383057,
0.03154183179140091,
1.869636058807373,
0.05200143903493881,
-0.8682090044021606,
0.2561962306499481,
-0.690333902835846,
1.8953971862792969,
1.6611567735671997,
1.2951751947402954,
0.03314022719860077,
-0.8812538981437683,
0.6153325438499451,
-0.16988436877727509,
-0.4366099238395691,
0.9368900060653687,
0.5693748593330383,
-0.177285298705101,
-1.3593499660491943,
0.6577919721603394,
1.33418869972229,
-0.7752443552017212,
-0.8485670685768127,
0.022249722853302956,
-0.6868380308151245,
1.0442219972610474,
0.6890017986297607,
0.4459327757358551,
0.3104379177093506,
1.5696887969970703,
0.7106199264526367,
-0.4699561595916748,
0.5082561373710632,
0.5157129168510437,
-0.2004958838224411,
-2.2097277641296387,
-1.1928359270095825,
0.2397017925977707,
-0.5459569692611694,
-1.5472602844238281,
1.3961904048919678,
-1.0457713603973389,
-0.7807077169418335,
0.5034940838813782,
0.14258582890033722,
1.6053297519683838,
0.48805469274520874,
1.5277950763702393,
1.9637634754180908,
0.8687993288040161,
0.24481089413166046,
1.5009263753890991,
-0.14759209752082825,
-0.4986531436443329,
1.9318135976791382,
-0.5240539908409119,
0.46607035398483276,
1.099457859992981,
-0.20186932384967804,
-1.0665075778961182,
-0.7802929282188416,
-1.1152963638305664,
-0.5914980173110962,
1.0832356214523315,
0.12670914828777313,
-1.1891604661941528,
0.1751355081796646,
1.4980278015136719,
0.17708811163902283,
-0.34172141551971436,
0.3719027042388916,
0.32125145196914673,
-0.7769941687583923,
-0.10179345309734344,
-1.0260387659072876,
0.5051540732383728,
-0.32181820273399353,
-0.34245485067367554,
0.366030216217041,
0.5157274007797241,
1.2415214776992798,
-0.1332615613937378,
0.15357625484466553,
1.1427496671676636,
-1.4888055324554443,
1.3930332660675049,
-0.583617627620697,
0.2994961440563202,
-2.3737945556640625,
1.4728333950042725,
-0.7031649351119995,
1.8909416198730469,
-2.797975540161133,
0.32131466269493103,
-0.5669472813606262,
-0.425757497549057,
0.3171865940093994,
-0.3804153501987457,
0.19769008457660675,
-0.10941071808338165,
-1.2095729112625122,
0.0642109215259552,
-0.7175605893135071,
0.4625292718410492,
1.0890146493911743,
1.3248934745788574,
-1.0987725257873535,
-0.23459570109844208,
-1.746774435043335,
-0.08253706991672516,
-0.6735422015190125,
0.4131605327129364,
-2.1464126110076904,
-0.12234704196453094,
-1.8432881832122803,
-2.2574429512023926,
-1.249373197555542,
-0.7569351196289062,
1.115450143814087,
0.1254177987575531,
-0.8268446326255798,
1.0479052066802979,
-0.31829139590263367,
-1.7642178535461426,
1.0440622568130493,
-2.1591949462890625
] |
https://github.com/huggingface/datasets/issues/4980 | Make `pyarrow` optional | Thanks for the info. Could `datasets` then be made optional for `transformers` instead? I used `transformers` only to deal with pretrained models to deploy them (convert to ONNX, and then I use TVM), so I don't really need `pyarrow` and `datasets` by now.
| **Is your feature request related to a problem? Please describe.**
Is `pyarrow` really needed for every dataset?
**Describe the solution you'd like**
It is made optional.
**Describe alternatives you've considered**
Likely, no.
| 526 | 43 | Make `pyarrow` optional
**Is your feature request related to a problem? Please describe.**
Is `pyarrow` really needed for every dataset?
**Describe the solution you'd like**
It is made optional.
**Describe alternatives you've considered**
Likely, no.
Thanks for the info. Could `datasets` then be made optional for `transformers` instead? I used `transformers` only to deal with pretrained models to deploy them (convert to ONNX, and then I use TVM), so I don't really need `pyarrow` and `datasets` by now.
| [
-1.298287272453308,
-0.9520204067230225,
-0.6742786169052124,
1.3552048206329346,
-0.23533661663532257,
-1.3268135786056519,
0.22780770063400269,
-1.1756871938705444,
1.8933429718017578,
-0.8104132413864136,
0.35542425513267517,
-1.7115174531936646,
0.010630709119141102,
-0.544163703918457,
-0.9105389714241028,
-0.6896700263023376,
-0.47555381059646606,
-0.8543219566345215,
0.950105607509613,
2.423983097076416,
1.122807264328003,
-1.437518835067749,
2.573594570159912,
0.6039147973060608,
-0.12689627707004547,
-1.0304762125015259,
0.3892636299133301,
0.10034456104040146,
-1.0975733995437622,
-0.5792453289031982,
-0.9765555262565613,
-0.12525233626365662,
-0.5024895071983337,
-0.6493553519248962,
0.05138102173805237,
0.4336819052696228,
-0.2611074149608612,
-0.5297498106956482,
-0.4393850564956665,
-0.6575429439544678,
0.5181475877761841,
-0.5081588625907898,
0.9567093849182129,
-0.5521804094314575,
1.8303214311599731,
-0.5959311127662659,
0.558188259601593,
0.7331565022468567,
1.5456188917160034,
0.1548820436000824,
-0.15718480944633484,
0.3864724338054657,
0.4645826816558838,
-0.04183988645672798,
0.5104038119316101,
1.0859816074371338,
0.5070409774780273,
0.7037593722343445,
0.7090950012207031,
-2.1816141605377197,
1.2892094850540161,
-1.1506011486053467,
0.2484053671360016,
1.4239811897277832,
-0.9763087630271912,
0.3334665298461914,
-1.8315391540527344,
0.05287354812026024,
0.48963844776153564,
-2.284543991088867,
0.2500078082084656,
-1.2787401676177979,
-0.5378744006156921,
1.03575599193573,
0.4067927598953247,
-1.4543098211288452,
0.10052258521318436,
-0.34561842679977417,
0.9255527853965759,
0.2975769639015198,
1.0341802835464478,
-1.656201720237732,
-0.05561097711324692,
-0.4796566665172577,
-0.05802248418331146,
-1.2575089931488037,
-1.4580761194229126,
0.6149989366531372,
0.5943640470504761,
0.6015531420707703,
-0.1353902667760849,
0.9575051069259644,
-0.961195170879364,
0.7575064301490784,
-1.0563656091690063,
-1.7109863758087158,
-1.2805734872817993,
-2.0177359580993652,
-2.1262993812561035,
1.0129343271255493,
-0.455238938331604,
-0.587427020072937,
1.9554815292358398,
-0.9312829375267029,
-1.8465452194213867,
1.1628955602645874,
0.36010849475860596,
0.04345705360174179,
2.3343465328216553,
0.2642660439014435,
-0.6152861714363098,
0.4528549015522003,
-0.7056772112846375,
0.8815276622772217,
-0.5420306324958801,
1.5071020126342773,
0.42862823605537415,
-1.0162131786346436,
1.7044672966003418,
-0.3622968792915344,
0.694849967956543,
-0.6400534510612488,
-0.6116857528686523,
-0.8207007050514221,
0.461058646440506,
2.0058043003082275,
-0.2955722212791443,
1.375883936882019,
-0.5343949198722839,
-1.6126766204833984,
-1.6044806241989136,
0.9628681540489197,
0.5302823185920715,
-0.7392227649688721,
0.06174377724528313,
-0.2146974503993988,
0.07770005613565445,
-0.10656300187110901,
1.1155380010604858,
1.2335001230239868,
0.7787500023841858,
-0.24614493548870087,
-0.8497441411018372,
0.18551163375377655,
-0.017061270773410797,
-0.7876265645027161,
-1.7707464694976807,
-0.3947584927082062,
0.13860484957695007,
0.59312504529953,
-1.196968913078308,
1.6930768489837646,
0.9697215557098389,
1.9550118446350098,
0.9683326482772827,
-0.33994486927986145,
1.36629319190979,
0.04966975376009941,
1.9077235460281372,
-0.47808387875556946,
0.7192782759666443,
-0.23660406470298767,
-1.0042024850845337,
0.8303622007369995,
-0.3625444173812866,
-2.0707788467407227,
-0.8045752048492432,
-0.9321296811103821,
-0.163288876414299,
-0.6656761765480042,
0.9626485705375671,
-0.2870017886161804,
-1.334863305091858,
0.16839413344860077,
-0.6517918109893799,
0.18807703256607056,
-1.257552981376648,
0.41142067313194275,
0.7594267725944519,
-0.5949704647064209,
-0.0777272954583168,
-0.2793932259082794,
-1.3469499349594116,
-0.5182965993881226,
0.1616380661725998,
1.927205204963684,
-0.832680344581604,
1.0147747993469238,
0.9499097466468811,
-0.8852407336235046,
-0.18671759963035583,
0.38755881786346436,
-0.306626558303833,
0.806175947189331,
-1.1368836164474487,
-0.37735217809677124,
1.1166348457336426,
-0.050352465361356735,
-0.5137816667556763,
1.5696216821670532,
0.7476020455360413,
-0.94758141040802,
0.022740907967090607,
-0.35468021035194397,
-0.786329984664917,
0.060302626341581345,
-1.5340394973754883,
-0.207783043384552,
0.2497718334197998,
-1.4992870092391968,
-0.5418474674224854,
-0.15401996672153473,
1.2369365692138672,
-0.1431562751531601,
1.1737358570098877,
-0.23026202619075775,
-0.3391917943954468,
-0.3434326648712158,
-0.23359383642673492,
0.10328720510005951,
-0.16389964520931244,
-0.6616754531860352,
0.17814771831035614,
-0.7176851034164429,
0.485792875289917,
1.381335735321045,
0.42897850275039673,
-0.10042164474725723,
0.6197672486305237,
0.9961122870445251,
0.221510112285614,
0.014080372639000416,
-0.9187532067298889,
-1.4576585292816162,
1.8357932567596436,
-1.507598876953125,
1.8421146869659424,
0.58919358253479,
-0.10749001801013947,
-1.6808770895004272,
-1.8372209072113037,
1.4470634460449219,
1.3498213291168213,
2.236323595046997,
0.7104716897010803,
0.37258875370025635,
-0.7946224212646484,
-0.6883199214935303,
0.24220618605613708,
-1.1253949403762817,
-0.6503008604049683,
0.06128319725394249,
2.2353479862213135,
1.7393819093704224,
-0.7159822583198547,
-0.19177241623401642,
-1.1204845905303955,
1.384470820426941,
-0.21357685327529907,
0.2597660720348358,
2.0362637042999268,
-0.4361070692539215,
-1.087379813194275,
1.2954075336456299,
-2.2231128215789795,
0.1470154970884323,
1.9490282535552979,
0.27667227387428284,
0.08959241211414337,
-1.5070549249649048,
-0.5421504378318787,
-0.11995629221200943,
-0.317851185798645,
-1.382030725479126,
0.5756670832633972,
-0.23452462255954742,
-0.6983592510223389,
-1.4526962041854858,
0.2270335704088211,
-1.172369122505188,
-1.5829622745513916,
0.31542590260505676,
2.1003262996673584,
1.9043028354644775,
-0.5671524405479431,
1.5848816633224487,
-0.2565874457359314,
0.18870507180690765,
1.3611658811569214,
1.0686157941818237,
2.964015245437622,
1.9259928464889526,
-1.079831600189209,
0.7052149176597595,
-0.24883288145065308,
-0.5860453248023987,
1.1333208084106445,
-1.0406707525253296,
1.2497081756591797,
-0.15186366438865662,
-1.0444507598876953,
-1.1978137493133545,
0.8094000220298767,
0.5373242497444153,
0.12117872387170792,
-0.43426281213760376,
1.1538505554199219,
0.09904945641756058,
1.2763862609863281,
0.4837743937969208,
-0.3540858030319214,
0.7924625277519226,
-0.43627744913101196,
-0.3795020878314972,
1.6028672456741333,
0.290143758058548,
-1.3039653301239014,
-2.3017940521240234,
-0.19473305344581604,
-0.8662748336791992,
0.13388532400131226,
-0.5454796552658081,
-1.0111132860183716,
1.6053653955459595,
0.5861582159996033,
-1.1980193853378296,
-0.2746555209159851,
-0.3274669349193573,
-0.6801700592041016,
2.6992735862731934,
-1.4033997058868408,
-0.2845577895641327,
-0.9735429286956787,
-0.4980708062648773,
1.7087935209274292,
-1.2374378442764282,
-0.16720424592494965,
-0.9996691346168518,
-0.5420025587081909,
-1.2869309186935425,
-0.5808396935462952,
-0.06525520980358124,
-0.927690327167511,
0.9174785614013672,
0.2014998346567154,
-1.1279643774032593,
-0.35376080870628357,
-0.8167411088943481,
0.6827107071876526,
-0.08722104132175446,
0.2822595536708832,
1.8551795482635498,
0.4392540454864502,
-0.33838579058647156,
0.7210753560066223,
1.2058955430984497,
0.5318017601966858,
-0.5300814509391785,
0.3759474456310272,
-0.6104308366775513,
0.38595420122146606,
-1.2833586931228638,
0.2625507116317749,
-2.980525493621826,
0.5966886281967163,
-0.09901285171508789,
-0.04760158434510231,
-0.032935161143541336,
-1.4621150493621826,
1.1155197620391846,
2.585322618484497,
-1.163700819015503,
0.39944082498550415,
0.2545996904373169,
1.2894482612609863,
-1.4440076351165771,
0.33989807963371277,
-0.40263938903808594,
2.098114252090454,
0.19481171667575836,
1.0988487005233765,
-0.5960120558738708,
-2.2009241580963135,
0.6837817430496216,
-1.1592973470687866,
-1.441460132598877,
0.5500165820121765,
-0.8341654539108276,
0.0014901719987392426,
-1.5674419403076172,
-0.1699354350566864,
-0.8203004002571106,
-1.131049394607544,
0.8853045105934143,
0.13052287697792053,
0.3498331904411316,
-0.6419394612312317,
0.3432934582233429,
-2.1017956733703613,
-1.5099176168441772,
-0.32629963755607605,
-0.8681533932685852,
0.5583685040473938,
-0.25039419531822205,
0.6190708875656128,
-0.06740160286426544,
0.11340174823999405,
0.31235215067863464,
1.4789882898330688,
3.2670302391052246,
0.11273884773254395,
0.4299049973487854,
-0.20082631707191467,
-0.8092043995857239,
1.3876385688781738,
1.0728601217269897,
0.09066839516162872,
-0.5983608961105347,
-1.025691270828247,
1.2545249462127686,
1.9108954668045044,
0.8240361213684082,
0.1282198280096054,
-0.7625800967216492,
-0.4981774687767029,
-0.12675081193447113,
0.20205943286418915,
0.4245631694793701,
0.9862768650054932,
0.2340145856142044,
0.08706390857696533,
1.2373335361480713,
1.2250213623046875,
-0.5799512267112732,
0.41861748695373535,
-0.7306616902351379,
-0.44197291135787964,
0.4994807839393616,
0.402117520570755,
0.03646324947476387,
0.1539745032787323,
-0.930041491985321,
-0.24092337489128113,
-0.1277807205915451,
-1.054313063621521,
-0.8632559180259705,
-0.40422993898391724,
-0.4187960922718048,
1.7946908473968506,
0.08829961717128754,
-0.6278731822967529,
-0.11344355344772339,
-0.8424648642539978,
0.07839861512184143,
-0.9987465143203735,
0.17916499078273773,
-0.18546873331069946,
-0.09639188647270203,
-0.062053557485342026,
1.7745025157928467,
-0.9487844109535217,
-1.9788445234298706,
0.2237967699766159,
0.3688429296016693,
-0.42231544852256775,
0.25733891129493713,
1.555867314338684,
0.6380522847175598,
1.5825510025024414,
1.4074991941452026,
0.9695674777030945,
-0.5170718431472778,
-1.3534855842590332,
0.5500569343566895,
0.845741331577301,
-1.356697916984558,
0.6848329305648804,
0.39687836170196533,
-0.46448034048080444,
0.6734726428985596,
1.366161584854126,
0.40355730056762695,
-1.9817296266555786,
0.7808634042739868,
-0.8903391361236572,
0.8827690482139587,
0.7044828534126282,
0.8267931938171387,
0.4218560755252838,
0.8814088106155396,
-1.1519496440887451,
-1.2848846912384033,
-1.0018274784088135,
-0.7065446376800537,
2.1286306381225586,
-0.29132530093193054,
0.6388344168663025,
-0.06448129564523697,
-1.297457218170166,
-0.15488643944263458,
0.6666730046272278,
0.5567064881324768,
-0.34155336022377014,
0.5818224549293518,
-0.6022869348526001,
-1.0786463022232056,
-1.5214589834213257,
-0.4700337052345276,
-0.9444175958633423,
-0.8274637460708618,
0.9903044104576111,
0.9538260698318481,
0.412229984998703,
1.8559283018112183,
0.6588556170463562,
0.23441332578659058,
-2.6320953369140625,
0.8157113790512085,
0.30666443705558777,
-0.12354066222906113,
0.8167838454246521,
0.4166420102119446,
0.8429936170578003,
-0.14410461485385895,
0.5344953536987305,
-2.3808963298797607,
2.2586278915405273,
-0.2534661591053009,
0.561403751373291,
0.018195535987615585,
-0.0777118057012558,
1.2814784049987793,
0.5358461737632751,
0.4959185719490051,
-1.1626209020614624,
0.5848208069801331,
-0.5992769002914429,
1.423990249633789,
0.8244891166687012,
-0.6796045303344727,
-0.10143385082483292,
1.3557697534561157,
0.5638452172279358,
-0.4872030019760132,
-0.972520649433136,
-0.9748526811599731,
0.8996533751487732,
1.7564465999603271,
-0.20228040218353271,
-0.14489446580410004,
0.7973865270614624,
0.7043179273605347,
-1.2848247289657593,
0.08892907947301865,
-0.847859799861908,
-0.7735170125961304,
1.6421860456466675,
2.1675148010253906,
-0.16162042319774628,
-0.23665399849414825,
-0.7834770083427429,
-1.1879116296768188,
0.8070934414863586,
0.10888504236936569,
0.06850223243236542,
0.5064620971679688,
-0.6612384915351868,
1.2748574018478394,
0.9421203136444092,
0.8881818056106567,
0.04835287854075432,
0.577313244342804,
0.30778980255126953,
-0.2383691668510437,
-1.1254469156265259,
-0.16470256447792053,
-1.1857576370239258,
-2.692514419555664,
0.4181183874607086,
-0.39591050148010254,
-1.4347401857376099,
-0.0723804384469986,
-1.1028233766555786,
0.8598394393920898,
-0.5237855911254883,
-1.2360960245132446,
-1.6512420177459717,
0.047304313629865646,
0.11633088439702988,
1.0169055461883545,
-1.6497613191604614,
0.11059651523828506,
1.2012861967086792,
0.8628560304641724,
-0.8010111451148987,
0.9702938795089722,
0.37297523021698,
1.0870921611785889,
0.8361545205116272,
-0.5312862992286682,
0.5180352926254272,
-0.06538376212120056,
-1.2629865407943726,
0.625458300113678,
1.1963309049606323,
0.07001479715108871,
1.3608475923538208,
-0.6072509288787842,
0.05814538523554802,
0.4891645908355713,
-0.6144319772720337,
-0.4520888030529022,
-0.5929193496704102,
0.7067903280258179,
0.147184357047081,
-0.9363210797309875,
0.11183597892522812,
0.03140104562044144,
-0.17377808690071106,
0.22357767820358276,
-1.5184431076049805,
-0.317453533411026,
-0.40269991755485535,
-0.5595242977142334,
-1.1494028568267822,
-0.13775032758712769,
1.334149718284607,
-0.6579897403717041,
-0.20565739274024963,
0.49298346042633057,
0.3616202771663666,
0.5720783472061157,
0.5251255035400391,
-0.7286118865013123,
-0.40441447496414185,
-0.2865601181983948,
-0.47197282314300537,
0.21772265434265137,
1.4225893020629883,
-0.19280210137367249,
-0.9733986854553223,
0.6298455595970154,
-0.44516149163246155,
-0.08345898240804672,
1.8686964511871338,
0.07748188823461533,
-0.8721757531166077,
0.3097897171974182,
-0.8056576251983643,
1.8988138437271118,
1.6286264657974243,
1.2187727689743042,
0.04529448598623276,
-0.8662139773368835,
0.5426356196403503,
-0.19894109666347504,
-0.515103280544281,
0.9069507122039795,
0.4803203344345093,
-0.20301660895347595,
-1.3733174800872803,
0.6604908108711243,
1.3696900606155396,
-0.8724794387817383,
-0.9872073531150818,
-0.02137671411037445,
-0.7952229976654053,
1.0680294036865234,
0.7010773420333862,
0.5145169496536255,
0.25954511761665344,
1.6256814002990723,
0.7098634839057922,
-0.36486145853996277,
0.5922846794128418,
0.5212569236755371,
-0.073252834379673,
-2.2331771850585938,
-1.2958059310913086,
0.2835208773612976,
-0.5837824940681458,
-1.5507982969284058,
1.3668879270553589,
-1.0145988464355469,
-0.8117126822471619,
0.5382387638092041,
0.2670300006866455,
1.7375329732894897,
0.44822150468826294,
1.5231610536575317,
1.9756330251693726,
0.9594836831092834,
0.2991305887699127,
1.4341285228729248,
-0.18797869980335236,
-0.5142502784729004,
1.9433971643447876,
-0.5616553425788879,
0.4306944012641907,
1.1294467449188232,
-0.17143481969833374,
-1.0688917636871338,
-0.7351869344711304,
-1.2126657962799072,
-0.6684423089027405,
1.1078383922576904,
0.1969793438911438,
-1.2080209255218506,
0.2265491783618927,
1.547281265258789,
0.13661031424999237,
-0.347307026386261,
0.36254754662513733,
0.3544234335422516,
-0.9450045228004456,
-0.15983007848262787,
-0.9618942737579346,
0.46536657214164734,
-0.2329050451517105,
-0.38075873255729675,
0.3643096089363098,
0.554332971572876,
1.2342087030410767,
-0.24683979153633118,
0.11666720360517502,
1.0650309324264526,
-1.5186196565628052,
1.5054923295974731,
-0.6637383699417114,
0.29165101051330566,
-2.3894169330596924,
1.5200482606887817,
-0.6876841187477112,
2.0140044689178467,
-2.77705717086792,
0.2823827266693115,
-0.6168760657310486,
-0.39302900433540344,
0.3177056312561035,
-0.3585194945335388,
0.15866877138614655,
-0.14621718227863312,
-1.3646719455718994,
0.04833560064435005,
-0.7075687646865845,
0.5478733777999878,
1.0433622598648071,
1.3832674026489258,
-1.1436618566513062,
-0.22538143396377563,
-1.7563973665237427,
-0.09891954809427261,
-0.5912734866142273,
0.4702450931072235,
-2.1417338848114014,
-0.14712032675743103,
-1.855654239654541,
-2.123087167739868,
-1.2776645421981812,
-0.7191532254219055,
1.0997308492660522,
-0.008123201318085194,
-0.787028431892395,
1.02106511592865,
-0.3397708237171173,
-1.8035929203033447,
1.013119101524353,
-2.2062485218048096
] |
https://github.com/huggingface/datasets/issues/4977 | Providing dataset size | Hi @sashavor, thanks for your suggestion.
Until now we have the CLI command
```
datasets-cli test datasets/<your-dataset-folder> --save_infos --all_configs
```
that generates the `dataset_infos.json` with the size of the downloaded dataset, among other information.
We are currently in the middle of removing those JSON files and putting their information directly in the header of the `README.md` (as YAML tags). Normally, the CLI command should continue working but saving its output to the dataset card instead. See:
- #4926 | **Is your feature request related to a problem? Please describe.**
Especially for big datasets like [LAION](https://huggingface.co/datasets/laion/laion2B-en/), it's hard to know exactly the downloaded size (because there are many files and you don't have their exact size when downloaded).
**Describe the solution you'd like**
Auto-populating the downloaded dataset size on the dataset page would be really useful, including that of each split (when there are some).
**Describe alternatives you've considered**
People should be adding this to dataset cards, but I don't think that is systematically the case :slightly_smiling_face:
**Additional context**
Mentioned to @lhoestq
| 527 | 78 | Providing dataset size
**Is your feature request related to a problem? Please describe.**
Especially for big datasets like [LAION](https://huggingface.co/datasets/laion/laion2B-en/), it's hard to know exactly the downloaded size (because there are many files and you don't have their exact size when downloaded).
**Describe the solution you'd like**
Auto-populating the downloaded dataset size on the dataset page would be really useful, including that of each split (when there are some).
**Describe alternatives you've considered**
People should be adding this to dataset cards, but I don't think that is systematically the case :slightly_smiling_face:
**Additional context**
Mentioned to @lhoestq
Hi @sashavor, thanks for your suggestion.
Until now we have the CLI command
```
datasets-cli test datasets/<your-dataset-folder> --save_infos --all_configs
```
that generates the `dataset_infos.json` with the size of the downloaded dataset, among other information.
We are currently in the middle of removing those JSON files and putting their information directly in the header of the `README.md` (as YAML tags). Normally, the CLI command should continue working but saving its output to the dataset card instead. See:
- #4926 | [
-1.2119687795639038,
-0.9335975646972656,
-0.7782955765724182,
1.3705039024353027,
-0.19030418992042542,
-1.2947285175323486,
0.06452353298664093,
-1.11398184299469,
1.7573416233062744,
-0.852889358997345,
0.26854774355888367,
-1.7615656852722168,
0.0368562713265419,
-0.5645166635513306,
-0.8220168352127075,
-0.8603432774543762,
-0.4491884112358093,
-0.8263431191444397,
0.9518690705299377,
2.4647133350372314,
1.2086365222930908,
-1.4058239459991455,
2.751702070236206,
0.6360628008842468,
-0.14211405813694,
-1.0062170028686523,
0.5754629373550415,
0.0338192917406559,
-1.2707240581512451,
-0.471815824508667,
-0.9236429929733276,
-0.09521414339542389,
-0.5351032018661499,
-0.5618085861206055,
0.08501012623310089,
0.358490914106369,
-0.1795618087053299,
-0.37736183404922485,
-0.5033555030822754,
-0.6958274841308594,
0.5298935174942017,
-0.3998662233352661,
0.9119889736175537,
-0.5106936693191528,
1.892029047012329,
-0.6231840252876282,
0.4057747721672058,
0.7438808679580688,
1.449820637702942,
0.2477259784936905,
-0.03805757313966751,
0.3542049825191498,
0.3799269199371338,
0.010603456757962704,
0.45818591117858887,
1.084518313407898,
0.6627497673034668,
0.5358720421791077,
0.7261596918106079,
-2.2078700065612793,
1.3510774374008179,
-1.1104639768600464,
0.32312124967575073,
1.4884790182113647,
-1.0339460372924805,
0.4014695882797241,
-1.823006510734558,
0.016461245715618134,
0.5802685618400574,
-2.351543664932251,
0.1582328826189041,
-1.2168079614639282,
-0.5547552704811096,
1.0047873258590698,
0.23977205157279968,
-1.297412395477295,
0.20903988182544708,
-0.4314758777618408,
1.0277047157287598,
0.5437601208686829,
1.1111265420913696,
-1.7464039325714111,
0.034355856478214264,
-0.28265494108200073,
0.013388999737799168,
-1.3555750846862793,
-1.535710096359253,
0.6257548928260803,
0.6128214597702026,
0.5302713513374329,
-0.12381134182214737,
0.8595893979072571,
-0.9765862226486206,
0.8702009916305542,
-1.036289095878601,
-1.6772962808609009,
-1.4530755281448364,
-2.18109130859375,
-2.286370038986206,
0.8921937942504883,
-0.450689435005188,
-0.522493302822113,
1.9857033491134644,
-1.0469106435775757,
-1.7458873987197876,
1.1424486637115479,
0.27879104018211365,
0.07648874819278717,
2.3616912364959717,
0.19557084143161774,
-0.6649377346038818,
0.4007948040962219,
-0.7241590023040771,
0.8522440195083618,
-0.37030673027038574,
1.3888156414031982,
0.4616733193397522,
-1.0627353191375732,
1.6412931680679321,
-0.46371254324913025,
0.4824508726596832,
-0.6528235673904419,
-0.5442578196525574,
-0.8849714398384094,
0.4060852825641632,
1.9666104316711426,
-0.25817450881004333,
1.59248948097229,
-0.3685063123703003,
-1.6224353313446045,
-1.5315812826156616,
0.8581739664077759,
0.46030256152153015,
-0.8718515038490295,
0.11491618305444717,
-0.4025264084339142,
0.09396882355213165,
-0.056064896285533905,
1.1418704986572266,
1.125401258468628,
0.7282302975654602,
-0.37416860461235046,
-0.8967993259429932,
0.19119800627231598,
-0.056830376386642456,
-0.6546999216079712,
-1.829245686531067,
-0.3774780333042145,
0.1170264407992363,
0.6270713210105896,
-1.1476962566375732,
1.721758246421814,
0.8772856593132019,
1.8760814666748047,
1.0605121850967407,
-0.33074888586997986,
1.418612003326416,
0.07257476449012756,
1.9353523254394531,
-0.5583304762840271,
0.7318515777587891,
-0.36089134216308594,
-1.1117770671844482,
0.8487153649330139,
-0.3739033639431,
-2.059014320373535,
-0.7835716009140015,
-0.8714591860771179,
-0.20008069276809692,
-0.7758283615112305,
1.0098687410354614,
-0.2153933197259903,
-1.3239431381225586,
0.25918468832969666,
-0.5729948878288269,
0.1499055176973343,
-1.27821946144104,
0.3722946047782898,
0.8467932343482971,
-0.6873079538345337,
0.02608008310198784,
-0.28200411796569824,
-1.3640466928482056,
-0.5242848992347717,
0.1840241253376007,
1.910628080368042,
-0.8008438944816589,
0.9301469326019287,
0.8885425925254822,
-0.7357276082038879,
-0.046729180961847305,
0.32102981209754944,
-0.2523460388183594,
0.814389169216156,
-1.0086745023727417,
-0.35098445415496826,
1.1274198293685913,
-0.21441209316253662,
-0.5291786193847656,
1.4983144998550415,
0.689582347869873,
-1.0155222415924072,
-0.18457774817943573,
-0.2717381417751312,
-0.8996629118919373,
-0.03918374702334404,
-1.4936144351959229,
-0.0994206964969635,
0.2714969515800476,
-1.4796102046966553,
-0.550584077835083,
-0.18453940749168396,
1.243096113204956,
-0.15011143684387207,
1.3373578786849976,
-0.3645032048225403,
-0.30450576543807983,
-0.45779934525489807,
-0.43879184126853943,
0.24864168465137482,
-0.15875650942325592,
-0.6923795938491821,
0.27625542879104614,
-0.8102236986160278,
0.3786373436450958,
1.4025039672851562,
0.4607734680175781,
-0.00624613743275404,
0.6133931875228882,
1.1087623834609985,
0.21757031977176666,
-0.0903153046965599,
-0.8237367272377014,
-1.5686386823654175,
2.112549066543579,
-1.4936864376068115,
1.8460406064987183,
0.6602545976638794,
-0.10213324427604675,
-1.7858619689941406,
-1.7899374961853027,
1.3383457660675049,
1.2412645816802979,
2.2639071941375732,
0.563003420829773,
0.4025975167751312,
-0.8338026404380798,
-0.6871408820152283,
0.324087530374527,
-1.0162134170532227,
-0.7436906695365906,
0.03908331319689751,
2.3168089389801025,
1.7765918970108032,
-0.5887883305549622,
-0.1114148497581482,
-0.9947395324707031,
1.3794968128204346,
-0.2073831558227539,
0.2572323679924011,
2.010685920715332,
-0.33617842197418213,
-1.1451646089553833,
1.3407196998596191,
-2.337369918823242,
0.23524260520935059,
2.008971929550171,
0.3574957847595215,
0.09971637278795242,
-1.3648216724395752,
-0.6094797849655151,
-0.27259305119514465,
-0.35283759236335754,
-1.3526967763900757,
0.5262094140052795,
-0.2942885756492615,
-0.8532671928405762,
-1.49319326877594,
0.11858674138784409,
-1.1033947467803955,
-1.6068415641784668,
0.40835288166999817,
1.8160765171051025,
1.977527379989624,
-0.6146337985992432,
1.479751706123352,
-0.2001878321170807,
0.22502142190933228,
1.3001902103424072,
1.167657732963562,
3.127692222595215,
1.9239474534988403,
-1.2597954273223877,
0.5717698335647583,
-0.1862669438123703,
-0.46301254630088806,
1.2028553485870361,
-1.0239535570144653,
1.2399230003356934,
-0.18599924445152283,
-1.241326928138733,
-1.30825936794281,
1.0037533044815063,
0.5005972981452942,
0.09126002341508865,
-0.5088940262794495,
1.247450828552246,
-0.02429986000061035,
1.3639886379241943,
0.5840383172035217,
-0.4416886866092682,
0.5140573978424072,
-0.4841381311416626,
-0.5262129902839661,
1.6464903354644775,
0.261318176984787,
-1.4115378856658936,
-2.2700655460357666,
-0.20810014009475708,
-0.8360358476638794,
0.012833832763135433,
-0.5697424411773682,
-0.942634105682373,
1.6222782135009766,
0.5055570602416992,
-1.3196349143981934,
-0.2816161811351776,
-0.3424486517906189,
-0.7198130488395691,
2.6557610034942627,
-1.4565362930297852,
-0.21116352081298828,
-0.9402361512184143,
-0.584500789642334,
1.7019212245941162,
-1.2829877138137817,
-0.14510445296764374,
-1.001104474067688,
-0.6483091115951538,
-1.304050087928772,
-0.4959971606731415,
-0.11127327382564545,
-0.9248368144035339,
0.878464937210083,
0.07493378221988678,
-1.069597840309143,
-0.33998438715934753,
-0.9129831790924072,
0.7747926115989685,
-0.1757325530052185,
0.2880077660083771,
1.828892469406128,
0.3879637122154236,
-0.3719300329685211,
0.6676865220069885,
1.1778249740600586,
0.6855787634849548,
-0.6689882874488831,
0.17588604986667633,
-0.6684660315513611,
0.33102652430534363,
-1.3057090044021606,
0.3076242208480835,
-2.9280717372894287,
0.6606506705284119,
-0.11885309964418411,
-0.059749092906713486,
-0.07218479365110397,
-1.3472431898117065,
1.0889308452606201,
2.5389046669006348,
-1.2177724838256836,
0.4471159875392914,
0.27950969338417053,
1.2582682371139526,
-1.6158854961395264,
0.29679980874061584,
-0.4089815616607666,
2.152381181716919,
0.1546185314655304,
1.1651686429977417,
-0.48924532532691956,
-2.1985514163970947,
0.6588354110717773,
-1.1769002676010132,
-1.2256873846054077,
0.6963209509849548,
-0.8033176064491272,
0.09537216275930405,
-1.5151405334472656,
-0.19449353218078613,
-0.9139685034751892,
-1.2598994970321655,
0.8096491098403931,
0.14575843513011932,
0.40234658122062683,
-0.5950134992599487,
0.25631704926490784,
-2.1646676063537598,
-1.3114213943481445,
-0.22563283145427704,
-0.8737066984176636,
0.4348645806312561,
-0.2433624565601349,
0.6956786513328552,
-0.019651902839541435,
0.06546133011579514,
0.3364753723144531,
1.4263218641281128,
3.35024356842041,
0.1785798817873001,
0.4438022971153259,
-0.1659967601299286,
-0.8958824872970581,
1.4379339218139648,
0.9575814008712769,
-0.06750785559415817,
-0.505875289440155,
-1.0265746116638184,
1.2893710136413574,
1.8893752098083496,
0.9746795892715454,
0.05971384048461914,
-0.7735955715179443,
-0.6134346723556519,
0.0061455825343728065,
0.18115821480751038,
0.5010743141174316,
0.8777781128883362,
0.024071626365184784,
0.1439453810453415,
1.454997181892395,
1.2463197708129883,
-0.4045986533164978,
0.37115129828453064,
-0.7842146754264832,
-0.49691152572631836,
0.5024498701095581,
0.41258057951927185,
0.038383133709430695,
0.2908249497413635,
-1.01422119140625,
-0.22744309902191162,
-0.25306257605552673,
-0.9442576766014099,
-0.7078394889831543,
-0.48978206515312195,
-0.4895770847797394,
1.6393014192581177,
0.04714421555399895,
-0.5302379727363586,
-0.07381796091794968,
-0.7957398891448975,
-0.127863809466362,
-1.1386950016021729,
0.3494178056716919,
-0.08761152625083923,
-0.15279528498649597,
-0.18379241228103638,
1.7513564825057983,
-0.9749936461448669,
-2.084164619445801,
0.25660884380340576,
0.3045051693916321,
-0.4561687111854553,
0.1161726787686348,
1.5999083518981934,
0.5054905414581299,
1.4546765089035034,
1.4669080972671509,
1.008043885231018,
-0.6347185969352722,
-1.336305022239685,
0.6602055430412292,
0.8838299512863159,
-1.4148261547088623,
0.8034889698028564,
0.06719424575567245,
-0.5410266518592834,
0.7282966375350952,
1.2887076139450073,
0.33724066615104675,
-1.9303345680236816,
0.8195213675498962,
-0.942557156085968,
0.7383365631103516,
0.7292218208312988,
0.7889603972434998,
0.20737017691135406,
0.8989752531051636,
-1.2927074432373047,
-1.1669739484786987,
-0.8451393246650696,
-0.5911767482757568,
1.9319157600402832,
-0.24374903738498688,
0.48481518030166626,
-0.110369473695755,
-1.2008546590805054,
-0.07221769541501999,
0.6722298264503479,
0.3999527096748352,
-0.2749361991882324,
0.8095073103904724,
-0.6899793148040771,
-1.1710097789764404,
-1.4139567613601685,
-0.3611902892589569,
-0.9830021262168884,
-0.824296236038208,
1.0529906749725342,
0.8972270488739014,
0.3595775067806244,
1.9032766819000244,
0.5935686230659485,
0.2482433170080185,
-2.66526198387146,
0.8406496047973633,
0.22328048944473267,
-0.10293151438236237,
0.8889156579971313,
0.32847872376441956,
1.0360761880874634,
0.004242908209562302,
0.4510280191898346,
-2.3839197158813477,
2.206045627593994,
-0.32086020708084106,
0.690246045589447,
-0.007996886968612671,
-0.11817480623722076,
1.1778538227081299,
0.6333962678909302,
0.5627194046974182,
-1.086599349975586,
0.7293986678123474,
-0.6035536527633667,
1.2090699672698975,
1.0270787477493286,
-0.7913039326667786,
-0.03040315955877304,
1.2972612380981445,
0.5116295218467712,
-0.5418936610221863,
-0.9599496126174927,
-0.8907129168510437,
0.938809871673584,
1.7748396396636963,
-0.13727831840515137,
-0.055453285574913025,
0.829362690448761,
0.7218877077102661,
-1.2229255437850952,
0.1746521145105362,
-0.8079188466072083,
-0.766933023929596,
1.611670732498169,
2.0299391746520996,
-0.02096252702176571,
-0.05548608675599098,
-0.7130342125892639,
-1.2929730415344238,
0.7861238718032837,
0.08988970518112183,
0.06220386177301407,
0.7455301284790039,
-0.6769512295722961,
1.0742076635360718,
0.951202929019928,
0.9388908743858337,
0.09627590328454971,
0.4016016125679016,
0.33806562423706055,
-0.2243616133928299,
-1.1157097816467285,
-0.23319190740585327,
-1.1058716773986816,
-2.49002742767334,
0.454314649105072,
-0.3303639888763428,
-1.4423513412475586,
0.051848627626895905,
-1.0364487171173096,
0.9222697615623474,
-0.5596847534179688,
-1.150267243385315,
-1.557088851928711,
0.26601529121398926,
0.018342696130275726,
0.8982532620429993,
-1.5883561372756958,
-0.03459280729293823,
1.2181340456008911,
0.7958749532699585,
-0.5651081800460815,
0.9626952409744263,
0.3485700786113739,
1.0144140720367432,
0.8027762174606323,
-0.41903653740882874,
0.45082131028175354,
0.17256417870521545,
-1.4307862520217896,
0.5263512134552002,
1.1345202922821045,
0.15169665217399597,
1.4164766073226929,
-0.5609360337257385,
0.06132841110229492,
0.41571396589279175,
-0.5279129147529602,
-0.40136441588401794,
-0.5868462324142456,
0.7007995843887329,
0.10583753883838654,
-0.8437848687171936,
0.006129121407866478,
-0.11322732269763947,
-0.23177199065685272,
0.23183995485305786,
-1.453709602355957,
-0.2761647403240204,
-0.3839440643787384,
-0.5444521307945251,
-1.188011646270752,
-0.1503676474094391,
1.4074175357818604,
-0.7252678871154785,
-0.1314961016178131,
0.5696702003479004,
0.4727141261100769,
0.5608299970626831,
0.6389309167861938,
-0.6396933794021606,
-0.36001697182655334,
-0.3303203582763672,
-0.2453426718711853,
0.15636807680130005,
1.2760584354400635,
-0.14745765924453735,
-0.9977725148200989,
0.6903110146522522,
-0.34565892815589905,
0.0023694830015301704,
1.9646081924438477,
0.08164994418621063,
-0.8461766839027405,
0.3832712471485138,
-0.7094324827194214,
1.8947441577911377,
1.7186305522918701,
1.3030827045440674,
-0.05403393134474754,
-0.9472057223320007,
0.5287936925888062,
-0.26887932419776917,
-0.3665009140968323,
0.8981013894081116,
0.5251941680908203,
-0.2315017729997635,
-1.401227355003357,
0.6504684090614319,
1.277915120124817,
-0.9094682931900024,
-0.7505987286567688,
0.1400650441646576,
-0.800014853477478,
1.0832782983779907,
0.7037913203239441,
0.5154507160186768,
0.22333046793937683,
1.665527105331421,
0.6636502146720886,
-0.4523777365684509,
0.45721033215522766,
0.5602372288703918,
-0.14978216588497162,
-2.0564675331115723,
-1.1454825401306152,
0.3546930253505707,
-0.4760495722293854,
-1.4935059547424316,
1.3579223155975342,
-1.1407246589660645,
-0.8537643551826477,
0.48199427127838135,
0.17098337411880493,
1.4138939380645752,
0.37582969665527344,
1.6578898429870605,
2.066922426223755,
0.8487815856933594,
0.35836854577064514,
1.3908369541168213,
-0.03137354552745819,
-0.38988929986953735,
1.7897125482559204,
-0.38123756647109985,
0.4968961477279663,
1.1816991567611694,
-0.40692394971847534,
-1.1137138605117798,
-0.7535250782966614,
-1.1641513109207153,
-0.6659784317016602,
0.997226357460022,
0.13999006152153015,
-1.1307718753814697,
0.15995988249778748,
1.5167354345321655,
0.10429923236370087,
-0.28791967034339905,
0.5202233791351318,
0.3986985385417938,
-0.7049409747123718,
-0.07820992171764374,
-0.9919812679290771,
0.46860387921333313,
-0.21640098094940186,
-0.3823516368865967,
0.35443592071533203,
0.4321475028991699,
1.301237940788269,
0.008062080480158329,
0.1480628252029419,
1.248760461807251,
-1.4382725954055786,
1.3941127061843872,
-0.6784109473228455,
0.21917618811130524,
-2.398313522338867,
1.4868766069412231,
-0.7694982886314392,
1.9077972173690796,
-2.6720058917999268,
0.35891005396842957,
-0.6208257675170898,
-0.4554898738861084,
0.3596622347831726,
-0.32769232988357544,
0.13330885767936707,
-0.10451724380254745,
-1.1625672578811646,
-0.012561466544866562,
-0.785122275352478,
0.5701039433479309,
1.1183313131332397,
1.4031219482421875,
-1.2074114084243774,
-0.33279380202293396,
-1.7406296730041504,
-0.11904068291187286,
-0.616494357585907,
0.3488430380821228,
-1.9850045442581177,
-0.11073196679353714,
-1.9109488725662231,
-2.291579246520996,
-1.4211143255233765,
-0.8818628787994385,
1.1339282989501953,
0.08047038316726685,
-0.8661210536956787,
1.1162736415863037,
-0.3868255615234375,
-1.8337551355361938,
1.057569146156311,
-2.1605277061462402
] |
https://github.com/huggingface/datasets/issues/4977 | Providing dataset size | Additionally, the download size can be inferred by doing HEAD requests to the files to be downloaded. And for files hosted on the hub you can even get the file sizes using the Hub API | **Is your feature request related to a problem? Please describe.**
Especially for big datasets like [LAION](https://huggingface.co/datasets/laion/laion2B-en/), it's hard to know exactly the downloaded size (because there are many files and you don't have their exact size when downloaded).
**Describe the solution you'd like**
Auto-populating the downloaded dataset size on the dataset page would be really useful, including that of each split (when there are some).
**Describe alternatives you've considered**
People should be adding this to dataset cards, but I don't think that is systematically the case :slightly_smiling_face:
**Additional context**
Mentioned to @lhoestq
| 527 | 35 | Providing dataset size
**Is your feature request related to a problem? Please describe.**
Especially for big datasets like [LAION](https://huggingface.co/datasets/laion/laion2B-en/), it's hard to know exactly the downloaded size (because there are many files and you don't have their exact size when downloaded).
**Describe the solution you'd like**
Auto-populating the downloaded dataset size on the dataset page would be really useful, including that of each split (when there are some).
**Describe alternatives you've considered**
People should be adding this to dataset cards, but I don't think that is systematically the case :slightly_smiling_face:
**Additional context**
Mentioned to @lhoestq
Additionally, the download size can be inferred by doing HEAD requests to the files to be downloaded. And for files hosted on the hub you can even get the file sizes using the Hub API | [
-1.289222240447998,
-1.0407052040100098,
-0.8658602833747864,
1.390047311782837,
-0.24262604117393494,
-1.263568639755249,
0.02221008390188217,
-1.1001251935958862,
1.6806292533874512,
-0.7598816156387329,
0.3018416464328766,
-1.721563696861267,
0.02689392864704132,
-0.5135473608970642,
-0.8397613763809204,
-0.8084700703620911,
-0.3986069858074188,
-0.9372634291648865,
0.9636807441711426,
2.4435760974884033,
1.169279932975769,
-1.434738278388977,
2.807142972946167,
0.6269641518592834,
-0.18044136464595795,
-1.0715672969818115,
0.6308596134185791,
0.06070130690932274,
-1.269015908241272,
-0.5230154991149902,
-0.9507715702056885,
-0.0600656159222126,
-0.4864656329154968,
-0.46257466077804565,
0.06966288387775421,
0.3118442893028259,
-0.07420822978019714,
-0.31490248441696167,
-0.580496609210968,
-0.6243656277656555,
0.5602014660835266,
-0.43971335887908936,
0.9110445976257324,
-0.5356232523918152,
1.8952648639678955,
-0.6138654947280884,
0.3744959533214569,
0.7289724349975586,
1.4944759607315063,
0.22390346229076385,
-0.008129642345011234,
0.3833087682723999,
0.3784056305885315,
-0.03852871060371399,
0.43497854471206665,
1.0984832048416138,
0.6032506823539734,
0.5428555607795715,
0.7217389345169067,
-2.211945056915283,
1.4148262739181519,
-1.1290944814682007,
0.31455403566360474,
1.4343496561050415,
-1.0209121704101562,
0.40361762046813965,
-1.8384974002838135,
0.02617737650871277,
0.5954236388206482,
-2.366896390914917,
0.1827930361032486,
-1.1705739498138428,
-0.6754531860351562,
0.9318437576293945,
0.251972496509552,
-1.4369161128997803,
0.18291962146759033,
-0.5203774571418762,
0.9727463722229004,
0.47525927424430847,
1.076719880104065,
-1.6944644451141357,
0.06465591490268707,
-0.3082500994205475,
-0.10927380621433258,
-1.457893967628479,
-1.536400556564331,
0.713756263256073,
0.558451771736145,
0.4713093340396881,
-0.10262973606586456,
0.9129896759986877,
-1.0078023672103882,
0.953019380569458,
-0.9702500700950623,
-1.6134670972824097,
-1.4894505739212036,
-2.2448267936706543,
-2.1336684226989746,
0.9817294478416443,
-0.4611058831214905,
-0.5523449778556824,
1.9084630012512207,
-1.102867841720581,
-1.7229266166687012,
1.2558103799819946,
0.21211417019367218,
0.18293817341327667,
2.3389551639556885,
0.15679903328418732,
-0.6381523013114929,
0.39087650179862976,
-0.7446469068527222,
0.9761263728141785,
-0.3384086787700653,
1.455459713935852,
0.44562795758247375,
-0.9714365601539612,
1.694628357887268,
-0.4251438081264496,
0.4409169852733612,
-0.5382358431816101,
-0.6902734637260437,
-0.9416325688362122,
0.41628530621528625,
1.9512923955917358,
-0.3018888831138611,
1.5913268327713013,
-0.3675660192966461,
-1.6275005340576172,
-1.4677734375,
0.8381414413452148,
0.5274547934532166,
-0.9459783434867859,
0.08134056627750397,
-0.4010406732559204,
0.07776813209056854,
-0.11067350208759308,
1.202246904373169,
1.1100157499313354,
0.6169195771217346,
-0.39336785674095154,
-0.9764736294746399,
0.15767766535282135,
-0.145375058054924,
-0.6307399868965149,
-1.9208147525787354,
-0.4147568643093109,
0.14521443843841553,
0.6909710764884949,
-1.2062773704528809,
1.6241527795791626,
0.9670353531837463,
1.9017976522445679,
1.0702641010284424,
-0.2861559987068176,
1.393911600112915,
0.05359901487827301,
1.89486825466156,
-0.6762942671775818,
0.7351371049880981,
-0.38296180963516235,
-1.0190105438232422,
0.8753576278686523,
-0.4209762513637543,
-2.029172658920288,
-0.8239962458610535,
-0.8550965785980225,
-0.31551018357276917,
-0.7588063478469849,
1.0247164964675903,
-0.4227122664451599,
-1.2468868494033813,
0.260489284992218,
-0.649939239025116,
0.12685176730155945,
-1.2370096445083618,
0.31315019726753235,
0.860347330570221,
-0.6955082416534424,
-0.04825973883271217,
-0.22104860842227936,
-1.3390090465545654,
-0.505437433719635,
0.14924997091293335,
1.9032042026519775,
-0.714281439781189,
0.9605796933174133,
0.8321446180343628,
-0.735952615737915,
-0.01943044364452362,
0.3623638153076172,
-0.224543958902359,
0.8565260767936707,
-0.9947803616523743,
-0.44193315505981445,
1.0256799459457397,
-0.1909589171409607,
-0.5144823789596558,
1.5290169715881348,
0.662378191947937,
-1.0229600667953491,
-0.2551824748516083,
-0.2687234580516815,
-0.9347553253173828,
-0.029912598431110382,
-1.460008978843689,
-0.17586460709571838,
0.20067198574543,
-1.5546047687530518,
-0.5670446157455444,
-0.15494830906391144,
1.223118782043457,
-0.16200196743011475,
1.2804245948791504,
-0.33313289284706116,
-0.3732442259788513,
-0.37586066126823425,
-0.4640193283557892,
0.31287696957588196,
-0.13633526861667633,
-0.7062779068946838,
0.2958822250366211,
-0.8745829463005066,
0.4004173278808594,
1.4233131408691406,
0.5499519109725952,
-0.059635598212480545,
0.6651795506477356,
1.0376616716384888,
0.2371780276298523,
-0.015243574976921082,
-0.8352316617965698,
-1.6081713438034058,
2.079439640045166,
-1.6015514135360718,
1.8298434019088745,
0.7376750707626343,
-0.14212873578071594,
-1.7956472635269165,
-1.696735143661499,
1.3059110641479492,
1.2724415063858032,
2.1730129718780518,
0.6279078722000122,
0.37784913182258606,
-0.7840558886528015,
-0.7153174877166748,
0.32159966230392456,
-1.1124199628829956,
-0.6877041459083557,
-0.03311639279127121,
2.275127649307251,
1.7892788648605347,
-0.5992113947868347,
-0.07957939803600311,
-0.9606826305389404,
1.347672700881958,
-0.12642066180706024,
0.2987290620803833,
1.9974480867385864,
-0.3045671582221985,
-1.1850097179412842,
1.3060660362243652,
-2.298184633255005,
0.2540217339992523,
1.98483145236969,
0.4491201937198639,
0.10087713599205017,
-1.3946094512939453,
-0.5712791085243225,
-0.2538067400455475,
-0.32622233033180237,
-1.377681016921997,
0.6084709763526917,
-0.34190648794174194,
-0.8990821242332458,
-1.4825278520584106,
0.05326800420880318,
-1.1761841773986816,
-1.6022114753723145,
0.5171340703964233,
1.80459463596344,
2.045288562774658,
-0.5249325633049011,
1.4494553804397583,
-0.2124311923980713,
0.2188415825366974,
1.263282299041748,
1.1413995027542114,
3.0638489723205566,
1.915319561958313,
-1.1585475206375122,
0.5322616696357727,
-0.18185016512870789,
-0.4855593740940094,
1.2066925764083862,
-0.9325080513954163,
1.286745548248291,
-0.11283373832702637,
-1.1394530534744263,
-1.2172236442565918,
1.0611248016357422,
0.4588671922683716,
0.05728452280163765,
-0.4742462933063507,
1.2693662643432617,
-0.01933308318257332,
1.303685188293457,
0.5356199145317078,
-0.4387504756450653,
0.4827655255794525,
-0.5204526782035828,
-0.5595237016677856,
1.7238742113113403,
0.21780449151992798,
-1.4193718433380127,
-2.2098209857940674,
-0.17086777091026306,
-0.7618681788444519,
0.07597525417804718,
-0.6022944450378418,
-1.0149027109146118,
1.6303718090057373,
0.4775272309780121,
-1.374985694885254,
-0.2903050482273102,
-0.4067210257053375,
-0.7673727869987488,
2.5962138175964355,
-1.4487719535827637,
-0.1875700205564499,
-0.9116219282150269,
-0.5380371809005737,
1.6952539682388306,
-1.3335018157958984,
-0.16153347492218018,
-0.979158878326416,
-0.6698786616325378,
-1.2455159425735474,
-0.5039346814155579,
-0.16304440796375275,
-0.9135298132896423,
0.8394594192504883,
0.057312946766614914,
-1.0096901655197144,
-0.3568447530269623,
-0.8443237543106079,
0.754086434841156,
-0.10549138486385345,
0.34146246314048767,
1.854689359664917,
0.35923120379447937,
-0.36183083057403564,
0.6604741215705872,
1.2195812463760376,
0.7056774497032166,
-0.6898770928382874,
0.07275187969207764,
-0.611612856388092,
0.3133263885974884,
-1.2775949239730835,
0.3573758900165558,
-2.975059747695923,
0.6899242997169495,
-0.04985613003373146,
-0.11389712989330292,
0.017343740910291672,
-1.2946767807006836,
1.1407183408737183,
2.514756917953491,
-1.1945401430130005,
0.39358606934547424,
0.253339558839798,
1.1276450157165527,
-1.605483055114746,
0.40661171078681946,
-0.39172255992889404,
2.1680400371551514,
0.14723916351795197,
1.164496898651123,
-0.5812917351722717,
-2.1790575981140137,
0.7421355843544006,
-1.1234660148620605,
-1.233296275138855,
0.5876470804214478,
-0.8047125339508057,
0.1369401067495346,
-1.6055809259414673,
-0.22935715317726135,
-0.9775456190109253,
-1.272486686706543,
0.8186033368110657,
0.19989140331745148,
0.280124694108963,
-0.5253521800041199,
0.22876180708408356,
-2.1664741039276123,
-1.368514060974121,
-0.23140132427215576,
-0.8273255825042725,
0.5549262166023254,
-0.27636483311653137,
0.6799255609512329,
0.06004623696208,
0.146833598613739,
0.2912932336330414,
1.4531759023666382,
3.409667730331421,
0.13902968168258667,
0.5209650993347168,
-0.1502792090177536,
-0.8662709593772888,
1.3959176540374756,
1.074266791343689,
0.06983974575996399,
-0.5923396348953247,
-1.0324530601501465,
1.3766013383865356,
1.8940165042877197,
0.8857845067977905,
0.12854786217212677,
-0.7422675490379333,
-0.5717066526412964,
-0.0553642138838768,
0.20033258199691772,
0.46794557571411133,
0.8963104486465454,
0.04559207707643509,
0.1432395875453949,
1.4650239944458008,
1.2389503717422485,
-0.4613151550292969,
0.3253285884857178,
-0.802745521068573,
-0.40217259526252747,
0.4604704678058624,
0.4013676345348358,
0.006020896136760712,
0.3374461531639099,
-0.9488744139671326,
-0.32823994755744934,
-0.20398248732089996,
-1.0065877437591553,
-0.6903138160705566,
-0.43604570627212524,
-0.49675342440605164,
1.6136375665664673,
0.11578229069709778,
-0.5327640771865845,
-0.14155779778957367,
-0.7788548469543457,
-0.1582910120487213,
-1.2201238870620728,
0.26356011629104614,
-0.025750331580638885,
-0.1338951587677002,
-0.1966872364282608,
1.7886899709701538,
-0.949606716632843,
-2.1384639739990234,
0.22045525908470154,
0.34175652265548706,
-0.4333506226539612,
0.1316298097372055,
1.5448018312454224,
0.4723202586174011,
1.456701397895813,
1.3988494873046875,
0.9914271831512451,
-0.5587718486785889,
-1.3225033283233643,
0.5583598017692566,
0.8971733450889587,
-1.4790235757827759,
0.8021668791770935,
0.0423748753964901,
-0.5050298571586609,
0.8468708992004395,
1.32935631275177,
0.40674373507499695,
-1.9351726770401,
0.867383599281311,
-0.8881499171257019,
0.7764053344726562,
0.7208283543586731,
0.7633955478668213,
0.26651448011398315,
0.9683093428611755,
-1.2910057306289673,
-1.1547722816467285,
-0.9561442732810974,
-0.620969831943512,
2.0060253143310547,
-0.28576213121414185,
0.44552934169769287,
-0.08811642229557037,
-1.1526473760604858,
-0.1409764438867569,
0.6049509644508362,
0.42113548517227173,
-0.17131176590919495,
0.7905117273330688,
-0.7403994798660278,
-1.226547360420227,
-1.4543566703796387,
-0.29509538412094116,
-0.877536952495575,
-0.8255266547203064,
1.051684856414795,
0.853882372379303,
0.4096504747867584,
2.003657579421997,
0.5137694478034973,
0.2112303525209427,
-2.6586809158325195,
0.8162314295768738,
0.251616507768631,
-0.0008585131727159023,
0.981839656829834,
0.2838957905769348,
1.101902961730957,
-0.0008689453825354576,
0.38146543502807617,
-2.3094229698181152,
2.142897605895996,
-0.3373245596885681,
0.7428972125053406,
-0.03467392176389694,
-0.10493655502796173,
1.2234232425689697,
0.6407638192176819,
0.6105127334594727,
-1.0508660078048706,
0.6855449676513672,
-0.5714492797851562,
1.2196093797683716,
1.0790824890136719,
-0.7489070892333984,
0.003496909514069557,
1.2867562770843506,
0.5313888192176819,
-0.5346694588661194,
-0.9385464787483215,
-0.8489567637443542,
0.9127450585365295,
1.7754744291305542,
-0.13378526270389557,
-0.017275895923376083,
0.7994468212127686,
0.6375009417533875,
-1.1888771057128906,
0.20183397829532623,
-0.8468231558799744,
-0.8389005064964294,
1.6003717184066772,
2.0951597690582275,
-0.030283259227871895,
-0.0325872078537941,
-0.6889932751655579,
-1.298192024230957,
0.7614486217498779,
0.01959208771586418,
0.12193797528743744,
0.7179767489433289,
-0.6703314185142517,
1.0067393779754639,
0.922912061214447,
0.9221765995025635,
0.021955642849206924,
0.49270179867744446,
0.3562552034854889,
-0.13725759088993073,
-1.0647045373916626,
-0.28768637776374817,
-1.146079182624817,
-2.5483312606811523,
0.4465635418891907,
-0.333347886800766,
-1.4377275705337524,
0.01742427982389927,
-1.0394432544708252,
0.9242563843727112,
-0.5315008163452148,
-1.10416841506958,
-1.6115916967391968,
0.2391989380121231,
0.0697980523109436,
0.9673866033554077,
-1.613886833190918,
-0.09112690389156342,
1.1698325872421265,
0.7878202795982361,
-0.549667477607727,
1.056072473526001,
0.3741437792778015,
1.0201059579849243,
0.7042909860610962,
-0.4750896692276001,
0.43142032623291016,
0.17756740748882294,
-1.3864885568618774,
0.5819856524467468,
1.1292316913604736,
0.14155469834804535,
1.3668696880340576,
-0.4555783271789551,
0.07403531670570374,
0.5123535990715027,
-0.5494887828826904,
-0.3326311409473419,
-0.5175706744194031,
0.7470629215240479,
0.09821604192256927,
-0.7716779708862305,
-0.046271808445453644,
-0.17772722244262695,
-0.2597290575504303,
0.17765800654888153,
-1.453466534614563,
-0.3816968500614166,
-0.4464583098888397,
-0.5534881949424744,
-1.259845495223999,
-0.13312354683876038,
1.3619564771652222,
-0.7905368804931641,
-0.13257162272930145,
0.5349846482276917,
0.5952208042144775,
0.6260046362876892,
0.6735635995864868,
-0.6550015211105347,
-0.38401877880096436,
-0.26606467366218567,
-0.21548143029212952,
0.15834645926952362,
1.2543319463729858,
-0.16703739762306213,
-0.9752429723739624,
0.6390868425369263,
-0.30952316522598267,
-0.025328990072011948,
1.97687566280365,
0.022417869418859482,
-0.7814317941665649,
0.39072367548942566,
-0.711074948310852,
1.925188422203064,
1.5590327978134155,
1.242366075515747,
-0.07760164141654968,
-0.8399176001548767,
0.5483347177505493,
-0.09736095368862152,
-0.41511791944503784,
0.8505080342292786,
0.549929141998291,
-0.21912260353565216,
-1.4171656370162964,
0.6652790904045105,
1.3611185550689697,
-1.0018346309661865,
-0.7356440424919128,
0.09764496982097626,
-0.825415313243866,
1.115916132926941,
0.613585352897644,
0.6012496948242188,
0.2338167428970337,
1.6830421686172485,
0.6081278324127197,
-0.49358561635017395,
0.4470441937446594,
0.5737066268920898,
-0.14073479175567627,
-2.141707420349121,
-1.1562379598617554,
0.35504230856895447,
-0.4832584857940674,
-1.4624742269515991,
1.321780800819397,
-1.0741385221481323,
-0.8155814409255981,
0.4973611533641815,
0.2118811160326004,
1.3722143173217773,
0.33479297161102295,
1.657638669013977,
2.037132978439331,
0.7782037854194641,
0.3126021921634674,
1.4817450046539307,
0.010912859812378883,
-0.4059021770954132,
1.8648892641067505,
-0.4241445064544678,
0.5622931718826294,
1.200211524963379,
-0.35156500339508057,
-1.1656399965286255,
-0.6605851054191589,
-1.1373487710952759,
-0.591121256351471,
0.9550055265426636,
0.1106032133102417,
-1.1550545692443848,
0.05187411606311798,
1.4648751020431519,
0.21741318702697754,
-0.2249581515789032,
0.38611817359924316,
0.43395867943763733,
-0.7125559449195862,
-0.11220160126686096,
-1.0208429098129272,
0.46671828627586365,
-0.24782052636146545,
-0.3607761263847351,
0.3114113211631775,
0.480998158454895,
1.2652393579483032,
-0.15180659294128418,
0.09863577783107758,
1.22587251663208,
-1.5138983726501465,
1.449830174446106,
-0.5495643615722656,
0.20929661393165588,
-2.462125539779663,
1.5146628618240356,
-0.7550262212753296,
1.9766204357147217,
-2.6514782905578613,
0.30486589670181274,
-0.7214202880859375,
-0.4822808802127838,
0.3517703711986542,
-0.2749364972114563,
0.10157844424247742,
-0.13095812499523163,
-1.0428184270858765,
0.10198229551315308,
-0.7542464733123779,
0.5372599959373474,
1.176956295967102,
1.4031873941421509,
-1.1793510913848877,
-0.23109202086925507,
-1.7467563152313232,
-0.13450533151626587,
-0.7033355236053467,
0.3208547830581665,
-2.1122846603393555,
-0.1162947565317154,
-1.8608404397964478,
-2.212418556213379,
-1.3849143981933594,
-0.8927708268165588,
1.110343337059021,
0.14497613906860352,
-0.8833386301994324,
1.0983912944793701,
-0.33975648880004883,
-1.7675899267196655,
1.0060819387435913,
-2.106065034866333
] |
https://github.com/huggingface/datasets/issues/4977 | Providing dataset size | Amazing @albertvillanova ! I think just having that information visible in the dataset info (without having to do any requests/additional coding) would be really useful :hugs: | **Is your feature request related to a problem? Please describe.**
Especially for big datasets like [LAION](https://huggingface.co/datasets/laion/laion2B-en/), it's hard to know exactly the downloaded size (because there are many files and you don't have their exact size when downloaded).
**Describe the solution you'd like**
Auto-populating the downloaded dataset size on the dataset page would be really useful, including that of each split (when there are some).
**Describe alternatives you've considered**
People should be adding this to dataset cards, but I don't think that is systematically the case :slightly_smiling_face:
**Additional context**
Mentioned to @lhoestq
| 527 | 26 | Providing dataset size
**Is your feature request related to a problem? Please describe.**
Especially for big datasets like [LAION](https://huggingface.co/datasets/laion/laion2B-en/), it's hard to know exactly the downloaded size (because there are many files and you don't have their exact size when downloaded).
**Describe the solution you'd like**
Auto-populating the downloaded dataset size on the dataset page would be really useful, including that of each split (when there are some).
**Describe alternatives you've considered**
People should be adding this to dataset cards, but I don't think that is systematically the case :slightly_smiling_face:
**Additional context**
Mentioned to @lhoestq
Amazing @albertvillanova ! I think just having that information visible in the dataset info (without having to do any requests/additional coding) would be really useful :hugs: | [
-1.274186372756958,
-1.0134552717208862,
-0.8443645238876343,
1.4183645248413086,
-0.2563062608242035,
-1.2443662881851196,
0.034843191504478455,
-1.033986210823059,
1.6460493803024292,
-0.7256711721420288,
0.2868073284626007,
-1.7659986019134521,
-0.01410647202283144,
-0.5485352277755737,
-0.8243200778961182,
-0.7750679850578308,
-0.4141801595687866,
-0.8752235770225525,
1.003509283065796,
2.4971420764923096,
1.1667835712432861,
-1.454466700553894,
2.791917562484741,
0.5951598882675171,
-0.1639053225517273,
-1.0581183433532715,
0.6156644821166992,
0.07303128391504288,
-1.2590978145599365,
-0.5275135040283203,
-0.9337025880813599,
-0.07868492603302002,
-0.4537389874458313,
-0.5025172829627991,
0.07605982571840286,
0.33307310938835144,
-0.05767889693379402,
-0.3231503367424011,
-0.5370364785194397,
-0.5846914649009705,
0.5442801117897034,
-0.42722299695014954,
0.897434413433075,
-0.5177867412567139,
1.8676823377609253,
-0.6223325729370117,
0.34818321466445923,
0.7048442363739014,
1.5095083713531494,
0.2002180814743042,
-0.03837387636303902,
0.4033334255218506,
0.4046614468097687,
0.005330915562808514,
0.44208383560180664,
1.104580283164978,
0.6177631616592407,
0.5441817045211792,
0.719981849193573,
-2.1844754219055176,
1.3978853225708008,
-1.1620556116104126,
0.3425893783569336,
1.4563651084899902,
-1.0131343603134155,
0.4345376789569855,
-1.8267300128936768,
0.028668228536844254,
0.5771262645721436,
-2.331352710723877,
0.17339104413986206,
-1.171505093574524,
-0.6596157550811768,
0.9069744944572449,
0.2667655646800995,
-1.396783709526062,
0.1538154035806656,
-0.4767449200153351,
0.9724434018135071,
0.46286994218826294,
1.1060277223587036,
-1.702996850013733,
0.08479604125022888,
-0.27471762895584106,
-0.09430672228336334,
-1.4214915037155151,
-1.520127534866333,
0.6794490814208984,
0.5697656273841858,
0.5070509910583496,
-0.092614084482193,
0.8617525100708008,
-0.983098030090332,
0.902813732624054,
-1.0119576454162598,
-1.6094805002212524,
-1.4948294162750244,
-2.2325735092163086,
-2.162841558456421,
0.9336861968040466,
-0.471323162317276,
-0.5237118005752563,
1.8965336084365845,
-1.0585010051727295,
-1.7528834342956543,
1.2258039712905884,
0.25686877965927124,
0.16521328687667847,
2.349388599395752,
0.19653208553791046,
-0.6634379625320435,
0.39164990186691284,
-0.7675303816795349,
0.9769120216369629,
-0.32860660552978516,
1.481844425201416,
0.483548641204834,
-0.9373093843460083,
1.6285966634750366,
-0.42164596915245056,
0.43871691823005676,
-0.49847549200057983,
-0.6341678500175476,
-0.9030411839485168,
0.40345028042793274,
1.9757579565048218,
-0.30489975214004517,
1.566749930381775,
-0.3925417959690094,
-1.6855623722076416,
-1.4601458311080933,
0.8449129462242126,
0.5441384315490723,
-0.9575260877609253,
0.1276731640100479,
-0.4403850734233856,
0.06983157247304916,
-0.07502675801515579,
1.225093126296997,
1.0908089876174927,
0.6340659856796265,
-0.38347700238227844,
-0.9580403566360474,
0.18119411170482635,
-0.10876040905714035,
-0.626807451248169,
-1.913102626800537,
-0.42940768599510193,
0.177284836769104,
0.6639146208763123,
-1.1960437297821045,
1.6348274946212769,
0.9539905786514282,
1.8690407276153564,
1.0471501350402832,
-0.24314430356025696,
1.4054502248764038,
0.021649818867444992,
1.8974233865737915,
-0.6628993153572083,
0.7051979303359985,
-0.36988067626953125,
-1.018609881401062,
0.8831865191459656,
-0.43586573004722595,
-2.0590078830718994,
-0.8752239346504211,
-0.8927977085113525,
-0.2878293991088867,
-0.7719647288322449,
1.028815507888794,
-0.36885836720466614,
-1.2835109233856201,
0.26308175921440125,
-0.6932682394981384,
0.15427540242671967,
-1.224500060081482,
0.3173030614852905,
0.8726246356964111,
-0.6944839358329773,
-0.06732559949159622,
-0.21547389030456543,
-1.3658475875854492,
-0.4906065762042999,
0.15384088456630707,
1.9299087524414062,
-0.7289320826530457,
0.976538896560669,
0.8266458511352539,
-0.7056492567062378,
-0.017111515626311302,
0.33187806606292725,
-0.2301800698041916,
0.8327227830886841,
-1.0006242990493774,
-0.4152830243110657,
1.04629647731781,
-0.16583235561847687,
-0.5533230900764465,
1.5384914875030518,
0.6729627847671509,
-0.988002359867096,
-0.26945945620536804,
-0.2852591574192047,
-0.9326797723770142,
-0.05291314423084259,
-1.4714009761810303,
-0.17904072999954224,
0.21237359941005707,
-1.538658857345581,
-0.5590193271636963,
-0.1647629588842392,
1.2370692491531372,
-0.16526560485363007,
1.2651629447937012,
-0.32971909642219543,
-0.3316642642021179,
-0.4517187476158142,
-0.4923171401023865,
0.31700262427330017,
-0.1486378014087677,
-0.7101510167121887,
0.31363606452941895,
-0.8776332139968872,
0.39767229557037354,
1.403741478919983,
0.5456571578979492,
-0.03338029980659485,
0.6365957856178284,
1.0408754348754883,
0.28520140051841736,
-0.03086789697408676,
-0.8254063725471497,
-1.5943366289138794,
2.105123281478882,
-1.5708041191101074,
1.7892565727233887,
0.7102636694908142,
-0.11985669285058975,
-1.7601574659347534,
-1.7669458389282227,
1.3471556901931763,
1.3480119705200195,
2.2054567337036133,
0.5751994848251343,
0.3976743519306183,
-0.779557466506958,
-0.7288402318954468,
0.31466418504714966,
-1.119802474975586,
-0.7507259249687195,
-0.031902071088552475,
2.3138458728790283,
1.8199865818023682,
-0.6355406641960144,
-0.10965237766504288,
-0.9874169826507568,
1.3345425128936768,
-0.10886983573436737,
0.26711902022361755,
2.0255818367004395,
-0.32329145073890686,
-1.1623153686523438,
1.3267625570297241,
-2.303277015686035,
0.23466630280017853,
2.0168211460113525,
0.45482152700424194,
0.11047777533531189,
-1.4248729944229126,
-0.5519330501556396,
-0.24481327831745148,
-0.2961708903312683,
-1.3887171745300293,
0.6780543327331543,
-0.2888949513435364,
-0.921063244342804,
-1.4824954271316528,
0.08873824030160904,
-1.2027066946029663,
-1.6160084009170532,
0.533341646194458,
1.7940491437911987,
2.0682265758514404,
-0.5641158223152161,
1.4163812398910522,
-0.24248209595680237,
0.22907470166683197,
1.276017665863037,
1.1426799297332764,
3.067690849304199,
1.940355896949768,
-1.154205322265625,
0.5557028651237488,
-0.1831996887922287,
-0.5325159430503845,
1.202975869178772,
-0.9592941999435425,
1.2481918334960938,
-0.14947858452796936,
-1.114121675491333,
-1.1924697160720825,
1.0074037313461304,
0.4818706512451172,
0.04033994674682617,
-0.4881817698478699,
1.2488429546356201,
-0.015580005943775177,
1.2583255767822266,
0.5522847771644592,
-0.4022977650165558,
0.5123800039291382,
-0.5828550457954407,
-0.5097551345825195,
1.6829986572265625,
0.23530098795890808,
-1.440871000289917,
-2.2112271785736084,
-0.1916026473045349,
-0.8224641680717468,
0.05617920681834221,
-0.5454083681106567,
-0.9990871548652649,
1.593645453453064,
0.49244654178619385,
-1.356050968170166,
-0.2670132517814636,
-0.3889547288417816,
-0.7397677302360535,
2.6022729873657227,
-1.4503191709518433,
-0.18784844875335693,
-0.9241328239440918,
-0.571251392364502,
1.7029919624328613,
-1.3171032667160034,
-0.10943469405174255,
-0.9938173294067383,
-0.6484623551368713,
-1.2728053331375122,
-0.4712293744087219,
-0.14997129142284393,
-0.9168228507041931,
0.8375425338745117,
-0.006277821492403746,
-1.0246281623840332,
-0.3416191041469574,
-0.855736255645752,
0.773292064666748,
-0.16083574295043945,
0.33617156744003296,
1.8553909063339233,
0.36173486709594727,
-0.34737488627433777,
0.6645126938819885,
1.2481764554977417,
0.69462651014328,
-0.70795077085495,
0.10115864872932434,
-0.6259533762931824,
0.33159908652305603,
-1.3529741764068604,
0.3096145689487457,
-2.9513614177703857,
0.700796902179718,
-0.019000576809048653,
-0.14615687727928162,
-0.007137012202292681,
-1.2924025058746338,
1.1831902265548706,
2.495882272720337,
-1.2600075006484985,
0.38042935729026794,
0.2625133991241455,
1.1545748710632324,
-1.562519907951355,
0.3994412422180176,
-0.4250974655151367,
2.210268020629883,
0.20539119839668274,
1.1578251123428345,
-0.5652121901512146,
-2.1703596115112305,
0.7375994920730591,
-1.1600737571716309,
-1.2300516366958618,
0.5658292770385742,
-0.8111149668693542,
0.14146167039871216,
-1.6361947059631348,
-0.19990533590316772,
-0.9626139998435974,
-1.2550331354141235,
0.8090003132820129,
0.17317819595336914,
0.2459421008825302,
-0.519268810749054,
0.258353590965271,
-2.1568214893341064,
-1.3788154125213623,
-0.22704392671585083,
-0.849335253238678,
0.5362109541893005,
-0.27115902304649353,
0.6916067004203796,
0.03830762580037117,
0.13303501904010773,
0.32090672850608826,
1.3996363878250122,
3.423945665359497,
0.17122113704681396,
0.5043267011642456,
-0.15900039672851562,
-0.8750007748603821,
1.436120867729187,
1.0540813207626343,
0.06313829869031906,
-0.5489505529403687,
-1.0385756492614746,
1.4051355123519897,
1.9194875955581665,
0.9075079560279846,
0.0821257010102272,
-0.7641581296920776,
-0.5855730175971985,
-0.04567672312259674,
0.15892167389392853,
0.4513745903968811,
0.9026384353637695,
-0.0019283113069832325,
0.15370944142341614,
1.479141354560852,
1.2259072065353394,
-0.41826820373535156,
0.3513597548007965,
-0.8169957399368286,
-0.38915711641311646,
0.4781555235385895,
0.382443904876709,
0.03310177102684975,
0.3359912633895874,
-0.9460709691047668,
-0.319229394197464,
-0.15096376836299896,
-0.9925830364227295,
-0.6934988498687744,
-0.44542214274406433,
-0.5044484734535217,
1.5969631671905518,
0.10726289451122284,
-0.5450809597969055,
-0.09772177040576935,
-0.8164520859718323,
-0.14387381076812744,
-1.1699702739715576,
0.255239337682724,
-0.05934743955731392,
-0.12216503173112869,
-0.20558899641036987,
1.7929270267486572,
-0.9793447852134705,
-2.139647960662842,
0.25314199924468994,
0.4035741686820984,
-0.44037315249443054,
0.09838397800922394,
1.5580016374588013,
0.5336793065071106,
1.3925365209579468,
1.3642770051956177,
1.0129245519638062,
-0.4877687394618988,
-1.3566941022872925,
0.5830726027488708,
0.8888382911682129,
-1.4094977378845215,
0.7923764586448669,
0.020090892910957336,
-0.47055116295814514,
0.8121222257614136,
1.3074994087219238,
0.4070478677749634,
-1.877816081047058,
0.8288448452949524,
-0.9048362374305725,
0.765718936920166,
0.7334242463111877,
0.7783113718032837,
0.26912516355514526,
0.9725964069366455,
-1.2932488918304443,
-1.1240841150283813,
-0.9795875549316406,
-0.6061899662017822,
2.0495617389678955,
-0.2922504246234894,
0.42758992314338684,
-0.06743124127388,
-1.1228541135787964,
-0.13199131190776825,
0.6788941025733948,
0.3181544840335846,
-0.22984562814235687,
0.8312932252883911,
-0.6849185824394226,
-1.1782888174057007,
-1.4495224952697754,
-0.3277870714664459,
-0.8576129674911499,
-0.8575652837753296,
1.0435304641723633,
0.8299624919891357,
0.44307804107666016,
1.9736692905426025,
0.5726471543312073,
0.22876575589179993,
-2.6333749294281006,
0.8081458806991577,
0.22432920336723328,
0.022990066558122635,
0.9564060568809509,
0.2986025810241699,
1.0685352087020874,
-0.009473694488406181,
0.4389703869819641,
-2.295571804046631,
2.122126817703247,
-0.3094504773616791,
0.7039886116981506,
0.003951185382902622,
-0.13909220695495605,
1.1938672065734863,
0.6362155675888062,
0.6082082390785217,
-1.0841636657714844,
0.6838042140007019,
-0.5657273530960083,
1.1960924863815308,
1.0299845933914185,
-0.7169861793518066,
-0.006463898345828056,
1.3081614971160889,
0.4959679841995239,
-0.493635892868042,
-0.9669842720031738,
-0.815403938293457,
1.0109226703643799,
1.758365511894226,
-0.15485328435897827,
-0.04274087771773338,
0.7857518196105957,
0.6569748520851135,
-1.1737265586853027,
0.13263201713562012,
-0.8372348546981812,
-0.7646356821060181,
1.6443092823028564,
2.1116740703582764,
-0.03675995394587517,
-0.03040298819541931,
-0.6856256127357483,
-1.2927320003509521,
0.7586491107940674,
0.054326076060533524,
0.0977679044008255,
0.7699049115180969,
-0.6644514799118042,
1.0055150985717773,
0.9192192554473877,
0.9440838694572449,
-0.013158352114260197,
0.4353494346141815,
0.3613699674606323,
-0.13019166886806488,
-1.1258471012115479,
-0.34254002571105957,
-1.1716471910476685,
-2.552910089492798,
0.3793591260910034,
-0.3595386743545532,
-1.3982770442962646,
0.038214463740587234,
-1.041974663734436,
0.9209615588188171,
-0.5434443950653076,
-1.0980995893478394,
-1.6422145366668701,
0.24793528020381927,
0.05683327838778496,
0.9796972274780273,
-1.6407986879348755,
-0.08956176787614822,
1.1918208599090576,
0.7800785899162292,
-0.5774829387664795,
1.0581005811691284,
0.366412878036499,
1.02500319480896,
0.7385262250900269,
-0.4484115242958069,
0.4560369551181793,
0.2267829328775406,
-1.4017326831817627,
0.583336591720581,
1.133493185043335,
0.16559366881847382,
1.3482966423034668,
-0.49007561802864075,
0.10312335193157196,
0.508488655090332,
-0.5997945666313171,
-0.3544732332229614,
-0.5029909014701843,
0.7199719548225403,
0.1378234624862671,
-0.8503657579421997,
-0.04788800701498985,
-0.14891156554222107,
-0.25685328245162964,
0.19318480789661407,
-1.4719853401184082,
-0.3644869327545166,
-0.3950952887535095,
-0.5554764866828918,
-1.2327797412872314,
-0.18649683892726898,
1.3782989978790283,
-0.8079743385314941,
-0.14377692341804504,
0.5675978660583496,
0.5677002668380737,
0.6145008206367493,
0.6526168584823608,
-0.6726458668708801,
-0.3455665111541748,
-0.27806907892227173,
-0.2115647941827774,
0.13388656079769135,
1.2662510871887207,
-0.1425275355577469,
-1.016966462135315,
0.6673427820205688,
-0.34237101674079895,
-0.01685223914682865,
1.966619849205017,
-0.012319210916757584,
-0.8348785042762756,
0.41283559799194336,
-0.7028202414512634,
1.9051179885864258,
1.5545212030410767,
1.225274682044983,
-0.07651521265506744,
-0.8502741456031799,
0.5542847514152527,
-0.10348285734653473,
-0.412119060754776,
0.8452466726303101,
0.5260397791862488,
-0.26129525899887085,
-1.427441954612732,
0.6402965784072876,
1.3412238359451294,
-0.9827350974082947,
-0.7563072443008423,
0.10408256202936172,
-0.8627124428749084,
1.1195999383926392,
0.6018041968345642,
0.5618894100189209,
0.23461462557315826,
1.6899635791778564,
0.6060695052146912,
-0.5026369690895081,
0.38534629344940186,
0.6018335223197937,
-0.10209298133850098,
-2.1625823974609375,
-1.14539635181427,
0.3219662308692932,
-0.47712549567222595,
-1.4376810789108276,
1.2601914405822754,
-1.134254813194275,
-0.8186724185943604,
0.5395799279212952,
0.1964229941368103,
1.3842641115188599,
0.3265877962112427,
1.680783748626709,
2.024210214614868,
0.7875176072120667,
0.3305787742137909,
1.4669911861419678,
-0.017593439668416977,
-0.37135565280914307,
1.813145399093628,
-0.3702525198459625,
0.5404938459396362,
1.1880369186401367,
-0.3990077078342438,
-1.1859972476959229,
-0.6626365184783936,
-1.1457051038742065,
-0.6215431690216064,
0.9562745690345764,
0.1507287621498108,
-1.2156225442886353,
0.0445190891623497,
1.470056176185608,
0.20930519700050354,
-0.23268349468708038,
0.37627872824668884,
0.4013976752758026,
-0.7222154140472412,
-0.058573827147483826,
-1.0506483316421509,
0.4382534921169281,
-0.20555320382118225,
-0.3090410828590393,
0.2912452220916748,
0.45786166191101074,
1.2626465559005737,
-0.10213960707187653,
0.10948804020881653,
1.1889547109603882,
-1.4917734861373901,
1.4504945278167725,
-0.5796626806259155,
0.21733790636062622,
-2.4472386837005615,
1.4930591583251953,
-0.7391253113746643,
1.9626076221466064,
-2.7025399208068848,
0.2989460825920105,
-0.7177180647850037,
-0.46949928998947144,
0.34512829780578613,
-0.2522504925727844,
0.08422929048538208,
-0.12420859932899475,
-1.0430182218551636,
0.09660623967647552,
-0.7478482723236084,
0.5674762725830078,
1.2063616514205933,
1.3824365139007568,
-1.202338457107544,
-0.26287841796875,
-1.757361650466919,
-0.1166456788778305,
-0.7225512266159058,
0.26493039727211,
-2.1006226539611816,
-0.09844512492418289,
-1.8632235527038574,
-2.1860291957855225,
-1.3916394710540771,
-0.8956918716430664,
1.1221388578414917,
0.18939778208732605,
-0.8914586305618286,
1.0604695081710815,
-0.33271947503089905,
-1.7443891763687134,
1.0176301002502441,
-2.128216028213501
] |
https://github.com/huggingface/datasets/issues/4976 | Hope to adapt Python3.9 as soon as possible | There is this related issue already: https://github.com/huggingface/datasets/issues/4113
And I guess we need a CI job for 3.9 ^^ | **Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context about the feature request here.
| 528 | 18 | Hope to adapt Python3.9 as soon as possible
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context about the feature request here.
There is this related issue already: https://github.com/huggingface/datasets/issues/4113
And I guess we need a CI job for 3.9 ^^ | [
-1.276026725769043,
-1.205436110496521,
-0.7327207326889038,
1.3628872632980347,
-0.30774757266044617,
-1.2829004526138306,
0.05802299454808235,
-0.9319745302200317,
1.7922008037567139,
-0.6015394926071167,
0.3033076524734497,
-1.6209580898284912,
-0.08568568527698517,
-0.5165401101112366,
-0.7587418556213379,
-0.7467113137245178,
-0.4997226297855377,
-0.9562196731567383,
0.967085063457489,
2.4730072021484375,
1.1198852062225342,
-1.532743215560913,
2.692570686340332,
0.7954872250556946,
-0.13876602053642273,
-0.871751606464386,
0.389914870262146,
0.06136896833777428,
-1.1983205080032349,
-0.561948299407959,
-0.9312275648117065,
0.02546333521604538,
-0.41070640087127686,
-0.4998520314693451,
-0.05503779649734497,
0.2902817130088806,
-0.04932943731546402,
-0.37518396973609924,
-0.6173792481422424,
-0.6975451111793518,
0.459236204624176,
-0.4637325406074524,
0.8013646602630615,
-0.48252296447753906,
1.7920268774032593,
-0.5241910219192505,
0.35279858112335205,
0.7145336866378784,
1.4122916460037231,
0.14850594103336334,
-0.004421672318130732,
0.4153830409049988,
0.5913680791854858,
-0.23370972275733948,
0.3643324375152588,
1.292905330657959,
0.5862257480621338,
0.5301265716552734,
0.7467178702354431,
-2.1581554412841797,
1.4548925161361694,
-1.1368701457977295,
0.3343444764614105,
1.363065242767334,
-1.0338741540908813,
0.44734618067741394,
-1.8130801916122437,
0.006553487852215767,
0.5153916478157043,
-2.4301018714904785,
0.20540401339530945,
-1.2421669960021973,
-0.7031888365745544,
0.7999448776245117,
0.18915335834026337,
-1.4001308679580688,
0.12011954188346863,
-0.5209484100341797,
0.9560065269470215,
0.3795403838157654,
1.1102186441421509,
-1.7615373134613037,
-0.06971123814582825,
-0.23899534344673157,
0.037128835916519165,
-1.3821414709091187,
-1.5327281951904297,
0.6420694589614868,
0.61883145570755,
0.6317338347434998,
-0.15136635303497314,
0.9827847480773926,
-1.0760002136230469,
1.0137939453125,
-0.9777658581733704,
-1.5403813123703003,
-1.4961682558059692,
-2.230536937713623,
-2.142294406890869,
1.024527668952942,
-0.5374462604522705,
-0.4878300428390503,
1.821001648902893,
-1.009774088859558,
-1.6962283849716187,
1.1685420274734497,
0.3330247104167938,
0.1237916350364685,
2.3395960330963135,
0.2803705632686615,
-0.7175410985946655,
0.3748137950897217,
-0.8141732215881348,
0.9920064210891724,
-0.5462286472320557,
1.530130386352539,
0.5374562740325928,
-0.8266584277153015,
1.6624406576156616,
-0.3991040289402008,
0.5682708024978638,
-0.5881389379501343,
-0.6714789271354675,
-0.9346691966056824,
0.503993570804596,
1.9537817239761353,
-0.30192697048187256,
1.5614736080169678,
-0.4842461943626404,
-1.6111606359481812,
-1.582658290863037,
0.923694908618927,
0.5936567783355713,
-0.9550281763076782,
0.05633838102221489,
-0.44255176186561584,
0.08946732431650162,
-0.08478594571352005,
1.050980567932129,
1.2487050294876099,
0.7532966732978821,
-0.22533515095710754,
-0.8798851370811462,
0.15751692652702332,
-0.1688830852508545,
-0.6730226278305054,
-1.8968279361724854,
-0.38043299317359924,
0.26746848225593567,
0.5630699992179871,
-1.319580078125,
1.4842174053192139,
1.0201548337936401,
1.988210678100586,
0.9432515501976013,
-0.3020728528499603,
1.445277214050293,
-0.023343123495578766,
1.8619307279586792,
-0.6607636213302612,
0.772532045841217,
-0.2018369883298874,
-0.9323554039001465,
0.8471869826316833,
-0.47606131434440613,
-2.141908645629883,
-0.6819037795066833,
-0.8880211710929871,
-0.2062208652496338,
-0.6921941041946411,
0.9743601679801941,
-0.3377659022808075,
-1.3396735191345215,
0.21205945312976837,
-0.6835457682609558,
0.19346021115779877,
-1.1293342113494873,
0.2536826729774475,
0.8677106499671936,
-0.6080100536346436,
-0.020964806899428368,
-0.15546531975269318,
-1.3619986772537231,
-0.5626944303512573,
0.3184676766395569,
1.9767335653305054,
-0.7734869718551636,
0.9776514768600464,
0.8601428270339966,
-0.8135566711425781,
0.01949993148446083,
0.31463974714279175,
-0.1581495851278305,
0.8411493301391602,
-1.1264328956604004,
-0.291498064994812,
1.0680229663848877,
-0.1728019267320633,
-0.5167125463485718,
1.5214875936508179,
0.7430618405342102,
-0.9208064079284668,
-0.19078820943832397,
-0.24339374899864197,
-0.708084762096405,
-0.037801314145326614,
-1.54118812084198,
-0.2864148020744324,
0.0851031243801117,
-1.4726964235305786,
-0.623249888420105,
-0.27483904361724854,
1.3094837665557861,
-0.1880451738834381,
1.2420947551727295,
-0.25185611844062805,
-0.3992597162723541,
-0.39399561285972595,
-0.3397558629512787,
0.27698931097984314,
-0.36145761609077454,
-0.567470371723175,
0.20489747822284698,
-0.8553024530410767,
0.38865694403648376,
1.4783174991607666,
0.5299801826477051,
-0.020572971552610397,
0.6573304533958435,
0.9584097266197205,
0.37086188793182373,
-0.11271515488624573,
-0.7915410995483398,
-1.4884134531021118,
1.9289796352386475,
-1.5068224668502808,
1.902618646621704,
0.6748789548873901,
-0.14019247889518738,
-1.750590443611145,
-2.006906032562256,
1.2198829650878906,
1.3173526525497437,
2.306788444519043,
0.6130732297897339,
0.36342331767082214,
-0.8272905349731445,
-0.6903032660484314,
0.27249446511268616,
-1.2024604082107544,
-0.7389918565750122,
-0.07315857708454132,
2.2634265422821045,
1.793080449104309,
-0.723797082901001,
-0.1715000420808792,
-1.163456916809082,
1.306074619293213,
-0.02009781450033188,
0.22029584646224976,
2.0296084880828857,
-0.38312235474586487,
-1.1146410703659058,
1.3014171123504639,
-2.240145206451416,
0.10344120860099792,
1.9431108236312866,
0.43895283341407776,
0.10318824648857117,
-1.493690013885498,
-0.6274991631507874,
-0.25009915232658386,
-0.41964077949523926,
-1.2902063131332397,
0.562484860420227,
-0.31671464443206787,
-0.9184979796409607,
-1.5211999416351318,
0.1340310424566269,
-1.0708954334259033,
-1.554914951324463,
0.4270823299884796,
2.0131351947784424,
1.9331910610198975,
-0.6140665411949158,
1.4764108657836914,
-0.18578551709651947,
0.03420783206820488,
1.2522536516189575,
1.1510820388793945,
3.03774356842041,
2.0238943099975586,
-1.025524616241455,
0.5940279364585876,
-0.241573765873909,
-0.38733968138694763,
1.0516365766525269,
-1.091283917427063,
1.2369922399520874,
-0.10807299613952637,
-1.0991393327713013,
-1.120386004447937,
0.9545193314552307,
0.5802348852157593,
0.12825416028499603,
-0.5606316328048706,
1.2252287864685059,
0.059036772698163986,
1.3212709426879883,
0.47494977712631226,
-0.33632510900497437,
0.6598193049430847,
-0.4501159191131592,
-0.4651362895965576,
1.7265610694885254,
0.2825559377670288,
-1.454107642173767,
-2.3192391395568848,
-0.20431408286094666,
-0.7796893119812012,
0.032630521804094315,
-0.5587530136108398,
-1.0080599784851074,
1.752739667892456,
0.5305073857307434,
-1.3298310041427612,
-0.3378954231739044,
-0.37658703327178955,
-0.6832931637763977,
2.6761205196380615,
-1.4050936698913574,
-0.3616864085197449,
-0.9197607636451721,
-0.3752954602241516,
1.6881154775619507,
-1.32938551902771,
-0.1697452962398529,
-1.0248852968215942,
-0.6215273141860962,
-1.2924363613128662,
-0.5723873376846313,
-0.23002400994300842,
-0.8324474692344666,
0.7876085042953491,
0.009350673295557499,
-1.0813320875167847,
-0.37998083233833313,
-0.8712881207466125,
0.6826975345611572,
-0.036181725561618805,
0.30610620975494385,
1.9232083559036255,
0.3725462257862091,
-0.2869774401187897,
0.7758817672729492,
1.2158420085906982,
0.6420368552207947,
-0.6586540341377258,
0.15206535160541534,
-0.5003585815429688,
0.43825921416282654,
-1.3420735597610474,
0.2502416968345642,
-2.997983455657959,
0.6461074352264404,
-0.09508099406957626,
-0.2190311700105667,
0.04389406740665436,
-1.2700031995773315,
1.206690788269043,
2.545588970184326,
-1.143477201461792,
0.4010760188102722,
0.32056206464767456,
1.2154865264892578,
-1.4463444948196411,
0.4308917224407196,
-0.4256576895713806,
2.1050705909729004,
0.25324171781539917,
1.0898823738098145,
-0.6854896545410156,
-2.1088435649871826,
0.5792247653007507,
-1.002403974533081,
-1.1792185306549072,
0.42778778076171875,
-0.9107999801635742,
0.13411873579025269,
-1.6687545776367188,
-0.1267738938331604,
-0.8686390519142151,
-1.2535436153411865,
0.6825286149978638,
0.22020703554153442,
0.2320931851863861,
-0.6282985210418701,
0.40092799067497253,
-2.181750774383545,
-1.4483511447906494,
-0.2845138907432556,
-1.0212775468826294,
0.6583927869796753,
-0.40552276372909546,
0.6453577876091003,
-0.01326843723654747,
0.059655968099832535,
0.2614828050136566,
1.3829679489135742,
3.3097288608551025,
0.11617456376552582,
0.4657644033432007,
-0.04264919459819794,
-0.8338651061058044,
1.5524471998214722,
1.1286240816116333,
0.18482719361782074,
-0.6448953151702881,
-1.0095798969268799,
1.4640660285949707,
2.0810282230377197,
0.8854670524597168,
0.06804811954498291,
-0.7735603451728821,
-0.5665932893753052,
0.018142718821763992,
0.22600816190242767,
0.4681834280490875,
1.0598925352096558,
-0.009397527202963829,
0.1026221215724945,
1.5239036083221436,
1.3299719095230103,
-0.49981802701950073,
0.4970977008342743,
-0.7815466523170471,
-0.389117568731308,
0.3025017976760864,
0.4420035779476166,
0.12508024275302887,
0.3096971809864044,
-1.0165905952453613,
-0.25752508640289307,
-0.18628503382205963,
-1.0173873901367188,
-0.7832907438278198,
-0.4184339940547943,
-0.4503457546234131,
1.7129490375518799,
0.1606864482164383,
-0.5119054317474365,
-0.10441457480192184,
-0.7660853266716003,
-0.008842894807457924,
-0.9458426237106323,
0.46133920550346375,
0.00069389957934618,
0.04935988038778305,
-0.15466761589050293,
1.7890323400497437,
-0.8706341981887817,
-2.152040958404541,
0.2449023574590683,
0.3271270990371704,
-0.4817284047603607,
0.15746624767780304,
1.588736891746521,
0.6342239379882812,
1.4859579801559448,
1.3092663288116455,
0.9163023829460144,
-0.5696542263031006,
-1.2774595022201538,
0.6803775429725647,
0.7895406484603882,
-1.4093577861785889,
0.7131026983261108,
0.07417412847280502,
-0.48244234919548035,
0.857231855392456,
1.3624486923217773,
0.37849029898643494,
-1.981685996055603,
0.877878725528717,
-0.8933963775634766,
0.927808940410614,
0.6666948795318604,
0.6926934123039246,
0.306013822555542,
0.8953949809074402,
-1.3634543418884277,
-1.146474838256836,
-1.0368260145187378,
-0.7263824343681335,
2.0299019813537598,
-0.2870037257671356,
0.5834861993789673,
-0.03471808880567551,
-1.2362816333770752,
-0.12547345459461212,
0.7539729475975037,
0.39592498540878296,
-0.2700948715209961,
0.8161136507987976,
-0.6343984603881836,
-1.173756718635559,
-1.3449665307998657,
-0.47530877590179443,
-0.8232982158660889,
-0.8530531525611877,
0.9530819058418274,
0.8570311665534973,
0.4743712246417999,
1.9710673093795776,
0.581878125667572,
0.26683712005615234,
-2.6490120887756348,
0.8408994674682617,
0.34237414598464966,
0.09664233773946762,
1.102560043334961,
0.25402581691741943,
0.9258678555488586,
-0.08613130450248718,
0.38881948590278625,
-2.320648431777954,
2.0976834297180176,
-0.3540828824043274,
0.768937885761261,
0.038007136434316635,
0.006877330131828785,
1.2386281490325928,
0.4872724711894989,
0.577669620513916,
-1.1772434711456299,
0.6562793254852295,
-0.5004935264587402,
1.239337682723999,
0.790045976638794,
-0.5880669951438904,
-0.005793655291199684,
1.1603585481643677,
0.558984100818634,
-0.40037479996681213,
-0.9984800219535828,
-0.885140061378479,
0.9202349185943604,
1.805997610092163,
-0.08060897886753082,
0.04373500496149063,
0.6958577632904053,
0.6333861351013184,
-1.306199073791504,
0.07414113730192184,
-0.8424109816551208,
-0.6106911301612854,
1.5769814252853394,
2.045593738555908,
-0.04371608793735504,
-0.17149718105793,
-0.5339319109916687,
-1.3581868410110474,
0.5640615820884705,
0.021960768848657608,
0.23738887906074524,
0.6544575095176697,
-0.6836088299751282,
1.0602751970291138,
0.7342060804367065,
0.8591886758804321,
-0.07515940070152283,
0.5315896272659302,
0.4896891415119171,
-0.2737863063812256,
-1.2176625728607178,
-0.41580119729042053,
-1.180011510848999,
-2.4915459156036377,
0.3899168372154236,
-0.3036690354347229,
-1.4009437561035156,
0.053416382521390915,
-1.1213395595550537,
0.9125693440437317,
-0.48908501863479614,
-1.1026554107666016,
-1.6512682437896729,
0.12520362436771393,
0.030966024845838547,
0.8625262379646301,
-1.5190308094024658,
-0.1331281065940857,
1.3073867559432983,
0.8919607996940613,
-0.6449549198150635,
1.0551855564117432,
0.26103129982948303,
1.0889657735824585,
0.703769326210022,
-0.5233134031295776,
0.32401058077812195,
0.11981241405010223,
-1.3563984632492065,
0.632499098777771,
1.2104122638702393,
0.11236363649368286,
1.4254919290542603,
-0.6705883145332336,
0.12398503720760345,
0.6113076210021973,
-0.6301644444465637,
-0.3658392131328583,
-0.46958523988723755,
0.6511124968528748,
0.05925785377621651,
-0.975751519203186,
-0.017765112221240997,
-0.1597508192062378,
-0.11791376769542694,
0.20054100453853607,
-1.4805694818496704,
-0.29920631647109985,
-0.45304033160209656,
-0.4341700077056885,
-1.2150095701217651,
0.024253174662590027,
1.333611011505127,
-0.7425430417060852,
-0.21023467183113098,
0.5599042773246765,
0.5847128033638,
0.6614370346069336,
0.6680602431297302,
-0.5683684945106506,
-0.4149067997932434,
-0.30030930042266846,
-0.33298712968826294,
0.2715167999267578,
1.1879738569259644,
-0.2395600825548172,
-0.9970890283584595,
0.7151399850845337,
-0.41629570722579956,
0.018471237272024155,
1.9603124856948853,
-0.07378274202346802,
-0.7145024538040161,
0.3012797236442566,
-0.8355552554130554,
1.7735795974731445,
1.4858863353729248,
1.2484045028686523,
-0.03338007256388664,
-0.7726680636405945,
0.4839087426662445,
-0.052248090505599976,
-0.34927234053611755,
0.9424652457237244,
0.6327893733978271,
-0.2052803933620453,
-1.3876783847808838,
0.5890787839889526,
1.243668556213379,
-1.153201699256897,
-0.874697744846344,
0.11503087729215622,
-0.7558634877204895,
1.1454334259033203,
0.7134008407592773,
0.4951576888561249,
0.3152430057525635,
1.7277123928070068,
0.6072137355804443,
-0.4167947769165039,
0.38146087527275085,
0.6370306015014648,
-0.19073176383972168,
-2.2051661014556885,
-1.1628382205963135,
0.3139055073261261,
-0.43348655104637146,
-1.409590721130371,
1.221490740776062,
-1.1133887767791748,
-0.967915952205658,
0.4371715784072876,
0.2761118710041046,
1.5263922214508057,
0.3773222863674164,
1.680970549583435,
2.059201955795288,
0.8929478526115417,
0.23324613273143768,
1.4120272397994995,
-0.08763865381479263,
-0.5438798666000366,
1.9119231700897217,
-0.4589528739452362,
0.4707706570625305,
0.9456782937049866,
-0.42061254382133484,
-1.0686354637145996,
-0.7013726830482483,
-1.141649842262268,
-0.5889569520950317,
1.0570770502090454,
0.17920653522014618,
-1.1997146606445312,
0.0329398438334465,
1.3609299659729004,
0.2588379979133606,
-0.2857649624347687,
0.2962709665298462,
0.3716754615306854,
-0.7228056192398071,
-0.10445709526538849,
-0.9493659138679504,
0.4841682016849518,
-0.21380022168159485,
-0.41915783286094666,
0.18391315639019012,
0.47678494453430176,
1.1114386320114136,
-0.1620119959115982,
0.08219180256128311,
1.2185804843902588,
-1.527579665184021,
1.5330754518508911,
-0.6112825870513916,
0.19253233075141907,
-2.4009711742401123,
1.516981601715088,
-0.7209026217460632,
1.9982267618179321,
-2.7789788246154785,
0.40459784865379333,
-0.5936455726623535,
-0.39821428060531616,
0.4648379385471344,
-0.22663161158561707,
0.22516019642353058,
-0.16661767661571503,
-1.0909860134124756,
0.037239812314510345,
-0.7029914259910583,
0.450676828622818,
1.1346710920333862,
1.3729830980300903,
-1.1498405933380127,
-0.1334325224161148,
-1.746570348739624,
-0.14170505106449127,
-0.8767080903053284,
0.3960869014263153,
-2.134657382965088,
-0.1412733495235443,
-1.7617216110229492,
-2.0281760692596436,
-1.3706543445587158,
-0.8811589479446411,
0.9768677353858948,
0.08119680732488632,
-0.8533144593238831,
1.0281089544296265,
-0.360474556684494,
-1.6712044477462769,
1.1039429903030396,
-2.268242120742798
] |
https://github.com/huggingface/datasets/issues/4965 | [Apple M1] MemoryError: Cannot allocate write+execute memory for ffi.callback() | Hi! This seems like a bug in `soundfile`. Could you please open an issue in their repo? `soundfile` works without any issues on my M1, so I'm not sure we can help. | ## Describe the bug
I'm trying to run `cast_column("audio", Audio())` on Apple M1 Pro, but it seems that it doesn't work.
## Steps to reproduce the bug
```python
import datasets
dataset = load_dataset("csv", data_files="./train.csv")["train"]
dataset = dataset.map(lambda x: {"audio": str(DATA_DIR / "audio" / x["audio"])})
dataset = dataset.cast_column("audio", Audio())
dataset[0]
```
## Expected results
```
{'audio': {'bytes': None,
'path': '/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~JOINT_ACCOUNT/602ba55abb1e6d0fbce92065.wav'},
'english_transcription': 'I would like to set up a joint account with my partner',
'intent_class': 11,
'lang_id': 4,
'path': '/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~JOINT_ACCOUNT/602ba55abb1e6d0fbce92065.wav',
'transcription': 'I would like to set up a joint account with my partner'}
```
## Actual results
````---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 dataset[0]
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/arrow_dataset.py:2165, in Dataset.__getitem__(self, key)
2163 def __getitem__(self, key): # noqa: F811
2164 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools)."""
-> 2165 return self._getitem(
2166 key,
2167 )
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/arrow_dataset.py:2150, in Dataset._getitem(self, key, decoded, **kwargs)
2148 formatter = get_formatter(format_type, features=self.features, decoded=decoded, **format_kwargs)
2149 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
-> 2150 formatted_output = format_table(
2151 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns
2152 )
2153 return formatted_output
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:532, in format_table(table, key, formatter, format_columns, output_all_columns)
530 python_formatter = PythonFormatter(features=None)
531 if format_columns is None:
--> 532 return formatter(pa_table, query_type=query_type)
533 elif query_type == "column":
534 if key in format_columns:
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:281, in Formatter.__call__(self, pa_table, query_type)
279 def __call__(self, pa_table: pa.Table, query_type: str) -> Union[RowFormat, ColumnFormat, BatchFormat]:
280 if query_type == "row":
--> 281 return self.format_row(pa_table)
282 elif query_type == "column":
283 return self.format_column(pa_table)
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:312, in PythonFormatter.format_row(self, pa_table)
310 row = self.python_arrow_extractor().extract_row(pa_table)
311 if self.decoded:
--> 312 row = self.python_features_decoder.decode_row(row)
313 return row
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:221, in PythonFeaturesDecoder.decode_row(self, row)
220 def decode_row(self, row: dict) -> dict:
--> 221 return self.features.decode_example(row) if self.features else row
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1647, in Features.decode_example(self, example, token_per_repo_id)
1634 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1635 """Decode example with custom feature decoding.
1636
1637 Args:
(...)
1644 :obj:`dict[str, Any]`
1645 """
-> 1647 return {
1648 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1649 if self._column_requires_decoding[column_name]
1650 else value
1651 for column_name, (feature, value) in zip_dict(
1652 {key: value for key, value in self.items() if key in example}, example
1653 )
1654 }
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1648, in <dictcomp>(.0)
1634 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1635 """Decode example with custom feature decoding.
1636
1637 Args:
(...)
1644 :obj:`dict[str, Any]`
1645 """
1647 return {
-> 1648 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1649 if self._column_requires_decoding[column_name]
1650 else value
1651 for column_name, (feature, value) in zip_dict(
1652 {key: value for key, value in self.items() if key in example}, example
1653 )
1654 }
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1260, in decode_nested_example(schema, obj, token_per_repo_id)
1257 # Object with special decoding:
1258 elif isinstance(schema, (Audio, Image)):
1259 # we pass the token to read and decode files from private repositories in streaming mode
-> 1260 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id) if obj is not None else None
1261 return obj
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/audio.py:156, in Audio.decode_example(self, value, token_per_repo_id)
154 array, sampling_rate = self._decode_non_mp3_file_like(file)
155 else:
--> 156 array, sampling_rate = self._decode_non_mp3_path_like(path, token_per_repo_id=token_per_repo_id)
157 return {"path": path, "array": array, "sampling_rate": sampling_rate}
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/audio.py:257, in Audio._decode_non_mp3_path_like(self, path, format, token_per_repo_id)
254 use_auth_token = None
256 with xopen(path, "rb", use_auth_token=use_auth_token) as f:
--> 257 array, sampling_rate = librosa.load(f, sr=self.sampling_rate, mono=self.mono)
258 return array, sampling_rate
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/util/decorators.py:88, in deprecate_positional_args.<locals>._inner_deprecate_positional_args.<locals>.inner_f(*args, **kwargs)
86 extra_args = len(args) - len(all_args)
87 if extra_args <= 0:
---> 88 return f(*args, **kwargs)
90 # extra_args > 0
91 args_msg = [
92 "{}={}".format(name, arg)
93 for name, arg in zip(kwonly_args[:extra_args], args[-extra_args:])
94 ]
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/core/audio.py:164, in load(path, sr, mono, offset, duration, dtype, res_type)
161 else:
162 # Otherwise try soundfile first, and then fall back if necessary
163 try:
--> 164 y, sr_native = __soundfile_load(path, offset, duration, dtype)
166 except RuntimeError as exc:
167 # If soundfile failed, try audioread instead
168 if isinstance(path, (str, pathlib.PurePath)):
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/core/audio.py:195, in __soundfile_load(path, offset, duration, dtype)
192 context = path
193 else:
194 # Otherwise, create the soundfile object
--> 195 context = sf.SoundFile(path)
197 with context as sf_desc:
198 sr_native = sf_desc.samplerate
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:629, in SoundFile.__init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
626 self._mode = mode
627 self._info = _create_info_struct(file, mode, samplerate, channels,
628 format, subtype, endian)
--> 629 self._file = self._open(file, mode_int, closefd)
630 if set(mode).issuperset('r+') and self.seekable():
631 # Move write position to 0 (like in Python file objects)
632 self.seek(0)
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:1179, in SoundFile._open(self, file, mode_int, closefd)
1177 file_ptr = _snd.sf_open_fd(file, mode_int, self._info, closefd)
1178 elif _has_virtual_io_attrs(file, mode_int):
-> 1179 file_ptr = _snd.sf_open_virtual(self._init_virtual_io(file),
1180 mode_int, self._info, _ffi.NULL)
1181 else:
1182 raise TypeError("Invalid file: {0!r}".format(self.name))
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:1197, in SoundFile._init_virtual_io(self, file)
1194 def _init_virtual_io(self, file):
1195 """Initialize callback functions for sf_open_virtual()."""
1196 @_ffi.callback("sf_vio_get_filelen")
-> 1197 def vio_get_filelen(user_data):
1198 curr = file.tell()
1199 file.seek(0, SEEK_END)
MemoryError: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4 | 529 | 32 | [Apple M1] MemoryError: Cannot allocate write+execute memory for ffi.callback()
## Describe the bug
I'm trying to run `cast_column("audio", Audio())` on Apple M1 Pro, but it seems that it doesn't work.
## Steps to reproduce the bug
```python
import datasets
dataset = load_dataset("csv", data_files="./train.csv")["train"]
dataset = dataset.map(lambda x: {"audio": str(DATA_DIR / "audio" / x["audio"])})
dataset = dataset.cast_column("audio", Audio())
dataset[0]
```
## Expected results
```
{'audio': {'bytes': None,
'path': '/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~JOINT_ACCOUNT/602ba55abb1e6d0fbce92065.wav'},
'english_transcription': 'I would like to set up a joint account with my partner',
'intent_class': 11,
'lang_id': 4,
'path': '/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~JOINT_ACCOUNT/602ba55abb1e6d0fbce92065.wav',
'transcription': 'I would like to set up a joint account with my partner'}
```
## Actual results
````---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 dataset[0]
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/arrow_dataset.py:2165, in Dataset.__getitem__(self, key)
2163 def __getitem__(self, key): # noqa: F811
2164 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools)."""
-> 2165 return self._getitem(
2166 key,
2167 )
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/arrow_dataset.py:2150, in Dataset._getitem(self, key, decoded, **kwargs)
2148 formatter = get_formatter(format_type, features=self.features, decoded=decoded, **format_kwargs)
2149 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
-> 2150 formatted_output = format_table(
2151 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns
2152 )
2153 return formatted_output
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:532, in format_table(table, key, formatter, format_columns, output_all_columns)
530 python_formatter = PythonFormatter(features=None)
531 if format_columns is None:
--> 532 return formatter(pa_table, query_type=query_type)
533 elif query_type == "column":
534 if key in format_columns:
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:281, in Formatter.__call__(self, pa_table, query_type)
279 def __call__(self, pa_table: pa.Table, query_type: str) -> Union[RowFormat, ColumnFormat, BatchFormat]:
280 if query_type == "row":
--> 281 return self.format_row(pa_table)
282 elif query_type == "column":
283 return self.format_column(pa_table)
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:312, in PythonFormatter.format_row(self, pa_table)
310 row = self.python_arrow_extractor().extract_row(pa_table)
311 if self.decoded:
--> 312 row = self.python_features_decoder.decode_row(row)
313 return row
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:221, in PythonFeaturesDecoder.decode_row(self, row)
220 def decode_row(self, row: dict) -> dict:
--> 221 return self.features.decode_example(row) if self.features else row
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1647, in Features.decode_example(self, example, token_per_repo_id)
1634 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1635 """Decode example with custom feature decoding.
1636
1637 Args:
(...)
1644 :obj:`dict[str, Any]`
1645 """
-> 1647 return {
1648 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1649 if self._column_requires_decoding[column_name]
1650 else value
1651 for column_name, (feature, value) in zip_dict(
1652 {key: value for key, value in self.items() if key in example}, example
1653 )
1654 }
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1648, in <dictcomp>(.0)
1634 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1635 """Decode example with custom feature decoding.
1636
1637 Args:
(...)
1644 :obj:`dict[str, Any]`
1645 """
1647 return {
-> 1648 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1649 if self._column_requires_decoding[column_name]
1650 else value
1651 for column_name, (feature, value) in zip_dict(
1652 {key: value for key, value in self.items() if key in example}, example
1653 )
1654 }
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1260, in decode_nested_example(schema, obj, token_per_repo_id)
1257 # Object with special decoding:
1258 elif isinstance(schema, (Audio, Image)):
1259 # we pass the token to read and decode files from private repositories in streaming mode
-> 1260 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id) if obj is not None else None
1261 return obj
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/audio.py:156, in Audio.decode_example(self, value, token_per_repo_id)
154 array, sampling_rate = self._decode_non_mp3_file_like(file)
155 else:
--> 156 array, sampling_rate = self._decode_non_mp3_path_like(path, token_per_repo_id=token_per_repo_id)
157 return {"path": path, "array": array, "sampling_rate": sampling_rate}
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/audio.py:257, in Audio._decode_non_mp3_path_like(self, path, format, token_per_repo_id)
254 use_auth_token = None
256 with xopen(path, "rb", use_auth_token=use_auth_token) as f:
--> 257 array, sampling_rate = librosa.load(f, sr=self.sampling_rate, mono=self.mono)
258 return array, sampling_rate
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/util/decorators.py:88, in deprecate_positional_args.<locals>._inner_deprecate_positional_args.<locals>.inner_f(*args, **kwargs)
86 extra_args = len(args) - len(all_args)
87 if extra_args <= 0:
---> 88 return f(*args, **kwargs)
90 # extra_args > 0
91 args_msg = [
92 "{}={}".format(name, arg)
93 for name, arg in zip(kwonly_args[:extra_args], args[-extra_args:])
94 ]
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/core/audio.py:164, in load(path, sr, mono, offset, duration, dtype, res_type)
161 else:
162 # Otherwise try soundfile first, and then fall back if necessary
163 try:
--> 164 y, sr_native = __soundfile_load(path, offset, duration, dtype)
166 except RuntimeError as exc:
167 # If soundfile failed, try audioread instead
168 if isinstance(path, (str, pathlib.PurePath)):
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/core/audio.py:195, in __soundfile_load(path, offset, duration, dtype)
192 context = path
193 else:
194 # Otherwise, create the soundfile object
--> 195 context = sf.SoundFile(path)
197 with context as sf_desc:
198 sr_native = sf_desc.samplerate
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:629, in SoundFile.__init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
626 self._mode = mode
627 self._info = _create_info_struct(file, mode, samplerate, channels,
628 format, subtype, endian)
--> 629 self._file = self._open(file, mode_int, closefd)
630 if set(mode).issuperset('r+') and self.seekable():
631 # Move write position to 0 (like in Python file objects)
632 self.seek(0)
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:1179, in SoundFile._open(self, file, mode_int, closefd)
1177 file_ptr = _snd.sf_open_fd(file, mode_int, self._info, closefd)
1178 elif _has_virtual_io_attrs(file, mode_int):
-> 1179 file_ptr = _snd.sf_open_virtual(self._init_virtual_io(file),
1180 mode_int, self._info, _ffi.NULL)
1181 else:
1182 raise TypeError("Invalid file: {0!r}".format(self.name))
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:1197, in SoundFile._init_virtual_io(self, file)
1194 def _init_virtual_io(self, file):
1195 """Initialize callback functions for sf_open_virtual()."""
1196 @_ffi.callback("sf_vio_get_filelen")
-> 1197 def vio_get_filelen(user_data):
1198 curr = file.tell()
1199 file.seek(0, SEEK_END)
MemoryError: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Hi! This seems like a bug in `soundfile`. Could you please open an issue in their repo? `soundfile` works without any issues on my M1, so I'm not sure we can help. | [
-1.173766016960144,
-0.852719783782959,
-0.7519888281822205,
1.4927517175674438,
-0.05840998888015747,
-1.2579002380371094,
0.01540210098028183,
-0.8796024322509766,
1.6415233612060547,
-0.751623809337616,
0.325585275888443,
-1.681330919265747,
-0.03777188062667847,
-0.7265690565109253,
-0.7154834270477295,
-0.660078763961792,
-0.2557125687599182,
-0.7454336881637573,
1.0658246278762817,
2.5528430938720703,
1.134187936782837,
-1.3434947729110718,
2.816070795059204,
0.6707550287246704,
-0.1954203099012375,
-0.8495033383369446,
0.3901939392089844,
-0.06275352835655212,
-1.3031023740768433,
-0.30564242601394653,
-0.96998131275177,
0.028492892161011696,
-0.5485169291496277,
-0.5411589741706848,
0.020189180970191956,
0.5229862928390503,
-0.2321079522371292,
-0.49979180097579956,
-0.43213194608688354,
-0.7255741357803345,
0.4774857759475708,
-0.3896093964576721,
0.8428829908370972,
-0.2381380796432495,
1.7688541412353516,
-0.62413489818573,
0.35493484139442444,
0.5697917342185974,
1.24940025806427,
0.26908594369888306,
0.06877468526363373,
0.4612160325050354,
0.32555219531059265,
0.01773281767964363,
0.6212384700775146,
1.2662075757980347,
0.6108194589614868,
0.43606099486351013,
0.7645900845527649,
-2.28143310546875,
1.2654216289520264,
-0.8837762475013733,
0.21700327098369598,
1.3255178928375244,
-1.0152366161346436,
0.5173918008804321,
-1.89989173412323,
-0.061289094388484955,
0.418607234954834,
-2.175318479537964,
0.2894698679447174,
-1.2486158609390259,
-0.5175492763519287,
0.9836089015007019,
0.32483774423599243,
-1.3131678104400635,
0.08714108914136887,
-0.4164315164089203,
0.9718640446662903,
0.32262009382247925,
1.0732495784759521,
-1.6745843887329102,
0.01865718513727188,
-0.2416965365409851,
0.23157484829425812,
-1.218984603881836,
-1.6008304357528687,
0.5996944308280945,
0.6193454265594482,
0.6698266267776489,
-0.1297711431980133,
0.9044731259346008,
-1.178127408027649,
0.7888036966323853,
-1.042115569114685,
-1.8339437246322632,
-1.3341174125671387,
-2.336899518966675,
-2.306817054748535,
0.808234453201294,
-0.39219942688941956,
-0.4057188928127289,
2.06435489654541,
-1.1093249320983887,
-1.7858917713165283,
1.0843288898468018,
0.3828940689563751,
-0.13938374817371368,
2.4028890132904053,
0.2560916244983673,
-0.9110240936279297,
0.6583101749420166,
-0.8539177179336548,
0.7061803340911865,
-0.3954584300518036,
1.3503679037094116,
0.4305204451084137,
-0.9585667848587036,
1.6848498582839966,
-0.39214956760406494,
0.5215258598327637,
-0.7421385049819946,
-0.38702017068862915,
-0.7017925977706909,
0.3170453608036041,
1.9871320724487305,
-0.2454129010438919,
1.4791109561920166,
-0.27574506402015686,
-1.510190725326538,
-1.4480249881744385,
0.8253961205482483,
0.4969843626022339,
-0.8499802947044373,
0.1813146322965622,
-0.43839648365974426,
0.20574526488780975,
-0.0512876957654953,
1.1527928113937378,
1.224997878074646,
0.7857682704925537,
-0.2026541382074356,
-0.9624963402748108,
0.12786419689655304,
-0.013111183419823647,
-0.5822648406028748,
-1.73258638381958,
-0.2792212963104248,
0.22813935577869415,
0.6308189034461975,
-1.2475405931472778,
1.8361328840255737,
0.8278505206108093,
1.9757554531097412,
1.0614105463027954,
-0.3114003837108612,
1.538830280303955,
0.1206800639629364,
1.9754213094711304,
-0.38166293501853943,
0.5938640236854553,
-0.44921591877937317,
-1.225792407989502,
0.7470579743385315,
-0.34792560338974,
-2.018333673477173,
-0.5969898104667664,
-0.9327778220176697,
-0.1478176862001419,
-0.8900265097618103,
0.9182221293449402,
-0.22889909148216248,
-1.5021518468856812,
0.21283072233200073,
-0.7054453492164612,
0.15990658104419708,
-1.342237949371338,
0.24333339929580688,
0.7450445890426636,
-0.6648119688034058,
0.1455937922000885,
-0.33097144961357117,
-1.4152365922927856,
-0.5436241626739502,
0.399356871843338,
1.884585976600647,
-0.7236018776893616,
0.9218443632125854,
1.0471850633621216,
-0.6146875023841858,
-0.06744914501905441,
0.4108871519565582,
-0.37401047348976135,
0.8246358633041382,
-1.0366930961608887,
-0.43455398082733154,
1.1457536220550537,
-0.20914921164512634,
-0.5494888424873352,
1.3156359195709229,
0.8051477670669556,
-1.0125651359558105,
-0.3581774830818176,
-0.17775724828243256,
-0.8121758699417114,
0.03974221646785736,
-1.6042571067810059,
-0.1331343799829483,
0.3596969246864319,
-1.4772930145263672,
-0.4347133934497833,
-0.17837195098400116,
1.2196170091629028,
-0.07431671023368835,
1.2793856859207153,
-0.24408143758773804,
-0.07258649915456772,
-0.41154900193214417,
-0.5538480877876282,
0.17296971380710602,
-0.130409836769104,
-0.6646498441696167,
0.2464672029018402,
-0.7187902331352234,
0.24234223365783691,
1.4517240524291992,
0.3138222098350525,
0.03646305203437805,
0.5825721025466919,
1.1955374479293823,
0.35299232602119446,
-0.030848579481244087,
-0.8519220352172852,
-1.6599900722503662,
1.9744197130203247,
-1.5929807424545288,
1.9614174365997314,
0.7176642417907715,
0.025602353736758232,
-1.8140263557434082,
-1.8628469705581665,
1.4817241430282593,
1.140268325805664,
2.4573302268981934,
0.5762842297554016,
0.4924933910369873,
-0.7912070751190186,
-0.7207266688346863,
0.38216590881347656,
-0.8842732310295105,
-0.8183028101921082,
0.19319957494735718,
2.4135751724243164,
1.7199805974960327,
-0.4228064715862274,
-0.22684785723686218,
-0.9091681838035583,
1.3190089464187622,
-0.22293828427791595,
0.2645781636238098,
1.9097824096679688,
-0.3394528329372406,
-1.0043954849243164,
1.3266420364379883,
-2.4747374057769775,
0.2956599295139313,
2.034644603729248,
0.27400603890419006,
0.11633463203907013,
-1.1921815872192383,
-0.6947585940361023,
-0.10078819841146469,
-0.4425290822982788,
-1.2505861520767212,
0.48444852232933044,
-0.23208370804786682,
-0.8241931200027466,
-1.4530987739562988,
0.07999801635742188,
-1.1761316061019897,
-1.592442512512207,
0.29777222871780396,
1.8064744472503662,
2.1291277408599854,
-0.8676507472991943,
1.4197821617126465,
-0.1918194741010666,
0.3293059766292572,
1.2362629175186157,
1.3166279792785645,
3.1531708240509033,
1.7803230285644531,
-1.2924976348876953,
0.7063570022583008,
-0.24501697719097137,
-0.4462892711162567,
1.1825801134109497,
-1.0964386463165283,
1.1350879669189453,
-0.20329292118549347,
-1.271907091140747,
-1.1494799852371216,
0.8981135487556458,
0.5180278420448303,
-0.07830142229795456,
-0.3888547122478485,
1.0838786363601685,
0.14188969135284424,
1.3184082508087158,
0.6448596715927124,
-0.3218192160129547,
0.5440874695777893,
-0.36935532093048096,
-0.47912055253982544,
1.5731284618377686,
0.05579465627670288,
-1.4578968286514282,
-2.3014721870422363,
-0.12697219848632812,
-0.966206431388855,
-0.038228683173656464,
-0.7465499639511108,
-1.0603950023651123,
1.5129703283309937,
0.4045586585998535,
-1.0297902822494507,
-0.09869655966758728,
-0.3177873492240906,
-0.5554957389831543,
2.64566707611084,
-1.3914953470230103,
-0.311221182346344,
-0.9925367832183838,
-0.5844214558601379,
1.6098281145095825,
-1.092966914176941,
-0.1879623979330063,
-1.0198791027069092,
-0.5342901945114136,
-1.3228646516799927,
-0.5112254619598389,
-0.026996580883860588,
-0.8069087862968445,
0.8475862145423889,
0.12852296233177185,
-1.2359670400619507,
-0.2586614489555359,
-1.0764470100402832,
0.8355509638786316,
-0.2775401473045349,
0.10954783111810684,
1.7759841680526733,
0.33178409934043884,
-0.37843120098114014,
0.8139241933822632,
1.2169681787490845,
0.6310657262802124,
-0.5502059459686279,
0.23488959670066833,
-0.6398530006408691,
0.4028707444667816,
-1.2865521907806396,
0.3431238532066345,
-2.8866052627563477,
0.6381290555000305,
0.04192434996366501,
-0.08497489243745804,
-0.05096547305583954,
-1.3974260091781616,
1.058746337890625,
2.4588370323181152,
-1.1319655179977417,
0.6145768165588379,
0.2927897572517395,
1.2751587629318237,
-1.692834496498108,
0.05482860654592514,
-0.5283437371253967,
2.085078477859497,
0.03963961452245712,
1.1228569746017456,
-0.508936882019043,
-2.3309261798858643,
0.5633896589279175,
-1.3232059478759766,
-1.0670154094696045,
0.7227572798728943,
-0.9088950157165527,
0.25351569056510925,
-1.2989892959594727,
-0.2347283661365509,
-1.0168558359146118,
-1.119368553161621,
0.6001197099685669,
0.0863804742693901,
0.5265586376190186,
-0.6043019890785217,
0.2930363714694977,
-2.193000555038452,
-1.3792728185653687,
-0.12067170441150665,
-0.8745639324188232,
0.5051237940788269,
-0.3453032970428467,
0.7165710926055908,
-0.14725923538208008,
-0.003400268964469433,
0.2612244188785553,
1.485161542892456,
3.27557110786438,
0.1427701860666275,
0.43626266717910767,
-0.23931579291820526,
-1.03044593334198,
1.5116803646087646,
0.9312655925750732,
-0.20481455326080322,
-0.6388226747512817,
-1.083306074142456,
1.3539824485778809,
1.9725642204284668,
1.0522633790969849,
0.06388778239488602,
-0.8465172052383423,
-0.7699400782585144,
0.05701436847448349,
0.13425815105438232,
0.4429228603839874,
0.9857699275016785,
0.07320137321949005,
0.09283072501420975,
1.3530396223068237,
1.0747758150100708,
-0.3842333257198334,
0.4042366147041321,
-0.8771045804023743,
-0.37114232778549194,
0.5146982073783875,
0.24028927087783813,
-0.03488529473543167,
0.282919317483902,
-1.0762962102890015,
-0.22970551252365112,
-0.2601855397224426,
-0.86383056640625,
-0.7903566360473633,
-0.3316306173801422,
-0.3666926920413971,
1.71861732006073,
0.06107434630393982,
-0.5402963757514954,
-0.11553718149662018,
-0.8092901110649109,
-0.09476861357688904,
-1.0088461637496948,
0.1621624231338501,
-0.2061338871717453,
-0.05126930773258209,
-0.14873161911964417,
1.698947548866272,
-0.9746303558349609,
-2.137584924697876,
0.08224166184663773,
0.2949979603290558,
-0.31934118270874023,
-0.005943851545453072,
1.7964507341384888,
0.5766148567199707,
1.422529935836792,
1.550607442855835,
1.078291416168213,
-0.6613790392875671,
-1.2811545133590698,
0.6572475433349609,
0.9474804997444153,
-1.3126330375671387,
0.8753656148910522,
-0.11195208132266998,
-0.5602569580078125,
0.5382129549980164,
1.344177007675171,
0.46279799938201904,
-1.9179890155792236,
0.7431591749191284,
-1.109511137008667,
0.820083498954773,
0.7333548665046692,
0.8582793474197388,
0.2037755250930786,
0.826913595199585,
-1.2636346817016602,
-1.0430411100387573,
-0.6900686621665955,
-0.6431038975715637,
1.8961313962936401,
-0.2314816266298294,
0.40918394923210144,
-0.16092589497566223,
-1.246213436126709,
0.07194575667381287,
0.7238037586212158,
0.3107924163341522,
-0.37063828110694885,
0.6933634877204895,
-0.7598231434822083,
-1.1325050592422485,
-1.2950778007507324,
-0.5172117352485657,
-0.9970059394836426,
-0.8625597357749939,
0.9633570909500122,
0.7097606658935547,
0.39848294854164124,
1.9909743070602417,
0.7474438548088074,
0.1969051957130432,
-2.6206581592559814,
0.825060248374939,
0.3638303279876709,
-0.037640370428562164,
0.8254251480102539,
0.3197856545448303,
1.2062410116195679,
-0.0454045832157135,
0.6186263561248779,
-2.345818519592285,
2.209556818008423,
-0.254944771528244,
0.7657477259635925,
-0.08962180465459824,
-0.04238360375165939,
0.9610662460327148,
0.48427218198776245,
0.5715622901916504,
-1.070532202720642,
0.7680585384368896,
-0.6019357442855835,
1.2031980752944946,
0.9127374887466431,
-0.9140785336494446,
0.1507132649421692,
1.2307822704315186,
0.37579742074012756,
-0.5589476227760315,
-1.0149232149124146,
-0.8253741264343262,
0.988777220249176,
1.7824939489364624,
-0.08001228421926498,
0.03965989500284195,
0.9081587791442871,
0.6730393171310425,
-1.3194568157196045,
-0.0518215075135231,
-0.5278429388999939,
-0.6926514506340027,
1.8340169191360474,
2.0309300422668457,
-0.10995835810899734,
-0.14395490288734436,
-0.7078397870063782,
-1.369879126548767,
0.8159160017967224,
0.1436443328857422,
0.012369129806756973,
0.8513162732124329,
-0.6879042387008667,
1.1205118894577026,
0.7603505849838257,
0.8347479701042175,
0.15031544864177704,
0.18848907947540283,
0.36867770552635193,
-0.3305742144584656,
-1.1164004802703857,
-0.3364029824733734,
-1.0972093343734741,
-2.6505303382873535,
0.4207564890384674,
-0.1342889368534088,
-1.4463374614715576,
0.08487262576818466,
-0.9244062304496765,
0.8649453520774841,
-0.5316175222396851,
-1.1802884340286255,
-1.3335808515548706,
0.29164421558380127,
-0.11899271607398987,
0.7671207785606384,
-1.692138910293579,
-0.15882176160812378,
1.1533654928207397,
1.0613765716552734,
-0.6740272045135498,
0.9065943956375122,
0.27205222845077515,
0.9483246803283691,
0.9382400512695312,
-0.35581690073013306,
0.4537509083747864,
0.1511540412902832,
-1.350940227508545,
0.4193840026855469,
1.4180796146392822,
0.1015884056687355,
1.4021350145339966,
-0.38469797372817993,
-0.08403322100639343,
0.45378637313842773,
-0.3431381583213806,
-0.460777223110199,
-0.6483446955680847,
0.615174412727356,
-0.008743415586650372,
-0.9207502603530884,
-0.0634969100356102,
0.09611500799655914,
-0.19550028443336487,
0.2752573788166046,
-1.4878593683242798,
-0.13559648394584656,
-0.38007381558418274,
-0.6515320539474487,
-1.3028877973556519,
-0.07725109905004501,
1.2715977430343628,
-0.8546850085258484,
-0.1988620012998581,
0.5558732748031616,
0.21064521372318268,
0.5222529768943787,
0.5095224976539612,
-0.7364405989646912,
-0.32083067297935486,
-0.20719414949417114,
-0.41482654213905334,
0.2556982934474945,
1.3285505771636963,
-0.07428603619337082,
-1.041757345199585,
0.5838328003883362,
-0.30734091997146606,
0.12630188465118408,
1.835160255432129,
-0.031033223494887352,
-0.9036227464675903,
0.27904653549194336,
-0.7311619520187378,
1.9150582551956177,
1.5772429704666138,
1.301992416381836,
-0.1101626306772232,
-0.87801194190979,
0.7066875696182251,
-0.3424062728881836,
-0.4148452579975128,
0.8636197447776794,
0.362350195646286,
-0.23954589664936066,
-1.4306305646896362,
0.7261738181114197,
1.2975643873214722,
-0.8138828277587891,
-0.7345755696296692,
0.08555708080530167,
-0.8644058108329773,
1.2275664806365967,
0.6272980570793152,
0.29550790786743164,
0.2437272071838379,
1.7016984224319458,
0.7483397722244263,
-0.5409734845161438,
0.5495196580886841,
0.5143176913261414,
-0.1382608413696289,
-2.105501174926758,
-1.0635640621185303,
0.16481637954711914,
-0.3034099340438843,
-1.551190733909607,
1.4081460237503052,
-1.2111072540283203,
-0.9251195192337036,
0.5856131911277771,
0.18440094590187073,
1.349969506263733,
0.3924891948699951,
1.6333523988723755,
2.0144433975219727,
0.7900744676589966,
0.4272472858428955,
1.139725685119629,
-0.26256734132766724,
-0.31180763244628906,
1.718375563621521,
-0.4858134984970093,
0.6804631352424622,
0.9974015355110168,
-0.37246498465538025,
-1.260169506072998,
-0.7912212014198303,
-1.2564191818237305,
-0.7327326536178589,
1.094961166381836,
0.12385106086730957,
-1.1461354494094849,
0.32465875148773193,
1.6640843152999878,
-0.03014608472585678,
-0.29951509833335876,
0.7326052188873291,
0.42030465602874756,
-0.7534893155097961,
-0.0665714293718338,
-0.9500444531440735,
0.5537980198860168,
-0.2037670761346817,
-0.23885458707809448,
0.24847102165222168,
0.584662139415741,
1.2810472249984741,
0.12849865853786469,
0.08016876131296158,
1.328763723373413,
-1.4195977449417114,
1.400498628616333,
-0.8952457308769226,
0.3976297676563263,
-2.3162412643432617,
1.393114686012268,
-1.0043201446533203,
1.9412920475006104,
-2.6316895484924316,
0.44591695070266724,
-0.4595797657966614,
-0.5719087719917297,
0.19336630403995514,
-0.2491215616464615,
0.05489175021648407,
-0.07846653461456299,
-1.0709755420684814,
-0.13216422498226166,
-0.7282484769821167,
0.46879634261131287,
1.2820488214492798,
1.3652071952819824,
-0.9775174856185913,
-0.2673902213573456,
-1.7022370100021362,
-0.19192928075790405,
-0.6114228367805481,
0.22764191031455994,
-1.9168673753738403,
-0.23120644688606262,
-2.005875825881958,
-2.3529186248779297,
-1.350600004196167,
-0.9911190271377563,
1.287457823753357,
0.13602343201637268,
-0.9922493100166321,
1.1799765825271606,
-0.3699158728122711,
-1.7512067556381226,
1.2057217359542847,
-2.1632323265075684
] |
https://github.com/huggingface/datasets/issues/4965 | [Apple M1] MemoryError: Cannot allocate write+execute memory for ffi.callback() | Hi @hoangtnm - I upgraded to python 3.10 and it fixed the problem for me. I was also running 3.8 on an M1 mac. | ## Describe the bug
I'm trying to run `cast_column("audio", Audio())` on Apple M1 Pro, but it seems that it doesn't work.
## Steps to reproduce the bug
```python
import datasets
dataset = load_dataset("csv", data_files="./train.csv")["train"]
dataset = dataset.map(lambda x: {"audio": str(DATA_DIR / "audio" / x["audio"])})
dataset = dataset.cast_column("audio", Audio())
dataset[0]
```
## Expected results
```
{'audio': {'bytes': None,
'path': '/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~JOINT_ACCOUNT/602ba55abb1e6d0fbce92065.wav'},
'english_transcription': 'I would like to set up a joint account with my partner',
'intent_class': 11,
'lang_id': 4,
'path': '/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~JOINT_ACCOUNT/602ba55abb1e6d0fbce92065.wav',
'transcription': 'I would like to set up a joint account with my partner'}
```
## Actual results
````---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 dataset[0]
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/arrow_dataset.py:2165, in Dataset.__getitem__(self, key)
2163 def __getitem__(self, key): # noqa: F811
2164 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools)."""
-> 2165 return self._getitem(
2166 key,
2167 )
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/arrow_dataset.py:2150, in Dataset._getitem(self, key, decoded, **kwargs)
2148 formatter = get_formatter(format_type, features=self.features, decoded=decoded, **format_kwargs)
2149 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
-> 2150 formatted_output = format_table(
2151 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns
2152 )
2153 return formatted_output
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:532, in format_table(table, key, formatter, format_columns, output_all_columns)
530 python_formatter = PythonFormatter(features=None)
531 if format_columns is None:
--> 532 return formatter(pa_table, query_type=query_type)
533 elif query_type == "column":
534 if key in format_columns:
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:281, in Formatter.__call__(self, pa_table, query_type)
279 def __call__(self, pa_table: pa.Table, query_type: str) -> Union[RowFormat, ColumnFormat, BatchFormat]:
280 if query_type == "row":
--> 281 return self.format_row(pa_table)
282 elif query_type == "column":
283 return self.format_column(pa_table)
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:312, in PythonFormatter.format_row(self, pa_table)
310 row = self.python_arrow_extractor().extract_row(pa_table)
311 if self.decoded:
--> 312 row = self.python_features_decoder.decode_row(row)
313 return row
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:221, in PythonFeaturesDecoder.decode_row(self, row)
220 def decode_row(self, row: dict) -> dict:
--> 221 return self.features.decode_example(row) if self.features else row
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1647, in Features.decode_example(self, example, token_per_repo_id)
1634 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1635 """Decode example with custom feature decoding.
1636
1637 Args:
(...)
1644 :obj:`dict[str, Any]`
1645 """
-> 1647 return {
1648 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1649 if self._column_requires_decoding[column_name]
1650 else value
1651 for column_name, (feature, value) in zip_dict(
1652 {key: value for key, value in self.items() if key in example}, example
1653 )
1654 }
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1648, in <dictcomp>(.0)
1634 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1635 """Decode example with custom feature decoding.
1636
1637 Args:
(...)
1644 :obj:`dict[str, Any]`
1645 """
1647 return {
-> 1648 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1649 if self._column_requires_decoding[column_name]
1650 else value
1651 for column_name, (feature, value) in zip_dict(
1652 {key: value for key, value in self.items() if key in example}, example
1653 )
1654 }
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1260, in decode_nested_example(schema, obj, token_per_repo_id)
1257 # Object with special decoding:
1258 elif isinstance(schema, (Audio, Image)):
1259 # we pass the token to read and decode files from private repositories in streaming mode
-> 1260 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id) if obj is not None else None
1261 return obj
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/audio.py:156, in Audio.decode_example(self, value, token_per_repo_id)
154 array, sampling_rate = self._decode_non_mp3_file_like(file)
155 else:
--> 156 array, sampling_rate = self._decode_non_mp3_path_like(path, token_per_repo_id=token_per_repo_id)
157 return {"path": path, "array": array, "sampling_rate": sampling_rate}
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/audio.py:257, in Audio._decode_non_mp3_path_like(self, path, format, token_per_repo_id)
254 use_auth_token = None
256 with xopen(path, "rb", use_auth_token=use_auth_token) as f:
--> 257 array, sampling_rate = librosa.load(f, sr=self.sampling_rate, mono=self.mono)
258 return array, sampling_rate
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/util/decorators.py:88, in deprecate_positional_args.<locals>._inner_deprecate_positional_args.<locals>.inner_f(*args, **kwargs)
86 extra_args = len(args) - len(all_args)
87 if extra_args <= 0:
---> 88 return f(*args, **kwargs)
90 # extra_args > 0
91 args_msg = [
92 "{}={}".format(name, arg)
93 for name, arg in zip(kwonly_args[:extra_args], args[-extra_args:])
94 ]
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/core/audio.py:164, in load(path, sr, mono, offset, duration, dtype, res_type)
161 else:
162 # Otherwise try soundfile first, and then fall back if necessary
163 try:
--> 164 y, sr_native = __soundfile_load(path, offset, duration, dtype)
166 except RuntimeError as exc:
167 # If soundfile failed, try audioread instead
168 if isinstance(path, (str, pathlib.PurePath)):
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/core/audio.py:195, in __soundfile_load(path, offset, duration, dtype)
192 context = path
193 else:
194 # Otherwise, create the soundfile object
--> 195 context = sf.SoundFile(path)
197 with context as sf_desc:
198 sr_native = sf_desc.samplerate
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:629, in SoundFile.__init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
626 self._mode = mode
627 self._info = _create_info_struct(file, mode, samplerate, channels,
628 format, subtype, endian)
--> 629 self._file = self._open(file, mode_int, closefd)
630 if set(mode).issuperset('r+') and self.seekable():
631 # Move write position to 0 (like in Python file objects)
632 self.seek(0)
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:1179, in SoundFile._open(self, file, mode_int, closefd)
1177 file_ptr = _snd.sf_open_fd(file, mode_int, self._info, closefd)
1178 elif _has_virtual_io_attrs(file, mode_int):
-> 1179 file_ptr = _snd.sf_open_virtual(self._init_virtual_io(file),
1180 mode_int, self._info, _ffi.NULL)
1181 else:
1182 raise TypeError("Invalid file: {0!r}".format(self.name))
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:1197, in SoundFile._init_virtual_io(self, file)
1194 def _init_virtual_io(self, file):
1195 """Initialize callback functions for sf_open_virtual()."""
1196 @_ffi.callback("sf_vio_get_filelen")
-> 1197 def vio_get_filelen(user_data):
1198 curr = file.tell()
1199 file.seek(0, SEEK_END)
MemoryError: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4 | 529 | 24 | [Apple M1] MemoryError: Cannot allocate write+execute memory for ffi.callback()
## Describe the bug
I'm trying to run `cast_column("audio", Audio())` on Apple M1 Pro, but it seems that it doesn't work.
## Steps to reproduce the bug
```python
import datasets
dataset = load_dataset("csv", data_files="./train.csv")["train"]
dataset = dataset.map(lambda x: {"audio": str(DATA_DIR / "audio" / x["audio"])})
dataset = dataset.cast_column("audio", Audio())
dataset[0]
```
## Expected results
```
{'audio': {'bytes': None,
'path': '/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~JOINT_ACCOUNT/602ba55abb1e6d0fbce92065.wav'},
'english_transcription': 'I would like to set up a joint account with my partner',
'intent_class': 11,
'lang_id': 4,
'path': '/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~JOINT_ACCOUNT/602ba55abb1e6d0fbce92065.wav',
'transcription': 'I would like to set up a joint account with my partner'}
```
## Actual results
````---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 dataset[0]
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/arrow_dataset.py:2165, in Dataset.__getitem__(self, key)
2163 def __getitem__(self, key): # noqa: F811
2164 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools)."""
-> 2165 return self._getitem(
2166 key,
2167 )
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/arrow_dataset.py:2150, in Dataset._getitem(self, key, decoded, **kwargs)
2148 formatter = get_formatter(format_type, features=self.features, decoded=decoded, **format_kwargs)
2149 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
-> 2150 formatted_output = format_table(
2151 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns
2152 )
2153 return formatted_output
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:532, in format_table(table, key, formatter, format_columns, output_all_columns)
530 python_formatter = PythonFormatter(features=None)
531 if format_columns is None:
--> 532 return formatter(pa_table, query_type=query_type)
533 elif query_type == "column":
534 if key in format_columns:
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:281, in Formatter.__call__(self, pa_table, query_type)
279 def __call__(self, pa_table: pa.Table, query_type: str) -> Union[RowFormat, ColumnFormat, BatchFormat]:
280 if query_type == "row":
--> 281 return self.format_row(pa_table)
282 elif query_type == "column":
283 return self.format_column(pa_table)
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:312, in PythonFormatter.format_row(self, pa_table)
310 row = self.python_arrow_extractor().extract_row(pa_table)
311 if self.decoded:
--> 312 row = self.python_features_decoder.decode_row(row)
313 return row
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/formatting/formatting.py:221, in PythonFeaturesDecoder.decode_row(self, row)
220 def decode_row(self, row: dict) -> dict:
--> 221 return self.features.decode_example(row) if self.features else row
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1647, in Features.decode_example(self, example, token_per_repo_id)
1634 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1635 """Decode example with custom feature decoding.
1636
1637 Args:
(...)
1644 :obj:`dict[str, Any]`
1645 """
-> 1647 return {
1648 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1649 if self._column_requires_decoding[column_name]
1650 else value
1651 for column_name, (feature, value) in zip_dict(
1652 {key: value for key, value in self.items() if key in example}, example
1653 )
1654 }
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1648, in <dictcomp>(.0)
1634 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1635 """Decode example with custom feature decoding.
1636
1637 Args:
(...)
1644 :obj:`dict[str, Any]`
1645 """
1647 return {
-> 1648 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1649 if self._column_requires_decoding[column_name]
1650 else value
1651 for column_name, (feature, value) in zip_dict(
1652 {key: value for key, value in self.items() if key in example}, example
1653 )
1654 }
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/features.py:1260, in decode_nested_example(schema, obj, token_per_repo_id)
1257 # Object with special decoding:
1258 elif isinstance(schema, (Audio, Image)):
1259 # we pass the token to read and decode files from private repositories in streaming mode
-> 1260 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id) if obj is not None else None
1261 return obj
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/audio.py:156, in Audio.decode_example(self, value, token_per_repo_id)
154 array, sampling_rate = self._decode_non_mp3_file_like(file)
155 else:
--> 156 array, sampling_rate = self._decode_non_mp3_path_like(path, token_per_repo_id=token_per_repo_id)
157 return {"path": path, "array": array, "sampling_rate": sampling_rate}
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/datasets/features/audio.py:257, in Audio._decode_non_mp3_path_like(self, path, format, token_per_repo_id)
254 use_auth_token = None
256 with xopen(path, "rb", use_auth_token=use_auth_token) as f:
--> 257 array, sampling_rate = librosa.load(f, sr=self.sampling_rate, mono=self.mono)
258 return array, sampling_rate
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/util/decorators.py:88, in deprecate_positional_args.<locals>._inner_deprecate_positional_args.<locals>.inner_f(*args, **kwargs)
86 extra_args = len(args) - len(all_args)
87 if extra_args <= 0:
---> 88 return f(*args, **kwargs)
90 # extra_args > 0
91 args_msg = [
92 "{}={}".format(name, arg)
93 for name, arg in zip(kwonly_args[:extra_args], args[-extra_args:])
94 ]
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/core/audio.py:164, in load(path, sr, mono, offset, duration, dtype, res_type)
161 else:
162 # Otherwise try soundfile first, and then fall back if necessary
163 try:
--> 164 y, sr_native = __soundfile_load(path, offset, duration, dtype)
166 except RuntimeError as exc:
167 # If soundfile failed, try audioread instead
168 if isinstance(path, (str, pathlib.PurePath)):
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/librosa/core/audio.py:195, in __soundfile_load(path, offset, duration, dtype)
192 context = path
193 else:
194 # Otherwise, create the soundfile object
--> 195 context = sf.SoundFile(path)
197 with context as sf_desc:
198 sr_native = sf_desc.samplerate
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:629, in SoundFile.__init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
626 self._mode = mode
627 self._info = _create_info_struct(file, mode, samplerate, channels,
628 format, subtype, endian)
--> 629 self._file = self._open(file, mode_int, closefd)
630 if set(mode).issuperset('r+') and self.seekable():
631 # Move write position to 0 (like in Python file objects)
632 self.seek(0)
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:1179, in SoundFile._open(self, file, mode_int, closefd)
1177 file_ptr = _snd.sf_open_fd(file, mode_int, self._info, closefd)
1178 elif _has_virtual_io_attrs(file, mode_int):
-> 1179 file_ptr = _snd.sf_open_virtual(self._init_virtual_io(file),
1180 mode_int, self._info, _ffi.NULL)
1181 else:
1182 raise TypeError("Invalid file: {0!r}".format(self.name))
File ~/miniconda3/envs/rodan/lib/python3.8/site-packages/soundfile.py:1197, in SoundFile._init_virtual_io(self, file)
1194 def _init_virtual_io(self, file):
1195 """Initialize callback functions for sf_open_virtual()."""
1196 @_ffi.callback("sf_vio_get_filelen")
-> 1197 def vio_get_filelen(user_data):
1198 curr = file.tell()
1199 file.seek(0, SEEK_END)
MemoryError: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks
```
## Environment info
- `datasets` version: 2.4.0
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Hi @hoangtnm - I upgraded to python 3.10 and it fixed the problem for me. I was also running 3.8 on an M1 mac. | [
-1.173766016960144,
-0.852719783782959,
-0.7519888281822205,
1.4927517175674438,
-0.05840998888015747,
-1.2579002380371094,
0.01540210098028183,
-0.8796024322509766,
1.6415233612060547,
-0.751623809337616,
0.325585275888443,
-1.681330919265747,
-0.03777188062667847,
-0.7265690565109253,
-0.7154834270477295,
-0.660078763961792,
-0.2557125687599182,
-0.7454336881637573,
1.0658246278762817,
2.5528430938720703,
1.134187936782837,
-1.3434947729110718,
2.816070795059204,
0.6707550287246704,
-0.1954203099012375,
-0.8495033383369446,
0.3901939392089844,
-0.06275352835655212,
-1.3031023740768433,
-0.30564242601394653,
-0.96998131275177,
0.028492892161011696,
-0.5485169291496277,
-0.5411589741706848,
0.020189180970191956,
0.5229862928390503,
-0.2321079522371292,
-0.49979180097579956,
-0.43213194608688354,
-0.7255741357803345,
0.4774857759475708,
-0.3896093964576721,
0.8428829908370972,
-0.2381380796432495,
1.7688541412353516,
-0.62413489818573,
0.35493484139442444,
0.5697917342185974,
1.24940025806427,
0.26908594369888306,
0.06877468526363373,
0.4612160325050354,
0.32555219531059265,
0.01773281767964363,
0.6212384700775146,
1.2662075757980347,
0.6108194589614868,
0.43606099486351013,
0.7645900845527649,
-2.28143310546875,
1.2654216289520264,
-0.8837762475013733,
0.21700327098369598,
1.3255178928375244,
-1.0152366161346436,
0.5173918008804321,
-1.89989173412323,
-0.061289094388484955,
0.418607234954834,
-2.175318479537964,
0.2894698679447174,
-1.2486158609390259,
-0.5175492763519287,
0.9836089015007019,
0.32483774423599243,
-1.3131678104400635,
0.08714108914136887,
-0.4164315164089203,
0.9718640446662903,
0.32262009382247925,
1.0732495784759521,
-1.6745843887329102,
0.01865718513727188,
-0.2416965365409851,
0.23157484829425812,
-1.218984603881836,
-1.6008304357528687,
0.5996944308280945,
0.6193454265594482,
0.6698266267776489,
-0.1297711431980133,
0.9044731259346008,
-1.178127408027649,
0.7888036966323853,
-1.042115569114685,
-1.8339437246322632,
-1.3341174125671387,
-2.336899518966675,
-2.306817054748535,
0.808234453201294,
-0.39219942688941956,
-0.4057188928127289,
2.06435489654541,
-1.1093249320983887,
-1.7858917713165283,
1.0843288898468018,
0.3828940689563751,
-0.13938374817371368,
2.4028890132904053,
0.2560916244983673,
-0.9110240936279297,
0.6583101749420166,
-0.8539177179336548,
0.7061803340911865,
-0.3954584300518036,
1.3503679037094116,
0.4305204451084137,
-0.9585667848587036,
1.6848498582839966,
-0.39214956760406494,
0.5215258598327637,
-0.7421385049819946,
-0.38702017068862915,
-0.7017925977706909,
0.3170453608036041,
1.9871320724487305,
-0.2454129010438919,
1.4791109561920166,
-0.27574506402015686,
-1.510190725326538,
-1.4480249881744385,
0.8253961205482483,
0.4969843626022339,
-0.8499802947044373,
0.1813146322965622,
-0.43839648365974426,
0.20574526488780975,
-0.0512876957654953,
1.1527928113937378,
1.224997878074646,
0.7857682704925537,
-0.2026541382074356,
-0.9624963402748108,
0.12786419689655304,
-0.013111183419823647,
-0.5822648406028748,
-1.73258638381958,
-0.2792212963104248,
0.22813935577869415,
0.6308189034461975,
-1.2475405931472778,
1.8361328840255737,
0.8278505206108093,
1.9757554531097412,
1.0614105463027954,
-0.3114003837108612,
1.538830280303955,
0.1206800639629364,
1.9754213094711304,
-0.38166293501853943,
0.5938640236854553,
-0.44921591877937317,
-1.225792407989502,
0.7470579743385315,
-0.34792560338974,
-2.018333673477173,
-0.5969898104667664,
-0.9327778220176697,
-0.1478176862001419,
-0.8900265097618103,
0.9182221293449402,
-0.22889909148216248,
-1.5021518468856812,
0.21283072233200073,
-0.7054453492164612,
0.15990658104419708,
-1.342237949371338,
0.24333339929580688,
0.7450445890426636,
-0.6648119688034058,
0.1455937922000885,
-0.33097144961357117,
-1.4152365922927856,
-0.5436241626739502,
0.399356871843338,
1.884585976600647,
-0.7236018776893616,
0.9218443632125854,
1.0471850633621216,
-0.6146875023841858,
-0.06744914501905441,
0.4108871519565582,
-0.37401047348976135,
0.8246358633041382,
-1.0366930961608887,
-0.43455398082733154,
1.1457536220550537,
-0.20914921164512634,
-0.5494888424873352,
1.3156359195709229,
0.8051477670669556,
-1.0125651359558105,
-0.3581774830818176,
-0.17775724828243256,
-0.8121758699417114,
0.03974221646785736,
-1.6042571067810059,
-0.1331343799829483,
0.3596969246864319,
-1.4772930145263672,
-0.4347133934497833,
-0.17837195098400116,
1.2196170091629028,
-0.07431671023368835,
1.2793856859207153,
-0.24408143758773804,
-0.07258649915456772,
-0.41154900193214417,
-0.5538480877876282,
0.17296971380710602,
-0.130409836769104,
-0.6646498441696167,
0.2464672029018402,
-0.7187902331352234,
0.24234223365783691,
1.4517240524291992,
0.3138222098350525,
0.03646305203437805,
0.5825721025466919,
1.1955374479293823,
0.35299232602119446,
-0.030848579481244087,
-0.8519220352172852,
-1.6599900722503662,
1.9744197130203247,
-1.5929807424545288,
1.9614174365997314,
0.7176642417907715,
0.025602353736758232,
-1.8140263557434082,
-1.8628469705581665,
1.4817241430282593,
1.140268325805664,
2.4573302268981934,
0.5762842297554016,
0.4924933910369873,
-0.7912070751190186,
-0.7207266688346863,
0.38216590881347656,
-0.8842732310295105,
-0.8183028101921082,
0.19319957494735718,
2.4135751724243164,
1.7199805974960327,
-0.4228064715862274,
-0.22684785723686218,
-0.9091681838035583,
1.3190089464187622,
-0.22293828427791595,
0.2645781636238098,
1.9097824096679688,
-0.3394528329372406,
-1.0043954849243164,
1.3266420364379883,
-2.4747374057769775,
0.2956599295139313,
2.034644603729248,
0.27400603890419006,
0.11633463203907013,
-1.1921815872192383,
-0.6947585940361023,
-0.10078819841146469,
-0.4425290822982788,
-1.2505861520767212,
0.48444852232933044,
-0.23208370804786682,
-0.8241931200027466,
-1.4530987739562988,
0.07999801635742188,
-1.1761316061019897,
-1.592442512512207,
0.29777222871780396,
1.8064744472503662,
2.1291277408599854,
-0.8676507472991943,
1.4197821617126465,
-0.1918194741010666,
0.3293059766292572,
1.2362629175186157,
1.3166279792785645,
3.1531708240509033,
1.7803230285644531,
-1.2924976348876953,
0.7063570022583008,
-0.24501697719097137,
-0.4462892711162567,
1.1825801134109497,
-1.0964386463165283,
1.1350879669189453,
-0.20329292118549347,
-1.271907091140747,
-1.1494799852371216,
0.8981135487556458,
0.5180278420448303,
-0.07830142229795456,
-0.3888547122478485,
1.0838786363601685,
0.14188969135284424,
1.3184082508087158,
0.6448596715927124,
-0.3218192160129547,
0.5440874695777893,
-0.36935532093048096,
-0.47912055253982544,
1.5731284618377686,
0.05579465627670288,
-1.4578968286514282,
-2.3014721870422363,
-0.12697219848632812,
-0.966206431388855,
-0.038228683173656464,
-0.7465499639511108,
-1.0603950023651123,
1.5129703283309937,
0.4045586585998535,
-1.0297902822494507,
-0.09869655966758728,
-0.3177873492240906,
-0.5554957389831543,
2.64566707611084,
-1.3914953470230103,
-0.311221182346344,
-0.9925367832183838,
-0.5844214558601379,
1.6098281145095825,
-1.092966914176941,
-0.1879623979330063,
-1.0198791027069092,
-0.5342901945114136,
-1.3228646516799927,
-0.5112254619598389,
-0.026996580883860588,
-0.8069087862968445,
0.8475862145423889,
0.12852296233177185,
-1.2359670400619507,
-0.2586614489555359,
-1.0764470100402832,
0.8355509638786316,
-0.2775401473045349,
0.10954783111810684,
1.7759841680526733,
0.33178409934043884,
-0.37843120098114014,
0.8139241933822632,
1.2169681787490845,
0.6310657262802124,
-0.5502059459686279,
0.23488959670066833,
-0.6398530006408691,
0.4028707444667816,
-1.2865521907806396,
0.3431238532066345,
-2.8866052627563477,
0.6381290555000305,
0.04192434996366501,
-0.08497489243745804,
-0.05096547305583954,
-1.3974260091781616,
1.058746337890625,
2.4588370323181152,
-1.1319655179977417,
0.6145768165588379,
0.2927897572517395,
1.2751587629318237,
-1.692834496498108,
0.05482860654592514,
-0.5283437371253967,
2.085078477859497,
0.03963961452245712,
1.1228569746017456,
-0.508936882019043,
-2.3309261798858643,
0.5633896589279175,
-1.3232059478759766,
-1.0670154094696045,
0.7227572798728943,
-0.9088950157165527,
0.25351569056510925,
-1.2989892959594727,
-0.2347283661365509,
-1.0168558359146118,
-1.119368553161621,
0.6001197099685669,
0.0863804742693901,
0.5265586376190186,
-0.6043019890785217,
0.2930363714694977,
-2.193000555038452,
-1.3792728185653687,
-0.12067170441150665,
-0.8745639324188232,
0.5051237940788269,
-0.3453032970428467,
0.7165710926055908,
-0.14725923538208008,
-0.003400268964469433,
0.2612244188785553,
1.485161542892456,
3.27557110786438,
0.1427701860666275,
0.43626266717910767,
-0.23931579291820526,
-1.03044593334198,
1.5116803646087646,
0.9312655925750732,
-0.20481455326080322,
-0.6388226747512817,
-1.083306074142456,
1.3539824485778809,
1.9725642204284668,
1.0522633790969849,
0.06388778239488602,
-0.8465172052383423,
-0.7699400782585144,
0.05701436847448349,
0.13425815105438232,
0.4429228603839874,
0.9857699275016785,
0.07320137321949005,
0.09283072501420975,
1.3530396223068237,
1.0747758150100708,
-0.3842333257198334,
0.4042366147041321,
-0.8771045804023743,
-0.37114232778549194,
0.5146982073783875,
0.24028927087783813,
-0.03488529473543167,
0.282919317483902,
-1.0762962102890015,
-0.22970551252365112,
-0.2601855397224426,
-0.86383056640625,
-0.7903566360473633,
-0.3316306173801422,
-0.3666926920413971,
1.71861732006073,
0.06107434630393982,
-0.5402963757514954,
-0.11553718149662018,
-0.8092901110649109,
-0.09476861357688904,
-1.0088461637496948,
0.1621624231338501,
-0.2061338871717453,
-0.05126930773258209,
-0.14873161911964417,
1.698947548866272,
-0.9746303558349609,
-2.137584924697876,
0.08224166184663773,
0.2949979603290558,
-0.31934118270874023,
-0.005943851545453072,
1.7964507341384888,
0.5766148567199707,
1.422529935836792,
1.550607442855835,
1.078291416168213,
-0.6613790392875671,
-1.2811545133590698,
0.6572475433349609,
0.9474804997444153,
-1.3126330375671387,
0.8753656148910522,
-0.11195208132266998,
-0.5602569580078125,
0.5382129549980164,
1.344177007675171,
0.46279799938201904,
-1.9179890155792236,
0.7431591749191284,
-1.109511137008667,
0.820083498954773,
0.7333548665046692,
0.8582793474197388,
0.2037755250930786,
0.826913595199585,
-1.2636346817016602,
-1.0430411100387573,
-0.6900686621665955,
-0.6431038975715637,
1.8961313962936401,
-0.2314816266298294,
0.40918394923210144,
-0.16092589497566223,
-1.246213436126709,
0.07194575667381287,
0.7238037586212158,
0.3107924163341522,
-0.37063828110694885,
0.6933634877204895,
-0.7598231434822083,
-1.1325050592422485,
-1.2950778007507324,
-0.5172117352485657,
-0.9970059394836426,
-0.8625597357749939,
0.9633570909500122,
0.7097606658935547,
0.39848294854164124,
1.9909743070602417,
0.7474438548088074,
0.1969051957130432,
-2.6206581592559814,
0.825060248374939,
0.3638303279876709,
-0.037640370428562164,
0.8254251480102539,
0.3197856545448303,
1.2062410116195679,
-0.0454045832157135,
0.6186263561248779,
-2.345818519592285,
2.209556818008423,
-0.254944771528244,
0.7657477259635925,
-0.08962180465459824,
-0.04238360375165939,
0.9610662460327148,
0.48427218198776245,
0.5715622901916504,
-1.070532202720642,
0.7680585384368896,
-0.6019357442855835,
1.2031980752944946,
0.9127374887466431,
-0.9140785336494446,
0.1507132649421692,
1.2307822704315186,
0.37579742074012756,
-0.5589476227760315,
-1.0149232149124146,
-0.8253741264343262,
0.988777220249176,
1.7824939489364624,
-0.08001228421926498,
0.03965989500284195,
0.9081587791442871,
0.6730393171310425,
-1.3194568157196045,
-0.0518215075135231,
-0.5278429388999939,
-0.6926514506340027,
1.8340169191360474,
2.0309300422668457,
-0.10995835810899734,
-0.14395490288734436,
-0.7078397870063782,
-1.369879126548767,
0.8159160017967224,
0.1436443328857422,
0.012369129806756973,
0.8513162732124329,
-0.6879042387008667,
1.1205118894577026,
0.7603505849838257,
0.8347479701042175,
0.15031544864177704,
0.18848907947540283,
0.36867770552635193,
-0.3305742144584656,
-1.1164004802703857,
-0.3364029824733734,
-1.0972093343734741,
-2.6505303382873535,
0.4207564890384674,
-0.1342889368534088,
-1.4463374614715576,
0.08487262576818466,
-0.9244062304496765,
0.8649453520774841,
-0.5316175222396851,
-1.1802884340286255,
-1.3335808515548706,
0.29164421558380127,
-0.11899271607398987,
0.7671207785606384,
-1.692138910293579,
-0.15882176160812378,
1.1533654928207397,
1.0613765716552734,
-0.6740272045135498,
0.9065943956375122,
0.27205222845077515,
0.9483246803283691,
0.9382400512695312,
-0.35581690073013306,
0.4537509083747864,
0.1511540412902832,
-1.350940227508545,
0.4193840026855469,
1.4180796146392822,
0.1015884056687355,
1.4021350145339966,
-0.38469797372817993,
-0.08403322100639343,
0.45378637313842773,
-0.3431381583213806,
-0.460777223110199,
-0.6483446955680847,
0.615174412727356,
-0.008743415586650372,
-0.9207502603530884,
-0.0634969100356102,
0.09611500799655914,
-0.19550028443336487,
0.2752573788166046,
-1.4878593683242798,
-0.13559648394584656,
-0.38007381558418274,
-0.6515320539474487,
-1.3028877973556519,
-0.07725109905004501,
1.2715977430343628,
-0.8546850085258484,
-0.1988620012998581,
0.5558732748031616,
0.21064521372318268,
0.5222529768943787,
0.5095224976539612,
-0.7364405989646912,
-0.32083067297935486,
-0.20719414949417114,
-0.41482654213905334,
0.2556982934474945,
1.3285505771636963,
-0.07428603619337082,
-1.041757345199585,
0.5838328003883362,
-0.30734091997146606,
0.12630188465118408,
1.835160255432129,
-0.031033223494887352,
-0.9036227464675903,
0.27904653549194336,
-0.7311619520187378,
1.9150582551956177,
1.5772429704666138,
1.301992416381836,
-0.1101626306772232,
-0.87801194190979,
0.7066875696182251,
-0.3424062728881836,
-0.4148452579975128,
0.8636197447776794,
0.362350195646286,
-0.23954589664936066,
-1.4306305646896362,
0.7261738181114197,
1.2975643873214722,
-0.8138828277587891,
-0.7345755696296692,
0.08555708080530167,
-0.8644058108329773,
1.2275664806365967,
0.6272980570793152,
0.29550790786743164,
0.2437272071838379,
1.7016984224319458,
0.7483397722244263,
-0.5409734845161438,
0.5495196580886841,
0.5143176913261414,
-0.1382608413696289,
-2.105501174926758,
-1.0635640621185303,
0.16481637954711914,
-0.3034099340438843,
-1.551190733909607,
1.4081460237503052,
-1.2111072540283203,
-0.9251195192337036,
0.5856131911277771,
0.18440094590187073,
1.349969506263733,
0.3924891948699951,
1.6333523988723755,
2.0144433975219727,
0.7900744676589966,
0.4272472858428955,
1.139725685119629,
-0.26256734132766724,
-0.31180763244628906,
1.718375563621521,
-0.4858134984970093,
0.6804631352424622,
0.9974015355110168,
-0.37246498465538025,
-1.260169506072998,
-0.7912212014198303,
-1.2564191818237305,
-0.7327326536178589,
1.094961166381836,
0.12385106086730957,
-1.1461354494094849,
0.32465875148773193,
1.6640843152999878,
-0.03014608472585678,
-0.29951509833335876,
0.7326052188873291,
0.42030465602874756,
-0.7534893155097961,
-0.0665714293718338,
-0.9500444531440735,
0.5537980198860168,
-0.2037670761346817,
-0.23885458707809448,
0.24847102165222168,
0.584662139415741,
1.2810472249984741,
0.12849865853786469,
0.08016876131296158,
1.328763723373413,
-1.4195977449417114,
1.400498628616333,
-0.8952457308769226,
0.3976297676563263,
-2.3162412643432617,
1.393114686012268,
-1.0043201446533203,
1.9412920475006104,
-2.6316895484924316,
0.44591695070266724,
-0.4595797657966614,
-0.5719087719917297,
0.19336630403995514,
-0.2491215616464615,
0.05489175021648407,
-0.07846653461456299,
-1.0709755420684814,
-0.13216422498226166,
-0.7282484769821167,
0.46879634261131287,
1.2820488214492798,
1.3652071952819824,
-0.9775174856185913,
-0.2673902213573456,
-1.7022370100021362,
-0.19192928075790405,
-0.6114228367805481,
0.22764191031455994,
-1.9168673753738403,
-0.23120644688606262,
-2.005875825881958,
-2.3529186248779297,
-1.350600004196167,
-0.9911190271377563,
1.287457823753357,
0.13602343201637268,
-0.9922493100166321,
1.1799765825271606,
-0.3699158728122711,
-1.7512067556381226,
1.2057217359542847,
-2.1632323265075684
] |
https://github.com/huggingface/datasets/issues/4964 | Column of arrays (2D+) are using unreasonably high memory | note i have tried the same code with `datasets` version 2.4.0, the outcome is the very same as described above. | ## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4 | 530 | 20 | Column of arrays (2D+) are using unreasonably high memory
## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
note i have tried the same code with `datasets` version 2.4.0, the outcome is the very same as described above. | [
-1.2684035301208496,
-0.9262070059776306,
-0.668622612953186,
1.4297523498535156,
-0.17996075749397278,
-1.1945101022720337,
0.19549421966075897,
-1.042979121208191,
1.7015550136566162,
-0.8125783205032349,
0.32705575227737427,
-1.653634786605835,
0.033171314746141434,
-0.5619453191757202,
-0.7085865139961243,
-0.8652985095977783,
-0.5308558344841003,
-0.7866120338439941,
1.0667624473571777,
2.434904098510742,
1.208701252937317,
-1.3599541187286377,
2.684549570083618,
0.8041220307350159,
-0.1629704236984253,
-0.9903703331947327,
0.4777035713195801,
-0.04228895157575607,
-1.4107387065887451,
-0.46996092796325684,
-0.8967759013175964,
-0.1405113786458969,
-0.5048663020133972,
-0.6583675742149353,
-0.04513588547706604,
0.3654175102710724,
-0.3339306116104126,
-0.4521852731704712,
-0.480766236782074,
-0.7668603658676147,
0.520197868347168,
-0.29408061504364014,
0.8507214784622192,
-0.36587515473365784,
1.7850509881973267,
-0.49149611592292786,
0.5082045197486877,
0.7254040241241455,
1.3186163902282715,
0.22985315322875977,
-0.05633093789219856,
0.45208942890167236,
0.37021803855895996,
0.03377847373485565,
0.5764759182929993,
1.1852047443389893,
0.7287206053733826,
0.46237656474113464,
0.7576172351837158,
-2.1617660522460938,
1.2901532649993896,
-1.0331053733825684,
0.39334791898727417,
1.4010767936706543,
-1.0279968976974487,
0.3513835370540619,
-1.6705050468444824,
-0.08181659877300262,
0.48322993516921997,
-2.1956653594970703,
0.2957387864589691,
-1.3462796211242676,
-0.48411935567855835,
1.0089467763900757,
0.42660799622535706,
-1.1806244850158691,
0.11514297127723694,
-0.4415428340435028,
0.9947210550308228,
0.4325391948223114,
1.1900354623794556,
-1.720198154449463,
0.009734230116009712,
-0.3575718104839325,
0.09363369643688202,
-1.2395931482315063,
-1.558571457862854,
0.582299530506134,
0.6492465138435364,
0.5546032190322876,
-0.15482455492019653,
1.072898507118225,
-1.061942458152771,
0.7727539539337158,
-1.006669044494629,
-1.661574363708496,
-1.4149014949798584,
-2.28420090675354,
-2.3276278972625732,
0.7492284178733826,
-0.42265135049819946,
-0.5293989181518555,
2.12541127204895,
-1.027783751487732,
-1.765415906906128,
1.1282196044921875,
0.2005275934934616,
-0.1313413679599762,
2.3526594638824463,
0.19474463164806366,
-0.7196907997131348,
0.46000635623931885,
-0.7979928851127625,
0.768984317779541,
-0.33922651410102844,
1.342035174369812,
0.48026180267333984,
-1.0793741941452026,
1.6105509996414185,
-0.38338106870651245,
0.5532944798469543,
-0.5463464260101318,
-0.50556880235672,
-0.7273330092430115,
0.3000761866569519,
1.974033236503601,
-0.25553643703460693,
1.5359445810317993,
-0.3373991847038269,
-1.536943793296814,
-1.6027933359146118,
0.9001469016075134,
0.5163388252258301,
-0.7276914119720459,
0.1544165462255478,
-0.3635702133178711,
0.07990792393684387,
0.011777516454458237,
1.1303666830062866,
1.316916823387146,
0.7353386282920837,
-0.3609984219074249,
-0.8624905943870544,
0.16261178255081177,
-0.12247775495052338,
-0.7591161727905273,
-1.6873698234558105,
-0.37584540247917175,
0.04290253296494484,
0.574055016040802,
-1.1759814023971558,
1.8152856826782227,
0.908320963382721,
1.8451255559921265,
1.030544400215149,
-0.3609623610973358,
1.4368780851364136,
0.11845804750919342,
1.857676386833191,
-0.4482772648334503,
0.7417997121810913,
-0.4720514118671417,
-1.206145167350769,
0.8877570033073425,
-0.32419466972351074,
-2.108701467514038,
-0.7331749796867371,
-0.7460065484046936,
-0.17511297762393951,
-0.8604866862297058,
1.0108702182769775,
-0.25055354833602905,
-1.38027822971344,
0.27916625142097473,
-0.8216361999511719,
0.17844590544700623,
-1.2241867780685425,
0.3528936207294464,
0.7478652000427246,
-0.6892825961112976,
0.09514056146144867,
-0.22538994252681732,
-1.2636712789535522,
-0.45774975419044495,
0.2714444398880005,
1.8265712261199951,
-0.7881489992141724,
0.9553024172782898,
1.0387272834777832,
-0.7448900938034058,
-0.029521150514483452,
0.2415362298488617,
-0.20528431236743927,
0.9337836503982544,
-1.0558359622955322,
-0.3619071841239929,
1.1904951333999634,
-0.19519393146038055,
-0.5390582084655762,
1.4150995016098022,
0.6712692975997925,
-0.9364591836929321,
-0.15358370542526245,
-0.08104585111141205,
-0.9469249844551086,
0.0662718266248703,
-1.5947084426879883,
-0.04655768722295761,
0.4880537688732147,
-1.5339808464050293,
-0.4953880310058594,
-0.14232651889324188,
1.3271547555923462,
-0.10400800406932831,
1.4123923778533936,
-0.3358350098133087,
-0.14338265359401703,
-0.42229604721069336,
-0.32780441641807556,
0.1291147619485855,
-0.17440389096736908,
-0.5252120494842529,
0.20332270860671997,
-0.7742084264755249,
0.33224183320999146,
1.4334055185317993,
0.33208367228507996,
0.06121641770005226,
0.5484321117401123,
1.1567906141281128,
0.3918033838272095,
-0.17647354304790497,
-0.8437195420265198,
-1.5480087995529175,
1.97311532497406,
-1.3972811698913574,
2.0038392543792725,
0.700627863407135,
0.01637306623160839,
-1.7800917625427246,
-1.8784420490264893,
1.3579062223434448,
1.1326406002044678,
2.366499423980713,
0.5628687143325806,
0.46977728605270386,
-0.8906873464584351,
-0.6582716107368469,
0.37831395864486694,
-1.0247396230697632,
-0.7537177801132202,
0.13631384074687958,
2.351813554763794,
1.7447254657745361,
-0.4238681197166443,
-0.1543072909116745,
-1.0736647844314575,
1.3671727180480957,
-0.2317156344652176,
0.19891847670078278,
1.9716368913650513,
-0.28714004158973694,
-1.1234196424484253,
1.367053508758545,
-2.3517141342163086,
0.11607520282268524,
1.9657409191131592,
0.35435792803764343,
0.03279013931751251,
-1.3329176902770996,
-0.7081581950187683,
-0.23222616314888,
-0.44629475474357605,
-1.2811516523361206,
0.5057416558265686,
-0.22377316653728485,
-0.7267817854881287,
-1.415263056755066,
0.12152025103569031,
-1.0980223417282104,
-1.6786539554595947,
0.24297112226486206,
1.9053677320480347,
1.9559367895126343,
-0.700929582118988,
1.561074137687683,
-0.2627955973148346,
0.16928941011428833,
1.2517184019088745,
1.174831748008728,
3.0721747875213623,
1.9708913564682007,
-1.272489070892334,
0.6272857189178467,
-0.109800785779953,
-0.48607391119003296,
1.1677215099334717,
-1.254952311515808,
1.3331676721572876,
-0.09991693496704102,
-1.2327948808670044,
-1.1552326679229736,
0.9737114906311035,
0.4672498404979706,
0.09875401854515076,
-0.43598034977912903,
1.19706392288208,
-0.01664123497903347,
1.3544340133666992,
0.6289668083190918,
-0.2730611264705658,
0.6695992350578308,
-0.40127119421958923,
-0.49743467569351196,
1.5141170024871826,
0.22585810720920563,
-1.4401845932006836,
-2.2697253227233887,
-0.21057860553264618,
-0.8463518619537354,
0.03773945942521095,
-0.6570852398872375,
-0.9303884506225586,
1.6506561040878296,
0.326005756855011,
-1.254197359085083,
-0.26372626423835754,
-0.3331533372402191,
-0.6072914004325867,
2.723163604736328,
-1.385985016822815,
-0.20475980639457703,
-1.0361346006393433,
-0.6911561489105225,
1.6062158346176147,
-1.2150695323944092,
-0.21561071276664734,
-1.005203127861023,
-0.5473730564117432,
-1.1983935832977295,
-0.5427699685096741,
-0.110836461186409,
-0.9458214640617371,
0.7684648036956787,
0.1307133436203003,
-1.1751707792282104,
-0.30183497071266174,
-0.8377285599708557,
0.8320719599723816,
-0.15165503323078156,
0.24002474546432495,
1.7847715616226196,
0.42535269260406494,
-0.293836772441864,
0.7152541875839233,
1.154290795326233,
0.6917725801467896,
-0.5734663009643555,
0.25219398736953735,
-0.653117835521698,
0.29888373613357544,
-1.3130855560302734,
0.2872757613658905,
-2.7900304794311523,
0.6093123555183411,
-0.1414613276720047,
-0.08663302659988403,
-0.007815773598849773,
-1.383718729019165,
1.0429831743240356,
2.5096487998962402,
-1.1616535186767578,
0.45807936787605286,
0.26514074206352234,
1.1392816305160522,
-1.5289973020553589,
0.319115549325943,
-0.4818178713321686,
2.1088154315948486,
0.22654545307159424,
1.1513442993164062,
-0.45155230164527893,
-2.298581838607788,
0.5634996891021729,
-1.2774595022201538,
-1.2028874158859253,
0.7900554537773132,
-0.8499476313591003,
0.09517544507980347,
-1.351472020149231,
-0.21348220109939575,
-0.780623197555542,
-1.1545255184173584,
0.6877310276031494,
0.15572674572467804,
0.36765941977500916,
-0.5438005328178406,
0.3794884979724884,
-2.2414870262145996,
-1.307679533958435,
-0.2358342707157135,
-0.9250707626342773,
0.4922841787338257,
-0.3236464262008667,
0.6269490718841553,
-0.2347581684589386,
-0.051178451627492905,
0.396190345287323,
1.4482322931289673,
3.3932979106903076,
0.14475736021995544,
0.36220985651016235,
-0.11852340400218964,
-0.9861034750938416,
1.517749309539795,
0.9931150674819946,
-0.14587245881557465,
-0.611138641834259,
-1.0784542560577393,
1.2130403518676758,
1.938907265663147,
1.0651150941848755,
-0.02425529807806015,
-0.8076433539390564,
-0.8162596225738525,
-0.03961607441306114,
0.12171365320682526,
0.4467505216598511,
0.9501076340675354,
0.21738019585609436,
0.08841593563556671,
1.4418405294418335,
1.1926535367965698,
-0.43289217352867126,
0.38988932967185974,
-0.7793599367141724,
-0.5342127680778503,
0.47867920994758606,
0.3253176808357239,
0.03168974816799164,
0.31386443972587585,
-1.0469940900802612,
-0.27401483058929443,
-0.4256686270236969,
-0.9153398871421814,
-0.8047852516174316,
-0.4705888628959656,
-0.433901309967041,
1.7030436992645264,
0.05670585110783577,
-0.5982832908630371,
-0.06421812623739243,
-0.7683391571044922,
-0.11350706219673157,
-1.0477216243743896,
0.42411041259765625,
-0.0869671106338501,
-0.15988688170909882,
-0.14788378775119781,
1.731632947921753,
-0.9438245296478271,
-2.1634442806243896,
0.24728253483772278,
0.1582222282886505,
-0.296290785074234,
0.19606496393680573,
1.554616093635559,
0.6260111331939697,
1.4581700563430786,
1.3855254650115967,
0.955876886844635,
-0.6346548199653625,
-1.366628646850586,
0.7532787322998047,
0.9115740656852722,
-1.4609837532043457,
0.7172823548316956,
-0.02296299859881401,
-0.5803835391998291,
0.6080197691917419,
1.220289945602417,
0.5606280565261841,
-2.0203440189361572,
0.8247697353363037,
-0.928851842880249,
0.7264842391014099,
0.696526288986206,
0.6916422247886658,
0.22703944146633148,
0.7531942129135132,
-1.3515386581420898,
-1.1467502117156982,
-0.6498240232467651,
-0.7339960932731628,
1.9587290287017822,
-0.3636888861656189,
0.6752863526344299,
-0.35069265961647034,
-1.3803648948669434,
-0.15996433794498444,
0.7177947759628296,
0.2976616621017456,
-0.5821625590324402,
0.7861040830612183,
-0.590219259262085,
-1.1069362163543701,
-1.3622395992279053,
-0.4339345395565033,
-1.1006970405578613,
-0.90122389793396,
0.9939031600952148,
0.7527583837509155,
0.2871605455875397,
1.845385193824768,
0.6398329138755798,
0.216462180018425,
-2.6333935260772705,
0.8986524939537048,
0.1977144479751587,
-0.09320355951786041,
0.835503101348877,
0.3330608010292053,
0.9682585000991821,
-0.04692094773054123,
0.5817314982414246,
-2.4890778064727783,
2.380265474319458,
-0.14377029240131378,
0.6494923830032349,
-0.014535730704665184,
-0.14085140824317932,
1.1140992641448975,
0.6092121601104736,
0.5267798900604248,
-1.069520354270935,
0.647031307220459,
-0.6077088713645935,
1.2462087869644165,
0.8082209229469299,
-0.8229213953018188,
-0.044948771595954895,
1.3616398572921753,
0.4835647642612457,
-0.46844491362571716,
-0.9216331243515015,
-1.0933367013931274,
0.940691351890564,
1.7810492515563965,
-0.10443300008773804,
0.014637675136327744,
0.8244134187698364,
0.6776247024536133,
-1.3322914838790894,
0.08022239804267883,
-0.6799246668815613,
-0.7974932789802551,
1.639843463897705,
2.0602166652679443,
-0.14261598885059357,
-0.20370791852474213,
-0.6686649918556213,
-1.3196853399276733,
0.7879336476325989,
0.025644924491643906,
0.13186457753181458,
0.6495231986045837,
-0.5801618099212646,
1.1142548322677612,
0.9512139558792114,
0.9373299479484558,
0.28130435943603516,
0.24539417028427124,
0.33238476514816284,
-0.25950294733047485,
-1.236297369003296,
-0.21176064014434814,
-1.0217902660369873,
-2.6032798290252686,
0.43258151412010193,
-0.2651594877243042,
-1.4592245817184448,
0.05266009271144867,
-1.0372352600097656,
0.8390911817550659,
-0.5661729574203491,
-1.1288776397705078,
-1.6016554832458496,
0.14695751667022705,
0.013110645115375519,
0.9543564319610596,
-1.5814341306686401,
-0.09452016651630402,
1.2269176244735718,
0.9099407196044922,
-0.6483451724052429,
1.004939317703247,
0.22804121673107147,
0.9999573230743408,
0.8568243384361267,
-0.368548721075058,
0.591139018535614,
0.060894500464200974,
-1.3761259317398071,
0.46212825179100037,
1.1632792949676514,
0.2003633826971054,
1.5295884609222412,
-0.5964227914810181,
-0.0054418910294771194,
0.4305807948112488,
-0.5138989090919495,
-0.44164150953292847,
-0.598028302192688,
0.6360204219818115,
0.031766049563884735,
-0.9558876156806946,
-0.07412762939929962,
-0.016391800716519356,
-0.2050165981054306,
0.15048085153102875,
-1.4110454320907593,
-0.11920756101608276,
-0.45129308104515076,
-0.6683156490325928,
-1.127433180809021,
-0.08453518152236938,
1.3669198751449585,
-0.7918330430984497,
-0.12628620862960815,
0.5340676307678223,
0.36185145378112793,
0.5326163172721863,
0.6744725108146667,
-0.6543658375740051,
-0.35978585481643677,
-0.20815254747867584,
-0.3753485381603241,
0.33977198600769043,
1.3741317987442017,
-0.1292334794998169,
-1.009413480758667,
0.7400491833686829,
-0.3239733576774597,
0.07035057246685028,
1.9161231517791748,
0.0014138463884592056,
-0.8257161974906921,
0.37265604734420776,
-0.6859909296035767,
1.9344184398651123,
1.7828525304794312,
1.3190768957138062,
-0.1653127521276474,
-0.9852210283279419,
0.5704038143157959,
-0.33861228823661804,
-0.28199565410614014,
0.9320710897445679,
0.435132771730423,
-0.2139710932970047,
-1.3937865495681763,
0.7684138417243958,
1.2781553268432617,
-0.8921256065368652,
-0.7483484148979187,
0.13921160995960236,
-0.7571606040000916,
1.0778467655181885,
0.6459579467773438,
0.344079852104187,
0.28553977608680725,
1.5968996286392212,
0.7740314602851868,
-0.3372872471809387,
0.591188907623291,
0.5437672734260559,
-0.1692153960466385,
-2.146352529525757,
-1.2165231704711914,
0.3937332332134247,
-0.6535247564315796,
-1.593711018562317,
1.315980076789856,
-1.1405328512191772,
-0.9679444432258606,
0.5333476066589355,
0.03455890715122223,
1.498992919921875,
0.37262386083602905,
1.5465599298477173,
2.0386385917663574,
0.9095078110694885,
0.34776124358177185,
1.2789087295532227,
-0.11074569821357727,
-0.31123068928718567,
1.7211222648620605,
-0.4450259804725647,
0.4004245698451996,
1.1227840185165405,
-0.26518192887306213,
-1.0834150314331055,
-0.7610625624656677,
-1.3139548301696777,
-0.7372725605964661,
1.1720889806747437,
0.09099888801574707,
-1.1168206930160522,
0.29998669028282166,
1.5051264762878418,
0.08911274373531342,
-0.2644752264022827,
0.5937678813934326,
0.37147513031959534,
-0.7609632015228271,
-0.0772860050201416,
-0.8853521943092346,
0.4914751648902893,
-0.2595522403717041,
-0.39785951375961304,
0.34393951296806335,
0.4580182731151581,
1.3551591634750366,
-0.015382473357021809,
0.119478240609169,
1.185302734375,
-1.4480063915252686,
1.5147199630737305,
-0.6969953179359436,
0.23254624009132385,
-2.2737085819244385,
1.431982398033142,
-0.7431276440620422,
1.908168077468872,
-2.7159130573272705,
0.4775899052619934,
-0.4774545729160309,
-0.48411205410957336,
0.3341924250125885,
-0.32952311635017395,
0.13583283126354218,
-0.20794104039669037,
-1.0933468341827393,
-0.1453848034143448,
-0.6541721224784851,
0.6213517189025879,
1.0896258354187012,
1.4077330827713013,
-1.0969030857086182,
-0.3152463138103485,
-1.6583667993545532,
-0.15767160058021545,
-0.6558154821395874,
0.3286306858062744,
-2.0262062549591064,
-0.14157694578170776,
-1.9412410259246826,
-2.4397504329681396,
-1.1735687255859375,
-0.7404953837394714,
1.1930246353149414,
0.05076085776090622,
-0.8259899616241455,
1.1845800876617432,
-0.3963626027107239,
-1.8347522020339966,
1.0704644918441772,
-2.1553220748901367
] |
https://github.com/huggingface/datasets/issues/4964 | Column of arrays (2D+) are using unreasonably high memory | Seems related to issues #4623 and #4802 so it would appear this issue has been around for a few months. | ## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4 | 530 | 20 | Column of arrays (2D+) are using unreasonably high memory
## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Seems related to issues #4623 and #4802 so it would appear this issue has been around for a few months. | [
-1.266213059425354,
-0.92769855260849,
-0.6652990579605103,
1.4449760913848877,
-0.1741117537021637,
-1.18246591091156,
0.1805284321308136,
-1.0316245555877686,
1.68502676486969,
-0.8011333346366882,
0.33123308420181274,
-1.6509066820144653,
0.03961080685257912,
-0.5689160227775574,
-0.7062293887138367,
-0.8683720827102661,
-0.5318729281425476,
-0.7824604511260986,
1.0866788625717163,
2.4403200149536133,
1.2182683944702148,
-1.3755536079406738,
2.682461738586426,
0.8111288547515869,
-0.1660170555114746,
-0.9972555637359619,
0.46745848655700684,
-0.028483234345912933,
-1.3976243734359741,
-0.46198520064353943,
-0.8682004809379578,
-0.15498167276382446,
-0.49486973881721497,
-0.654902994632721,
-0.05857064574956894,
0.3701103925704956,
-0.3012828826904297,
-0.44265586137771606,
-0.4712463319301605,
-0.7529598474502563,
0.5214454531669617,
-0.3100506365299225,
0.837601900100708,
-0.35537880659103394,
1.7804269790649414,
-0.4972226321697235,
0.488847553730011,
0.7005454301834106,
1.3081326484680176,
0.24036628007888794,
-0.029938815161585808,
0.4511292576789856,
0.35596615076065063,
0.025402218103408813,
0.5844305753707886,
1.1760696172714233,
0.7440862655639648,
0.45902231335639954,
0.7509961128234863,
-2.152193784713745,
1.3050825595855713,
-1.0299288034439087,
0.39714381098747253,
1.4056962728500366,
-1.0390338897705078,
0.3539033532142639,
-1.660914421081543,
-0.09514246881008148,
0.5052967667579651,
-2.183058023452759,
0.3128592073917389,
-1.3183846473693848,
-0.48599475622177124,
1.0170135498046875,
0.42468196153640747,
-1.1808900833129883,
0.09393330663442612,
-0.45097872614860535,
1.0108753442764282,
0.40728411078453064,
1.1864346265792847,
-1.7198872566223145,
0.018401071429252625,
-0.37479260563850403,
0.07768430560827255,
-1.2591139078140259,
-1.5651485919952393,
0.5869333744049072,
0.6599480509757996,
0.5580837726593018,
-0.13875561952590942,
1.051119327545166,
-1.0767937898635864,
0.7718031406402588,
-1.0210790634155273,
-1.652915120124817,
-1.4194401502609253,
-2.3136141300201416,
-2.3321619033813477,
0.7621608376502991,
-0.41006535291671753,
-0.5618982315063477,
2.110517740249634,
-1.0132046937942505,
-1.7697865962982178,
1.134934425354004,
0.2027522325515747,
-0.1401033103466034,
2.381018877029419,
0.18838751316070557,
-0.7325665354728699,
0.47413983941078186,
-0.8054730892181396,
0.7689303159713745,
-0.36963680386543274,
1.355658769607544,
0.4750462472438812,
-1.0858572721481323,
1.5955836772918701,
-0.37997740507125854,
0.5400940775871277,
-0.5617029666900635,
-0.5135632157325745,
-0.7335885167121887,
0.3139151632785797,
1.9819083213806152,
-0.24341702461242676,
1.5487505197525024,
-0.3358873128890991,
-1.5388402938842773,
-1.6004419326782227,
0.8888401389122009,
0.5146411061286926,
-0.7402588725090027,
0.16621172428131104,
-0.3697260022163391,
0.0774153545498848,
0.01421007513999939,
1.1218864917755127,
1.3166056871414185,
0.7118868827819824,
-0.359308660030365,
-0.8627008199691772,
0.1580500304698944,
-0.12357858568429947,
-0.7591360211372375,
-1.6870653629302979,
-0.36156734824180603,
0.03845403343439102,
0.5555249452590942,
-1.182673454284668,
1.8004872798919678,
0.9119681715965271,
1.8530977964401245,
1.0278372764587402,
-0.3730087876319885,
1.4413212537765503,
0.10502547770738602,
1.850039005279541,
-0.46250757575035095,
0.7561175227165222,
-0.464755654335022,
-1.2063419818878174,
0.8728402853012085,
-0.34123170375823975,
-2.1032841205596924,
-0.7247259616851807,
-0.7408156394958496,
-0.16577580571174622,
-0.8659543991088867,
1.006457805633545,
-0.24402299523353577,
-1.364324688911438,
0.2972850799560547,
-0.8395941853523254,
0.18423110246658325,
-1.2246263027191162,
0.3520250618457794,
0.7574682235717773,
-0.6690254807472229,
0.11238761246204376,
-0.22511130571365356,
-1.2486640214920044,
-0.436687707901001,
0.2781464755535126,
1.831714391708374,
-0.7933536171913147,
0.9502126574516296,
1.0446733236312866,
-0.7276066541671753,
-0.029518380761146545,
0.2276746928691864,
-0.18999424576759338,
0.9381632804870605,
-1.0757980346679688,
-0.3794999122619629,
1.1831235885620117,
-0.19443970918655396,
-0.5308326482772827,
1.41881263256073,
0.6744586825370789,
-0.940657377243042,
-0.1531689167022705,
-0.08340209722518921,
-0.9535767436027527,
0.08065778017044067,
-1.6071994304656982,
-0.053207509219646454,
0.49325883388519287,
-1.5407896041870117,
-0.49372079968452454,
-0.16246721148490906,
1.3125324249267578,
-0.1131044253706932,
1.407003402709961,
-0.3279673159122467,
-0.1418079137802124,
-0.40675079822540283,
-0.3203813135623932,
0.11569154262542725,
-0.1716490387916565,
-0.5089351534843445,
0.20008808374404907,
-0.783132016658783,
0.34095585346221924,
1.4387685060501099,
0.3186265528202057,
0.08406063914299011,
0.538917064666748,
1.1433969736099243,
0.3913462162017822,
-0.17745867371559143,
-0.828472912311554,
-1.5465631484985352,
1.9688339233398438,
-1.3954260349273682,
2.0325610637664795,
0.7363208532333374,
0.016455234959721565,
-1.7613846063613892,
-1.8711127042770386,
1.3419736623764038,
1.1462969779968262,
2.3861465454101562,
0.574218213558197,
0.4755427837371826,
-0.904602587223053,
-0.6689764261245728,
0.37204864621162415,
-1.0357749462127686,
-0.7520236372947693,
0.13933014869689941,
2.3372080326080322,
1.7460682392120361,
-0.40283510088920593,
-0.1436670422554016,
-1.066231369972229,
1.3694976568222046,
-0.2138708233833313,
0.18912962079048157,
1.9786896705627441,
-0.2684139311313629,
-1.1340919733047485,
1.3428462743759155,
-2.3445138931274414,
0.11087744683027267,
1.9620981216430664,
0.3528267443180084,
0.017125867307186127,
-1.3260760307312012,
-0.6951474547386169,
-0.2649143934249878,
-0.41527584195137024,
-1.2928844690322876,
0.5018479824066162,
-0.1994445025920868,
-0.7174847722053528,
-1.4277602434158325,
0.12036191672086716,
-1.0922282934188843,
-1.6712895631790161,
0.2352672815322876,
1.900654911994934,
1.9672373533248901,
-0.7178786993026733,
1.5500656366348267,
-0.2340621054172516,
0.16903039813041687,
1.2489770650863647,
1.1586250066757202,
3.057953119277954,
1.9663959741592407,
-1.2760688066482544,
0.6133506894111633,
-0.11869657039642334,
-0.4892909824848175,
1.1665173768997192,
-1.2696934938430786,
1.3369653224945068,
-0.08404111117124557,
-1.221845269203186,
-1.1708414554595947,
0.9687290191650391,
0.4594547748565674,
0.07593269646167755,
-0.44022393226623535,
1.2171616554260254,
-0.007463224697858095,
1.364202618598938,
0.61057049036026,
-0.2379014492034912,
0.6606574058532715,
-0.4018929898738861,
-0.5038988590240479,
1.5143215656280518,
0.2401764690876007,
-1.4487396478652954,
-2.259953260421753,
-0.19933617115020752,
-0.8504096269607544,
0.027634523808956146,
-0.6601404547691345,
-0.963310182094574,
1.6445090770721436,
0.3206121623516083,
-1.2451335191726685,
-0.2696201503276825,
-0.3141949474811554,
-0.6352383494377136,
2.7405521869659424,
-1.3834556341171265,
-0.20583587884902954,
-1.0364675521850586,
-0.6815354228019714,
1.610390543937683,
-1.2242804765701294,
-0.2300592064857483,
-0.99008709192276,
-0.5582751035690308,
-1.17690908908844,
-0.5301393866539001,
-0.11876394599676132,
-0.9407044649124146,
0.7666926980018616,
0.14293688535690308,
-1.1730711460113525,
-0.2878444492816925,
-0.834359884262085,
0.8282552361488342,
-0.15137431025505066,
0.2610038220882416,
1.7698071002960205,
0.4136897921562195,
-0.2777785360813141,
0.7326474189758301,
1.1514827013015747,
0.6860888600349426,
-0.5712598562240601,
0.22407063841819763,
-0.6533252000808716,
0.28545069694519043,
-1.30799400806427,
0.3067674934864044,
-2.7876546382904053,
0.6069830060005188,
-0.1380278468132019,
-0.08050234615802765,
-0.009322213008999825,
-1.3739720582962036,
1.062440276145935,
2.50724196434021,
-1.1526706218719482,
0.462053507566452,
0.2827261686325073,
1.1368898153305054,
-1.5480859279632568,
0.33200231194496155,
-0.46077051758766174,
2.105480432510376,
0.23024290800094604,
1.1543926000595093,
-0.4643617570400238,
-2.3273708820343018,
0.5677761435508728,
-1.2861638069152832,
-1.1816519498825073,
0.7742568254470825,
-0.8818196058273315,
0.07875309139490128,
-1.357418179512024,
-0.22099274396896362,
-0.7891069054603577,
-1.186296820640564,
0.6715107560157776,
0.14059311151504517,
0.35790005326271057,
-0.5291058421134949,
0.372406542301178,
-2.2523155212402344,
-1.3367120027542114,
-0.24218472838401794,
-0.9232370853424072,
0.48565396666526794,
-0.32748523354530334,
0.6270368695259094,
-0.2380199134349823,
-0.05033165588974953,
0.4043823182582855,
1.448307752609253,
3.3816967010498047,
0.16178342700004578,
0.3806609809398651,
-0.10051415115594864,
-0.9737412929534912,
1.5132195949554443,
0.9777082800865173,
-0.1516043245792389,
-0.6152953505516052,
-1.0749489068984985,
1.2447564601898193,
1.9469494819641113,
1.070547342300415,
-0.02900603786110878,
-0.7948071360588074,
-0.8107749223709106,
-0.042397454380989075,
0.13513019680976868,
0.42308053374290466,
0.9436116218566895,
0.21456396579742432,
0.09830158203840256,
1.4378397464752197,
1.210959553718567,
-0.4561868906021118,
0.3699791431427002,
-0.7756375670433044,
-0.5331637263298035,
0.4681224524974823,
0.31329604983329773,
0.03253638744354248,
0.3100181519985199,
-1.0371079444885254,
-0.2964399456977844,
-0.42646536231040955,
-0.9017390608787537,
-0.8245981335639954,
-0.4590713679790497,
-0.42778345942497253,
1.7054176330566406,
0.043087463825941086,
-0.6120170950889587,
-0.05648094043135643,
-0.7715058326721191,
-0.11721032857894897,
-1.0465645790100098,
0.40304625034332275,
-0.063860222697258,
-0.1689695417881012,
-0.1268865019083023,
1.751060128211975,
-0.9631806015968323,
-2.188605308532715,
0.24732434749603271,
0.17027664184570312,
-0.30269113183021545,
0.17946293950080872,
1.5716322660446167,
0.6217601895332336,
1.453511118888855,
1.3771592378616333,
0.9679096341133118,
-0.6579847931861877,
-1.3676743507385254,
0.7652040719985962,
0.9398457407951355,
-1.4609369039535522,
0.7132371664047241,
-0.040184490382671356,
-0.5682892203330994,
0.6075440645217896,
1.2305397987365723,
0.5832040905952454,
-2.008399486541748,
0.8154125213623047,
-0.9497895240783691,
0.7412349581718445,
0.7085517048835754,
0.6853813529014587,
0.22939187288284302,
0.7473086714744568,
-1.359522819519043,
-1.1307015419006348,
-0.6618630290031433,
-0.7296544313430786,
1.9481345415115356,
-0.36503028869628906,
0.6713308095932007,
-0.33791422843933105,
-1.3923290967941284,
-0.1488794982433319,
0.7161130905151367,
0.3023238480091095,
-0.5935477018356323,
0.7947989702224731,
-0.5959755778312683,
-1.0982475280761719,
-1.3624413013458252,
-0.43621334433555603,
-1.0967957973480225,
-0.906398594379425,
0.9997119903564453,
0.7579456567764282,
0.2902413308620453,
1.8439443111419678,
0.6472527384757996,
0.21301963925361633,
-2.621480703353882,
0.9135934710502625,
0.17965960502624512,
-0.08083532005548477,
0.8317458629608154,
0.33076703548431396,
0.9421208500862122,
-0.046597227454185486,
0.5717228651046753,
-2.500154495239258,
2.3910343647003174,
-0.15089979767799377,
0.6534531712532043,
-0.0122129637748003,
-0.12803106009960175,
1.108964204788208,
0.6011326313018799,
0.514242947101593,
-1.0759646892547607,
0.6514051556587219,
-0.5741559863090515,
1.2502859830856323,
0.7853569388389587,
-0.8114898800849915,
-0.04577276110649109,
1.3438656330108643,
0.47011104226112366,
-0.48371565341949463,
-0.9192822575569153,
-1.076939344406128,
0.9344991445541382,
1.7760282754898071,
-0.0979829803109169,
0.01228911243379116,
0.8307574391365051,
0.6405054926872253,
-1.312063455581665,
0.07562831789255142,
-0.6760526895523071,
-0.8042110204696655,
1.6396712064743042,
2.066007137298584,
-0.14865493774414062,
-0.21375644207000732,
-0.648669421672821,
-1.31029212474823,
0.7890748977661133,
0.021819740533828735,
0.14261645078659058,
0.6369602680206299,
-0.5792062282562256,
1.09718656539917,
0.960938572883606,
0.9396187663078308,
0.2665347754955292,
0.2111545205116272,
0.34538352489471436,
-0.2593688666820526,
-1.2220900058746338,
-0.20099875330924988,
-1.043534517288208,
-2.600994110107422,
0.4203100800514221,
-0.26323094964027405,
-1.449242115020752,
0.06457065790891647,
-1.0346702337265015,
0.8508739471435547,
-0.5547630786895752,
-1.11021888256073,
-1.5945227146148682,
0.1413278579711914,
0.0038075968623161316,
0.9692075848579407,
-1.5930732488632202,
-0.09980683028697968,
1.2135714292526245,
0.8975781798362732,
-0.6497461795806885,
1.0088348388671875,
0.21524620056152344,
1.0064653158187866,
0.8661888241767883,
-0.3436250686645508,
0.5963062047958374,
0.08353544771671295,
-1.3892313241958618,
0.4720851480960846,
1.1798219680786133,
0.1845162808895111,
1.531684160232544,
-0.5895379781723022,
-0.015663888305425644,
0.4167819321155548,
-0.5075202584266663,
-0.4198845326900482,
-0.5951880812644958,
0.6385941505432129,
0.04329662770032883,
-0.9532357454299927,
-0.07217272371053696,
-0.027476467192173004,
-0.18193557858467102,
0.1355954110622406,
-1.42923903465271,
-0.11514373868703842,
-0.45395004749298096,
-0.6898452043533325,
-1.1250183582305908,
-0.08773623406887054,
1.3709231615066528,
-0.7906681299209595,
-0.1321902871131897,
0.528168797492981,
0.3814238905906677,
0.5385013222694397,
0.6722422242164612,
-0.6475322246551514,
-0.37659430503845215,
-0.17917639017105103,
-0.37657445669174194,
0.3560251295566559,
1.366938829421997,
-0.12396527826786041,
-1.0097826719284058,
0.7522017359733582,
-0.3241018056869507,
0.08707419037818909,
1.902431845664978,
0.020520247519016266,
-0.838521420955658,
0.3644084334373474,
-0.686802864074707,
1.95366370677948,
1.7879709005355835,
1.3309249877929688,
-0.1620025932788849,
-0.9814126491546631,
0.587007462978363,
-0.32243630290031433,
-0.299996018409729,
0.9169691205024719,
0.43136096000671387,
-0.22404488921165466,
-1.3937582969665527,
0.7571432590484619,
1.2770640850067139,
-0.8937236070632935,
-0.7526479959487915,
0.13319426774978638,
-0.7607163786888123,
1.08754301071167,
0.6360916495323181,
0.3373684883117676,
0.29100480675697327,
1.598778247833252,
0.774714469909668,
-0.3551620841026306,
0.5846247673034668,
0.5314431190490723,
-0.16549649834632874,
-2.1395363807678223,
-1.2076644897460938,
0.39909449219703674,
-0.649359405040741,
-1.5773180723190308,
1.3070104122161865,
-1.1496896743774414,
-0.9515711069107056,
0.5429403781890869,
0.03391275554895401,
1.5101584196090698,
0.36334505677223206,
1.5425429344177246,
2.0400643348693848,
0.9054944515228271,
0.3428401052951813,
1.2658299207687378,
-0.118446484208107,
-0.31501567363739014,
1.721437692642212,
-0.44287633895874023,
0.4047033488750458,
1.1229772567749023,
-0.2760164737701416,
-1.108736515045166,
-0.7537520527839661,
-1.3140347003936768,
-0.7277895212173462,
1.1625447273254395,
0.09384889900684357,
-1.1223989725112915,
0.29687196016311646,
1.5147806406021118,
0.09653531014919281,
-0.27801385521888733,
0.5693441033363342,
0.36913609504699707,
-0.7798529267311096,
-0.07811553031206131,
-0.8669407963752747,
0.5022871494293213,
-0.24816137552261353,
-0.3895069658756256,
0.3393278121948242,
0.464127779006958,
1.346067190170288,
-0.007735005114227533,
0.12131420522928238,
1.1742373704910278,
-1.4607884883880615,
1.5067191123962402,
-0.678855836391449,
0.22275075316429138,
-2.2652368545532227,
1.427457571029663,
-0.7101054787635803,
1.918537974357605,
-2.7237513065338135,
0.48619788885116577,
-0.4947679042816162,
-0.49466681480407715,
0.33761903643608093,
-0.34189727902412415,
0.14534920454025269,
-0.21729308366775513,
-1.1013634204864502,
-0.14937835931777954,
-0.6588611006736755,
0.6167033910751343,
1.0991889238357544,
1.40068781375885,
-1.0708823204040527,
-0.2968800365924835,
-1.640482783317566,
-0.1526695191860199,
-0.6607529520988464,
0.2901627719402313,
-2.041261672973633,
-0.13400202989578247,
-1.9403775930404663,
-2.424847364425659,
-1.189495325088501,
-0.7413268685340881,
1.1841726303100586,
0.05339042842388153,
-0.824905276298523,
1.1945881843566895,
-0.3972821831703186,
-1.830751657485962,
1.068720817565918,
-2.1533007621765137
] |
https://github.com/huggingface/datasets/issues/4964 | Column of arrays (2D+) are using unreasonably high memory | Hi ! `Dataset.from_dict` keeps the data in memory. You can write on disk and reload them with
```python
dataset.save_to_disk("path/to/local")
dataset = load_from_disk("path/to/local")
```
this way you'll end up with a dataset loaded from your disk using memory mapping, and it won't fill up your RAM :)
related to https://github.com/huggingface/datasets/issues/4861 | ## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4 | 530 | 49 | Column of arrays (2D+) are using unreasonably high memory
## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Hi ! `Dataset.from_dict` keeps the data in memory. You can write on disk and reload them with
```python
dataset.save_to_disk("path/to/local")
dataset = load_from_disk("path/to/local")
```
this way you'll end up with a dataset loaded from your disk using memory mapping, and it won't fill up your RAM :)
related to https://github.com/huggingface/datasets/issues/4861 | [
-1.256632924079895,
-0.9199981689453125,
-0.6366620063781738,
1.4514319896697998,
-0.19122375547885895,
-1.1986018419265747,
0.20836780965328217,
-1.04438054561615,
1.6999812126159668,
-0.8131505846977234,
0.3271414041519165,
-1.659867525100708,
0.04496977478265762,
-0.5871059894561768,
-0.7151313424110413,
-0.8741745352745056,
-0.5286404490470886,
-0.7673004269599915,
1.0201956033706665,
2.409048318862915,
1.231471061706543,
-1.334065556526184,
2.703747510910034,
0.8035632371902466,
-0.17579807341098785,
-0.9926483035087585,
0.4513136148452759,
-0.02369113638997078,
-1.3870619535446167,
-0.4513758420944214,
-0.9088229537010193,
-0.15185636281967163,
-0.4931892156600952,
-0.6529232263565063,
-0.03863959014415741,
0.38627028465270996,
-0.33359137177467346,
-0.4565470814704895,
-0.49588003754615784,
-0.7701029777526855,
0.5204575061798096,
-0.32598012685775757,
0.8780225515365601,
-0.36640697717666626,
1.7670457363128662,
-0.5282360315322876,
0.49999478459358215,
0.7350034713745117,
1.3041585683822632,
0.20671911537647247,
-0.00963599979877472,
0.42123308777809143,
0.38297373056411743,
0.0462215431034565,
0.5874167084693909,
1.2061244249343872,
0.717851996421814,
0.4811239540576935,
0.7555599212646484,
-2.18007755279541,
1.2746272087097168,
-1.0230273008346558,
0.3770807087421417,
1.3506989479064941,
-1.0021498203277588,
0.36057451367378235,
-1.6905937194824219,
-0.07501383870840073,
0.5047227144241333,
-2.197422742843628,
0.2957346737384796,
-1.3350794315338135,
-0.5020490288734436,
1.0062099695205688,
0.40566882491111755,
-1.1358217000961304,
0.11969001591205597,
-0.44922539591789246,
1.0040940046310425,
0.438688188791275,
1.1586912870407104,
-1.6979293823242188,
0.008130784146487713,
-0.34506845474243164,
0.10555899888277054,
-1.2341811656951904,
-1.5644389390945435,
0.6131691932678223,
0.659410297870636,
0.5676501393318176,
-0.16845346987247467,
1.1067850589752197,
-1.0530964136123657,
0.7551789283752441,
-1.0208028554916382,
-1.652572512626648,
-1.408757209777832,
-2.2739102840423584,
-2.30572772026062,
0.7589125037193298,
-0.4381147623062134,
-0.5508664846420288,
2.081542730331421,
-1.0164140462875366,
-1.78871750831604,
1.1192779541015625,
0.2225208431482315,
-0.12007679790258408,
2.336906909942627,
0.16771140694618225,
-0.7087710499763489,
0.4832058846950531,
-0.7542886734008789,
0.757262647151947,
-0.3663087785243988,
1.3375157117843628,
0.4616393446922302,
-1.0891172885894775,
1.597322940826416,
-0.40081191062927246,
0.5815417170524597,
-0.5737267732620239,
-0.49935057759284973,
-0.7315708994865417,
0.29462915658950806,
1.9567984342575073,
-0.28063568472862244,
1.50857412815094,
-0.3225613236427307,
-1.527349829673767,
-1.6173367500305176,
0.8832859992980957,
0.5058023929595947,
-0.7081476449966431,
0.14528007805347443,
-0.4167560040950775,
0.09045559912919998,
-0.02605913206934929,
1.1373398303985596,
1.2834395170211792,
0.734423041343689,
-0.3397383689880371,
-0.8271548748016357,
0.17172516882419586,
-0.09859481453895569,
-0.7498358488082886,
-1.7083258628845215,
-0.36905744671821594,
0.09806650131940842,
0.5524786710739136,
-1.1271212100982666,
1.8013529777526855,
0.893772542476654,
1.8602594137191772,
1.0398133993148804,
-0.35436129570007324,
1.4576268196105957,
0.13175074756145477,
1.8534274101257324,
-0.48104822635650635,
0.718841016292572,
-0.4344163239002228,
-1.196345567703247,
0.8651217818260193,
-0.3384919762611389,
-2.1021134853363037,
-0.6875016689300537,
-0.7291256785392761,
-0.1588330864906311,
-0.8553194403648376,
0.9899281859397888,
-0.27077436447143555,
-1.398970127105713,
0.24262215197086334,
-0.7931984663009644,
0.2134000062942505,
-1.199634313583374,
0.34356439113616943,
0.7597543001174927,
-0.6864616870880127,
0.09215781092643738,
-0.23284059762954712,
-1.2643108367919922,
-0.46218231320381165,
0.2939445972442627,
1.8366461992263794,
-0.7641175389289856,
0.952811062335968,
1.045405387878418,
-0.7262634038925171,
-0.01955235004425049,
0.228956401348114,
-0.20598246157169342,
0.9034745097160339,
-1.0747510194778442,
-0.40466636419296265,
1.2090067863464355,
-0.20300818979740143,
-0.5803737640380859,
1.4225132465362549,
0.7001301050186157,
-0.9377208352088928,
-0.1668950468301773,
-0.1070064902305603,
-0.9303189516067505,
0.049508653581142426,
-1.5899683237075806,
-0.03616990149021149,
0.48357924818992615,
-1.5260642766952515,
-0.49516361951828003,
-0.1541397124528885,
1.2922041416168213,
-0.12102880328893661,
1.4040919542312622,
-0.33105215430259705,
-0.1418737769126892,
-0.3892945349216461,
-0.3338086009025574,
0.11529994755983353,
-0.19726552069187164,
-0.562670886516571,
0.17048028111457825,
-0.7556126713752747,
0.3423226475715637,
1.4535154104232788,
0.3164890706539154,
0.06197838485240936,
0.564268171787262,
1.1739997863769531,
0.36382848024368286,
-0.17743471264839172,
-0.8244593739509583,
-1.5601948499679565,
1.9258055686950684,
-1.387984275817871,
2.004034996032715,
0.6925621628761292,
-0.0074049015529453754,
-1.7712074518203735,
-1.8786942958831787,
1.3473669290542603,
1.147728681564331,
2.390446186065674,
0.5484529137611389,
0.4499354958534241,
-0.8770427107810974,
-0.6786668300628662,
0.3745526671409607,
-0.9985261559486389,
-0.7276272177696228,
0.15100009739398956,
2.3337395191192627,
1.7985031604766846,
-0.4178526997566223,
-0.171600341796875,
-1.0789841413497925,
1.3668417930603027,
-0.2672388553619385,
0.21535319089889526,
1.9788124561309814,
-0.30202317237854004,
-1.1021597385406494,
1.3722567558288574,
-2.345740556716919,
0.12844455242156982,
1.9643219709396362,
0.3410451114177704,
0.02862727642059326,
-1.312359094619751,
-0.7089974284172058,
-0.28597891330718994,
-0.42570069432258606,
-1.3285654783248901,
0.4732729494571686,
-0.2454291582107544,
-0.7188299894332886,
-1.3856738805770874,
0.1407206952571869,
-1.0757755041122437,
-1.648870825767517,
0.24300067126750946,
1.9090681076049805,
1.951871395111084,
-0.7046336531639099,
1.541914939880371,
-0.27887240052223206,
0.16161362826824188,
1.2669401168823242,
1.2139064073562622,
3.1016008853912354,
1.9777144193649292,
-1.2762948274612427,
0.651843249797821,
-0.13236017525196075,
-0.5033928155899048,
1.2103263139724731,
-1.275826096534729,
1.316057801246643,
-0.10351742058992386,
-1.222335696220398,
-1.1665126085281372,
0.9740194082260132,
0.47302690148353577,
0.09870035946369171,
-0.45529597997665405,
1.1864311695098877,
-0.0035494863986968994,
1.3640241622924805,
0.6276226043701172,
-0.3173418343067169,
0.66981041431427,
-0.3879524767398834,
-0.49909549951553345,
1.5202486515045166,
0.21304363012313843,
-1.4106261730194092,
-2.250196695327759,
-0.20695188641548157,
-0.8520225882530212,
0.038721952587366104,
-0.6517146825790405,
-0.952531099319458,
1.6667678356170654,
0.309286504983902,
-1.2690497636795044,
-0.2433391511440277,
-0.29797711968421936,
-0.5903071165084839,
2.740992546081543,
-1.34657883644104,
-0.2122652232646942,
-1.0387120246887207,
-0.6779401302337646,
1.6387009620666504,
-1.205656886100769,
-0.2457069307565689,
-1.0052871704101562,
-0.553588330745697,
-1.2145494222640991,
-0.5366944074630737,
-0.07485683262348175,
-0.943446695804596,
0.8124087452888489,
0.1436932384967804,
-1.2095441818237305,
-0.31489288806915283,
-0.828063428401947,
0.8953519463539124,
-0.1928573101758957,
0.22819513082504272,
1.8220289945602417,
0.40765658020973206,
-0.3349810540676117,
0.7197895050048828,
1.1313732862472534,
0.6630092859268188,
-0.6016068458557129,
0.23629936575889587,
-0.7058991193771362,
0.2847937047481537,
-1.3544986248016357,
0.27979207038879395,
-2.810981273651123,
0.6297980546951294,
-0.11756760627031326,
-0.08705552667379379,
-0.027381204068660736,
-1.3909192085266113,
1.0004572868347168,
2.5521202087402344,
-1.1664992570877075,
0.43849074840545654,
0.2936631739139557,
1.1499130725860596,
-1.5311330556869507,
0.29903388023376465,
-0.44547319412231445,
2.0858640670776367,
0.2026173621416092,
1.1784427165985107,
-0.4346860647201538,
-2.311697006225586,
0.5718697905540466,
-1.2733322381973267,
-1.1974257230758667,
0.7848045825958252,
-0.8661285042762756,
0.11018853634595871,
-1.351683497428894,
-0.22480860352516174,
-0.8203023672103882,
-1.1588327884674072,
0.68647301197052,
0.15478554368019104,
0.36727872490882874,
-0.5700769424438477,
0.3594750165939331,
-2.2156825065612793,
-1.314412236213684,
-0.26858335733413696,
-0.9140350222587585,
0.5115918517112732,
-0.31858277320861816,
0.6208563446998596,
-0.21894040703773499,
-0.05254197493195534,
0.3839419186115265,
1.482887625694275,
3.3629884719848633,
0.15648330748081207,
0.3261508643627167,
-0.10377919673919678,
-0.965226948261261,
1.4877220392227173,
0.9444112777709961,
-0.1261310577392578,
-0.5943769812583923,
-1.0695945024490356,
1.2187222242355347,
1.9173240661621094,
1.0545215606689453,
-0.008527316153049469,
-0.8134377598762512,
-0.8242783546447754,
-0.06252621114253998,
0.10664742439985275,
0.4372360110282898,
0.9296503067016602,
0.18378864228725433,
0.10780461877584457,
1.4238227605819702,
1.2074075937271118,
-0.4024202227592468,
0.361776202917099,
-0.7898274064064026,
-0.5139895081520081,
0.49091699719429016,
0.3099791407585144,
0.021184146404266357,
0.30874717235565186,
-1.067284345626831,
-0.2784259021282196,
-0.4243986904621124,
-0.8928477764129639,
-0.8025360107421875,
-0.45291003584861755,
-0.41960227489471436,
1.6938393115997314,
0.05116082727909088,
-0.59895259141922,
-0.0741577073931694,
-0.7544185519218445,
-0.11570360511541367,
-1.0272014141082764,
0.38937243819236755,
-0.08849603682756424,
-0.1548546999692917,
-0.13992056250572205,
1.686852216720581,
-0.9395591020584106,
-2.147911548614502,
0.24120326340198517,
0.1654021143913269,
-0.30037128925323486,
0.18589617311954498,
1.581470012664795,
0.6159934401512146,
1.4542409181594849,
1.3920488357543945,
0.9793540239334106,
-0.6291806101799011,
-1.350066900253296,
0.7702556848526001,
0.9377409219741821,
-1.439222812652588,
0.7637500762939453,
-0.019885754212737083,
-0.5880268216133118,
0.6201052069664001,
1.2205662727355957,
0.5664594173431396,
-2.0179145336151123,
0.8097316026687622,
-0.959089457988739,
0.7080512046813965,
0.7359545826911926,
0.6945601105690002,
0.2205035239458084,
0.8282186388969421,
-1.330009937286377,
-1.1638394594192505,
-0.6554455161094666,
-0.7222309112548828,
1.9661859273910522,
-0.35994476079940796,
0.6564878821372986,
-0.3570878803730011,
-1.3867087364196777,
-0.14908896386623383,
0.7386783957481384,
0.32615846395492554,
-0.604705274105072,
0.7745121121406555,
-0.6139377951622009,
-1.0488511323928833,
-1.316635251045227,
-0.44785237312316895,
-1.1144570112228394,
-0.9047336578369141,
0.9795019030570984,
0.796567440032959,
0.3032226860523224,
1.8418577909469604,
0.6836897730827332,
0.24037976562976837,
-2.622847318649292,
0.8840258717536926,
0.18513379991054535,
-0.09494694322347641,
0.8137027621269226,
0.3283021152019501,
0.969508707523346,
-0.03347471356391907,
0.5994141697883606,
-2.50180983543396,
2.350741147994995,
-0.1587003767490387,
0.649408757686615,
-0.023862304165959358,
-0.15944579243659973,
1.1050633192062378,
0.5700201392173767,
0.5198591351509094,
-1.0699124336242676,
0.637923002243042,
-0.5887881517410278,
1.2440274953842163,
0.799286425113678,
-0.8373494744300842,
-0.018790144473314285,
1.388468861579895,
0.4795498251914978,
-0.4815998673439026,
-0.9177975058555603,
-1.0591694116592407,
0.9374241828918457,
1.776286005973816,
-0.06336814165115356,
0.0007257554680109024,
0.8687013983726501,
0.6846016645431519,
-1.2955223321914673,
0.08446254581212997,
-0.6748762130737305,
-0.7842337489128113,
1.6631956100463867,
2.061721086502075,
-0.17436683177947998,
-0.19763439893722534,
-0.6658311486244202,
-1.2589210271835327,
0.7905435562133789,
0.028161756694316864,
0.11000830680131912,
0.6685963869094849,
-0.5972849726676941,
1.0906107425689697,
0.9158943295478821,
0.9488839507102966,
0.2624824643135071,
0.27014750242233276,
0.3852590322494507,
-0.30216267704963684,
-1.2377368211746216,
-0.20374971628189087,
-1.0380887985229492,
-2.6015708446502686,
0.4400394856929779,
-0.2416013926267624,
-1.4706165790557861,
0.0620628297328949,
-1.0449479818344116,
0.8453742265701294,
-0.5947277545928955,
-1.1448657512664795,
-1.6010020971298218,
0.16966450214385986,
-0.0019940552301704884,
0.9640014171600342,
-1.5854039192199707,
-0.09708705544471741,
1.19584059715271,
0.9126232266426086,
-0.6345853209495544,
0.9699732661247253,
0.2189834862947464,
1.0177642107009888,
0.8983591198921204,
-0.35290178656578064,
0.5777747631072998,
0.044333234429359436,
-1.3710533380508423,
0.470939040184021,
1.1766670942306519,
0.18428626656532288,
1.520082712173462,
-0.5598036050796509,
-0.010949811898171902,
0.4011126756668091,
-0.5459168553352356,
-0.4463217854499817,
-0.5799389481544495,
0.61785489320755,
0.007497423328459263,
-0.9509156942367554,
-0.07504317909479141,
0.002218445762991905,
-0.22495998442173004,
0.1223534494638443,
-1.4189889430999756,
-0.10663972049951553,
-0.42431944608688354,
-0.6927757859230042,
-1.1366735696792603,
-0.06177648529410362,
1.3659385442733765,
-0.7819564342498779,
-0.14395208656787872,
0.5216626524925232,
0.3416670262813568,
0.5258290767669678,
0.6240531206130981,
-0.6817578077316284,
-0.32788652181625366,
-0.19923357665538788,
-0.39078569412231445,
0.3228794038295746,
1.394132375717163,
-0.12115748226642609,
-0.9786933660507202,
0.7338244318962097,
-0.3624633252620697,
0.06565850228071213,
1.9312008619308472,
0.028705555945634842,
-0.798157811164856,
0.3514827489852905,
-0.7177037596702576,
1.915725827217102,
1.8178834915161133,
1.344251275062561,
-0.15493927896022797,
-0.9718586802482605,
0.5590210556983948,
-0.381442129611969,
-0.3183029890060425,
0.9221188426017761,
0.401199609041214,
-0.2188166230916977,
-1.3809813261032104,
0.8066188097000122,
1.2809571027755737,
-0.8642144799232483,
-0.7549700140953064,
0.16115501523017883,
-0.7591111660003662,
1.1067285537719727,
0.6367368102073669,
0.29804491996765137,
0.3002830445766449,
1.5997854471206665,
0.7787263989448547,
-0.3346356749534607,
0.6024690866470337,
0.5755409598350525,
-0.1601996272802353,
-2.155508518218994,
-1.2188502550125122,
0.39600232243537903,
-0.6271775960922241,
-1.610886812210083,
1.305922269821167,
-1.14101243019104,
-0.9613528847694397,
0.5257487893104553,
0.05632320046424866,
1.4934059381484985,
0.3886173963546753,
1.541007399559021,
2.0674116611480713,
0.884695827960968,
0.38010695576667786,
1.2779057025909424,
-0.11474450677633286,
-0.3323008418083191,
1.7673553228378296,
-0.4448348879814148,
0.4320386052131653,
1.1172564029693604,
-0.2545047700405121,
-1.1113518476486206,
-0.7590468525886536,
-1.3186497688293457,
-0.7209165692329407,
1.1738590002059937,
0.08242087066173553,
-1.1128493547439575,
0.28356868028640747,
1.5183779001235962,
0.09673355519771576,
-0.2863706648349762,
0.6648838520050049,
0.34314948320388794,
-0.7726763486862183,
-0.0728769600391388,
-0.8704777956008911,
0.5286268591880798,
-0.2398017793893814,
-0.36274105310440063,
0.3256947100162506,
0.5135205984115601,
1.3367358446121216,
-0.011885463260114193,
0.07315503805875778,
1.1631112098693848,
-1.4604634046554565,
1.508539080619812,
-0.7170246839523315,
0.24052096903324127,
-2.336442232131958,
1.4326695203781128,
-0.7442173361778259,
1.9093914031982422,
-2.6781585216522217,
0.4955274164676666,
-0.4799864888191223,
-0.4963957965373993,
0.3373487889766693,
-0.33594489097595215,
0.10201689600944519,
-0.18870113790035248,
-1.1252626180648804,
-0.0840890035033226,
-0.6492809653282166,
0.6360562443733215,
1.107962965965271,
1.4252293109893799,
-1.1541566848754883,
-0.29839572310447693,
-1.6743204593658447,
-0.1462896764278412,
-0.7072288990020752,
0.32822757959365845,
-2.0067343711853027,
-0.1501554548740387,
-1.9313170909881592,
-2.4397919178009033,
-1.1802719831466675,
-0.755267322063446,
1.1605010032653809,
0.058637022972106934,
-0.8692366480827332,
1.2076709270477295,
-0.41214385628700256,
-1.8633259534835815,
1.080108880996704,
-2.184607982635498
] |
https://github.com/huggingface/datasets/issues/4964 | Column of arrays (2D+) are using unreasonably high memory | @lhoestq thnx for getting back to me! i've tested the suggested method, but unfortunately the memory consumption is the very same:
```
from datasets import Dataset, Features, Array2D, Array3D, load_from_disk
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
dataset.save_to_disk("foo")
foo_db = load_from_disk("foo")
colum_value = foo_db[column_name]
```
the very same happens when you create the dataset, but dont specify the feature type.
i've tried running this on different envs (macOS, linux) and it's behaving the very same way. | ## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4 | 530 | 93 | Column of arrays (2D+) are using unreasonably high memory
## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
@lhoestq thnx for getting back to me! i've tested the suggested method, but unfortunately the memory consumption is the very same:
```
from datasets import Dataset, Features, Array2D, Array3D, load_from_disk
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
dataset.save_to_disk("foo")
foo_db = load_from_disk("foo")
colum_value = foo_db[column_name]
```
the very same happens when you create the dataset, but dont specify the feature type.
i've tried running this on different envs (macOS, linux) and it's behaving the very same way. | [
-1.2797363996505737,
-0.9081579446792603,
-0.6423531174659729,
1.4234970808029175,
-0.1964198797941208,
-1.1796073913574219,
0.21151258051395416,
-1.0611871480941772,
1.6786152124404907,
-0.8262267112731934,
0.30746152997016907,
-1.6501115560531616,
0.047532953321933746,
-0.5749403834342957,
-0.7116788029670715,
-0.8583073616027832,
-0.5358957052230835,
-0.7861786484718323,
1.0716971158981323,
2.4037554264068604,
1.201428771018982,
-1.364652156829834,
2.7064614295959473,
0.8112541437149048,
-0.16499823331832886,
-1.000234842300415,
0.47142329812049866,
-0.04207435995340347,
-1.4001901149749756,
-0.46812957525253296,
-0.9176348447799683,
-0.17064961791038513,
-0.5054068565368652,
-0.6392847299575806,
-0.0457787849009037,
0.3880470097064972,
-0.3127734959125519,
-0.4430846869945526,
-0.4952200949192047,
-0.7447063326835632,
0.5313986539840698,
-0.30956172943115234,
0.8611941933631897,
-0.3425008952617645,
1.7757976055145264,
-0.5035749673843384,
0.5001274347305298,
0.7121227383613586,
1.3086893558502197,
0.21594616770744324,
-0.04033351317048073,
0.43083736300468445,
0.36069852113723755,
0.03824092820286751,
0.5948359966278076,
1.1861692667007446,
0.7260623574256897,
0.47461581230163574,
0.7707862854003906,
-2.137038230895996,
1.2955340147018433,
-1.028814435005188,
0.4217694401741028,
1.3972266912460327,
-1.0119630098342896,
0.3619231879711151,
-1.6816880702972412,
-0.07090206444263458,
0.48609021306037903,
-2.1836140155792236,
0.32000231742858887,
-1.3094145059585571,
-0.5116161704063416,
0.9957976937294006,
0.423786997795105,
-1.1440966129302979,
0.12582586705684662,
-0.4640772342681885,
0.9955304265022278,
0.42594826221466064,
1.1677194833755493,
-1.7202191352844238,
0.03733192756772041,
-0.35589125752449036,
0.11156432330608368,
-1.25269615650177,
-1.5588493347167969,
0.6010907292366028,
0.6542478203773499,
0.5495440363883972,
-0.17553193867206573,
1.0983563661575317,
-1.0729091167449951,
0.7588558197021484,
-1.0367622375488281,
-1.612693428993225,
-1.4095081090927124,
-2.277383804321289,
-2.2989745140075684,
0.7337153553962708,
-0.43086501955986023,
-0.5657297372817993,
2.0990171432495117,
-1.006718635559082,
-1.7668211460113525,
1.139798879623413,
0.20322094857692719,
-0.10533678531646729,
2.357173442840576,
0.1820749044418335,
-0.691337525844574,
0.48458418250083923,
-0.8048661351203918,
0.7822937369346619,
-0.35846081376075745,
1.3370387554168701,
0.46688106656074524,
-1.0791947841644287,
1.5981193780899048,
-0.3874685764312744,
0.559333086013794,
-0.5481715798377991,
-0.5063422918319702,
-0.7221384048461914,
0.300398051738739,
1.9961541891098022,
-0.25357577204704285,
1.5141006708145142,
-0.32780757546424866,
-1.541996955871582,
-1.620314121246338,
0.9106409549713135,
0.4987694025039673,
-0.7449061274528503,
0.160800963640213,
-0.3952729403972626,
0.08673137426376343,
-0.028451502323150635,
1.1169800758361816,
1.3184362649917603,
0.7224269509315491,
-0.33223870396614075,
-0.8480544686317444,
0.14956627786159515,
-0.1423514038324356,
-0.7647807002067566,
-1.6886637210845947,
-0.377997487783432,
0.03659640625119209,
0.5587621331214905,
-1.1697920560836792,
1.8054245710372925,
0.9248489141464233,
1.823135495185852,
1.0139992237091064,
-0.38516363501548767,
1.4606773853302002,
0.1325305700302124,
1.8410395383834839,
-0.5073735117912292,
0.7264472842216492,
-0.4568021297454834,
-1.1964207887649536,
0.8958133459091187,
-0.3269488215446472,
-2.109206438064575,
-0.7034551501274109,
-0.7302294373512268,
-0.18950410187244415,
-0.8770005702972412,
0.9782010316848755,
-0.2768379747867584,
-1.3972147703170776,
0.28433361649513245,
-0.8169605135917664,
0.21506373584270477,
-1.206133484840393,
0.3571288287639618,
0.7652358412742615,
-0.6838346123695374,
0.07510228455066681,
-0.2259574830532074,
-1.261397123336792,
-0.4534379243850708,
0.28270721435546875,
1.8392784595489502,
-0.7597336769104004,
0.9371539950370789,
1.0459446907043457,
-0.7319216132164001,
-0.04271385446190834,
0.24218297004699707,
-0.1778765469789505,
0.905881404876709,
-1.0709434747695923,
-0.4262193441390991,
1.182586669921875,
-0.20885924994945526,
-0.5331052541732788,
1.409116268157959,
0.6830424666404724,
-0.956537663936615,
-0.1541416198015213,
-0.09780095517635345,
-0.941443681716919,
0.058838117867708206,
-1.5680463314056396,
-0.04115944355726242,
0.5034756660461426,
-1.5420469045639038,
-0.5045796036720276,
-0.14795467257499695,
1.294513463973999,
-0.12410297989845276,
1.420929193496704,
-0.32373693585395813,
-0.12621870636940002,
-0.3958395719528198,
-0.31999412178993225,
0.11715613305568695,
-0.18667304515838623,
-0.5172236561775208,
0.16103032231330872,
-0.7765063047409058,
0.35144343972206116,
1.4533668756484985,
0.3208766579627991,
0.06479141116142273,
0.5505661368370056,
1.1580700874328613,
0.3992856442928314,
-0.1516466587781906,
-0.8531731367111206,
-1.514482021331787,
1.9269613027572632,
-1.4218546152114868,
2.000298500061035,
0.7082471251487732,
0.029615748673677444,
-1.7570823431015015,
-1.855779767036438,
1.34952974319458,
1.1608885526657104,
2.3770015239715576,
0.5504570603370667,
0.44734930992126465,
-0.8908661007881165,
-0.6676536202430725,
0.3786040246486664,
-1.0192363262176514,
-0.7330582737922668,
0.15335828065872192,
2.3579442501068115,
1.7883713245391846,
-0.40427517890930176,
-0.17247845232486725,
-1.060210108757019,
1.3765842914581299,
-0.25210413336753845,
0.20611728727817535,
1.97705078125,
-0.30072370171546936,
-1.1198292970657349,
1.3743457794189453,
-2.3677706718444824,
0.10661575198173523,
1.9584550857543945,
0.36377108097076416,
0.03237524628639221,
-1.3106414079666138,
-0.6903958320617676,
-0.2611764371395111,
-0.4395116865634918,
-1.3244179487228394,
0.47665420174598694,
-0.2048431634902954,
-0.7079777717590332,
-1.3907727003097534,
0.13690243661403656,
-1.105320930480957,
-1.660634994506836,
0.23218639194965363,
1.922307014465332,
1.9738720655441284,
-0.6960810422897339,
1.5472263097763062,
-0.27865952253341675,
0.18030570447444916,
1.2276971340179443,
1.1953397989273071,
3.0738062858581543,
1.9618968963623047,
-1.2472310066223145,
0.6273037195205688,
-0.1528465896844864,
-0.4927310645580292,
1.1808810234069824,
-1.2528488636016846,
1.3162260055541992,
-0.07864806056022644,
-1.224794864654541,
-1.1611825227737427,
0.9696939587593079,
0.45484504103660583,
0.08659039437770844,
-0.4282646179199219,
1.1968843936920166,
-0.009897969663143158,
1.3706785440444946,
0.6364105343818665,
-0.27912637591362,
0.6570086479187012,
-0.38573166728019714,
-0.5084921717643738,
1.5293173789978027,
0.22142621874809265,
-1.4483493566513062,
-2.2387967109680176,
-0.22206106781959534,
-0.8576040267944336,
0.04576193168759346,
-0.6590712666511536,
-0.9667326211929321,
1.6610645055770874,
0.2932497560977936,
-1.2592147588729858,
-0.23858271539211273,
-0.31858038902282715,
-0.6024469137191772,
2.744629144668579,
-1.3705804347991943,
-0.21806441247463226,
-1.02536141872406,
-0.6943326592445374,
1.624971866607666,
-1.2240227460861206,
-0.24374975264072418,
-1.0196136236190796,
-0.5482932329177856,
-1.1834077835083008,
-0.5040891170501709,
-0.11243554949760437,
-0.958017885684967,
0.7840551137924194,
0.14648234844207764,
-1.1884504556655884,
-0.31966763734817505,
-0.8241393566131592,
0.8825485110282898,
-0.1625300645828247,
0.2315293550491333,
1.7707189321517944,
0.39621809124946594,
-0.3055001497268677,
0.7392299175262451,
1.1741458177566528,
0.6821295619010925,
-0.5658828020095825,
0.19900895655155182,
-0.683670699596405,
0.2845815122127533,
-1.3295289278030396,
0.2925151586532593,
-2.8004000186920166,
0.6099371910095215,
-0.14160189032554626,
-0.09248368442058563,
-0.020574072375893593,
-1.3953224420547485,
1.038699746131897,
2.5465807914733887,
-1.147918701171875,
0.4451850354671478,
0.2888798713684082,
1.1416338682174683,
-1.531959056854248,
0.3119227886199951,
-0.47925612330436707,
2.0838024616241455,
0.22984352707862854,
1.1569815874099731,
-0.4587927460670471,
-2.360245943069458,
0.5405013561248779,
-1.2837212085723877,
-1.1848150491714478,
0.7807137966156006,
-0.8302716612815857,
0.11699728667736053,
-1.3762129545211792,
-0.2264580875635147,
-0.8069926500320435,
-1.1660089492797852,
0.6894948482513428,
0.16616475582122803,
0.3619299829006195,
-0.5574622750282288,
0.3878727853298187,
-2.2321603298187256,
-1.3223716020584106,
-0.2513376474380493,
-0.8983363509178162,
0.5106589794158936,
-0.3390466272830963,
0.6206082701683044,
-0.22238393127918243,
-0.05718600004911423,
0.39634522795677185,
1.4754053354263306,
3.39235520362854,
0.1611851155757904,
0.35094159841537476,
-0.12140902876853943,
-0.9632049798965454,
1.5031999349594116,
0.9797956943511963,
-0.11026591062545776,
-0.614681601524353,
-1.063847303390503,
1.2196871042251587,
1.9358501434326172,
1.046187400817871,
-0.032035522162914276,
-0.8048736453056335,
-0.794234037399292,
-0.05611087381839752,
0.12512822449207306,
0.43050020933151245,
0.951433002948761,
0.1977062076330185,
0.08868655562400818,
1.4307111501693726,
1.2032572031021118,
-0.4183026850223541,
0.3691846430301666,
-0.7795130014419556,
-0.5384402275085449,
0.49216824769973755,
0.3089258670806885,
0.014487961307168007,
0.329409658908844,
-1.0493946075439453,
-0.2825925350189209,
-0.43028923869132996,
-0.9045605659484863,
-0.7922890186309814,
-0.44294002652168274,
-0.42938607931137085,
1.7055280208587646,
0.06330849230289459,
-0.6157732605934143,
-0.053311221301555634,
-0.7587598562240601,
-0.11311790347099304,
-1.0588977336883545,
0.3838790953159332,
-0.08059795200824738,
-0.18004396557807922,
-0.14256301522254944,
1.7200990915298462,
-0.9284052848815918,
-2.1524152755737305,
0.22254244983196259,
0.16999565064907074,
-0.25913935899734497,
0.18782903254032135,
1.5841199159622192,
0.6127181053161621,
1.4743281602859497,
1.3615175485610962,
0.9811260104179382,
-0.6112375855445862,
-1.3748327493667603,
0.7817102074623108,
0.9177538156509399,
-1.4306845664978027,
0.7374595999717712,
-0.03995982185006142,
-0.5787200331687927,
0.6193997859954834,
1.2091270685195923,
0.5713040828704834,
-2.0269010066986084,
0.8214915990829468,
-0.984666109085083,
0.72822505235672,
0.715831995010376,
0.6829162836074829,
0.24208548665046692,
0.8072320222854614,
-1.340309977531433,
-1.1561315059661865,
-0.6586765050888062,
-0.7239002585411072,
1.9707119464874268,
-0.3795536160469055,
0.6717267036437988,
-0.35974568128585815,
-1.376819133758545,
-0.1546936184167862,
0.7231630682945251,
0.30700987577438354,
-0.6093753576278687,
0.7727451324462891,
-0.6259586811065674,
-1.0875344276428223,
-1.331607699394226,
-0.4475212097167969,
-1.104473352432251,
-0.9241725206375122,
0.9990290999412537,
0.7669582366943359,
0.2995363175868988,
1.8440849781036377,
0.6781632900238037,
0.22496505081653595,
-2.608370780944824,
0.8969119191169739,
0.18261417746543884,
-0.10460613667964935,
0.8169651627540588,
0.34718912839889526,
0.9764602780342102,
-0.02841312810778618,
0.5944536924362183,
-2.5087790489196777,
2.3783857822418213,
-0.14170539379119873,
0.6495740413665771,
-0.022684048861265182,
-0.14474791288375854,
1.1219881772994995,
0.6012634634971619,
0.4948180913925171,
-1.0598684549331665,
0.6136929988861084,
-0.600131094455719,
1.2579001188278198,
0.8270244002342224,
-0.8017301559448242,
-0.021786626428365707,
1.3630820512771606,
0.4714542329311371,
-0.5067601799964905,
-0.9358814358711243,
-1.089685320854187,
0.9583122134208679,
1.7716524600982666,
-0.09927807748317719,
0.004005424678325653,
0.8040319085121155,
0.7090193033218384,
-1.2972017526626587,
0.07544393837451935,
-0.672824501991272,
-0.8047670125961304,
1.6513278484344482,
2.055790901184082,
-0.19422826170921326,
-0.1886027604341507,
-0.6398336291313171,
-1.2990381717681885,
0.7660196423530579,
0.01976938173174858,
0.14325357973575592,
0.630699098110199,
-0.5897718667984009,
1.0844496488571167,
0.9348604679107666,
0.9443525075912476,
0.27449119091033936,
0.2587011456489563,
0.35942912101745605,
-0.2848285436630249,
-1.2197641134262085,
-0.19596455991268158,
-1.039833664894104,
-2.6309447288513184,
0.41182151436805725,
-0.25664496421813965,
-1.4706779718399048,
0.0671958327293396,
-1.0495820045471191,
0.849007785320282,
-0.5654475688934326,
-1.136739730834961,
-1.5972023010253906,
0.15997125208377838,
0.03122495487332344,
0.9797052145004272,
-1.59246826171875,
-0.09281432628631592,
1.1996376514434814,
0.8921025991439819,
-0.6466706395149231,
0.9896070957183838,
0.23034635186195374,
1.0268858671188354,
0.8590100407600403,
-0.34181368350982666,
0.6001356244087219,
0.05682723596692085,
-1.3654677867889404,
0.4703666567802429,
1.1593791246414185,
0.1912120133638382,
1.5069407224655151,
-0.5640024542808533,
-0.012027749791741371,
0.4235815107822418,
-0.5352703928947449,
-0.4544832110404968,
-0.5808338522911072,
0.594643235206604,
0.009902959689497948,
-0.9521487951278687,
-0.09198017418384552,
-0.013656968250870705,
-0.24357065558433533,
0.14128746092319489,
-1.405914306640625,
-0.1141766756772995,
-0.4765968918800354,
-0.6650983095169067,
-1.1485533714294434,
-0.07981158792972565,
1.3771336078643799,
-0.7657133936882019,
-0.1460941880941391,
0.5246625542640686,
0.38228076696395874,
0.513416588306427,
0.6640129089355469,
-0.6808943748474121,
-0.34846943616867065,
-0.17475402355194092,
-0.41048258543014526,
0.34218406677246094,
1.3814913034439087,
-0.14761881530284882,
-0.9929368495941162,
0.7322724461555481,
-0.3340720236301422,
0.0696726143360138,
1.9101585149765015,
0.016997620463371277,
-0.8092907667160034,
0.3736029267311096,
-0.7193968892097473,
1.9278024435043335,
1.801788091659546,
1.3104444742202759,
-0.18072929978370667,
-0.9458720088005066,
0.5766918659210205,
-0.34866511821746826,
-0.2976000905036926,
0.9134664535522461,
0.40511801838874817,
-0.2309017926454544,
-1.4270213842391968,
0.7954968214035034,
1.287211537361145,
-0.8517568707466125,
-0.7608556151390076,
0.16194602847099304,
-0.7626917958259583,
1.1125757694244385,
0.614889919757843,
0.33965280652046204,
0.2860029339790344,
1.6124305725097656,
0.7847161889076233,
-0.3540693521499634,
0.61383455991745,
0.5677980184555054,
-0.16292639076709747,
-2.1595704555511475,
-1.2239054441452026,
0.3760647475719452,
-0.6458050012588501,
-1.6000003814697266,
1.3213813304901123,
-1.1355971097946167,
-0.9796016812324524,
0.5310930013656616,
0.03647224232554436,
1.4812184572219849,
0.3948858082294464,
1.5204362869262695,
2.0331859588623047,
0.8903516530990601,
0.37977057695388794,
1.2675981521606445,
-0.11258788406848907,
-0.29591992497444153,
1.7397692203521729,
-0.4468032419681549,
0.40701594948768616,
1.1378846168518066,
-0.2595420181751251,
-1.09612238407135,
-0.7460712194442749,
-1.3174484968185425,
-0.7432215809822083,
1.1710439920425415,
0.07998430728912354,
-1.126729965209961,
0.2936980426311493,
1.4996471405029297,
0.09523220360279083,
-0.25316527485847473,
0.6208754181861877,
0.37104368209838867,
-0.7679895758628845,
-0.08882525563240051,
-0.8645238876342773,
0.5021905899047852,
-0.25985187292099,
-0.3813317120075226,
0.3411072790622711,
0.501397967338562,
1.350456953048706,
-0.0174730084836483,
0.10364729166030884,
1.1476925611495972,
-1.4790548086166382,
1.499691128730774,
-0.6863220930099487,
0.24462735652923584,
-2.3103134632110596,
1.4031784534454346,
-0.711764395236969,
1.939435362815857,
-2.714775323867798,
0.4865277409553528,
-0.4989069998264313,
-0.4990425705909729,
0.34484925866127014,
-0.332943856716156,
0.11852957308292389,
-0.18807727098464966,
-1.09024977684021,
-0.09005039930343628,
-0.640039324760437,
0.648050844669342,
1.091127634048462,
1.4215538501739502,
-1.1121717691421509,
-0.3063138723373413,
-1.6379938125610352,
-0.14449262619018555,
-0.6832795143127441,
0.29853036999702454,
-2.03529953956604,
-0.13582201302051544,
-1.9499799013137817,
-2.415290117263794,
-1.17096745967865,
-0.7449092268943787,
1.1826121807098389,
0.0704016238451004,
-0.8484686613082886,
1.2299422025680542,
-0.40461382269859314,
-1.8387115001678467,
1.0701169967651367,
-2.1452596187591553
] |
https://github.com/huggingface/datasets/issues/4964 | Column of arrays (2D+) are using unreasonably high memory | When you call `colum_value = foo_db[column_name]`, you load the full column in memory.
If you want to avoid filling up your memory, you can access chunks of data instead
```python
embeddings = dataset[i:i + chunk_size]["embeddings"]
``` | ## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4 | 530 | 36 | Column of arrays (2D+) are using unreasonably high memory
## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
When you call `colum_value = foo_db[column_name]`, you load the full column in memory.
If you want to avoid filling up your memory, you can access chunks of data instead
```python
embeddings = dataset[i:i + chunk_size]["embeddings"]
``` | [
-1.267552137374878,
-0.8983005285263062,
-0.6615188121795654,
1.4437391757965088,
-0.18862861394882202,
-1.1924810409545898,
0.19916154444217682,
-1.0601012706756592,
1.7130720615386963,
-0.8129832148551941,
0.3288203477859497,
-1.643703818321228,
0.04448450356721878,
-0.5933412909507751,
-0.7223792672157288,
-0.8725576996803284,
-0.5276463031768799,
-0.7946420311927795,
1.0446902513504028,
2.4021873474121094,
1.2090961933135986,
-1.3654701709747314,
2.701836347579956,
0.7917734980583191,
-0.14524021744728088,
-0.9859811067581177,
0.46953991055488586,
-0.037484992295503616,
-1.4002230167388916,
-0.457142174243927,
-0.9076365232467651,
-0.1616462767124176,
-0.5180582404136658,
-0.6362735033035278,
-0.0575379952788353,
0.37382572889328003,
-0.33092978596687317,
-0.4501437246799469,
-0.48050516843795776,
-0.7619528770446777,
0.5328586101531982,
-0.31444936990737915,
0.8610332012176514,
-0.38347139954566956,
1.7729053497314453,
-0.5150027275085449,
0.4852585792541504,
0.7221972942352295,
1.2946244478225708,
0.21133117377758026,
-0.01685481145977974,
0.4408929944038391,
0.36862778663635254,
0.020228296518325806,
0.6142513155937195,
1.1864842176437378,
0.7255814671516418,
0.4830319285392761,
0.7779606580734253,
-2.1652472019195557,
1.2850172519683838,
-1.0091551542282104,
0.38170066475868225,
1.3761916160583496,
-1.0039689540863037,
0.32606562972068787,
-1.7037193775177002,
-0.060426510870456696,
0.5216999053955078,
-2.1999144554138184,
0.3188590407371521,
-1.3294217586517334,
-0.5036168098449707,
1.0071978569030762,
0.4295043647289276,
-1.1629749536514282,
0.12052598595619202,
-0.4388697147369385,
1.0349136590957642,
0.42095860838890076,
1.1751880645751953,
-1.7105369567871094,
0.018199767917394638,
-0.3512093722820282,
0.07687335461378098,
-1.2365777492523193,
-1.5451990365982056,
0.5962745547294617,
0.6532375812530518,
0.556657612323761,
-0.16178752481937408,
1.0818326473236084,
-1.0472711324691772,
0.7756038904190063,
-1.0508930683135986,
-1.660212516784668,
-1.4093536138534546,
-2.2675421237945557,
-2.2895538806915283,
0.7789050936698914,
-0.4255152940750122,
-0.518004834651947,
2.0995798110961914,
-1.0199612379074097,
-1.7696274518966675,
1.127038836479187,
0.2088911384344101,
-0.1200011819601059,
2.324950933456421,
0.17859512567520142,
-0.7139747142791748,
0.4750293493270874,
-0.785592257976532,
0.7569546699523926,
-0.3216833472251892,
1.3438634872436523,
0.439200758934021,
-1.0846996307373047,
1.6060792207717896,
-0.3970848023891449,
0.5863817930221558,
-0.5745776891708374,
-0.5310486555099487,
-0.7147019505500793,
0.29812484979629517,
1.9917101860046387,
-0.2641119062900543,
1.5343228578567505,
-0.3373243510723114,
-1.5401215553283691,
-1.6085010766983032,
0.8749530911445618,
0.5157920718193054,
-0.7395679354667664,
0.14094646275043488,
-0.3707531988620758,
0.08217800408601761,
-0.005322244018316269,
1.1387746334075928,
1.305771827697754,
0.7321670055389404,
-0.32401925325393677,
-0.8228890299797058,
0.15902230143547058,
-0.09453444927930832,
-0.7679135799407959,
-1.7042930126190186,
-0.37761515378952026,
0.0805136039853096,
0.5762118101119995,
-1.1749926805496216,
1.8063535690307617,
0.9076188206672668,
1.866619348526001,
1.0543040037155151,
-0.3864520788192749,
1.4441841840744019,
0.1279354989528656,
1.8545410633087158,
-0.4566172957420349,
0.7168049812316895,
-0.45077934861183167,
-1.2044428586959839,
0.8873617053031921,
-0.32809916138648987,
-2.110646963119507,
-0.7034711241722107,
-0.7204274535179138,
-0.14975683391094208,
-0.8584780097007751,
0.9890766143798828,
-0.28336620330810547,
-1.3885695934295654,
0.26733002066612244,
-0.8224031329154968,
0.18135805428028107,
-1.1967378854751587,
0.33826014399528503,
0.7541512250900269,
-0.6939606070518494,
0.09469408541917801,
-0.24710562825202942,
-1.2627679109573364,
-0.45354247093200684,
0.2729702293872833,
1.8233439922332764,
-0.7820761799812317,
0.9422602653503418,
1.0609245300292969,
-0.7211737036705017,
-0.04107381030917168,
0.23148760199546814,
-0.2045438140630722,
0.9001790881156921,
-1.081656575202942,
-0.40462014079093933,
1.1768970489501953,
-0.16581475734710693,
-0.5665349960327148,
1.402815818786621,
0.7061695456504822,
-0.9545435309410095,
-0.15138311684131622,
-0.09372726082801819,
-0.9356809854507446,
0.07220707833766937,
-1.5827906131744385,
-0.05093998834490776,
0.5032668113708496,
-1.544810175895691,
-0.4981442391872406,
-0.1323690563440323,
1.3049938678741455,
-0.13033922016620636,
1.4151437282562256,
-0.31958234310150146,
-0.12231414020061493,
-0.3855128586292267,
-0.32597416639328003,
0.1207570880651474,
-0.17265628278255463,
-0.5625099539756775,
0.20013682544231415,
-0.7512010335922241,
0.3278135061264038,
1.428424596786499,
0.3055794835090637,
0.059580523520708084,
0.5264036655426025,
1.1727510690689087,
0.37613338232040405,
-0.127939373254776,
-0.8443465232849121,
-1.5519590377807617,
1.9661914110183716,
-1.4073151350021362,
2.0362772941589355,
0.6868934631347656,
0.0056613897904753685,
-1.766502022743225,
-1.8844151496887207,
1.375606894493103,
1.1471625566482544,
2.3811733722686768,
0.5633083581924438,
0.47401443123817444,
-0.8846055865287781,
-0.65682053565979,
0.37216249108314514,
-1.0182336568832397,
-0.7433339357376099,
0.14943481981754303,
2.3637726306915283,
1.7672895193099976,
-0.42309287190437317,
-0.1583004891872406,
-1.04115891456604,
1.3811198472976685,
-0.2387639731168747,
0.2165873646736145,
1.9567735195159912,
-0.25870227813720703,
-1.1321030855178833,
1.3577982187271118,
-2.3411002159118652,
0.11088939756155014,
1.9650706052780151,
0.3295319378376007,
0.03989748656749725,
-1.3253376483917236,
-0.690923810005188,
-0.2625000774860382,
-0.43099331855773926,
-1.320143461227417,
0.47269490361213684,
-0.2306741178035736,
-0.7122617363929749,
-1.3855701684951782,
0.14019007980823517,
-1.0907822847366333,
-1.6493772268295288,
0.24722972512245178,
1.934693455696106,
1.9624971151351929,
-0.7065779566764832,
1.5823107957839966,
-0.3104299008846283,
0.17707043886184692,
1.2318288087844849,
1.213427186012268,
3.0866901874542236,
1.955906629562378,
-1.2754530906677246,
0.6172012686729431,
-0.13350345194339752,
-0.4877813458442688,
1.179925799369812,
-1.2357813119888306,
1.3374483585357666,
-0.10228662192821503,
-1.2054893970489502,
-1.1554862260818481,
0.9679700136184692,
0.48410162329673767,
0.09350632131099701,
-0.4473908245563507,
1.2076200246810913,
-0.02560463547706604,
1.3534506559371948,
0.6180797219276428,
-0.2800314426422119,
0.6568866968154907,
-0.3686966300010681,
-0.4971666932106018,
1.5227081775665283,
0.2060544639825821,
-1.4087817668914795,
-2.257572650909424,
-0.1878768354654312,
-0.8609552383422852,
0.048197321593761444,
-0.6416685581207275,
-0.9574020504951477,
1.6681087017059326,
0.30354398488998413,
-1.27106773853302,
-0.24188736081123352,
-0.3115321695804596,
-0.6020914316177368,
2.739508628845215,
-1.3772430419921875,
-0.20776967704296112,
-1.026992917060852,
-0.6626569032669067,
1.6433080434799194,
-1.1961373090744019,
-0.2340095192193985,
-0.9990611672401428,
-0.5404991507530212,
-1.1873037815093994,
-0.5154691338539124,
-0.07803326100111008,
-0.9275868535041809,
0.7976086139678955,
0.15005983412265778,
-1.2095284461975098,
-0.3332918584346771,
-0.840502142906189,
0.8645434379577637,
-0.18792402744293213,
0.23378156125545502,
1.8049041032791138,
0.4043554961681366,
-0.3006044030189514,
0.7226226925849915,
1.1487362384796143,
0.684160053730011,
-0.572254478931427,
0.24573245644569397,
-0.6600877642631531,
0.27733463048934937,
-1.355127215385437,
0.2771219313144684,
-2.7986257076263428,
0.6377004981040955,
-0.10543974488973618,
-0.07240753620862961,
-0.0070291198790073395,
-1.389583945274353,
1.0219635963439941,
2.5340943336486816,
-1.1660913228988647,
0.4364234507083893,
0.30011945962905884,
1.150469183921814,
-1.5433613061904907,
0.3097890615463257,
-0.4785209000110626,
2.094440221786499,
0.19640502333641052,
1.1594243049621582,
-0.4485919773578644,
-2.3362319469451904,
0.5538865327835083,
-1.2739388942718506,
-1.1906490325927734,
0.808104932308197,
-0.8627365231513977,
0.10596203804016113,
-1.3569583892822266,
-0.23843486607074738,
-0.8273479342460632,
-1.1613752841949463,
0.6948243379592896,
0.17231415212154388,
0.35734984278678894,
-0.5469565987586975,
0.36788615584373474,
-2.212761402130127,
-1.3253936767578125,
-0.2297651767730713,
-0.9211705923080444,
0.5054640173912048,
-0.32646217942237854,
0.6310297846794128,
-0.19554020464420319,
-0.07364791631698608,
0.40906259417533875,
1.465126872062683,
3.391568660736084,
0.14857217669487,
0.3520946800708771,
-0.14417433738708496,
-0.9528751373291016,
1.4989737272262573,
0.9788160920143127,
-0.1144518256187439,
-0.6010268926620483,
-1.0657929182052612,
1.2123090028762817,
1.9540938138961792,
1.0634104013442993,
-0.017983924597501755,
-0.8274113535881042,
-0.806084156036377,
-0.03711296617984772,
0.13019075989723206,
0.4469614028930664,
0.9160251021385193,
0.20059695839881897,
0.0853307917714119,
1.4052523374557495,
1.1780892610549927,
-0.42188435792922974,
0.39395034313201904,
-0.7959028482437134,
-0.5233262181282043,
0.4898454248905182,
0.31338170170783997,
0.036071937531232834,
0.30058908462524414,
-1.0438427925109863,
-0.2780127227306366,
-0.4155348837375641,
-0.8837892413139343,
-0.8045555949211121,
-0.44888368248939514,
-0.42486855387687683,
1.698500633239746,
0.04042372107505798,
-0.6131622195243835,
-0.05145123600959778,
-0.7728503942489624,
-0.11851780116558075,
-1.0453230142593384,
0.39342358708381653,
-0.0888083204627037,
-0.16303449869155884,
-0.12664753198623657,
1.7145788669586182,
-0.952730655670166,
-2.1567842960357666,
0.23897197842597961,
0.1783631145954132,
-0.27892789244651794,
0.18442051112651825,
1.5767145156860352,
0.6216330528259277,
1.439339518547058,
1.378589153289795,
0.9701620936393738,
-0.633872926235199,
-1.3713926076889038,
0.7569105625152588,
0.9528067111968994,
-1.4432361125946045,
0.7505186200141907,
-0.03700960800051689,
-0.5687676668167114,
0.6254496574401855,
1.243468999862671,
0.5625369548797607,
-2.0396041870117188,
0.8385198712348938,
-0.9484256505966187,
0.7308731079101562,
0.7260267734527588,
0.6797828078269958,
0.2372622787952423,
0.8083063364028931,
-1.3402036428451538,
-1.1576597690582275,
-0.6499007344245911,
-0.7420584559440613,
1.93958580493927,
-0.35684457421302795,
0.6543048620223999,
-0.3220660090446472,
-1.3756262063980103,
-0.18356111645698547,
0.7342496514320374,
0.32348838448524475,
-0.605766236782074,
0.7747535109519958,
-0.6308668851852417,
-1.0695738792419434,
-1.351043701171875,
-0.46362659335136414,
-1.087483525276184,
-0.9291229844093323,
0.9891484379768372,
0.7781922817230225,
0.32897141575813293,
1.8287711143493652,
0.6599184274673462,
0.20303794741630554,
-2.608499050140381,
0.8908994793891907,
0.19678832590579987,
-0.11241519451141357,
0.820888102054596,
0.34475433826446533,
0.9597594738006592,
-0.0286775641143322,
0.5949271321296692,
-2.4990124702453613,
2.377657651901245,
-0.16949254274368286,
0.6331065893173218,
-0.028569091111421585,
-0.15616558492183685,
1.077332615852356,
0.579838752746582,
0.49475741386413574,
-1.0619285106658936,
0.6055272817611694,
-0.5898571014404297,
1.2625033855438232,
0.8010920882225037,
-0.8265631198883057,
-0.019070278853178024,
1.3528313636779785,
0.4558679461479187,
-0.506737232208252,
-0.9252653121948242,
-1.0654866695404053,
0.9388372302055359,
1.7625919580459595,
-0.09043946117162704,
0.00017970707267522812,
0.847554624080658,
0.6753157377243042,
-1.3115278482437134,
0.086074598133564,
-0.6776977181434631,
-0.8260132670402527,
1.6396795511245728,
2.076021194458008,
-0.17474614083766937,
-0.18857170641422272,
-0.6815402507781982,
-1.272107481956482,
0.7886598706245422,
0.005010505206882954,
0.13562777638435364,
0.641681969165802,
-0.6089276671409607,
1.090305209159851,
0.9306398034095764,
0.9210650324821472,
0.2737746238708496,
0.2632153630256653,
0.3768441081047058,
-0.2833046317100525,
-1.206569790840149,
-0.21737456321716309,
-1.0164679288864136,
-2.618508815765381,
0.4189261496067047,
-0.23058806359767914,
-1.4401646852493286,
0.0444478802382946,
-1.046899676322937,
0.83751380443573,
-0.5836174488067627,
-1.1203022003173828,
-1.5874664783477783,
0.1581486463546753,
0.031042322516441345,
0.9656243920326233,
-1.5961706638336182,
-0.11041872203350067,
1.198610544204712,
0.9058750867843628,
-0.6639509201049805,
0.9794379472732544,
0.22105605900287628,
1.0244070291519165,
0.8778136372566223,
-0.3639306128025055,
0.5746756792068481,
0.02860211208462715,
-1.365042805671692,
0.47156065702438354,
1.1702574491500854,
0.1758638471364975,
1.5167373418807983,
-0.5767219066619873,
-0.013130061328411102,
0.4103316068649292,
-0.5120863318443298,
-0.4516993761062622,
-0.6146629452705383,
0.6009106636047363,
0.05068625882267952,
-0.9401127696037292,
-0.06907135248184204,
-0.010245874524116516,
-0.20158234238624573,
0.1406044214963913,
-1.4097882509231567,
-0.11995510011911392,
-0.4407036602497101,
-0.6791191697120667,
-1.1332385540008545,
-0.07933711260557175,
1.3627914190292358,
-0.7608839869499207,
-0.14073394238948822,
0.5183329582214355,
0.36804282665252686,
0.514825701713562,
0.6490305066108704,
-0.6801946759223938,
-0.371105432510376,
-0.19901485741138458,
-0.38895854353904724,
0.32521188259124756,
1.3844833374023438,
-0.11847418546676636,
-0.9771965146064758,
0.7184005379676819,
-0.3447376787662506,
0.06772308796644211,
1.9326521158218384,
0.02832351252436638,
-0.8251447081565857,
0.33742114901542664,
-0.7162193655967712,
1.9351595640182495,
1.7876167297363281,
1.33342444896698,
-0.17627155780792236,
-0.9634415507316589,
0.6081364750862122,
-0.3703644573688507,
-0.3175030052661896,
0.9149549603462219,
0.3961011469364166,
-0.2326127290725708,
-1.4272044897079468,
0.8050768375396729,
1.3030925989151,
-0.8690457344055176,
-0.7579243779182434,
0.14270856976509094,
-0.7486693263053894,
1.0753474235534668,
0.6324043273925781,
0.32813122868537903,
0.3039293885231018,
1.5779708623886108,
0.7898588180541992,
-0.3366679251194,
0.600034236907959,
0.5466954112052917,
-0.14034989476203918,
-2.161454200744629,
-1.2508665323257446,
0.39452531933784485,
-0.6237884163856506,
-1.620125651359558,
1.3397570848464966,
-1.141860842704773,
-0.9788160920143127,
0.5312298536300659,
0.02619437500834465,
1.476256012916565,
0.38075342774391174,
1.5335767269134521,
2.0322227478027344,
0.8775889873504639,
0.3464176058769226,
1.2784281969070435,
-0.12799662351608276,
-0.3349747061729431,
1.749411702156067,
-0.47307926416397095,
0.4119526743888855,
1.1111338138580322,
-0.25129130482673645,
-1.0899758338928223,
-0.7579736113548279,
-1.3340044021606445,
-0.7116395831108093,
1.163393497467041,
0.06843584030866623,
-1.1247923374176025,
0.2758733928203583,
1.5286188125610352,
0.08735015243291855,
-0.2937767207622528,
0.6449750065803528,
0.34096771478652954,
-0.8029100298881531,
-0.07826622575521469,
-0.8906846046447754,
0.527210533618927,
-0.22291213274002075,
-0.37591612339019775,
0.3575007915496826,
0.490140438079834,
1.348634958267212,
-0.019150134176015854,
0.10235106199979782,
1.1508262157440186,
-1.4380152225494385,
1.4751251935958862,
-0.7164014577865601,
0.26210129261016846,
-2.3136866092681885,
1.4357290267944336,
-0.7179118394851685,
1.905319333076477,
-2.6952688694000244,
0.48887020349502563,
-0.49327513575553894,
-0.49557003378868103,
0.3554195761680603,
-0.3121704161167145,
0.14660939574241638,
-0.1938530057668686,
-1.106308102607727,
-0.09892954677343369,
-0.6834309697151184,
0.6232947111129761,
1.0853561162948608,
1.420069694519043,
-1.116117000579834,
-0.2733423709869385,
-1.6569349765777588,
-0.14833030104637146,
-0.680823802947998,
0.3144705593585968,
-2.0545921325683594,
-0.156768798828125,
-1.9400403499603271,
-2.4275853633880615,
-1.170243263244629,
-0.7410233616828918,
1.1875590085983276,
0.054441239684820175,
-0.8496221899986267,
1.2284257411956787,
-0.4032192528247833,
-1.8389191627502441,
1.0462716817855835,
-2.135340690612793
] |
https://github.com/huggingface/datasets/issues/4964 | Column of arrays (2D+) are using unreasonably high memory | @lhoestq yeah that's intentional, i.e. i really want to load the whole column into the memory. but as said above there's an unreasonable amount of overhead for the memory. the np array itself is using about 1G of memory:
```
>>> getsizeof(data)/1024/1024
937.5001525878906
```
that accessing of column above is using 10x memory compared to the original numpy array. | ## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4 | 530 | 59 | Column of arrays (2D+) are using unreasonably high memory
## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
@lhoestq yeah that's intentional, i.e. i really want to load the whole column into the memory. but as said above there's an unreasonable amount of overhead for the memory. the np array itself is using about 1G of memory:
```
>>> getsizeof(data)/1024/1024
937.5001525878906
```
that accessing of column above is using 10x memory compared to the original numpy array. | [
-1.2894636392593384,
-0.9190853238105774,
-0.6539430022239685,
1.41818106174469,
-0.18156881630420685,
-1.186705470085144,
0.21041493117809296,
-1.041393518447876,
1.6718565225601196,
-0.7860320210456848,
0.32317280769348145,
-1.6578565835952759,
0.026557639241218567,
-0.580013632774353,
-0.7285809516906738,
-0.8679431676864624,
-0.5287589430809021,
-0.7938281893730164,
1.0279078483581543,
2.441157817840576,
1.2229526042938232,
-1.364395260810852,
2.700915813446045,
0.7848917841911316,
-0.16894547641277313,
-1.007079839706421,
0.4553421139717102,
-0.03091147169470787,
-1.3992825746536255,
-0.4563818871974945,
-0.9252443313598633,
-0.13356180489063263,
-0.5316919088363647,
-0.6487092971801758,
-0.01444551907479763,
0.3725220561027527,
-0.30390918254852295,
-0.4576319456100464,
-0.49028563499450684,
-0.740557849407196,
0.53294837474823,
-0.33099138736724854,
0.8523510694503784,
-0.3439943790435791,
1.7613047361373901,
-0.5037938356399536,
0.483076810836792,
0.7204863429069519,
1.3281631469726562,
0.22297102212905884,
-0.028260575607419014,
0.43971800804138184,
0.3683094382286072,
0.042638663202524185,
0.5681129097938538,
1.1900200843811035,
0.7385738492012024,
0.4410799741744995,
0.7646734714508057,
-2.170454502105713,
1.2929468154907227,
-1.0093196630477905,
0.394296258687973,
1.3693867921829224,
-1.026495099067688,
0.36935046315193176,
-1.7315492630004883,
-0.041264116764068604,
0.48954901099205017,
-2.206960916519165,
0.2863529622554779,
-1.3187956809997559,
-0.47787004709243774,
0.9893214106559753,
0.40277600288391113,
-1.1741058826446533,
0.11183173954486847,
-0.4591253101825714,
1.0001124143600464,
0.4333343207836151,
1.2022920846939087,
-1.7266089916229248,
-0.004186179488897324,
-0.3442550301551819,
0.10402768850326538,
-1.2176822423934937,
-1.553778052330017,
0.6057650446891785,
0.6723790764808655,
0.5525544285774231,
-0.16566666960716248,
1.065683126449585,
-1.036527395248413,
0.773585319519043,
-1.0244983434677124,
-1.671702265739441,
-1.4160847663879395,
-2.2474234104156494,
-2.2980334758758545,
0.7577729225158691,
-0.415107786655426,
-0.5397529006004333,
2.113025665283203,
-1.0032262802124023,
-1.8040541410446167,
1.1174442768096924,
0.20417611300945282,
-0.13971489667892456,
2.336601972579956,
0.18280890583992004,
-0.708882212638855,
0.45971956849098206,
-0.7824398279190063,
0.7687353491783142,
-0.3646191954612732,
1.3556324243545532,
0.4470062851905823,
-1.0502948760986328,
1.594822883605957,
-0.3652208149433136,
0.5485725998878479,
-0.5830264091491699,
-0.5186794400215149,
-0.7188760638237,
0.29744142293930054,
1.999028205871582,
-0.25945529341697693,
1.5201010704040527,
-0.3374048173427582,
-1.5575674772262573,
-1.6075798273086548,
0.895450234413147,
0.5359085202217102,
-0.7481883764266968,
0.15767589211463928,
-0.4052598476409912,
0.09827294945716858,
-0.00015054550021886826,
1.1011637449264526,
1.3072152137756348,
0.7361502647399902,
-0.3147190809249878,
-0.8679444193840027,
0.16108094155788422,
-0.092214435338974,
-0.7459068894386292,
-1.6981892585754395,
-0.384085088968277,
0.05519700422883034,
0.5906415581703186,
-1.1879515647888184,
1.7895351648330688,
0.9098461270332336,
1.8403981924057007,
1.0267877578735352,
-0.3645893335342407,
1.479702353477478,
0.13362333178520203,
1.8463258743286133,
-0.4787742793560028,
0.721727728843689,
-0.47274625301361084,
-1.2069945335388184,
0.8683415055274963,
-0.31861838698387146,
-2.103937864303589,
-0.7073436975479126,
-0.7489249110221863,
-0.1633773148059845,
-0.8568492531776428,
0.9723458886146545,
-0.2717815935611725,
-1.3543676137924194,
0.2892557978630066,
-0.7974913120269775,
0.1888778656721115,
-1.2237868309020996,
0.3471625745296478,
0.7615188360214233,
-0.6882142424583435,
0.11597341299057007,
-0.2526637315750122,
-1.2631860971450806,
-0.4623907506465912,
0.27116432785987854,
1.840110421180725,
-0.7985461354255676,
0.9472611546516418,
1.0300054550170898,
-0.7250117659568787,
-0.02530132234096527,
0.24734246730804443,
-0.1778130978345871,
0.9215545654296875,
-1.0854978561401367,
-0.3885413706302643,
1.1796826124191284,
-0.19160297513008118,
-0.5401783585548401,
1.4152905941009521,
0.6858917474746704,
-0.9510378241539001,
-0.1658651977777481,
-0.08613376319408417,
-0.9407894611358643,
0.06317529082298279,
-1.608498454093933,
-0.05509583279490471,
0.47828683257102966,
-1.5539709329605103,
-0.520858883857727,
-0.1678161919116974,
1.2965564727783203,
-0.08541834354400635,
1.416746735572815,
-0.3215659558773041,
-0.11534184217453003,
-0.3938988447189331,
-0.3252967298030853,
0.12914316356182098,
-0.20019632577896118,
-0.5456463694572449,
0.21177929639816284,
-0.7796539068222046,
0.34285789728164673,
1.4465712308883667,
0.32554394006729126,
0.054886240512132645,
0.5460488200187683,
1.1587636470794678,
0.3769109845161438,
-0.12501801550388336,
-0.8437237739562988,
-1.5350421667099,
1.9788339138031006,
-1.4123039245605469,
1.9940226078033447,
0.7077355980873108,
0.019450049847364426,
-1.7428621053695679,
-1.8608908653259277,
1.3481863737106323,
1.1449172496795654,
2.385237455368042,
0.5793511271476746,
0.4624274969100952,
-0.864761233329773,
-0.6509581208229065,
0.380123496055603,
-1.0421278476715088,
-0.7634894847869873,
0.15301913022994995,
2.374364137649536,
1.761838436126709,
-0.41993433237075806,
-0.16765820980072021,
-1.0599695444107056,
1.3562818765640259,
-0.22062237560749054,
0.19736060500144958,
1.95753812789917,
-0.28891393542289734,
-1.133695125579834,
1.35958993434906,
-2.342061996459961,
0.12332567572593689,
1.9647127389907837,
0.33850201964378357,
0.027223393321037292,
-1.3477619886398315,
-0.7119722962379456,
-0.25104427337646484,
-0.41743797063827515,
-1.3125877380371094,
0.506280779838562,
-0.22469718754291534,
-0.7290549874305725,
-1.4104697704315186,
0.12011805176734924,
-1.0983964204788208,
-1.661770224571228,
0.2470722794532776,
1.9233494997024536,
1.9570671319961548,
-0.6965180039405823,
1.5414221286773682,
-0.2885531485080719,
0.17591768503189087,
1.2431336641311646,
1.1894012689590454,
3.1019835472106934,
1.9764283895492554,
-1.2576435804367065,
0.6297053694725037,
-0.13737323880195618,
-0.4648786187171936,
1.149047613143921,
-1.2419244050979614,
1.3007490634918213,
-0.10714825987815857,
-1.2195618152618408,
-1.1640253067016602,
0.997782826423645,
0.44573554396629333,
0.0678163468837738,
-0.4391809403896332,
1.2096856832504272,
-0.0205227080732584,
1.3854167461395264,
0.6052538156509399,
-0.2671366333961487,
0.6841986775398254,
-0.37671342492103577,
-0.4904631972312927,
1.5369465351104736,
0.22676095366477966,
-1.4144479036331177,
-2.2549021244049072,
-0.21391527354717255,
-0.822199821472168,
0.05879811570048332,
-0.6403863430023193,
-0.9712845087051392,
1.65833580493927,
0.3058241009712219,
-1.263461709022522,
-0.26044851541519165,
-0.319411963224411,
-0.5995215773582458,
2.698239803314209,
-1.4117075204849243,
-0.2343284785747528,
-1.0254288911819458,
-0.6531045436859131,
1.6204396486282349,
-1.1982182264328003,
-0.22501464188098907,
-0.989356279373169,
-0.5521578788757324,
-1.1975679397583008,
-0.5379410982131958,
-0.10577704012393951,
-0.9369100332260132,
0.7871800661087036,
0.1604900360107422,
-1.1895133256912231,
-0.28274184465408325,
-0.8265983462333679,
0.8544003963470459,
-0.1609559953212738,
0.24206221103668213,
1.8177423477172852,
0.43578919768333435,
-0.30871620774269104,
0.7353392243385315,
1.1441255807876587,
0.6818377375602722,
-0.5647923946380615,
0.21010038256645203,
-0.6661982536315918,
0.28335341811180115,
-1.3128204345703125,
0.30682483315467834,
-2.7914552688598633,
0.6363102197647095,
-0.13840000331401825,
-0.047054920345544815,
-0.014003949239850044,
-1.388102650642395,
1.0347257852554321,
2.546635866165161,
-1.1389820575714111,
0.45896226167678833,
0.30074965953826904,
1.1483999490737915,
-1.5397906303405762,
0.2990413010120392,
-0.4579675793647766,
2.12304425239563,
0.20133712887763977,
1.1624486446380615,
-0.4511895477771759,
-2.3399081230163574,
0.549095869064331,
-1.2863483428955078,
-1.2080309391021729,
0.7765769958496094,
-0.8313188552856445,
0.06241382285952568,
-1.3667644262313843,
-0.22598084807395935,
-0.8056038022041321,
-1.1637592315673828,
0.7155413031578064,
0.16066157817840576,
0.3676689565181732,
-0.5809298157691956,
0.3746747374534607,
-2.1978225708007812,
-1.3259449005126953,
-0.2518760859966278,
-0.9153197407722473,
0.4793996512889862,
-0.3244114816188812,
0.6479007601737976,
-0.22309610247612,
-0.03656876087188721,
0.39112168550491333,
1.4561045169830322,
3.374248743057251,
0.1267056167125702,
0.34211400151252747,
-0.11599807441234589,
-0.9456093907356262,
1.5047259330749512,
0.986818253993988,
-0.15066608786582947,
-0.6166076064109802,
-1.081279993057251,
1.222312092781067,
1.946537971496582,
1.0424537658691406,
-0.01021904032677412,
-0.8058719635009766,
-0.7956698536872864,
-0.05682257562875748,
0.12394975125789642,
0.4463828206062317,
0.9299078583717346,
0.1801219880580902,
0.10510383546352386,
1.4372611045837402,
1.2202359437942505,
-0.41295191645622253,
0.3648906946182251,
-0.7904430627822876,
-0.5445562601089478,
0.4807070195674896,
0.3352905213832855,
0.013472642749547958,
0.2948019206523895,
-1.0485461950302124,
-0.24801543354988098,
-0.40523669123649597,
-0.9122899770736694,
-0.8098311424255371,
-0.42435431480407715,
-0.41184717416763306,
1.7084925174713135,
0.07743024826049805,
-0.6112682223320007,
-0.07712019979953766,
-0.7616373300552368,
-0.1235036700963974,
-1.0363050699234009,
0.4043835997581482,
-0.10363958775997162,
-0.15178950130939484,
-0.12100708484649658,
1.7056668996810913,
-0.9411672949790955,
-2.1622750759124756,
0.24910801649093628,
0.15284651517868042,
-0.3089797794818878,
0.19327551126480103,
1.5823055505752563,
0.6309241056442261,
1.4741437435150146,
1.3934972286224365,
0.9624325633049011,
-0.6163892149925232,
-1.336535096168518,
0.7348395586013794,
0.9131719470024109,
-1.436471700668335,
0.7275208234786987,
-0.006385492160916328,
-0.5673880577087402,
0.6207111477851868,
1.2280980348587036,
0.5497480630874634,
-2.0458366870880127,
0.8580594658851624,
-0.942583441734314,
0.7191559076309204,
0.7141927480697632,
0.7140409350395203,
0.22792816162109375,
0.8015754222869873,
-1.3197165727615356,
-1.1596442461013794,
-0.6740880012512207,
-0.7128567099571228,
1.98577082157135,
-0.3610519468784332,
0.6164944767951965,
-0.32092270255088806,
-1.3917475938796997,
-0.18907558917999268,
0.7093839645385742,
0.30705398321151733,
-0.5817084908485413,
0.747002124786377,
-0.6170221567153931,
-1.1070188283920288,
-1.3348850011825562,
-0.4796990752220154,
-1.0699609518051147,
-0.9418805241584778,
1.0018773078918457,
0.7838834524154663,
0.3316027820110321,
1.843450665473938,
0.6360337138175964,
0.17836837470531464,
-2.629760265350342,
0.8828317523002625,
0.22008992731571198,
-0.11155958473682404,
0.8563129305839539,
0.31724119186401367,
0.9530331492424011,
-0.039391934871673584,
0.5987483859062195,
-2.4709126949310303,
2.3557698726654053,
-0.16761144995689392,
0.6843369603157043,
-0.01266669761389494,
-0.1255253553390503,
1.0910422801971436,
0.5617764592170715,
0.5567852258682251,
-1.0713093280792236,
0.6452136635780334,
-0.6169366836547852,
1.2551543712615967,
0.8143084645271301,
-0.8292074203491211,
-0.014644213020801544,
1.37362539768219,
0.4792642295360565,
-0.5071443915367126,
-0.9342612624168396,
-1.0742758512496948,
0.935813307762146,
1.8190871477127075,
-0.09643533825874329,
0.019488776102662086,
0.8288520574569702,
0.6740795373916626,
-1.3132140636444092,
0.04761213809251785,
-0.6900312304496765,
-0.794376790523529,
1.6562405824661255,
2.06773042678833,
-0.1639854907989502,
-0.23160716891288757,
-0.6589432954788208,
-1.3131766319274902,
0.7874267101287842,
0.0390821173787117,
0.14037685096263885,
0.6686643958091736,
-0.5865333676338196,
1.1147818565368652,
0.9038177132606506,
0.9424659013748169,
0.2578983008861542,
0.27463290095329285,
0.3547450006008148,
-0.26890525221824646,
-1.2085691690444946,
-0.21174706518650055,
-1.0341992378234863,
-2.579721689224243,
0.45691806077957153,
-0.23714123666286469,
-1.4342625141143799,
0.03985901549458504,
-1.0259793996810913,
0.8357624411582947,
-0.5835962295532227,
-1.1465965509414673,
-1.5754597187042236,
0.15354102849960327,
-0.00519561767578125,
0.933604896068573,
-1.5949697494506836,
-0.08823701739311218,
1.22483491897583,
0.9393629431724548,
-0.6384321451187134,
0.9756773114204407,
0.25694847106933594,
0.995918869972229,
0.885619044303894,
-0.3490848243236542,
0.5710901618003845,
0.04253510385751724,
-1.3549054861068726,
0.4631243348121643,
1.158349871635437,
0.15822213888168335,
1.527372121810913,
-0.6088941693305969,
-0.046007316559553146,
0.4268139898777008,
-0.500073254108429,
-0.4382030665874481,
-0.6058492660522461,
0.6243931651115417,
0.021261682733893394,
-0.9386260509490967,
-0.06930812448263168,
-0.039567284286022186,
-0.18341833353042603,
0.1557513177394867,
-1.4167271852493286,
-0.08266106247901917,
-0.4536829888820648,
-0.6630848050117493,
-1.1447678804397583,
-0.0747639387845993,
1.3760567903518677,
-0.7891921401023865,
-0.1588931828737259,
0.5035843253135681,
0.37460288405418396,
0.5114690661430359,
0.6481348872184753,
-0.6724510192871094,
-0.39768677949905396,
-0.1877969354391098,
-0.4074416756629944,
0.33135515451431274,
1.35552978515625,
-0.13258351385593414,
-1.0306341648101807,
0.7369459867477417,
-0.35128018260002136,
0.07935677468776703,
1.90342378616333,
0.015535561367869377,
-0.8149590492248535,
0.3355863392353058,
-0.7176349759101868,
1.9329081773757935,
1.7879302501678467,
1.3296291828155518,
-0.18949343264102936,
-0.9756039381027222,
0.6064487099647522,
-0.3374105989933014,
-0.30810630321502686,
0.9103974103927612,
0.4489317834377289,
-0.22277534008026123,
-1.4194353818893433,
0.7584591507911682,
1.282339096069336,
-0.8848655223846436,
-0.7406676411628723,
0.12488764524459839,
-0.7675352096557617,
1.0842472314834595,
0.6404439806938171,
0.32800477743148804,
0.24667885899543762,
1.6316301822662354,
0.7637396454811096,
-0.35985684394836426,
0.6001295447349548,
0.532333493232727,
-0.1596822291612625,
-2.1660799980163574,
-1.2279937267303467,
0.37089604139328003,
-0.5893666744232178,
-1.6189600229263306,
1.3084412813186646,
-1.1229430437088013,
-0.9607545733451843,
0.5057344436645508,
0.04361797869205475,
1.5079644918441772,
0.35434508323669434,
1.56171715259552,
2.043736457824707,
0.9032524824142456,
0.3609910309314728,
1.2857487201690674,
-0.11491113901138306,
-0.3236929476261139,
1.7383575439453125,
-0.4384857714176178,
0.42019620537757874,
1.1509058475494385,
-0.2578130066394806,
-1.1009653806686401,
-0.7538555860519409,
-1.3165342807769775,
-0.7178437113761902,
1.1626416444778442,
0.10028363764286041,
-1.1416752338409424,
0.29467955231666565,
1.5223963260650635,
0.113086998462677,
-0.27284741401672363,
0.6123999953269958,
0.3734738826751709,
-0.773208498954773,
-0.08153416216373444,
-0.8759579658508301,
0.5071041584014893,
-0.237998366355896,
-0.38983362913131714,
0.3379748463630676,
0.45153287053108215,
1.3506550788879395,
-0.001624302938580513,
0.07884125411510468,
1.17733895778656,
-1.461179256439209,
1.494475245475769,
-0.692244291305542,
0.22570350766181946,
-2.2884459495544434,
1.4225343465805054,
-0.7679322957992554,
1.9086467027664185,
-2.6985273361206055,
0.4690776765346527,
-0.49746808409690857,
-0.4679190516471863,
0.33247220516204834,
-0.3261354863643646,
0.120247021317482,
-0.18434377014636993,
-1.103466272354126,
-0.10750898718833923,
-0.6511480212211609,
0.638504147529602,
1.0946502685546875,
1.4044126272201538,
-1.1088248491287231,
-0.2643466293811798,
-1.6531747579574585,
-0.1793491095304489,
-0.6751682162284851,
0.33204278349876404,
-2.021393299102783,
-0.15401236712932587,
-1.9419454336166382,
-2.4258885383605957,
-1.1891891956329346,
-0.7400708794593811,
1.1526644229888916,
0.06332316994667053,
-0.8380500078201294,
1.1965469121932983,
-0.3927405774593353,
-1.8419348001480103,
1.0722858905792236,
-2.1650328636169434
] |
https://github.com/huggingface/datasets/issues/4964 | Column of arrays (2D+) are using unreasonably high memory | The dataset must be twice as big because we use regular arrow ListArray under the hood and not FixedSizeListArray. Basically we store unnecessary offsets.
And this should affect performance as well. When we developed this, FixedSizeListArray still had some issues but they should be resolved on the PyArrow side now | ## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4 | 530 | 50 | Column of arrays (2D+) are using unreasonably high memory
## Describe the bug
When trying to store `Array2D, Array3D, etc` as column values in a dataset, accessing that column (or creating depending on how you create it, see code below) will cause more than 10 fold of memory usage.
## Steps to reproduce the bug
```python
from datasets import Dataset, Features, Array2D, Array3D
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data}, features=Features({column_name: Array3D(shape=array_shape, dtype="float64")}))
```
the code above will use about 10Gb of RAM while constructing the `dataset` object.
The code below will use roughly the same amount of memory (and time) when trying to actually access the data itself of that column.
```python
from datasets import Dataset
import numpy as np
column_name = "a"
array_shape = (64, 64, 3)
data = np.random.random((10000,) + array_shape)
dataset = Dataset.from_dict({column_name: data})
dataset[column_name]
```
## Expected results
Some memory overhead, but not like as it is now and certainly not an overhead of such runtime that is currently happening.
## Actual results
Enormous memory- and runtime overhead.
## Environment info
- `datasets` version: 2.3.2
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
The dataset must be twice as big because we use regular arrow ListArray under the hood and not FixedSizeListArray. Basically we store unnecessary offsets.
And this should affect performance as well. When we developed this, FixedSizeListArray still had some issues but they should be resolved on the PyArrow side now | [
-1.2754237651824951,
-0.9282872676849365,
-0.6582369208335876,
1.4238660335540771,
-0.19320303201675415,
-1.2185300588607788,
0.1608784943819046,
-1.0488041639328003,
1.6745717525482178,
-0.8396340012550354,
0.30636900663375854,
-1.6451749801635742,
0.05371898040175438,
-0.5499829649925232,
-0.7173651456832886,
-0.8700363039970398,
-0.5175126791000366,
-0.7912065982818604,
1.061217188835144,
2.4318621158599854,
1.2117195129394531,
-1.3874341249465942,
2.71645188331604,
0.7915847897529602,
-0.18015064299106598,
-0.9986764788627625,
0.47767382860183716,
-0.051384422928094864,
-1.4347176551818848,
-0.4926855266094208,
-0.9093633890151978,
-0.1276107132434845,
-0.486141562461853,
-0.6104962229728699,
-0.033945873379707336,
0.34165504574775696,
-0.2958463132381439,
-0.4425017237663269,
-0.49298155307769775,
-0.7483363151550293,
0.5394801497459412,
-0.317527174949646,
0.8492569923400879,
-0.3490046560764313,
1.7721037864685059,
-0.5096973776817322,
0.4807189404964447,
0.6984730958938599,
1.3069181442260742,
0.24738337099552155,
-0.054201122373342514,
0.43199819326400757,
0.3732418715953827,
0.036135800182819366,
0.5805322527885437,
1.1654014587402344,
0.7211213111877441,
0.43279775977134705,
0.7603450417518616,
-2.1360435485839844,
1.2920458316802979,
-1.0325267314910889,
0.38800421357154846,
1.3670717477798462,
-0.9988594651222229,
0.34468233585357666,
-1.6892495155334473,
-0.07149393856525421,
0.5019358992576599,
-2.2045981884002686,
0.3018171489238739,
-1.3346346616744995,
-0.48559728264808655,
1.0194202661514282,
0.4037230610847473,
-1.16154944896698,
0.10505595803260803,
-0.47164589166641235,
1.0101726055145264,
0.44619277119636536,
1.1634938716888428,
-1.6985666751861572,
-0.006735984236001968,
-0.33976203203201294,
0.07790015637874603,
-1.2656335830688477,
-1.573950171470642,
0.6003278493881226,
0.6713953614234924,
0.5270252227783203,
-0.12676216661930084,
1.076579213142395,
-1.0526611804962158,
0.7704671025276184,
-1.028484582901001,
-1.6505661010742188,
-1.4186910390853882,
-2.268094778060913,
-2.2769763469696045,
0.7818670272827148,
-0.4348037540912628,
-0.5341323018074036,
2.085414171218872,
-1.0338414907455444,
-1.7864879369735718,
1.1528453826904297,
0.2026987075805664,
-0.11142922937870026,
2.3474526405334473,
0.19934828579425812,
-0.7076001167297363,
0.48546525835990906,
-0.7850695252418518,
0.7611862421035767,
-0.37819042801856995,
1.3167898654937744,
0.46178171038627625,
-1.0653821229934692,
1.583662748336792,
-0.3839475214481354,
0.544213056564331,
-0.5788109302520752,
-0.522973358631134,
-0.7352572679519653,
0.3065139055252075,
1.9976571798324585,
-0.2760584354400635,
1.5151417255401611,
-0.3462773859500885,
-1.5584006309509277,
-1.6044992208480835,
0.8926693201065063,
0.526809811592102,
-0.7390244603157043,
0.12503857910633087,
-0.37327805161476135,
0.06314808130264282,
-0.00293422257527709,
1.1070547103881836,
1.302912950515747,
0.7147795557975769,
-0.3309142589569092,
-0.8434724807739258,
0.1586826741695404,
-0.12510953843593597,
-0.74677973985672,
-1.6966668367385864,
-0.37339502573013306,
0.05513506010174751,
0.5747950077056885,
-1.1774944067001343,
1.7921638488769531,
0.9447449445724487,
1.8462001085281372,
1.045247197151184,
-0.3633248209953308,
1.4588921070098877,
0.1237274706363678,
1.8634063005447388,
-0.4706791341304779,
0.7368772029876709,
-0.457334041595459,
-1.197037935256958,
0.8766841888427734,
-0.32095709443092346,
-2.1003353595733643,
-0.6823542714118958,
-0.7235324382781982,
-0.18493682146072388,
-0.8534398078918457,
1.011193871498108,
-0.2765725553035736,
-1.358655571937561,
0.2505929470062256,
-0.8232067227363586,
0.18650147318840027,
-1.2083359956741333,
0.3435278832912445,
0.7780583500862122,
-0.6903298497200012,
0.09804965555667877,
-0.2245567888021469,
-1.2571028470993042,
-0.4426322877407074,
0.2767338156700134,
1.8281910419464111,
-0.8034017086029053,
0.9393771290779114,
1.0460108518600464,
-0.7286019921302795,
-0.023191381245851517,
0.25014543533325195,
-0.21931865811347961,
0.9079892635345459,
-1.0504910945892334,
-0.37872111797332764,
1.2059884071350098,
-0.19876393675804138,
-0.5408301949501038,
1.4139177799224854,
0.6796533465385437,
-0.9419059157371521,
-0.1786457598209381,
-0.08589313924312592,
-0.9597475528717041,
0.06468598544597626,
-1.5889208316802979,
-0.07498690485954285,
0.46499103307724,
-1.5606334209442139,
-0.49772125482559204,
-0.17236779630184174,
1.31862211227417,
-0.09650307893753052,
1.4104015827178955,
-0.3489268124103546,
-0.1295505166053772,
-0.3746378719806671,
-0.33073070645332336,
0.1379469931125641,
-0.19869491457939148,
-0.5127816796302795,
0.20857775211334229,
-0.8006239533424377,
0.3220517337322235,
1.4637399911880493,
0.3262541890144348,
0.07543535530567169,
0.5509127974510193,
1.1278256177902222,
0.41052675247192383,
-0.17309235036373138,
-0.8343802690505981,
-1.566866397857666,
1.9733508825302124,
-1.4420682191848755,
2.034099578857422,
0.7428773641586304,
0.009859500452876091,
-1.760048508644104,
-1.8840817213058472,
1.3167024850845337,
1.115838885307312,
2.367821216583252,
0.5411946773529053,
0.4544597864151001,
-0.8822171092033386,
-0.6664438247680664,
0.3819090723991394,
-1.0144429206848145,
-0.7662955522537231,
0.13989025354385376,
2.3424835205078125,
1.7667862176895142,
-0.4109663963317871,
-0.14186131954193115,
-1.0410606861114502,
1.3716211318969727,
-0.20638000965118408,
0.2085983157157898,
1.9687721729278564,
-0.24929846823215485,
-1.1171224117279053,
1.3615795373916626,
-2.3555405139923096,
0.13752469420433044,
1.966335415840149,
0.349415123462677,
0.038984425365924835,
-1.3217796087265015,
-0.7075985074043274,
-0.2436801642179489,
-0.41209402680397034,
-1.2954868078231812,
0.49358969926834106,
-0.2228635549545288,
-0.7433781027793884,
-1.4037572145462036,
0.12518444657325745,
-1.1074331998825073,
-1.6795049905776978,
0.25264719128608704,
1.926594853401184,
1.9796570539474487,
-0.6982765197753906,
1.5636613368988037,
-0.2672600746154785,
0.156724214553833,
1.2317166328430176,
1.1899664402008057,
3.061549186706543,
1.9620263576507568,
-1.2791839838027954,
0.6181908249855042,
-0.11031866073608398,
-0.4945494532585144,
1.1400253772735596,
-1.2380831241607666,
1.343026876449585,
-0.08687935769557953,
-1.2177033424377441,
-1.1569406986236572,
0.9970782995223999,
0.47692951560020447,
0.09392206370830536,
-0.44323915243148804,
1.213943362236023,
-0.029709605500102043,
1.3423367738723755,
0.6181010603904724,
-0.2802565395832062,
0.6426889896392822,
-0.37402772903442383,
-0.526711642742157,
1.5111125707626343,
0.21890290081501007,
-1.4413717985153198,
-2.2599239349365234,
-0.19553333520889282,
-0.8505139946937561,
0.028421558439731598,
-0.6413968801498413,
-0.948211669921875,
1.6556788682937622,
0.31605586409568787,
-1.2782177925109863,
-0.27379971742630005,
-0.29935455322265625,
-0.6059606671333313,
2.7329158782958984,
-1.3731564283370972,
-0.2003927230834961,
-1.007883906364441,
-0.647184431552887,
1.6007722616195679,
-1.241888403892517,
-0.23805652558803558,
-1.011854887008667,
-0.5523918271064758,
-1.2089414596557617,
-0.5300496816635132,
-0.11270812153816223,
-0.9634987711906433,
0.7813470959663391,
0.15380226075649261,
-1.1669515371322632,
-0.3228825032711029,
-0.8358670473098755,
0.8503981232643127,
-0.1401117891073227,
0.24026496708393097,
1.8108893632888794,
0.39662033319473267,
-0.2891985774040222,
0.7176358699798584,
1.1467915773391724,
0.6830543875694275,
-0.5656712651252747,
0.23338758945465088,
-0.6557909250259399,
0.29750996828079224,
-1.3392747640609741,
0.32247814536094666,
-2.826322555541992,
0.610054612159729,
-0.12328526377677917,
-0.06002959609031677,
-0.026430753991007805,
-1.3822264671325684,
1.0503933429718018,
2.5491175651550293,
-1.136144995689392,
0.4652523994445801,
0.2951388359069824,
1.1637746095657349,
-1.544233798980713,
0.3364039361476898,
-0.44383761286735535,
2.1102378368377686,
0.22761105000972748,
1.1595159769058228,
-0.46169325709342957,
-2.3185794353485107,
0.5840628743171692,
-1.2748523950576782,
-1.1964905261993408,
0.7715749740600586,
-0.8513181209564209,
0.07517407834529877,
-1.3887275457382202,
-0.20303994417190552,
-0.7989732623100281,
-1.1609362363815308,
0.6882954239845276,
0.15527230501174927,
0.37101271748542786,
-0.5470086336135864,
0.35360974073410034,
-2.2335267066955566,
-1.334749698638916,
-0.2303481251001358,
-0.9041972160339355,
0.487969309091568,
-0.3366258144378662,
0.6122779846191406,
-0.21852833032608032,
-0.05471419543027878,
0.39725908637046814,
1.443009853363037,
3.3829681873321533,
0.16020606458187103,
0.36785435676574707,
-0.11730518937110901,
-0.963408350944519,
1.4971404075622559,
0.9806926250457764,
-0.1431475132703781,
-0.6029985547065735,
-1.049420714378357,
1.2086880207061768,
1.937016248703003,
1.046958565711975,
-0.024448543787002563,
-0.8170103430747986,
-0.8514796495437622,
-0.037375401705503464,
0.13028335571289062,
0.466019868850708,
0.9510259628295898,
0.20096011459827423,
0.09135977923870087,
1.4450860023498535,
1.209672212600708,
-0.44464778900146484,
0.39845404028892517,
-0.7705195546150208,
-0.5267453193664551,
0.46054741740226746,
0.32337817549705505,
0.023312576115131378,
0.31926751136779785,
-1.0552668571472168,
-0.2738960385322571,
-0.42557382583618164,
-0.8743596076965332,
-0.7956821322441101,
-0.45141908526420593,
-0.4490034580230713,
1.6823760271072388,
0.05631742998957634,
-0.5763876438140869,
-0.05710311606526375,
-0.747334361076355,
-0.11931437253952026,
-1.0411162376403809,
0.4164086878299713,
-0.08497200906276703,
-0.168561652302742,
-0.12433445453643799,
1.7182183265686035,
-0.9334652423858643,
-2.1569321155548096,
0.22079285979270935,
0.1568213850259781,
-0.2912766635417938,
0.19302695989608765,
1.5942288637161255,
0.612939178943634,
1.4677157402038574,
1.3879992961883545,
0.9475176930427551,
-0.6354179382324219,
-1.3517842292785645,
0.7671401500701904,
0.9162161946296692,
-1.4519809484481812,
0.7294860482215881,
-0.04270067811012268,
-0.5866063237190247,
0.6401581168174744,
1.2308886051177979,
0.5529850125312805,
-2.0329813957214355,
0.8234309554100037,
-0.9456101655960083,
0.7248879075050354,
0.7266039252281189,
0.7000012397766113,
0.21638049185276031,
0.7693439722061157,
-1.3471641540527344,
-1.1703426837921143,
-0.6873518824577332,
-0.7335433959960938,
1.944146990776062,
-0.3586440086364746,
0.6233272552490234,
-0.3088812232017517,
-1.388338565826416,
-0.1580018848180771,
0.6801077127456665,
0.30408570170402527,
-0.5597919821739197,
0.7783589363098145,
-0.638148844242096,
-1.0950928926467896,
-1.3475221395492554,
-0.4489939510822296,
-1.089976191520691,
-0.9037166237831116,
1.0013113021850586,
0.7963969707489014,
0.29658252000808716,
1.8458776473999023,
0.6461648941040039,
0.22494402527809143,
-2.639641523361206,
0.9067460894584656,
0.19683830440044403,
-0.10622626543045044,
0.8439962267875671,
0.31692221760749817,
0.964496910572052,
-0.011419223621487617,
0.5738024115562439,
-2.518712043762207,
2.379026412963867,
-0.17355462908744812,
0.6516716480255127,
-0.021110370755195618,
-0.12517862021923065,
1.1070261001586914,
0.6088958382606506,
0.5267690420150757,
-1.0643310546875,
0.6508333086967468,
-0.581388533115387,
1.2322322130203247,
0.8040316104888916,
-0.8173642158508301,
-0.03363147750496864,
1.350970983505249,
0.47514382004737854,
-0.5085085034370422,
-0.9119990468025208,
-1.0793322324752808,
0.908735454082489,
1.8086349964141846,
-0.08056303858757019,
-0.022287338972091675,
0.8189075589179993,
0.6501759886741638,
-1.3186391592025757,
0.06732362508773804,
-0.6656674146652222,
-0.8315987586975098,
1.630251169204712,
2.0556325912475586,
-0.14798752963542938,
-0.19872568547725677,
-0.6255843639373779,
-1.2799172401428223,
0.780060350894928,
0.0014953482896089554,
0.1469743400812149,
0.6346904039382935,
-0.5942467451095581,
1.1046099662780762,
0.9641867876052856,
0.9519283771514893,
0.24833260476589203,
0.24073855578899384,
0.3500745892524719,
-0.27350711822509766,
-1.212077021598816,
-0.22021859884262085,
-1.0465646982192993,
-2.584347724914551,
0.43051502108573914,
-0.23282192647457123,
-1.469921588897705,
0.0713261067867279,
-1.0460875034332275,
0.8430020213127136,
-0.582239031791687,
-1.1219485998153687,
-1.5871983766555786,
0.15233689546585083,
-0.012738432735204697,
0.9429671168327332,
-1.6035826206207275,
-0.10320234298706055,
1.1994104385375977,
0.9031059145927429,
-0.6128593683242798,
1.0095837116241455,
0.24015946686267853,
1.0334619283676147,
0.8583632707595825,
-0.3495265543460846,
0.5829371809959412,
0.08643694221973419,
-1.3842684030532837,
0.4632626175880432,
1.1614625453948975,
0.20507214963436127,
1.5295926332473755,
-0.5899102687835693,
-0.008140183985233307,
0.4116755425930023,
-0.5280379056930542,
-0.41724681854248047,
-0.6083917021751404,
0.6278976798057556,
0.03130762651562691,
-0.9500654339790344,
-0.0788855254650116,
-0.06554141640663147,
-0.21503739058971405,
0.13210654258728027,
-1.4285829067230225,
-0.10928261280059814,
-0.46330681443214417,
-0.6813361644744873,
-1.139918565750122,
-0.0833122730255127,
1.3706557750701904,
-0.7879855036735535,
-0.13549181818962097,
0.5328306555747986,
0.3722865879535675,
0.5220279097557068,
0.7052203416824341,
-0.6695892810821533,
-0.3709924519062042,
-0.16336296498775482,
-0.3998450040817261,
0.3478740453720093,
1.4061249494552612,
-0.12033332884311676,
-0.9972788095474243,
0.7324180603027344,
-0.3506946563720703,
0.06883560121059418,
1.9164882898330688,
0.024421818554401398,
-0.8171776533126831,
0.378633052110672,
-0.7128852605819702,
1.9566173553466797,
1.7952972650527954,
1.3292356729507446,
-0.16090862452983856,
-0.9589110016822815,
0.590622067451477,
-0.3264109492301941,
-0.28283077478408813,
0.9288561344146729,
0.45164838433265686,
-0.24776053428649902,
-1.400365948677063,
0.7601929903030396,
1.2607028484344482,
-0.881183922290802,
-0.7180837392807007,
0.10873928666114807,
-0.7390163540840149,
1.0968706607818604,
0.6545484662055969,
0.3222888112068176,
0.2826645076274872,
1.579445242881775,
0.8019406199455261,
-0.3599299192428589,
0.5820322036743164,
0.5572811961174011,
-0.1448320895433426,
-2.148890972137451,
-1.1804955005645752,
0.4127922058105469,
-0.5872361063957214,
-1.6045007705688477,
1.344376802444458,
-1.1476935148239136,
-0.9500243663787842,
0.5282238721847534,
0.04219650477170944,
1.5079832077026367,
0.38289666175842285,
1.542908787727356,
2.0547778606414795,
0.9061861038208008,
0.3398832678794861,
1.2931694984436035,
-0.12778443098068237,
-0.3211650848388672,
1.7339571714401245,
-0.4537375271320343,
0.4202147424221039,
1.1117833852767944,
-0.2830084264278412,
-1.0730985403060913,
-0.7355682253837585,
-1.3373981714248657,
-0.7241777181625366,
1.1660367250442505,
0.07537403702735901,
-1.1258643865585327,
0.2973615527153015,
1.512581706047058,
0.07917162775993347,
-0.24846003949642181,
0.6147380471229553,
0.3825186789035797,
-0.7637706398963928,
-0.1053352802991867,
-0.8566188812255859,
0.49100062251091003,
-0.25428086519241333,
-0.4050943851470947,
0.34476450085639954,
0.4639352262020111,
1.3491668701171875,
-0.009334092028439045,
0.11186203360557556,
1.167967438697815,
-1.4597240686416626,
1.4743493795394897,
-0.6985746622085571,
0.24385009706020355,
-2.29313063621521,
1.4447487592697144,
-0.7439749836921692,
1.934600591659546,
-2.6955325603485107,
0.4718835651874542,
-0.5079865455627441,
-0.4930313229560852,
0.334632933139801,
-0.35661569237709045,
0.12653712928295135,
-0.18000754714012146,
-1.0897972583770752,
-0.1301695555448532,
-0.6405501961708069,
0.6384310722351074,
1.1136868000030518,
1.3946044445037842,
-1.0930469036102295,
-0.2886899709701538,
-1.6634441614151,
-0.14797593653202057,
-0.6713375449180603,
0.2906413972377777,
-2.0242607593536377,
-0.14316318929195404,
-1.9571993350982666,
-2.398707151412964,
-1.1982650756835938,
-0.7512367963790894,
1.1782795190811157,
0.07593372464179993,
-0.8528189063072205,
1.185034155845642,
-0.39177775382995605,
-1.8403618335723877,
1.0617989301681519,
-2.1476051807403564
] |
Subsets and Splits