html_url
stringlengths 51
51
| comments
stringlengths 67
24.7k
| title
stringlengths 6
280
| body
stringlengths 51
36.2k
| comment_length
int64 16
1.45k
| text
stringlengths 190
38.3k
| embeddings
sequence |
---|---|---|---|---|---|---|
https://github.com/huggingface/datasets/issues/6311 | Thanks for reporting! We've spotted the bugs with the `array.values` handling and are fixing them in https://github.com/huggingface/datasets/pull/6283 (should be part of the next release). | cast_column to Sequence with length=4 occur exception raise in datasets/table.py:2146 | ### Describe the bug
i load a dataset from local csv file which has 187383612 examples, then use `map` to generate new columns for test.
here is my code :
```
import os
from datasets import load_dataset
from datasets.features import Sequence, Value
def add_new_path(example):
example["ais_bbox"] = [100,100,200,200]
example["ais_image_path"] = os.path.join("images", example["image_path"]) if example["image_path"] else ""
return example
ais_dataset = load_dataset("/data/ryan.gao/ais_dataset_cache/raw/1749/")
hf_ds = ais_dataset.map(add_new_path, batched=False, num_proc=32)
ds = hf_ds.cast_column("ais_bbox", Sequence(Value("int32"), length=4))
```
and the `cast_column` raise an exception
```
Casting the dataset: 3%|ββββ
...
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2145, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
list<item: int64>
to
Sequence(feature=Value(dtype='int32', id=None), length=4, id=None)
```
i check the source code and make debug info:
in datasets/table.py:2092
```
2091 if feature.length > -1:
2092 if feature.length * len(array) == len(array.values):
2093 return pa.FixedSizeListArray.from_arrays(_c(array.values, feature.feature), feature.length)
2094 print(len(array))
2095 print(len(array.values))
```
my feature.length is 4. but feature.length * len(array) == len(array.values) is false.
print(len(array)) is 262
print(len(array.values)) is 4000
then I use "for item in array" to print each item then get 262 * [100,100,200,200]
and use "for item in array.values" to print each item and get 4000 int32 which are 1000 * [100,100,200,200]
i'm wondering the `chunk` in each `array.chunks`, the "chunk.values" may get all the chunks's value rather than single chunk? but i check the pyarrow's doc seems chunk.values is chunk's value not all.
### Steps to reproduce the bug
code provided above.
### Expected behavior
feature.length * len(array) == len(array.values) should be true. and there should not has Exception.
### Environment info
python3.9
x86_64
datasets: 2.14.4
pyarrow: 13.0.0 or 10.0.0 | 24 | cast_column to Sequence with length=4 occur exception raise in datasets/table.py:2146
### Describe the bug
i load a dataset from local csv file which has 187383612 examples, then use `map` to generate new columns for test.
here is my code :
```
import os
from datasets import load_dataset
from datasets.features import Sequence, Value
def add_new_path(example):
example["ais_bbox"] = [100,100,200,200]
example["ais_image_path"] = os.path.join("images", example["image_path"]) if example["image_path"] else ""
return example
ais_dataset = load_dataset("/data/ryan.gao/ais_dataset_cache/raw/1749/")
hf_ds = ais_dataset.map(add_new_path, batched=False, num_proc=32)
ds = hf_ds.cast_column("ais_bbox", Sequence(Value("int32"), length=4))
```
and the `cast_column` raise an exception
```
Casting the dataset: 3%|ββββ
...
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2145, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
list<item: int64>
to
Sequence(feature=Value(dtype='int32', id=None), length=4, id=None)
```
i check the source code and make debug info:
in datasets/table.py:2092
```
2091 if feature.length > -1:
2092 if feature.length * len(array) == len(array.values):
2093 return pa.FixedSizeListArray.from_arrays(_c(array.values, feature.feature), feature.length)
2094 print(len(array))
2095 print(len(array.values))
```
my feature.length is 4. but feature.length * len(array) == len(array.values) is false.
print(len(array)) is 262
print(len(array.values)) is 4000
then I use "for item in array" to print each item then get 262 * [100,100,200,200]
and use "for item in array.values" to print each item and get 4000 int32 which are 1000 * [100,100,200,200]
i'm wondering the `chunk` in each `array.chunks`, the "chunk.values" may get all the chunks's value rather than single chunk? but i check the pyarrow's doc seems chunk.values is chunk's value not all.
### Steps to reproduce the bug
code provided above.
### Expected behavior
feature.length * len(array) == len(array.values) should be true. and there should not has Exception.
### Environment info
python3.9
x86_64
datasets: 2.14.4
pyarrow: 13.0.0 or 10.0.0
Thanks for reporting! We've spotted the bugs with the `array.values` handling and are fixing them in https://github.com/huggingface/datasets/pull/6283 (should be part of the next release). | [
-0.22929179668426514,
-0.11489871144294739,
-0.02320384792983532,
0.21615716814994812,
0.5230922102928162,
0.17112109065055847,
0.44043073058128357,
0.48009565472602844,
0.3565998077392578,
0.0004348158836364746,
0.361715704202652,
0.2731039226055145,
-0.14019687473773956,
-0.05468828231096268,
-0.15532337129116058,
-0.23779192566871643,
0.1403605192899704,
0.17907074093818665,
-0.12250175327062607,
0.17658990621566772,
-0.6017123460769653,
-0.022230319678783417,
-0.2926483452320099,
0.11850224435329437,
-0.03601868450641632,
-0.09288375824689865,
-0.17189356684684753,
-0.10042545944452286,
0.054575808346271515,
-0.4979945123195648,
0.06749049574136734,
-0.36459997296333313,
0.20196661353111267,
0.5927488207817078,
-0.00011433733743615448,
-0.05504603311419487,
0.25506722927093506,
0.06531652808189392,
0.04782625287771225,
0.06988869607448578,
-0.5054455399513245,
-0.16339950263500214,
-0.17035984992980957,
-0.492534339427948,
0.009167127311229706,
-0.043216995894908905,
-0.35508573055267334,
-0.3552670478820801,
0.12257466465234756,
0.5797805190086365,
0.18842190504074097,
0.21055498719215393,
-0.10033323615789413,
-0.16828662157058716,
0.29065990447998047,
-0.06987965106964111,
-0.08669678866863251,
0.09136532247066498,
0.2426360547542572,
0.06502654403448105,
0.07881006598472595,
0.21785716712474823,
-0.16679196059703827,
0.04538560286164284,
-0.04330847039818764,
0.07806110382080078,
0.19012883305549622,
-0.10533678531646729,
0.1103070080280304,
0.16660219430923462,
0.35878241062164307,
-0.21757176518440247,
-0.25079116225242615,
-0.10257519781589508,
0.0558738112449646,
-0.289587140083313,
0.10333367437124252,
0.034665822982788086,
0.023151103407144547,
0.11125850677490234,
-0.45199310779571533,
0.2900082767009735,
-0.13923662900924683,
0.15380439162254333,
-0.06919767707586288,
0.07946860790252686,
0.03709809109568596,
0.20616447925567627,
0.03207226097583771,
-0.26909497380256653,
0.10779057443141937,
-0.16774982213974,
-0.02561279572546482,
0.2080327868461609,
-0.3950224220752716,
-0.1643480360507965,
0.1141371876001358,
0.07945232093334198,
0.12134361267089844,
-0.18909484148025513,
0.03032372146844864,
0.05066867545247078,
0.2587851583957672,
-0.025957729667425156,
-0.00996898952871561,
-0.007999293506145477,
-0.24855439364910126,
0.28076082468032837,
0.10732701420783997,
0.2521888017654419,
-0.09001392871141434,
-0.0501071996986866,
0.1808483749628067,
-0.3330143392086029,
0.19541144371032715,
0.4226154386997223,
0.27505800127983093,
-0.006417952477931976,
-0.033698488026857376,
0.21991467475891113,
-0.04321630671620369,
0.07399804890155792,
0.21079882979393005,
0.4042799472808838,
0.08547594398260117,
0.045051392167806625,
0.07742397487163544,
0.19202417135238647,
-0.10698185861110687,
0.04981984198093414,
-0.2368675172328949,
0.2373100221157074,
-0.017548196017742157,
-0.14166027307510376,
-0.13741153478622437,
0.07704371213912964,
-0.01985790953040123,
0.0412735790014267,
-0.201093852519989,
-0.05506816506385803,
0.006564252078533173,
-0.2948133051395416,
0.1754138469696045,
0.36429888010025024,
-0.2644701302051544,
0.09270892292261124,
0.08352974057197571,
-0.006006084382534027,
-0.12376351654529572,
0.26681652665138245,
-0.250346839427948,
-0.38751715421676636,
-0.20235224068164825,
0.2267370969057083,
0.03169635683298111,
0.23744578659534454,
-0.09985288232564926,
-0.2426605224609375,
0.5225322246551514,
-0.2672891616821289,
0.36586806178092957,
-0.35014593601226807,
-0.33019548654556274,
-0.28617966175079346,
0.04621891677379608,
0.44217509031295776,
-0.0170942023396492,
0.26336148381233215,
-0.22913716733455658,
0.15521781146526337,
0.06998156756162643,
0.23842206597328186,
-0.002112165093421936,
0.20881155133247375,
-0.44165492057800293,
0.22298014163970947,
0.5143516659736633,
-0.1629805564880371,
-0.29353395104408264,
0.3101195693016052,
-0.3240566849708557,
-0.1369035542011261,
0.1706361323595047,
0.09749022126197815,
0.2634328603744507,
-0.22971117496490479,
0.14393676817417145,
0.10867129266262054,
-0.24965596199035645,
0.28388985991477966,
-0.124409019947052,
-0.12295101583003998,
0.14438551664352417,
-0.18921074271202087,
-0.09708338975906372,
0.09817241132259369,
0.2900686264038086,
-0.15073685348033905,
0.14167724549770355,
-0.28879448771476746,
0.0830364003777504,
0.29635047912597656,
0.15935149788856506,
-0.12146171927452087,
0.005884863436222076,
-0.15556970238685608,
-0.2694767415523529,
0.23954203724861145,
0.37202903628349304,
-0.1266930103302002,
-0.3021009564399719,
-0.2554123103618622,
-0.3354114890098572,
0.29121434688568115,
-0.1774308681488037,
0.2745823562145233,
0.06319399923086166,
-0.068495973944664,
0.22236602008342743,
-0.05709719657897949,
0.06703118979930878,
0.007765663787722588,
-0.3104986548423767,
-0.04480049014091492,
-0.32755404710769653,
0.20785407721996307,
-0.23246558010578156,
-0.15327498316764832,
-0.11824964731931686,
0.20953592658042908,
0.24143069982528687,
-0.1765192449092865,
-0.1173684298992157,
0.33075088262557983,
0.08915774524211884,
0.09214182198047638,
-0.4959746301174164,
0.0849652886390686,
0.1037415862083435,
-0.34361863136291504,
0.028100067749619484,
0.14170712232589722,
0.2561931312084198,
-0.027117103338241577,
-0.15689189732074738,
0.32087206840515137,
-0.0900687426328659,
0.24394063651561737,
-0.0367373526096344,
-0.021541517227888107,
0.14709191024303436,
-0.07866187393665314,
0.2098296582698822,
-0.23627354204654694,
0.05694771558046341,
0.10777070373296738,
0.005729861557483673,
-0.03168893977999687,
-0.07585946470499039,
0.15863734483718872,
0.5668790936470032,
-0.0793033242225647,
0.11287035793066025,
0.26591482758522034,
0.12772484123706818,
-0.0009565353393554688,
0.14388969540596008,
0.25258827209472656,
0.5420505404472351,
0.14554809033870697,
0.0539097860455513,
0.038372673094272614,
-0.10785365849733353,
-0.08979388326406479,
0.15662355720996857,
0.14471065998077393,
0.05033931881189346,
0.31691795587539673,
0.29274699091911316,
0.007316503673791885,
-0.06725208461284637,
-0.2803017795085907,
0.1676912009716034,
0.31990915536880493,
-0.4981811046600342,
0.12733431160449982,
-0.1428544968366623,
-0.06233671307563782,
-0.2776091396808624,
0.04565570130944252,
0.3051234781742096,
-0.28579479455947876,
-0.3146105408668518,
0.11909346282482147,
-0.24003544449806213,
0.24817027151584625,
-0.40546584129333496,
-0.2669484615325928,
0.3770153522491455,
-0.2141309678554535,
-0.0853646993637085,
-0.04435955733060837,
0.07167075574398041,
0.005333293229341507,
0.09867687523365021,
-0.05998445674777031,
0.2778925597667694,
0.07493780553340912,
-0.03903791680932045,
-0.32418498396873474,
-0.38823336362838745,
-0.022787488996982574,
-0.1484079211950302,
-0.10947920382022858,
0.4319031238555908,
0.19809545576572418,
0.04447959363460541,
-0.2522135376930237,
0.23219381272792816,
-0.054857101291418076,
-0.07053903490304947,
0.47808289527893066,
0.036977533251047134,
0.07042109221220016,
-0.20229485630989075,
-0.3545112609863281,
-0.05537128821015358,
-0.41177159547805786,
0.016740038990974426,
0.002962268888950348,
0.10031582415103912,
0.002886299043893814,
0.40228405594825745,
0.3068162798881531,
0.21710477769374847,
-0.1717892289161682,
-0.12168875336647034,
0.3281705379486084,
0.24345755577087402,
-0.06401757895946503,
-0.24227124452590942,
-0.07512465119361877,
-0.5806824564933777,
-0.14628612995147705,
0.23472753167152405,
-0.40402406454086304,
-0.22145839035511017,
-0.24602560698986053,
0.32319992780685425,
-0.08623417466878891,
-0.027767710387706757,
0.47810977697372437,
-0.018606038764119148,
-0.07854734361171722,
-0.20677977800369263,
-0.057440370321273804,
-0.005256321281194687,
0.20375320315361023,
-0.12911571562290192,
0.14995819330215454,
0.8351044058799744,
-0.027633000165224075,
0.08933666348457336,
0.23985004425048828,
-0.2540503144264221,
0.44250765442848206,
-0.3932558596134186,
0.0976397767663002,
-0.25378498435020447,
-0.16086475551128387,
-0.1039452776312828,
-0.021059885621070862,
-0.07964693009853363,
0.04729564115405083,
-0.12065397948026657,
-0.16436366736888885,
0.16702768206596375,
0.006506182253360748,
-0.10928527265787125,
-0.1862669289112091,
0.1262776404619217,
-0.15882685780525208,
0.2969193756580353,
-0.16427825391292572,
-0.06368041038513184,
-0.32136470079421997,
-0.04512687027454376,
0.03989338502287865,
-0.1930663138628006,
-0.0626244843006134,
-0.3104415833950043,
-0.33758407831192017,
-0.3714350461959839,
-0.29862457513809204,
0.44351494312286377,
0.5915877819061279,
0.6055492162704468,
-0.024097710847854614,
-0.12014071643352509,
0.051996782422065735,
-0.283937007188797,
0.8482605218887329,
-0.5643445253372192,
0.07273344695568085,
0.1398710161447525,
0.21876657009124756,
-0.31866255402565,
0.11023232340812683,
-0.006735846400260925,
0.007070738822221756,
-0.004787038080394268,
0.530360996723175,
-0.03930460661649704,
0.06239432469010353,
0.5120470523834229,
0.40896207094192505,
-0.04802490398287773,
-0.08920059353113174,
-0.09926392883062363,
-0.4339064359664917,
-0.2281184196472168,
0.18868401646614075,
0.21737128496170044,
0.10342790186405182,
0.07699686288833618,
-0.2933276891708374,
-0.02775852382183075,
-0.18571701645851135,
-0.1963285505771637,
0.043825410306453705,
0.2553834319114685,
0.1199321374297142,
0.4153044819831848,
-0.21210937201976776,
-0.4198070764541626,
0.006895182654261589,
0.5965350866317749,
-0.36610332131385803,
-0.14497509598731995,
-0.04562929645180702,
-0.26337507367134094,
0.19565747678279877,
0.2349807173013687,
-0.07238767296075821,
0.11907958984375,
-0.040629394352436066,
0.3120690584182739,
-0.300351083278656,
-0.12298303842544556,
0.39319610595703125,
0.016125693917274475,
-0.3105052411556244,
-0.38868629932403564,
0.3532569110393524,
0.024453938007354736,
-0.11431282758712769,
0.11581719666719437,
0.1615746021270752,
-0.35841047763824463,
0.5608789920806885,
0.025489673018455505,
0.7237347960472107,
-0.09851537644863129,
-0.08624444156885147,
0.4808209538459778,
-0.1388014554977417,
0.4092838168144226,
0.26600420475006104,
-0.007193075492978096,
-0.5069204568862915,
-0.35904720425605774,
-0.13096308708190918,
-0.17018553614616394,
0.17314791679382324,
0.14107036590576172,
-0.1982058882713318,
0.15886090695858002,
-0.2581198811531067,
0.3486849069595337,
-0.12849119305610657,
0.029429689049720764,
-0.036004289984703064,
-0.1772773414850235,
-0.31577590107917786,
0.13892418146133423,
0.12158556282520294,
-0.3496868908405304,
0.05336946249008179,
0.17314499616622925,
-0.009825117886066437,
-0.6655282378196716,
-0.15302300453186035,
0.06533516943454742,
0.00029783323407173157,
0.2046150267124176,
-0.06161842122673988,
-0.18196122348308563,
0.1303965151309967,
0.20556336641311646,
0.22747062146663666,
0.04112290218472481,
-0.0126781165599823,
0.04827733710408211,
0.37445423007011414,
0.1886022835969925,
0.203419491648674,
-0.07963795959949493,
0.2017744481563568,
0.12382584810256958,
-0.11924068629741669,
0.10922762751579285,
-0.20082880556583405,
-0.12851470708847046,
0.20312252640724182,
0.2883830666542053,
0.17036449909210205,
-0.3735780119895935,
-0.41540026664733887,
-0.24990680813789368,
-0.007863625884056091,
-0.22196251153945923,
0.09940038621425629,
-0.26148754358291626,
-0.08028808236122131,
0.27655425667762756,
-0.26227566599845886,
-0.2347562611103058,
-0.15171605348587036,
0.4439069330692291,
-0.0005794018507003784,
0.24805982410907745,
0.41989827156066895,
0.28128334879875183,
-0.1447449028491974,
-0.21312937140464783,
0.055728569626808167,
0.25310593843460083,
-0.7087969779968262,
-0.008557263761758804,
-0.21130144596099854,
-0.0023057013750076294,
0.18896594643592834,
0.2342977374792099,
-0.009047875180840492,
-0.14256711304187775,
-0.05710978806018829,
-0.321877121925354,
-0.465749055147171,
0.18810629844665527,
0.1209774911403656,
0.11424089968204498,
0.0197848379611969,
0.16559983789920807,
-0.20321816205978394,
-0.13091757893562317,
-0.26647213101387024,
0.08170736581087112,
-0.2472761571407318,
0.41713786125183105,
0.30545884370803833,
0.08089856058359146,
0.03218750283122063,
-0.13672959804534912,
0.17897659540176392,
0.31727197766304016,
-0.1632828563451767,
-0.20447702705860138,
-0.075144462287426,
0.09489388763904572,
0.02017807587981224,
-0.12266255170106888,
-0.16392815113067627,
-0.321288138628006,
-0.08347935974597931,
-0.2622205913066864,
0.05060683935880661,
0.10101233422756195,
-0.1502922922372818,
-0.10386106371879578,
0.25691771507263184,
-0.18093574047088623,
-0.011989355087280273,
0.25896936655044556,
-0.397104412317276,
0.018546652048826218,
-0.11673633009195328,
0.31229329109191895,
-0.048246949911117554,
-0.031532734632492065,
-0.006308883428573608,
0.038905780762434006,
-0.10027539730072021,
-0.1261478215456009,
0.5141867995262146,
-0.09177310764789581,
0.0852137953042984,
0.2804889380931854,
0.2521672248840332,
-0.026095889508724213,
-0.4464293420314789,
-0.1971946507692337,
0.053858935832977295,
0.20028220117092133,
-0.3231307864189148,
-0.23417222499847412,
0.10364274680614471,
-0.11791054904460907,
0.12456116825342178,
0.35611429810523987,
0.018901832401752472,
-0.23921819031238556,
0.04457049071788788,
0.21073460578918457,
0.5816619396209717,
-0.2610943913459778,
-0.03330203518271446,
0.6071075201034546,
-0.04962538555264473,
-0.07491113245487213,
0.15627215802669525,
0.1979503631591797,
0.42311328649520874,
0.30810073018074036,
0.022688573226332664,
-0.1203039139509201,
0.19396883249282837,
0.04261314868927002,
-0.190924733877182,
-0.5539606213569641,
0.5139065384864807,
0.17239266633987427,
-0.14615850150585175,
-0.021199125796556473,
0.3571550250053406,
-0.013183251023292542,
-0.16811203956604004,
-0.041593026369810104,
-0.12619826197624207,
0.08895610272884369,
-0.09663920104503632,
0.024722661823034286,
0.16504260897636414,
0.1217261552810669,
-0.17644622921943665,
-0.2167065143585205,
-0.015131335705518723,
0.14301857352256775,
0.6012574434280396,
0.12547819316387177,
0.22881749272346497,
-0.016419894993305206,
-0.061006397008895874,
0.0774136334657669,
-0.04536575451493263,
-0.47074100375175476,
0.31986916065216064,
0.34167271852493286,
0.013816621154546738,
0.13934040069580078,
-0.025126736611127853,
0.542805552482605,
0.1872151643037796,
-0.02503744512796402,
0.0665631964802742,
0.07583589851856232,
-0.10376866906881332,
0.0929599478840828,
0.12686143815517426,
-0.13002236187458038,
0.316996693611145,
0.2040766477584839,
0.15463456511497498,
-0.15049412846565247,
0.2237827330827713,
0.11448773741722107,
0.3509487211704254,
-0.20492613315582275,
0.4784025549888611,
-0.068890281021595,
-0.40491700172424316,
-0.05381511151790619,
0.11732491105794907,
-0.25864487886428833,
0.28956344723701477,
0.30080392956733704,
-0.4495639204978943,
0.3168323040008545,
0.15405379235744476,
0.07193487137556076,
0.0012909527868032455,
0.19898435473442078,
0.14402025938034058,
-0.035518109798431396,
-0.31420156359672546,
-0.09087346494197845,
-0.46379929780960083,
-0.12452145665884018,
-0.256482869386673,
-0.011379532516002655,
0.24349817633628845,
-0.11427641659975052,
-0.020122241228818893,
-0.12764964997768402,
0.16304484009742737,
-0.17262691259384155,
-0.11571945995092392,
0.34214332699775696,
-0.017865300178527832,
-0.5266839861869812,
-0.021598976105451584,
-0.10978584736585617,
-0.11822071671485901,
-0.5985739231109619,
0.3505050837993622,
-0.13325104117393494,
0.10409890115261078,
-0.10524965822696686,
-0.06480898708105087,
-0.021781712770462036,
-0.33429285883903503,
0.2362397313117981,
0.1917458474636078,
0.40661394596099854,
-0.20216655731201172,
0.11565908789634705,
-0.15102525055408478,
-0.3123185932636261,
0.0028548352420330048,
0.42791107296943665,
0.017585759982466698,
0.48849523067474365,
-0.11321419477462769,
0.03940751776099205,
-0.12033960223197937,
-0.052908893674612045,
-0.01031387597322464,
0.09840355813503265,
-0.2124854326248169,
0.48037999868392944,
-0.5130462646484375,
0.2160867154598236,
0.1373879611492157,
0.00970376469194889,
0.2349112629890442,
0.37298980355262756,
0.08563642203807831,
-0.7212560772895813,
0.5360859632492065,
-0.3975192606449127,
-0.2592470049858093,
0.12980446219444275,
0.35942602157592773,
-0.160140261054039,
-0.10496068745851517,
-0.4210330843925476,
0.005724266171455383,
0.4678092896938324,
-0.02764069102704525,
-0.30604639649391174,
0.12533007562160492,
-0.02293415740132332,
0.07178189605474472,
-0.011120319366455078,
0.28496846556663513,
-0.12363484501838684,
-0.19545763731002808,
0.20541223883628845,
-0.14836937189102173
] |
https://github.com/huggingface/datasets/issues/6311 | > Thanks for reporting! We've spotted the bugs with the `array.values` handling and are fixing them in #6283 (should be part of the next release).
i encounter another exception while cast_column to type `Sequence(feature={"points": Array2D(shape=(-1, 2), dtype="int64"), "label": ClassLabel(num_classes=num_classes, names=names)})`
while my data like this: '{"points": [[0.6,0.6], [0.7,0.7], [0.8,0.8]], "label": "A1"}'
here is the backtrace info:
```
out = func(dataset, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2073, in cast_array_to_feature
arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2073, in <listcomp>
arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1833, in wrapper
return func(array, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2095, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1833, in wrapper
return func(array, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2144, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1833, in wrapper
return func(array, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1967, in array_cast
return pa_type.wrap_array(array)
File "pyarrow/types.pxi", line 1369, in pyarrow.lib.BaseExtensionType.wrap_array
TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: double>>, got list<item: double>
```
and i print(array) in datasets/table.py:1967 indeed get 2D list. is that same issue in #6283 ?
besides this, hugging face datasets seems don't naturally support multi-labels which means `Sequence(ClassLabel)` illegal if data is ["label1", "label2"]. so i have to define a class derived from `ClassLabel`, like this:
```
class AisClassLabels(ClassLabel):
def encode_example(self, example_data):
if self.num_classes is None:
raise ValueError(
"Trying to use ClassLabel feature with undefined number of class. "
"Please set ClassLabel.names or num_classes."
)
if not isinstance(example_data, list):
example_data = [example_data]
for i in range(len(example_data)):
if isinstance(example_data[i], str):
example_data[i] = self.str2int(example_data[i])
if not -1 <= example_data[i] < self.num_classes:
raise ValueError(f"Class label {example_data:d} greater than configured num_classes {self.num_classes}")
return example_data
```
and it works well in my case. but is there any recommend way to implement multi-labels? | cast_column to Sequence with length=4 occur exception raise in datasets/table.py:2146 | ### Describe the bug
i load a dataset from local csv file which has 187383612 examples, then use `map` to generate new columns for test.
here is my code :
```
import os
from datasets import load_dataset
from datasets.features import Sequence, Value
def add_new_path(example):
example["ais_bbox"] = [100,100,200,200]
example["ais_image_path"] = os.path.join("images", example["image_path"]) if example["image_path"] else ""
return example
ais_dataset = load_dataset("/data/ryan.gao/ais_dataset_cache/raw/1749/")
hf_ds = ais_dataset.map(add_new_path, batched=False, num_proc=32)
ds = hf_ds.cast_column("ais_bbox", Sequence(Value("int32"), length=4))
```
and the `cast_column` raise an exception
```
Casting the dataset: 3%|ββββ
...
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2145, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
list<item: int64>
to
Sequence(feature=Value(dtype='int32', id=None), length=4, id=None)
```
i check the source code and make debug info:
in datasets/table.py:2092
```
2091 if feature.length > -1:
2092 if feature.length * len(array) == len(array.values):
2093 return pa.FixedSizeListArray.from_arrays(_c(array.values, feature.feature), feature.length)
2094 print(len(array))
2095 print(len(array.values))
```
my feature.length is 4. but feature.length * len(array) == len(array.values) is false.
print(len(array)) is 262
print(len(array.values)) is 4000
then I use "for item in array" to print each item then get 262 * [100,100,200,200]
and use "for item in array.values" to print each item and get 4000 int32 which are 1000 * [100,100,200,200]
i'm wondering the `chunk` in each `array.chunks`, the "chunk.values" may get all the chunks's value rather than single chunk? but i check the pyarrow's doc seems chunk.values is chunk's value not all.
### Steps to reproduce the bug
code provided above.
### Expected behavior
feature.length * len(array) == len(array.values) should be true. and there should not has Exception.
### Environment info
python3.9
x86_64
datasets: 2.14.4
pyarrow: 13.0.0 or 10.0.0 | 440 | cast_column to Sequence with length=4 occur exception raise in datasets/table.py:2146
### Describe the bug
i load a dataset from local csv file which has 187383612 examples, then use `map` to generate new columns for test.
here is my code :
```
import os
from datasets import load_dataset
from datasets.features import Sequence, Value
def add_new_path(example):
example["ais_bbox"] = [100,100,200,200]
example["ais_image_path"] = os.path.join("images", example["image_path"]) if example["image_path"] else ""
return example
ais_dataset = load_dataset("/data/ryan.gao/ais_dataset_cache/raw/1749/")
hf_ds = ais_dataset.map(add_new_path, batched=False, num_proc=32)
ds = hf_ds.cast_column("ais_bbox", Sequence(Value("int32"), length=4))
```
and the `cast_column` raise an exception
```
Casting the dataset: 3%|ββββ
...
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2145, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
list<item: int64>
to
Sequence(feature=Value(dtype='int32', id=None), length=4, id=None)
```
i check the source code and make debug info:
in datasets/table.py:2092
```
2091 if feature.length > -1:
2092 if feature.length * len(array) == len(array.values):
2093 return pa.FixedSizeListArray.from_arrays(_c(array.values, feature.feature), feature.length)
2094 print(len(array))
2095 print(len(array.values))
```
my feature.length is 4. but feature.length * len(array) == len(array.values) is false.
print(len(array)) is 262
print(len(array.values)) is 4000
then I use "for item in array" to print each item then get 262 * [100,100,200,200]
and use "for item in array.values" to print each item and get 4000 int32 which are 1000 * [100,100,200,200]
i'm wondering the `chunk` in each `array.chunks`, the "chunk.values" may get all the chunks's value rather than single chunk? but i check the pyarrow's doc seems chunk.values is chunk's value not all.
### Steps to reproduce the bug
code provided above.
### Expected behavior
feature.length * len(array) == len(array.values) should be true. and there should not has Exception.
### Environment info
python3.9
x86_64
datasets: 2.14.4
pyarrow: 13.0.0 or 10.0.0
> Thanks for reporting! We've spotted the bugs with the `array.values` handling and are fixing them in #6283 (should be part of the next release).
i encounter another exception while cast_column to type `Sequence(feature={"points": Array2D(shape=(-1, 2), dtype="int64"), "label": ClassLabel(num_classes=num_classes, names=names)})`
while my data like this: '{"points": [[0.6,0.6], [0.7,0.7], [0.8,0.8]], "label": "A1"}'
here is the backtrace info:
```
out = func(dataset, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2073, in cast_array_to_feature
arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2073, in <listcomp>
arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1833, in wrapper
return func(array, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2095, in cast_array_to_feature
casted_values = _c(array.values, feature.feature)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1833, in wrapper
return func(array, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2144, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1833, in wrapper
return func(array, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1967, in array_cast
return pa_type.wrap_array(array)
File "pyarrow/types.pxi", line 1369, in pyarrow.lib.BaseExtensionType.wrap_array
TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: double>>, got list<item: double>
```
and i print(array) in datasets/table.py:1967 indeed get 2D list. is that same issue in #6283 ?
besides this, hugging face datasets seems don't naturally support multi-labels which means `Sequence(ClassLabel)` illegal if data is ["label1", "label2"]. so i have to define a class derived from `ClassLabel`, like this:
```
class AisClassLabels(ClassLabel):
def encode_example(self, example_data):
if self.num_classes is None:
raise ValueError(
"Trying to use ClassLabel feature with undefined number of class. "
"Please set ClassLabel.names or num_classes."
)
if not isinstance(example_data, list):
example_data = [example_data]
for i in range(len(example_data)):
if isinstance(example_data[i], str):
example_data[i] = self.str2int(example_data[i])
if not -1 <= example_data[i] < self.num_classes:
raise ValueError(f"Class label {example_data:d} greater than configured num_classes {self.num_classes}")
return example_data
```
and it works well in my case. but is there any recommend way to implement multi-labels? | [
-0.22929179668426514,
-0.11489871144294739,
-0.02320384792983532,
0.21615716814994812,
0.5230922102928162,
0.17112109065055847,
0.44043073058128357,
0.48009565472602844,
0.3565998077392578,
0.0004348158836364746,
0.361715704202652,
0.2731039226055145,
-0.14019687473773956,
-0.05468828231096268,
-0.15532337129116058,
-0.23779192566871643,
0.1403605192899704,
0.17907074093818665,
-0.12250175327062607,
0.17658990621566772,
-0.6017123460769653,
-0.022230319678783417,
-0.2926483452320099,
0.11850224435329437,
-0.03601868450641632,
-0.09288375824689865,
-0.17189356684684753,
-0.10042545944452286,
0.054575808346271515,
-0.4979945123195648,
0.06749049574136734,
-0.36459997296333313,
0.20196661353111267,
0.5927488207817078,
-0.00011433733743615448,
-0.05504603311419487,
0.25506722927093506,
0.06531652808189392,
0.04782625287771225,
0.06988869607448578,
-0.5054455399513245,
-0.16339950263500214,
-0.17035984992980957,
-0.492534339427948,
0.009167127311229706,
-0.043216995894908905,
-0.35508573055267334,
-0.3552670478820801,
0.12257466465234756,
0.5797805190086365,
0.18842190504074097,
0.21055498719215393,
-0.10033323615789413,
-0.16828662157058716,
0.29065990447998047,
-0.06987965106964111,
-0.08669678866863251,
0.09136532247066498,
0.2426360547542572,
0.06502654403448105,
0.07881006598472595,
0.21785716712474823,
-0.16679196059703827,
0.04538560286164284,
-0.04330847039818764,
0.07806110382080078,
0.19012883305549622,
-0.10533678531646729,
0.1103070080280304,
0.16660219430923462,
0.35878241062164307,
-0.21757176518440247,
-0.25079116225242615,
-0.10257519781589508,
0.0558738112449646,
-0.289587140083313,
0.10333367437124252,
0.034665822982788086,
0.023151103407144547,
0.11125850677490234,
-0.45199310779571533,
0.2900082767009735,
-0.13923662900924683,
0.15380439162254333,
-0.06919767707586288,
0.07946860790252686,
0.03709809109568596,
0.20616447925567627,
0.03207226097583771,
-0.26909497380256653,
0.10779057443141937,
-0.16774982213974,
-0.02561279572546482,
0.2080327868461609,
-0.3950224220752716,
-0.1643480360507965,
0.1141371876001358,
0.07945232093334198,
0.12134361267089844,
-0.18909484148025513,
0.03032372146844864,
0.05066867545247078,
0.2587851583957672,
-0.025957729667425156,
-0.00996898952871561,
-0.007999293506145477,
-0.24855439364910126,
0.28076082468032837,
0.10732701420783997,
0.2521888017654419,
-0.09001392871141434,
-0.0501071996986866,
0.1808483749628067,
-0.3330143392086029,
0.19541144371032715,
0.4226154386997223,
0.27505800127983093,
-0.006417952477931976,
-0.033698488026857376,
0.21991467475891113,
-0.04321630671620369,
0.07399804890155792,
0.21079882979393005,
0.4042799472808838,
0.08547594398260117,
0.045051392167806625,
0.07742397487163544,
0.19202417135238647,
-0.10698185861110687,
0.04981984198093414,
-0.2368675172328949,
0.2373100221157074,
-0.017548196017742157,
-0.14166027307510376,
-0.13741153478622437,
0.07704371213912964,
-0.01985790953040123,
0.0412735790014267,
-0.201093852519989,
-0.05506816506385803,
0.006564252078533173,
-0.2948133051395416,
0.1754138469696045,
0.36429888010025024,
-0.2644701302051544,
0.09270892292261124,
0.08352974057197571,
-0.006006084382534027,
-0.12376351654529572,
0.26681652665138245,
-0.250346839427948,
-0.38751715421676636,
-0.20235224068164825,
0.2267370969057083,
0.03169635683298111,
0.23744578659534454,
-0.09985288232564926,
-0.2426605224609375,
0.5225322246551514,
-0.2672891616821289,
0.36586806178092957,
-0.35014593601226807,
-0.33019548654556274,
-0.28617966175079346,
0.04621891677379608,
0.44217509031295776,
-0.0170942023396492,
0.26336148381233215,
-0.22913716733455658,
0.15521781146526337,
0.06998156756162643,
0.23842206597328186,
-0.002112165093421936,
0.20881155133247375,
-0.44165492057800293,
0.22298014163970947,
0.5143516659736633,
-0.1629805564880371,
-0.29353395104408264,
0.3101195693016052,
-0.3240566849708557,
-0.1369035542011261,
0.1706361323595047,
0.09749022126197815,
0.2634328603744507,
-0.22971117496490479,
0.14393676817417145,
0.10867129266262054,
-0.24965596199035645,
0.28388985991477966,
-0.124409019947052,
-0.12295101583003998,
0.14438551664352417,
-0.18921074271202087,
-0.09708338975906372,
0.09817241132259369,
0.2900686264038086,
-0.15073685348033905,
0.14167724549770355,
-0.28879448771476746,
0.0830364003777504,
0.29635047912597656,
0.15935149788856506,
-0.12146171927452087,
0.005884863436222076,
-0.15556970238685608,
-0.2694767415523529,
0.23954203724861145,
0.37202903628349304,
-0.1266930103302002,
-0.3021009564399719,
-0.2554123103618622,
-0.3354114890098572,
0.29121434688568115,
-0.1774308681488037,
0.2745823562145233,
0.06319399923086166,
-0.068495973944664,
0.22236602008342743,
-0.05709719657897949,
0.06703118979930878,
0.007765663787722588,
-0.3104986548423767,
-0.04480049014091492,
-0.32755404710769653,
0.20785407721996307,
-0.23246558010578156,
-0.15327498316764832,
-0.11824964731931686,
0.20953592658042908,
0.24143069982528687,
-0.1765192449092865,
-0.1173684298992157,
0.33075088262557983,
0.08915774524211884,
0.09214182198047638,
-0.4959746301174164,
0.0849652886390686,
0.1037415862083435,
-0.34361863136291504,
0.028100067749619484,
0.14170712232589722,
0.2561931312084198,
-0.027117103338241577,
-0.15689189732074738,
0.32087206840515137,
-0.0900687426328659,
0.24394063651561737,
-0.0367373526096344,
-0.021541517227888107,
0.14709191024303436,
-0.07866187393665314,
0.2098296582698822,
-0.23627354204654694,
0.05694771558046341,
0.10777070373296738,
0.005729861557483673,
-0.03168893977999687,
-0.07585946470499039,
0.15863734483718872,
0.5668790936470032,
-0.0793033242225647,
0.11287035793066025,
0.26591482758522034,
0.12772484123706818,
-0.0009565353393554688,
0.14388969540596008,
0.25258827209472656,
0.5420505404472351,
0.14554809033870697,
0.0539097860455513,
0.038372673094272614,
-0.10785365849733353,
-0.08979388326406479,
0.15662355720996857,
0.14471065998077393,
0.05033931881189346,
0.31691795587539673,
0.29274699091911316,
0.007316503673791885,
-0.06725208461284637,
-0.2803017795085907,
0.1676912009716034,
0.31990915536880493,
-0.4981811046600342,
0.12733431160449982,
-0.1428544968366623,
-0.06233671307563782,
-0.2776091396808624,
0.04565570130944252,
0.3051234781742096,
-0.28579479455947876,
-0.3146105408668518,
0.11909346282482147,
-0.24003544449806213,
0.24817027151584625,
-0.40546584129333496,
-0.2669484615325928,
0.3770153522491455,
-0.2141309678554535,
-0.0853646993637085,
-0.04435955733060837,
0.07167075574398041,
0.005333293229341507,
0.09867687523365021,
-0.05998445674777031,
0.2778925597667694,
0.07493780553340912,
-0.03903791680932045,
-0.32418498396873474,
-0.38823336362838745,
-0.022787488996982574,
-0.1484079211950302,
-0.10947920382022858,
0.4319031238555908,
0.19809545576572418,
0.04447959363460541,
-0.2522135376930237,
0.23219381272792816,
-0.054857101291418076,
-0.07053903490304947,
0.47808289527893066,
0.036977533251047134,
0.07042109221220016,
-0.20229485630989075,
-0.3545112609863281,
-0.05537128821015358,
-0.41177159547805786,
0.016740038990974426,
0.002962268888950348,
0.10031582415103912,
0.002886299043893814,
0.40228405594825745,
0.3068162798881531,
0.21710477769374847,
-0.1717892289161682,
-0.12168875336647034,
0.3281705379486084,
0.24345755577087402,
-0.06401757895946503,
-0.24227124452590942,
-0.07512465119361877,
-0.5806824564933777,
-0.14628612995147705,
0.23472753167152405,
-0.40402406454086304,
-0.22145839035511017,
-0.24602560698986053,
0.32319992780685425,
-0.08623417466878891,
-0.027767710387706757,
0.47810977697372437,
-0.018606038764119148,
-0.07854734361171722,
-0.20677977800369263,
-0.057440370321273804,
-0.005256321281194687,
0.20375320315361023,
-0.12911571562290192,
0.14995819330215454,
0.8351044058799744,
-0.027633000165224075,
0.08933666348457336,
0.23985004425048828,
-0.2540503144264221,
0.44250765442848206,
-0.3932558596134186,
0.0976397767663002,
-0.25378498435020447,
-0.16086475551128387,
-0.1039452776312828,
-0.021059885621070862,
-0.07964693009853363,
0.04729564115405083,
-0.12065397948026657,
-0.16436366736888885,
0.16702768206596375,
0.006506182253360748,
-0.10928527265787125,
-0.1862669289112091,
0.1262776404619217,
-0.15882685780525208,
0.2969193756580353,
-0.16427825391292572,
-0.06368041038513184,
-0.32136470079421997,
-0.04512687027454376,
0.03989338502287865,
-0.1930663138628006,
-0.0626244843006134,
-0.3104415833950043,
-0.33758407831192017,
-0.3714350461959839,
-0.29862457513809204,
0.44351494312286377,
0.5915877819061279,
0.6055492162704468,
-0.024097710847854614,
-0.12014071643352509,
0.051996782422065735,
-0.283937007188797,
0.8482605218887329,
-0.5643445253372192,
0.07273344695568085,
0.1398710161447525,
0.21876657009124756,
-0.31866255402565,
0.11023232340812683,
-0.006735846400260925,
0.007070738822221756,
-0.004787038080394268,
0.530360996723175,
-0.03930460661649704,
0.06239432469010353,
0.5120470523834229,
0.40896207094192505,
-0.04802490398287773,
-0.08920059353113174,
-0.09926392883062363,
-0.4339064359664917,
-0.2281184196472168,
0.18868401646614075,
0.21737128496170044,
0.10342790186405182,
0.07699686288833618,
-0.2933276891708374,
-0.02775852382183075,
-0.18571701645851135,
-0.1963285505771637,
0.043825410306453705,
0.2553834319114685,
0.1199321374297142,
0.4153044819831848,
-0.21210937201976776,
-0.4198070764541626,
0.006895182654261589,
0.5965350866317749,
-0.36610332131385803,
-0.14497509598731995,
-0.04562929645180702,
-0.26337507367134094,
0.19565747678279877,
0.2349807173013687,
-0.07238767296075821,
0.11907958984375,
-0.040629394352436066,
0.3120690584182739,
-0.300351083278656,
-0.12298303842544556,
0.39319610595703125,
0.016125693917274475,
-0.3105052411556244,
-0.38868629932403564,
0.3532569110393524,
0.024453938007354736,
-0.11431282758712769,
0.11581719666719437,
0.1615746021270752,
-0.35841047763824463,
0.5608789920806885,
0.025489673018455505,
0.7237347960472107,
-0.09851537644863129,
-0.08624444156885147,
0.4808209538459778,
-0.1388014554977417,
0.4092838168144226,
0.26600420475006104,
-0.007193075492978096,
-0.5069204568862915,
-0.35904720425605774,
-0.13096308708190918,
-0.17018553614616394,
0.17314791679382324,
0.14107036590576172,
-0.1982058882713318,
0.15886090695858002,
-0.2581198811531067,
0.3486849069595337,
-0.12849119305610657,
0.029429689049720764,
-0.036004289984703064,
-0.1772773414850235,
-0.31577590107917786,
0.13892418146133423,
0.12158556282520294,
-0.3496868908405304,
0.05336946249008179,
0.17314499616622925,
-0.009825117886066437,
-0.6655282378196716,
-0.15302300453186035,
0.06533516943454742,
0.00029783323407173157,
0.2046150267124176,
-0.06161842122673988,
-0.18196122348308563,
0.1303965151309967,
0.20556336641311646,
0.22747062146663666,
0.04112290218472481,
-0.0126781165599823,
0.04827733710408211,
0.37445423007011414,
0.1886022835969925,
0.203419491648674,
-0.07963795959949493,
0.2017744481563568,
0.12382584810256958,
-0.11924068629741669,
0.10922762751579285,
-0.20082880556583405,
-0.12851470708847046,
0.20312252640724182,
0.2883830666542053,
0.17036449909210205,
-0.3735780119895935,
-0.41540026664733887,
-0.24990680813789368,
-0.007863625884056091,
-0.22196251153945923,
0.09940038621425629,
-0.26148754358291626,
-0.08028808236122131,
0.27655425667762756,
-0.26227566599845886,
-0.2347562611103058,
-0.15171605348587036,
0.4439069330692291,
-0.0005794018507003784,
0.24805982410907745,
0.41989827156066895,
0.28128334879875183,
-0.1447449028491974,
-0.21312937140464783,
0.055728569626808167,
0.25310593843460083,
-0.7087969779968262,
-0.008557263761758804,
-0.21130144596099854,
-0.0023057013750076294,
0.18896594643592834,
0.2342977374792099,
-0.009047875180840492,
-0.14256711304187775,
-0.05710978806018829,
-0.321877121925354,
-0.465749055147171,
0.18810629844665527,
0.1209774911403656,
0.11424089968204498,
0.0197848379611969,
0.16559983789920807,
-0.20321816205978394,
-0.13091757893562317,
-0.26647213101387024,
0.08170736581087112,
-0.2472761571407318,
0.41713786125183105,
0.30545884370803833,
0.08089856058359146,
0.03218750283122063,
-0.13672959804534912,
0.17897659540176392,
0.31727197766304016,
-0.1632828563451767,
-0.20447702705860138,
-0.075144462287426,
0.09489388763904572,
0.02017807587981224,
-0.12266255170106888,
-0.16392815113067627,
-0.321288138628006,
-0.08347935974597931,
-0.2622205913066864,
0.05060683935880661,
0.10101233422756195,
-0.1502922922372818,
-0.10386106371879578,
0.25691771507263184,
-0.18093574047088623,
-0.011989355087280273,
0.25896936655044556,
-0.397104412317276,
0.018546652048826218,
-0.11673633009195328,
0.31229329109191895,
-0.048246949911117554,
-0.031532734632492065,
-0.006308883428573608,
0.038905780762434006,
-0.10027539730072021,
-0.1261478215456009,
0.5141867995262146,
-0.09177310764789581,
0.0852137953042984,
0.2804889380931854,
0.2521672248840332,
-0.026095889508724213,
-0.4464293420314789,
-0.1971946507692337,
0.053858935832977295,
0.20028220117092133,
-0.3231307864189148,
-0.23417222499847412,
0.10364274680614471,
-0.11791054904460907,
0.12456116825342178,
0.35611429810523987,
0.018901832401752472,
-0.23921819031238556,
0.04457049071788788,
0.21073460578918457,
0.5816619396209717,
-0.2610943913459778,
-0.03330203518271446,
0.6071075201034546,
-0.04962538555264473,
-0.07491113245487213,
0.15627215802669525,
0.1979503631591797,
0.42311328649520874,
0.30810073018074036,
0.022688573226332664,
-0.1203039139509201,
0.19396883249282837,
0.04261314868927002,
-0.190924733877182,
-0.5539606213569641,
0.5139065384864807,
0.17239266633987427,
-0.14615850150585175,
-0.021199125796556473,
0.3571550250053406,
-0.013183251023292542,
-0.16811203956604004,
-0.041593026369810104,
-0.12619826197624207,
0.08895610272884369,
-0.09663920104503632,
0.024722661823034286,
0.16504260897636414,
0.1217261552810669,
-0.17644622921943665,
-0.2167065143585205,
-0.015131335705518723,
0.14301857352256775,
0.6012574434280396,
0.12547819316387177,
0.22881749272346497,
-0.016419894993305206,
-0.061006397008895874,
0.0774136334657669,
-0.04536575451493263,
-0.47074100375175476,
0.31986916065216064,
0.34167271852493286,
0.013816621154546738,
0.13934040069580078,
-0.025126736611127853,
0.542805552482605,
0.1872151643037796,
-0.02503744512796402,
0.0665631964802742,
0.07583589851856232,
-0.10376866906881332,
0.0929599478840828,
0.12686143815517426,
-0.13002236187458038,
0.316996693611145,
0.2040766477584839,
0.15463456511497498,
-0.15049412846565247,
0.2237827330827713,
0.11448773741722107,
0.3509487211704254,
-0.20492613315582275,
0.4784025549888611,
-0.068890281021595,
-0.40491700172424316,
-0.05381511151790619,
0.11732491105794907,
-0.25864487886428833,
0.28956344723701477,
0.30080392956733704,
-0.4495639204978943,
0.3168323040008545,
0.15405379235744476,
0.07193487137556076,
0.0012909527868032455,
0.19898435473442078,
0.14402025938034058,
-0.035518109798431396,
-0.31420156359672546,
-0.09087346494197845,
-0.46379929780960083,
-0.12452145665884018,
-0.256482869386673,
-0.011379532516002655,
0.24349817633628845,
-0.11427641659975052,
-0.020122241228818893,
-0.12764964997768402,
0.16304484009742737,
-0.17262691259384155,
-0.11571945995092392,
0.34214332699775696,
-0.017865300178527832,
-0.5266839861869812,
-0.021598976105451584,
-0.10978584736585617,
-0.11822071671485901,
-0.5985739231109619,
0.3505050837993622,
-0.13325104117393494,
0.10409890115261078,
-0.10524965822696686,
-0.06480898708105087,
-0.021781712770462036,
-0.33429285883903503,
0.2362397313117981,
0.1917458474636078,
0.40661394596099854,
-0.20216655731201172,
0.11565908789634705,
-0.15102525055408478,
-0.3123185932636261,
0.0028548352420330048,
0.42791107296943665,
0.017585759982466698,
0.48849523067474365,
-0.11321419477462769,
0.03940751776099205,
-0.12033960223197937,
-0.052908893674612045,
-0.01031387597322464,
0.09840355813503265,
-0.2124854326248169,
0.48037999868392944,
-0.5130462646484375,
0.2160867154598236,
0.1373879611492157,
0.00970376469194889,
0.2349112629890442,
0.37298980355262756,
0.08563642203807831,
-0.7212560772895813,
0.5360859632492065,
-0.3975192606449127,
-0.2592470049858093,
0.12980446219444275,
0.35942602157592773,
-0.160140261054039,
-0.10496068745851517,
-0.4210330843925476,
0.005724266171455383,
0.4678092896938324,
-0.02764069102704525,
-0.30604639649391174,
0.12533007562160492,
-0.02293415740132332,
0.07178189605474472,
-0.011120319366455078,
0.28496846556663513,
-0.12363484501838684,
-0.19545763731002808,
0.20541223883628845,
-0.14836937189102173
] |
https://github.com/huggingface/datasets/issues/6311 | `Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: double>>, got list<item: double>`
if i change `Array2D(shape=(-1, 2), dtype="int64")` to `Sequence(Value("int64"))` , every thing goes well. but my data is 2D int list | cast_column to Sequence with length=4 occur exception raise in datasets/table.py:2146 | ### Describe the bug
i load a dataset from local csv file which has 187383612 examples, then use `map` to generate new columns for test.
here is my code :
```
import os
from datasets import load_dataset
from datasets.features import Sequence, Value
def add_new_path(example):
example["ais_bbox"] = [100,100,200,200]
example["ais_image_path"] = os.path.join("images", example["image_path"]) if example["image_path"] else ""
return example
ais_dataset = load_dataset("/data/ryan.gao/ais_dataset_cache/raw/1749/")
hf_ds = ais_dataset.map(add_new_path, batched=False, num_proc=32)
ds = hf_ds.cast_column("ais_bbox", Sequence(Value("int32"), length=4))
```
and the `cast_column` raise an exception
```
Casting the dataset: 3%|ββββ
...
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2145, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
list<item: int64>
to
Sequence(feature=Value(dtype='int32', id=None), length=4, id=None)
```
i check the source code and make debug info:
in datasets/table.py:2092
```
2091 if feature.length > -1:
2092 if feature.length * len(array) == len(array.values):
2093 return pa.FixedSizeListArray.from_arrays(_c(array.values, feature.feature), feature.length)
2094 print(len(array))
2095 print(len(array.values))
```
my feature.length is 4. but feature.length * len(array) == len(array.values) is false.
print(len(array)) is 262
print(len(array.values)) is 4000
then I use "for item in array" to print each item then get 262 * [100,100,200,200]
and use "for item in array.values" to print each item and get 4000 int32 which are 1000 * [100,100,200,200]
i'm wondering the `chunk` in each `array.chunks`, the "chunk.values" may get all the chunks's value rather than single chunk? but i check the pyarrow's doc seems chunk.values is chunk's value not all.
### Steps to reproduce the bug
code provided above.
### Expected behavior
feature.length * len(array) == len(array.values) should be true. and there should not has Exception.
### Environment info
python3.9
x86_64
datasets: 2.14.4
pyarrow: 13.0.0 or 10.0.0 | 32 | cast_column to Sequence with length=4 occur exception raise in datasets/table.py:2146
### Describe the bug
i load a dataset from local csv file which has 187383612 examples, then use `map` to generate new columns for test.
here is my code :
```
import os
from datasets import load_dataset
from datasets.features import Sequence, Value
def add_new_path(example):
example["ais_bbox"] = [100,100,200,200]
example["ais_image_path"] = os.path.join("images", example["image_path"]) if example["image_path"] else ""
return example
ais_dataset = load_dataset("/data/ryan.gao/ais_dataset_cache/raw/1749/")
hf_ds = ais_dataset.map(add_new_path, batched=False, num_proc=32)
ds = hf_ds.cast_column("ais_bbox", Sequence(Value("int32"), length=4))
```
and the `cast_column` raise an exception
```
Casting the dataset: 3%|ββββ
...
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2145, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
list<item: int64>
to
Sequence(feature=Value(dtype='int32', id=None), length=4, id=None)
```
i check the source code and make debug info:
in datasets/table.py:2092
```
2091 if feature.length > -1:
2092 if feature.length * len(array) == len(array.values):
2093 return pa.FixedSizeListArray.from_arrays(_c(array.values, feature.feature), feature.length)
2094 print(len(array))
2095 print(len(array.values))
```
my feature.length is 4. but feature.length * len(array) == len(array.values) is false.
print(len(array)) is 262
print(len(array.values)) is 4000
then I use "for item in array" to print each item then get 262 * [100,100,200,200]
and use "for item in array.values" to print each item and get 4000 int32 which are 1000 * [100,100,200,200]
i'm wondering the `chunk` in each `array.chunks`, the "chunk.values" may get all the chunks's value rather than single chunk? but i check the pyarrow's doc seems chunk.values is chunk's value not all.
### Steps to reproduce the bug
code provided above.
### Expected behavior
feature.length * len(array) == len(array.values) should be true. and there should not has Exception.
### Environment info
python3.9
x86_64
datasets: 2.14.4
pyarrow: 13.0.0 or 10.0.0
`Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: double>>, got list<item: double>`
if i change `Array2D(shape=(-1, 2), dtype="int64")` to `Sequence(Value("int64"))` , every thing goes well. but my data is 2D int list | [
-0.22929179668426514,
-0.11489871144294739,
-0.02320384792983532,
0.21615716814994812,
0.5230922102928162,
0.17112109065055847,
0.44043073058128357,
0.48009565472602844,
0.3565998077392578,
0.0004348158836364746,
0.361715704202652,
0.2731039226055145,
-0.14019687473773956,
-0.05468828231096268,
-0.15532337129116058,
-0.23779192566871643,
0.1403605192899704,
0.17907074093818665,
-0.12250175327062607,
0.17658990621566772,
-0.6017123460769653,
-0.022230319678783417,
-0.2926483452320099,
0.11850224435329437,
-0.03601868450641632,
-0.09288375824689865,
-0.17189356684684753,
-0.10042545944452286,
0.054575808346271515,
-0.4979945123195648,
0.06749049574136734,
-0.36459997296333313,
0.20196661353111267,
0.5927488207817078,
-0.00011433733743615448,
-0.05504603311419487,
0.25506722927093506,
0.06531652808189392,
0.04782625287771225,
0.06988869607448578,
-0.5054455399513245,
-0.16339950263500214,
-0.17035984992980957,
-0.492534339427948,
0.009167127311229706,
-0.043216995894908905,
-0.35508573055267334,
-0.3552670478820801,
0.12257466465234756,
0.5797805190086365,
0.18842190504074097,
0.21055498719215393,
-0.10033323615789413,
-0.16828662157058716,
0.29065990447998047,
-0.06987965106964111,
-0.08669678866863251,
0.09136532247066498,
0.2426360547542572,
0.06502654403448105,
0.07881006598472595,
0.21785716712474823,
-0.16679196059703827,
0.04538560286164284,
-0.04330847039818764,
0.07806110382080078,
0.19012883305549622,
-0.10533678531646729,
0.1103070080280304,
0.16660219430923462,
0.35878241062164307,
-0.21757176518440247,
-0.25079116225242615,
-0.10257519781589508,
0.0558738112449646,
-0.289587140083313,
0.10333367437124252,
0.034665822982788086,
0.023151103407144547,
0.11125850677490234,
-0.45199310779571533,
0.2900082767009735,
-0.13923662900924683,
0.15380439162254333,
-0.06919767707586288,
0.07946860790252686,
0.03709809109568596,
0.20616447925567627,
0.03207226097583771,
-0.26909497380256653,
0.10779057443141937,
-0.16774982213974,
-0.02561279572546482,
0.2080327868461609,
-0.3950224220752716,
-0.1643480360507965,
0.1141371876001358,
0.07945232093334198,
0.12134361267089844,
-0.18909484148025513,
0.03032372146844864,
0.05066867545247078,
0.2587851583957672,
-0.025957729667425156,
-0.00996898952871561,
-0.007999293506145477,
-0.24855439364910126,
0.28076082468032837,
0.10732701420783997,
0.2521888017654419,
-0.09001392871141434,
-0.0501071996986866,
0.1808483749628067,
-0.3330143392086029,
0.19541144371032715,
0.4226154386997223,
0.27505800127983093,
-0.006417952477931976,
-0.033698488026857376,
0.21991467475891113,
-0.04321630671620369,
0.07399804890155792,
0.21079882979393005,
0.4042799472808838,
0.08547594398260117,
0.045051392167806625,
0.07742397487163544,
0.19202417135238647,
-0.10698185861110687,
0.04981984198093414,
-0.2368675172328949,
0.2373100221157074,
-0.017548196017742157,
-0.14166027307510376,
-0.13741153478622437,
0.07704371213912964,
-0.01985790953040123,
0.0412735790014267,
-0.201093852519989,
-0.05506816506385803,
0.006564252078533173,
-0.2948133051395416,
0.1754138469696045,
0.36429888010025024,
-0.2644701302051544,
0.09270892292261124,
0.08352974057197571,
-0.006006084382534027,
-0.12376351654529572,
0.26681652665138245,
-0.250346839427948,
-0.38751715421676636,
-0.20235224068164825,
0.2267370969057083,
0.03169635683298111,
0.23744578659534454,
-0.09985288232564926,
-0.2426605224609375,
0.5225322246551514,
-0.2672891616821289,
0.36586806178092957,
-0.35014593601226807,
-0.33019548654556274,
-0.28617966175079346,
0.04621891677379608,
0.44217509031295776,
-0.0170942023396492,
0.26336148381233215,
-0.22913716733455658,
0.15521781146526337,
0.06998156756162643,
0.23842206597328186,
-0.002112165093421936,
0.20881155133247375,
-0.44165492057800293,
0.22298014163970947,
0.5143516659736633,
-0.1629805564880371,
-0.29353395104408264,
0.3101195693016052,
-0.3240566849708557,
-0.1369035542011261,
0.1706361323595047,
0.09749022126197815,
0.2634328603744507,
-0.22971117496490479,
0.14393676817417145,
0.10867129266262054,
-0.24965596199035645,
0.28388985991477966,
-0.124409019947052,
-0.12295101583003998,
0.14438551664352417,
-0.18921074271202087,
-0.09708338975906372,
0.09817241132259369,
0.2900686264038086,
-0.15073685348033905,
0.14167724549770355,
-0.28879448771476746,
0.0830364003777504,
0.29635047912597656,
0.15935149788856506,
-0.12146171927452087,
0.005884863436222076,
-0.15556970238685608,
-0.2694767415523529,
0.23954203724861145,
0.37202903628349304,
-0.1266930103302002,
-0.3021009564399719,
-0.2554123103618622,
-0.3354114890098572,
0.29121434688568115,
-0.1774308681488037,
0.2745823562145233,
0.06319399923086166,
-0.068495973944664,
0.22236602008342743,
-0.05709719657897949,
0.06703118979930878,
0.007765663787722588,
-0.3104986548423767,
-0.04480049014091492,
-0.32755404710769653,
0.20785407721996307,
-0.23246558010578156,
-0.15327498316764832,
-0.11824964731931686,
0.20953592658042908,
0.24143069982528687,
-0.1765192449092865,
-0.1173684298992157,
0.33075088262557983,
0.08915774524211884,
0.09214182198047638,
-0.4959746301174164,
0.0849652886390686,
0.1037415862083435,
-0.34361863136291504,
0.028100067749619484,
0.14170712232589722,
0.2561931312084198,
-0.027117103338241577,
-0.15689189732074738,
0.32087206840515137,
-0.0900687426328659,
0.24394063651561737,
-0.0367373526096344,
-0.021541517227888107,
0.14709191024303436,
-0.07866187393665314,
0.2098296582698822,
-0.23627354204654694,
0.05694771558046341,
0.10777070373296738,
0.005729861557483673,
-0.03168893977999687,
-0.07585946470499039,
0.15863734483718872,
0.5668790936470032,
-0.0793033242225647,
0.11287035793066025,
0.26591482758522034,
0.12772484123706818,
-0.0009565353393554688,
0.14388969540596008,
0.25258827209472656,
0.5420505404472351,
0.14554809033870697,
0.0539097860455513,
0.038372673094272614,
-0.10785365849733353,
-0.08979388326406479,
0.15662355720996857,
0.14471065998077393,
0.05033931881189346,
0.31691795587539673,
0.29274699091911316,
0.007316503673791885,
-0.06725208461284637,
-0.2803017795085907,
0.1676912009716034,
0.31990915536880493,
-0.4981811046600342,
0.12733431160449982,
-0.1428544968366623,
-0.06233671307563782,
-0.2776091396808624,
0.04565570130944252,
0.3051234781742096,
-0.28579479455947876,
-0.3146105408668518,
0.11909346282482147,
-0.24003544449806213,
0.24817027151584625,
-0.40546584129333496,
-0.2669484615325928,
0.3770153522491455,
-0.2141309678554535,
-0.0853646993637085,
-0.04435955733060837,
0.07167075574398041,
0.005333293229341507,
0.09867687523365021,
-0.05998445674777031,
0.2778925597667694,
0.07493780553340912,
-0.03903791680932045,
-0.32418498396873474,
-0.38823336362838745,
-0.022787488996982574,
-0.1484079211950302,
-0.10947920382022858,
0.4319031238555908,
0.19809545576572418,
0.04447959363460541,
-0.2522135376930237,
0.23219381272792816,
-0.054857101291418076,
-0.07053903490304947,
0.47808289527893066,
0.036977533251047134,
0.07042109221220016,
-0.20229485630989075,
-0.3545112609863281,
-0.05537128821015358,
-0.41177159547805786,
0.016740038990974426,
0.002962268888950348,
0.10031582415103912,
0.002886299043893814,
0.40228405594825745,
0.3068162798881531,
0.21710477769374847,
-0.1717892289161682,
-0.12168875336647034,
0.3281705379486084,
0.24345755577087402,
-0.06401757895946503,
-0.24227124452590942,
-0.07512465119361877,
-0.5806824564933777,
-0.14628612995147705,
0.23472753167152405,
-0.40402406454086304,
-0.22145839035511017,
-0.24602560698986053,
0.32319992780685425,
-0.08623417466878891,
-0.027767710387706757,
0.47810977697372437,
-0.018606038764119148,
-0.07854734361171722,
-0.20677977800369263,
-0.057440370321273804,
-0.005256321281194687,
0.20375320315361023,
-0.12911571562290192,
0.14995819330215454,
0.8351044058799744,
-0.027633000165224075,
0.08933666348457336,
0.23985004425048828,
-0.2540503144264221,
0.44250765442848206,
-0.3932558596134186,
0.0976397767663002,
-0.25378498435020447,
-0.16086475551128387,
-0.1039452776312828,
-0.021059885621070862,
-0.07964693009853363,
0.04729564115405083,
-0.12065397948026657,
-0.16436366736888885,
0.16702768206596375,
0.006506182253360748,
-0.10928527265787125,
-0.1862669289112091,
0.1262776404619217,
-0.15882685780525208,
0.2969193756580353,
-0.16427825391292572,
-0.06368041038513184,
-0.32136470079421997,
-0.04512687027454376,
0.03989338502287865,
-0.1930663138628006,
-0.0626244843006134,
-0.3104415833950043,
-0.33758407831192017,
-0.3714350461959839,
-0.29862457513809204,
0.44351494312286377,
0.5915877819061279,
0.6055492162704468,
-0.024097710847854614,
-0.12014071643352509,
0.051996782422065735,
-0.283937007188797,
0.8482605218887329,
-0.5643445253372192,
0.07273344695568085,
0.1398710161447525,
0.21876657009124756,
-0.31866255402565,
0.11023232340812683,
-0.006735846400260925,
0.007070738822221756,
-0.004787038080394268,
0.530360996723175,
-0.03930460661649704,
0.06239432469010353,
0.5120470523834229,
0.40896207094192505,
-0.04802490398287773,
-0.08920059353113174,
-0.09926392883062363,
-0.4339064359664917,
-0.2281184196472168,
0.18868401646614075,
0.21737128496170044,
0.10342790186405182,
0.07699686288833618,
-0.2933276891708374,
-0.02775852382183075,
-0.18571701645851135,
-0.1963285505771637,
0.043825410306453705,
0.2553834319114685,
0.1199321374297142,
0.4153044819831848,
-0.21210937201976776,
-0.4198070764541626,
0.006895182654261589,
0.5965350866317749,
-0.36610332131385803,
-0.14497509598731995,
-0.04562929645180702,
-0.26337507367134094,
0.19565747678279877,
0.2349807173013687,
-0.07238767296075821,
0.11907958984375,
-0.040629394352436066,
0.3120690584182739,
-0.300351083278656,
-0.12298303842544556,
0.39319610595703125,
0.016125693917274475,
-0.3105052411556244,
-0.38868629932403564,
0.3532569110393524,
0.024453938007354736,
-0.11431282758712769,
0.11581719666719437,
0.1615746021270752,
-0.35841047763824463,
0.5608789920806885,
0.025489673018455505,
0.7237347960472107,
-0.09851537644863129,
-0.08624444156885147,
0.4808209538459778,
-0.1388014554977417,
0.4092838168144226,
0.26600420475006104,
-0.007193075492978096,
-0.5069204568862915,
-0.35904720425605774,
-0.13096308708190918,
-0.17018553614616394,
0.17314791679382324,
0.14107036590576172,
-0.1982058882713318,
0.15886090695858002,
-0.2581198811531067,
0.3486849069595337,
-0.12849119305610657,
0.029429689049720764,
-0.036004289984703064,
-0.1772773414850235,
-0.31577590107917786,
0.13892418146133423,
0.12158556282520294,
-0.3496868908405304,
0.05336946249008179,
0.17314499616622925,
-0.009825117886066437,
-0.6655282378196716,
-0.15302300453186035,
0.06533516943454742,
0.00029783323407173157,
0.2046150267124176,
-0.06161842122673988,
-0.18196122348308563,
0.1303965151309967,
0.20556336641311646,
0.22747062146663666,
0.04112290218472481,
-0.0126781165599823,
0.04827733710408211,
0.37445423007011414,
0.1886022835969925,
0.203419491648674,
-0.07963795959949493,
0.2017744481563568,
0.12382584810256958,
-0.11924068629741669,
0.10922762751579285,
-0.20082880556583405,
-0.12851470708847046,
0.20312252640724182,
0.2883830666542053,
0.17036449909210205,
-0.3735780119895935,
-0.41540026664733887,
-0.24990680813789368,
-0.007863625884056091,
-0.22196251153945923,
0.09940038621425629,
-0.26148754358291626,
-0.08028808236122131,
0.27655425667762756,
-0.26227566599845886,
-0.2347562611103058,
-0.15171605348587036,
0.4439069330692291,
-0.0005794018507003784,
0.24805982410907745,
0.41989827156066895,
0.28128334879875183,
-0.1447449028491974,
-0.21312937140464783,
0.055728569626808167,
0.25310593843460083,
-0.7087969779968262,
-0.008557263761758804,
-0.21130144596099854,
-0.0023057013750076294,
0.18896594643592834,
0.2342977374792099,
-0.009047875180840492,
-0.14256711304187775,
-0.05710978806018829,
-0.321877121925354,
-0.465749055147171,
0.18810629844665527,
0.1209774911403656,
0.11424089968204498,
0.0197848379611969,
0.16559983789920807,
-0.20321816205978394,
-0.13091757893562317,
-0.26647213101387024,
0.08170736581087112,
-0.2472761571407318,
0.41713786125183105,
0.30545884370803833,
0.08089856058359146,
0.03218750283122063,
-0.13672959804534912,
0.17897659540176392,
0.31727197766304016,
-0.1632828563451767,
-0.20447702705860138,
-0.075144462287426,
0.09489388763904572,
0.02017807587981224,
-0.12266255170106888,
-0.16392815113067627,
-0.321288138628006,
-0.08347935974597931,
-0.2622205913066864,
0.05060683935880661,
0.10101233422756195,
-0.1502922922372818,
-0.10386106371879578,
0.25691771507263184,
-0.18093574047088623,
-0.011989355087280273,
0.25896936655044556,
-0.397104412317276,
0.018546652048826218,
-0.11673633009195328,
0.31229329109191895,
-0.048246949911117554,
-0.031532734632492065,
-0.006308883428573608,
0.038905780762434006,
-0.10027539730072021,
-0.1261478215456009,
0.5141867995262146,
-0.09177310764789581,
0.0852137953042984,
0.2804889380931854,
0.2521672248840332,
-0.026095889508724213,
-0.4464293420314789,
-0.1971946507692337,
0.053858935832977295,
0.20028220117092133,
-0.3231307864189148,
-0.23417222499847412,
0.10364274680614471,
-0.11791054904460907,
0.12456116825342178,
0.35611429810523987,
0.018901832401752472,
-0.23921819031238556,
0.04457049071788788,
0.21073460578918457,
0.5816619396209717,
-0.2610943913459778,
-0.03330203518271446,
0.6071075201034546,
-0.04962538555264473,
-0.07491113245487213,
0.15627215802669525,
0.1979503631591797,
0.42311328649520874,
0.30810073018074036,
0.022688573226332664,
-0.1203039139509201,
0.19396883249282837,
0.04261314868927002,
-0.190924733877182,
-0.5539606213569641,
0.5139065384864807,
0.17239266633987427,
-0.14615850150585175,
-0.021199125796556473,
0.3571550250053406,
-0.013183251023292542,
-0.16811203956604004,
-0.041593026369810104,
-0.12619826197624207,
0.08895610272884369,
-0.09663920104503632,
0.024722661823034286,
0.16504260897636414,
0.1217261552810669,
-0.17644622921943665,
-0.2167065143585205,
-0.015131335705518723,
0.14301857352256775,
0.6012574434280396,
0.12547819316387177,
0.22881749272346497,
-0.016419894993305206,
-0.061006397008895874,
0.0774136334657669,
-0.04536575451493263,
-0.47074100375175476,
0.31986916065216064,
0.34167271852493286,
0.013816621154546738,
0.13934040069580078,
-0.025126736611127853,
0.542805552482605,
0.1872151643037796,
-0.02503744512796402,
0.0665631964802742,
0.07583589851856232,
-0.10376866906881332,
0.0929599478840828,
0.12686143815517426,
-0.13002236187458038,
0.316996693611145,
0.2040766477584839,
0.15463456511497498,
-0.15049412846565247,
0.2237827330827713,
0.11448773741722107,
0.3509487211704254,
-0.20492613315582275,
0.4784025549888611,
-0.068890281021595,
-0.40491700172424316,
-0.05381511151790619,
0.11732491105794907,
-0.25864487886428833,
0.28956344723701477,
0.30080392956733704,
-0.4495639204978943,
0.3168323040008545,
0.15405379235744476,
0.07193487137556076,
0.0012909527868032455,
0.19898435473442078,
0.14402025938034058,
-0.035518109798431396,
-0.31420156359672546,
-0.09087346494197845,
-0.46379929780960083,
-0.12452145665884018,
-0.256482869386673,
-0.011379532516002655,
0.24349817633628845,
-0.11427641659975052,
-0.020122241228818893,
-0.12764964997768402,
0.16304484009742737,
-0.17262691259384155,
-0.11571945995092392,
0.34214332699775696,
-0.017865300178527832,
-0.5266839861869812,
-0.021598976105451584,
-0.10978584736585617,
-0.11822071671485901,
-0.5985739231109619,
0.3505050837993622,
-0.13325104117393494,
0.10409890115261078,
-0.10524965822696686,
-0.06480898708105087,
-0.021781712770462036,
-0.33429285883903503,
0.2362397313117981,
0.1917458474636078,
0.40661394596099854,
-0.20216655731201172,
0.11565908789634705,
-0.15102525055408478,
-0.3123185932636261,
0.0028548352420330048,
0.42791107296943665,
0.017585759982466698,
0.48849523067474365,
-0.11321419477462769,
0.03940751776099205,
-0.12033960223197937,
-0.052908893674612045,
-0.01031387597322464,
0.09840355813503265,
-0.2124854326248169,
0.48037999868392944,
-0.5130462646484375,
0.2160867154598236,
0.1373879611492157,
0.00970376469194889,
0.2349112629890442,
0.37298980355262756,
0.08563642203807831,
-0.7212560772895813,
0.5360859632492065,
-0.3975192606449127,
-0.2592470049858093,
0.12980446219444275,
0.35942602157592773,
-0.160140261054039,
-0.10496068745851517,
-0.4210330843925476,
0.005724266171455383,
0.4678092896938324,
-0.02764069102704525,
-0.30604639649391174,
0.12533007562160492,
-0.02293415740132332,
0.07178189605474472,
-0.011120319366455078,
0.28496846556663513,
-0.12363484501838684,
-0.19545763731002808,
0.20541223883628845,
-0.14836937189102173
] |
https://github.com/huggingface/datasets/issues/6311 | i test Sequence(ClassLabel) is ok if one column is label list. but it is not ok in nested column such as `Sequence(feature= {"points": Sequence(Value("int32")), "label": Sequence(ClassLabel(num_classes....)))`. in this case i need override ClassLabels. encode_example as i given above. | cast_column to Sequence with length=4 occur exception raise in datasets/table.py:2146 | ### Describe the bug
i load a dataset from local csv file which has 187383612 examples, then use `map` to generate new columns for test.
here is my code :
```
import os
from datasets import load_dataset
from datasets.features import Sequence, Value
def add_new_path(example):
example["ais_bbox"] = [100,100,200,200]
example["ais_image_path"] = os.path.join("images", example["image_path"]) if example["image_path"] else ""
return example
ais_dataset = load_dataset("/data/ryan.gao/ais_dataset_cache/raw/1749/")
hf_ds = ais_dataset.map(add_new_path, batched=False, num_proc=32)
ds = hf_ds.cast_column("ais_bbox", Sequence(Value("int32"), length=4))
```
and the `cast_column` raise an exception
```
Casting the dataset: 3%|ββββ
...
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2145, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
list<item: int64>
to
Sequence(feature=Value(dtype='int32', id=None), length=4, id=None)
```
i check the source code and make debug info:
in datasets/table.py:2092
```
2091 if feature.length > -1:
2092 if feature.length * len(array) == len(array.values):
2093 return pa.FixedSizeListArray.from_arrays(_c(array.values, feature.feature), feature.length)
2094 print(len(array))
2095 print(len(array.values))
```
my feature.length is 4. but feature.length * len(array) == len(array.values) is false.
print(len(array)) is 262
print(len(array.values)) is 4000
then I use "for item in array" to print each item then get 262 * [100,100,200,200]
and use "for item in array.values" to print each item and get 4000 int32 which are 1000 * [100,100,200,200]
i'm wondering the `chunk` in each `array.chunks`, the "chunk.values" may get all the chunks's value rather than single chunk? but i check the pyarrow's doc seems chunk.values is chunk's value not all.
### Steps to reproduce the bug
code provided above.
### Expected behavior
feature.length * len(array) == len(array.values) should be true. and there should not has Exception.
### Environment info
python3.9
x86_64
datasets: 2.14.4
pyarrow: 13.0.0 or 10.0.0 | 38 | cast_column to Sequence with length=4 occur exception raise in datasets/table.py:2146
### Describe the bug
i load a dataset from local csv file which has 187383612 examples, then use `map` to generate new columns for test.
here is my code :
```
import os
from datasets import load_dataset
from datasets.features import Sequence, Value
def add_new_path(example):
example["ais_bbox"] = [100,100,200,200]
example["ais_image_path"] = os.path.join("images", example["image_path"]) if example["image_path"] else ""
return example
ais_dataset = load_dataset("/data/ryan.gao/ais_dataset_cache/raw/1749/")
hf_ds = ais_dataset.map(add_new_path, batched=False, num_proc=32)
ds = hf_ds.cast_column("ais_bbox", Sequence(Value("int32"), length=4))
```
and the `cast_column` raise an exception
```
Casting the dataset: 3%|ββββ
...
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2145, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
list<item: int64>
to
Sequence(feature=Value(dtype='int32', id=None), length=4, id=None)
```
i check the source code and make debug info:
in datasets/table.py:2092
```
2091 if feature.length > -1:
2092 if feature.length * len(array) == len(array.values):
2093 return pa.FixedSizeListArray.from_arrays(_c(array.values, feature.feature), feature.length)
2094 print(len(array))
2095 print(len(array.values))
```
my feature.length is 4. but feature.length * len(array) == len(array.values) is false.
print(len(array)) is 262
print(len(array.values)) is 4000
then I use "for item in array" to print each item then get 262 * [100,100,200,200]
and use "for item in array.values" to print each item and get 4000 int32 which are 1000 * [100,100,200,200]
i'm wondering the `chunk` in each `array.chunks`, the "chunk.values" may get all the chunks's value rather than single chunk? but i check the pyarrow's doc seems chunk.values is chunk's value not all.
### Steps to reproduce the bug
code provided above.
### Expected behavior
feature.length * len(array) == len(array.values) should be true. and there should not has Exception.
### Environment info
python3.9
x86_64
datasets: 2.14.4
pyarrow: 13.0.0 or 10.0.0
i test Sequence(ClassLabel) is ok if one column is label list. but it is not ok in nested column such as `Sequence(feature= {"points": Sequence(Value("int32")), "label": Sequence(ClassLabel(num_classes....)))`. in this case i need override ClassLabels. encode_example as i given above. | [
-0.22929179668426514,
-0.11489871144294739,
-0.02320384792983532,
0.21615716814994812,
0.5230922102928162,
0.17112109065055847,
0.44043073058128357,
0.48009565472602844,
0.3565998077392578,
0.0004348158836364746,
0.361715704202652,
0.2731039226055145,
-0.14019687473773956,
-0.05468828231096268,
-0.15532337129116058,
-0.23779192566871643,
0.1403605192899704,
0.17907074093818665,
-0.12250175327062607,
0.17658990621566772,
-0.6017123460769653,
-0.022230319678783417,
-0.2926483452320099,
0.11850224435329437,
-0.03601868450641632,
-0.09288375824689865,
-0.17189356684684753,
-0.10042545944452286,
0.054575808346271515,
-0.4979945123195648,
0.06749049574136734,
-0.36459997296333313,
0.20196661353111267,
0.5927488207817078,
-0.00011433733743615448,
-0.05504603311419487,
0.25506722927093506,
0.06531652808189392,
0.04782625287771225,
0.06988869607448578,
-0.5054455399513245,
-0.16339950263500214,
-0.17035984992980957,
-0.492534339427948,
0.009167127311229706,
-0.043216995894908905,
-0.35508573055267334,
-0.3552670478820801,
0.12257466465234756,
0.5797805190086365,
0.18842190504074097,
0.21055498719215393,
-0.10033323615789413,
-0.16828662157058716,
0.29065990447998047,
-0.06987965106964111,
-0.08669678866863251,
0.09136532247066498,
0.2426360547542572,
0.06502654403448105,
0.07881006598472595,
0.21785716712474823,
-0.16679196059703827,
0.04538560286164284,
-0.04330847039818764,
0.07806110382080078,
0.19012883305549622,
-0.10533678531646729,
0.1103070080280304,
0.16660219430923462,
0.35878241062164307,
-0.21757176518440247,
-0.25079116225242615,
-0.10257519781589508,
0.0558738112449646,
-0.289587140083313,
0.10333367437124252,
0.034665822982788086,
0.023151103407144547,
0.11125850677490234,
-0.45199310779571533,
0.2900082767009735,
-0.13923662900924683,
0.15380439162254333,
-0.06919767707586288,
0.07946860790252686,
0.03709809109568596,
0.20616447925567627,
0.03207226097583771,
-0.26909497380256653,
0.10779057443141937,
-0.16774982213974,
-0.02561279572546482,
0.2080327868461609,
-0.3950224220752716,
-0.1643480360507965,
0.1141371876001358,
0.07945232093334198,
0.12134361267089844,
-0.18909484148025513,
0.03032372146844864,
0.05066867545247078,
0.2587851583957672,
-0.025957729667425156,
-0.00996898952871561,
-0.007999293506145477,
-0.24855439364910126,
0.28076082468032837,
0.10732701420783997,
0.2521888017654419,
-0.09001392871141434,
-0.0501071996986866,
0.1808483749628067,
-0.3330143392086029,
0.19541144371032715,
0.4226154386997223,
0.27505800127983093,
-0.006417952477931976,
-0.033698488026857376,
0.21991467475891113,
-0.04321630671620369,
0.07399804890155792,
0.21079882979393005,
0.4042799472808838,
0.08547594398260117,
0.045051392167806625,
0.07742397487163544,
0.19202417135238647,
-0.10698185861110687,
0.04981984198093414,
-0.2368675172328949,
0.2373100221157074,
-0.017548196017742157,
-0.14166027307510376,
-0.13741153478622437,
0.07704371213912964,
-0.01985790953040123,
0.0412735790014267,
-0.201093852519989,
-0.05506816506385803,
0.006564252078533173,
-0.2948133051395416,
0.1754138469696045,
0.36429888010025024,
-0.2644701302051544,
0.09270892292261124,
0.08352974057197571,
-0.006006084382534027,
-0.12376351654529572,
0.26681652665138245,
-0.250346839427948,
-0.38751715421676636,
-0.20235224068164825,
0.2267370969057083,
0.03169635683298111,
0.23744578659534454,
-0.09985288232564926,
-0.2426605224609375,
0.5225322246551514,
-0.2672891616821289,
0.36586806178092957,
-0.35014593601226807,
-0.33019548654556274,
-0.28617966175079346,
0.04621891677379608,
0.44217509031295776,
-0.0170942023396492,
0.26336148381233215,
-0.22913716733455658,
0.15521781146526337,
0.06998156756162643,
0.23842206597328186,
-0.002112165093421936,
0.20881155133247375,
-0.44165492057800293,
0.22298014163970947,
0.5143516659736633,
-0.1629805564880371,
-0.29353395104408264,
0.3101195693016052,
-0.3240566849708557,
-0.1369035542011261,
0.1706361323595047,
0.09749022126197815,
0.2634328603744507,
-0.22971117496490479,
0.14393676817417145,
0.10867129266262054,
-0.24965596199035645,
0.28388985991477966,
-0.124409019947052,
-0.12295101583003998,
0.14438551664352417,
-0.18921074271202087,
-0.09708338975906372,
0.09817241132259369,
0.2900686264038086,
-0.15073685348033905,
0.14167724549770355,
-0.28879448771476746,
0.0830364003777504,
0.29635047912597656,
0.15935149788856506,
-0.12146171927452087,
0.005884863436222076,
-0.15556970238685608,
-0.2694767415523529,
0.23954203724861145,
0.37202903628349304,
-0.1266930103302002,
-0.3021009564399719,
-0.2554123103618622,
-0.3354114890098572,
0.29121434688568115,
-0.1774308681488037,
0.2745823562145233,
0.06319399923086166,
-0.068495973944664,
0.22236602008342743,
-0.05709719657897949,
0.06703118979930878,
0.007765663787722588,
-0.3104986548423767,
-0.04480049014091492,
-0.32755404710769653,
0.20785407721996307,
-0.23246558010578156,
-0.15327498316764832,
-0.11824964731931686,
0.20953592658042908,
0.24143069982528687,
-0.1765192449092865,
-0.1173684298992157,
0.33075088262557983,
0.08915774524211884,
0.09214182198047638,
-0.4959746301174164,
0.0849652886390686,
0.1037415862083435,
-0.34361863136291504,
0.028100067749619484,
0.14170712232589722,
0.2561931312084198,
-0.027117103338241577,
-0.15689189732074738,
0.32087206840515137,
-0.0900687426328659,
0.24394063651561737,
-0.0367373526096344,
-0.021541517227888107,
0.14709191024303436,
-0.07866187393665314,
0.2098296582698822,
-0.23627354204654694,
0.05694771558046341,
0.10777070373296738,
0.005729861557483673,
-0.03168893977999687,
-0.07585946470499039,
0.15863734483718872,
0.5668790936470032,
-0.0793033242225647,
0.11287035793066025,
0.26591482758522034,
0.12772484123706818,
-0.0009565353393554688,
0.14388969540596008,
0.25258827209472656,
0.5420505404472351,
0.14554809033870697,
0.0539097860455513,
0.038372673094272614,
-0.10785365849733353,
-0.08979388326406479,
0.15662355720996857,
0.14471065998077393,
0.05033931881189346,
0.31691795587539673,
0.29274699091911316,
0.007316503673791885,
-0.06725208461284637,
-0.2803017795085907,
0.1676912009716034,
0.31990915536880493,
-0.4981811046600342,
0.12733431160449982,
-0.1428544968366623,
-0.06233671307563782,
-0.2776091396808624,
0.04565570130944252,
0.3051234781742096,
-0.28579479455947876,
-0.3146105408668518,
0.11909346282482147,
-0.24003544449806213,
0.24817027151584625,
-0.40546584129333496,
-0.2669484615325928,
0.3770153522491455,
-0.2141309678554535,
-0.0853646993637085,
-0.04435955733060837,
0.07167075574398041,
0.005333293229341507,
0.09867687523365021,
-0.05998445674777031,
0.2778925597667694,
0.07493780553340912,
-0.03903791680932045,
-0.32418498396873474,
-0.38823336362838745,
-0.022787488996982574,
-0.1484079211950302,
-0.10947920382022858,
0.4319031238555908,
0.19809545576572418,
0.04447959363460541,
-0.2522135376930237,
0.23219381272792816,
-0.054857101291418076,
-0.07053903490304947,
0.47808289527893066,
0.036977533251047134,
0.07042109221220016,
-0.20229485630989075,
-0.3545112609863281,
-0.05537128821015358,
-0.41177159547805786,
0.016740038990974426,
0.002962268888950348,
0.10031582415103912,
0.002886299043893814,
0.40228405594825745,
0.3068162798881531,
0.21710477769374847,
-0.1717892289161682,
-0.12168875336647034,
0.3281705379486084,
0.24345755577087402,
-0.06401757895946503,
-0.24227124452590942,
-0.07512465119361877,
-0.5806824564933777,
-0.14628612995147705,
0.23472753167152405,
-0.40402406454086304,
-0.22145839035511017,
-0.24602560698986053,
0.32319992780685425,
-0.08623417466878891,
-0.027767710387706757,
0.47810977697372437,
-0.018606038764119148,
-0.07854734361171722,
-0.20677977800369263,
-0.057440370321273804,
-0.005256321281194687,
0.20375320315361023,
-0.12911571562290192,
0.14995819330215454,
0.8351044058799744,
-0.027633000165224075,
0.08933666348457336,
0.23985004425048828,
-0.2540503144264221,
0.44250765442848206,
-0.3932558596134186,
0.0976397767663002,
-0.25378498435020447,
-0.16086475551128387,
-0.1039452776312828,
-0.021059885621070862,
-0.07964693009853363,
0.04729564115405083,
-0.12065397948026657,
-0.16436366736888885,
0.16702768206596375,
0.006506182253360748,
-0.10928527265787125,
-0.1862669289112091,
0.1262776404619217,
-0.15882685780525208,
0.2969193756580353,
-0.16427825391292572,
-0.06368041038513184,
-0.32136470079421997,
-0.04512687027454376,
0.03989338502287865,
-0.1930663138628006,
-0.0626244843006134,
-0.3104415833950043,
-0.33758407831192017,
-0.3714350461959839,
-0.29862457513809204,
0.44351494312286377,
0.5915877819061279,
0.6055492162704468,
-0.024097710847854614,
-0.12014071643352509,
0.051996782422065735,
-0.283937007188797,
0.8482605218887329,
-0.5643445253372192,
0.07273344695568085,
0.1398710161447525,
0.21876657009124756,
-0.31866255402565,
0.11023232340812683,
-0.006735846400260925,
0.007070738822221756,
-0.004787038080394268,
0.530360996723175,
-0.03930460661649704,
0.06239432469010353,
0.5120470523834229,
0.40896207094192505,
-0.04802490398287773,
-0.08920059353113174,
-0.09926392883062363,
-0.4339064359664917,
-0.2281184196472168,
0.18868401646614075,
0.21737128496170044,
0.10342790186405182,
0.07699686288833618,
-0.2933276891708374,
-0.02775852382183075,
-0.18571701645851135,
-0.1963285505771637,
0.043825410306453705,
0.2553834319114685,
0.1199321374297142,
0.4153044819831848,
-0.21210937201976776,
-0.4198070764541626,
0.006895182654261589,
0.5965350866317749,
-0.36610332131385803,
-0.14497509598731995,
-0.04562929645180702,
-0.26337507367134094,
0.19565747678279877,
0.2349807173013687,
-0.07238767296075821,
0.11907958984375,
-0.040629394352436066,
0.3120690584182739,
-0.300351083278656,
-0.12298303842544556,
0.39319610595703125,
0.016125693917274475,
-0.3105052411556244,
-0.38868629932403564,
0.3532569110393524,
0.024453938007354736,
-0.11431282758712769,
0.11581719666719437,
0.1615746021270752,
-0.35841047763824463,
0.5608789920806885,
0.025489673018455505,
0.7237347960472107,
-0.09851537644863129,
-0.08624444156885147,
0.4808209538459778,
-0.1388014554977417,
0.4092838168144226,
0.26600420475006104,
-0.007193075492978096,
-0.5069204568862915,
-0.35904720425605774,
-0.13096308708190918,
-0.17018553614616394,
0.17314791679382324,
0.14107036590576172,
-0.1982058882713318,
0.15886090695858002,
-0.2581198811531067,
0.3486849069595337,
-0.12849119305610657,
0.029429689049720764,
-0.036004289984703064,
-0.1772773414850235,
-0.31577590107917786,
0.13892418146133423,
0.12158556282520294,
-0.3496868908405304,
0.05336946249008179,
0.17314499616622925,
-0.009825117886066437,
-0.6655282378196716,
-0.15302300453186035,
0.06533516943454742,
0.00029783323407173157,
0.2046150267124176,
-0.06161842122673988,
-0.18196122348308563,
0.1303965151309967,
0.20556336641311646,
0.22747062146663666,
0.04112290218472481,
-0.0126781165599823,
0.04827733710408211,
0.37445423007011414,
0.1886022835969925,
0.203419491648674,
-0.07963795959949493,
0.2017744481563568,
0.12382584810256958,
-0.11924068629741669,
0.10922762751579285,
-0.20082880556583405,
-0.12851470708847046,
0.20312252640724182,
0.2883830666542053,
0.17036449909210205,
-0.3735780119895935,
-0.41540026664733887,
-0.24990680813789368,
-0.007863625884056091,
-0.22196251153945923,
0.09940038621425629,
-0.26148754358291626,
-0.08028808236122131,
0.27655425667762756,
-0.26227566599845886,
-0.2347562611103058,
-0.15171605348587036,
0.4439069330692291,
-0.0005794018507003784,
0.24805982410907745,
0.41989827156066895,
0.28128334879875183,
-0.1447449028491974,
-0.21312937140464783,
0.055728569626808167,
0.25310593843460083,
-0.7087969779968262,
-0.008557263761758804,
-0.21130144596099854,
-0.0023057013750076294,
0.18896594643592834,
0.2342977374792099,
-0.009047875180840492,
-0.14256711304187775,
-0.05710978806018829,
-0.321877121925354,
-0.465749055147171,
0.18810629844665527,
0.1209774911403656,
0.11424089968204498,
0.0197848379611969,
0.16559983789920807,
-0.20321816205978394,
-0.13091757893562317,
-0.26647213101387024,
0.08170736581087112,
-0.2472761571407318,
0.41713786125183105,
0.30545884370803833,
0.08089856058359146,
0.03218750283122063,
-0.13672959804534912,
0.17897659540176392,
0.31727197766304016,
-0.1632828563451767,
-0.20447702705860138,
-0.075144462287426,
0.09489388763904572,
0.02017807587981224,
-0.12266255170106888,
-0.16392815113067627,
-0.321288138628006,
-0.08347935974597931,
-0.2622205913066864,
0.05060683935880661,
0.10101233422756195,
-0.1502922922372818,
-0.10386106371879578,
0.25691771507263184,
-0.18093574047088623,
-0.011989355087280273,
0.25896936655044556,
-0.397104412317276,
0.018546652048826218,
-0.11673633009195328,
0.31229329109191895,
-0.048246949911117554,
-0.031532734632492065,
-0.006308883428573608,
0.038905780762434006,
-0.10027539730072021,
-0.1261478215456009,
0.5141867995262146,
-0.09177310764789581,
0.0852137953042984,
0.2804889380931854,
0.2521672248840332,
-0.026095889508724213,
-0.4464293420314789,
-0.1971946507692337,
0.053858935832977295,
0.20028220117092133,
-0.3231307864189148,
-0.23417222499847412,
0.10364274680614471,
-0.11791054904460907,
0.12456116825342178,
0.35611429810523987,
0.018901832401752472,
-0.23921819031238556,
0.04457049071788788,
0.21073460578918457,
0.5816619396209717,
-0.2610943913459778,
-0.03330203518271446,
0.6071075201034546,
-0.04962538555264473,
-0.07491113245487213,
0.15627215802669525,
0.1979503631591797,
0.42311328649520874,
0.30810073018074036,
0.022688573226332664,
-0.1203039139509201,
0.19396883249282837,
0.04261314868927002,
-0.190924733877182,
-0.5539606213569641,
0.5139065384864807,
0.17239266633987427,
-0.14615850150585175,
-0.021199125796556473,
0.3571550250053406,
-0.013183251023292542,
-0.16811203956604004,
-0.041593026369810104,
-0.12619826197624207,
0.08895610272884369,
-0.09663920104503632,
0.024722661823034286,
0.16504260897636414,
0.1217261552810669,
-0.17644622921943665,
-0.2167065143585205,
-0.015131335705518723,
0.14301857352256775,
0.6012574434280396,
0.12547819316387177,
0.22881749272346497,
-0.016419894993305206,
-0.061006397008895874,
0.0774136334657669,
-0.04536575451493263,
-0.47074100375175476,
0.31986916065216064,
0.34167271852493286,
0.013816621154546738,
0.13934040069580078,
-0.025126736611127853,
0.542805552482605,
0.1872151643037796,
-0.02503744512796402,
0.0665631964802742,
0.07583589851856232,
-0.10376866906881332,
0.0929599478840828,
0.12686143815517426,
-0.13002236187458038,
0.316996693611145,
0.2040766477584839,
0.15463456511497498,
-0.15049412846565247,
0.2237827330827713,
0.11448773741722107,
0.3509487211704254,
-0.20492613315582275,
0.4784025549888611,
-0.068890281021595,
-0.40491700172424316,
-0.05381511151790619,
0.11732491105794907,
-0.25864487886428833,
0.28956344723701477,
0.30080392956733704,
-0.4495639204978943,
0.3168323040008545,
0.15405379235744476,
0.07193487137556076,
0.0012909527868032455,
0.19898435473442078,
0.14402025938034058,
-0.035518109798431396,
-0.31420156359672546,
-0.09087346494197845,
-0.46379929780960083,
-0.12452145665884018,
-0.256482869386673,
-0.011379532516002655,
0.24349817633628845,
-0.11427641659975052,
-0.020122241228818893,
-0.12764964997768402,
0.16304484009742737,
-0.17262691259384155,
-0.11571945995092392,
0.34214332699775696,
-0.017865300178527832,
-0.5266839861869812,
-0.021598976105451584,
-0.10978584736585617,
-0.11822071671485901,
-0.5985739231109619,
0.3505050837993622,
-0.13325104117393494,
0.10409890115261078,
-0.10524965822696686,
-0.06480898708105087,
-0.021781712770462036,
-0.33429285883903503,
0.2362397313117981,
0.1917458474636078,
0.40661394596099854,
-0.20216655731201172,
0.11565908789634705,
-0.15102525055408478,
-0.3123185932636261,
0.0028548352420330048,
0.42791107296943665,
0.017585759982466698,
0.48849523067474365,
-0.11321419477462769,
0.03940751776099205,
-0.12033960223197937,
-0.052908893674612045,
-0.01031387597322464,
0.09840355813503265,
-0.2124854326248169,
0.48037999868392944,
-0.5130462646484375,
0.2160867154598236,
0.1373879611492157,
0.00970376469194889,
0.2349112629890442,
0.37298980355262756,
0.08563642203807831,
-0.7212560772895813,
0.5360859632492065,
-0.3975192606449127,
-0.2592470049858093,
0.12980446219444275,
0.35942602157592773,
-0.160140261054039,
-0.10496068745851517,
-0.4210330843925476,
0.005724266171455383,
0.4678092896938324,
-0.02764069102704525,
-0.30604639649391174,
0.12533007562160492,
-0.02293415740132332,
0.07178189605474472,
-0.011120319366455078,
0.28496846556663513,
-0.12363484501838684,
-0.19545763731002808,
0.20541223883628845,
-0.14836937189102173
] |
https://github.com/huggingface/datasets/issues/6308 | This (Windows) issue was fixed in `fsspec` in https://github.com/fsspec/filesystem_spec/pull/1275. So, to avoid the error, update the `fsspec` installation with `pip install -U fsspec`. | module 'resource' has no attribute 'error' | ### Describe the bug
just run import:
`from datasets import load_dataset`
and then:
```
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module>
from .arrow_dataset import Dataset
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module>
from .arrow_reader import ArrowReader
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module>
from .download.download_config import DownloadConfig
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module>
from .streaming_download_manager import StreamingDownloadManager
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module>
from ..filesystems import COMPRESSION_FILESYSTEMS
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module>
import fsspec.asyn
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module>
ResourceEror = resource.error
AttributeError: module 'resource' has no attribute 'error'
Process finished with exit code 1
```
and the error codes are:
```
try:
import resource
except ImportError:
resource = None
ResourceError = OSError
else:
ResourceEror = resource.error
```
1. miss spelling : "ResourceEror " should be "ResourceErorr"
2. module 'resource' has no attribute 'error'
### Steps to reproduce the bug
only one step:
`from datasets import load_dataset`
### Expected behavior
slove error: module 'resource' has no attribute 'error'
### Environment info
python=3.10
datasets==2.14.5
| 23 | module 'resource' has no attribute 'error'
### Describe the bug
just run import:
`from datasets import load_dataset`
and then:
```
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module>
from .arrow_dataset import Dataset
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module>
from .arrow_reader import ArrowReader
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module>
from .download.download_config import DownloadConfig
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module>
from .streaming_download_manager import StreamingDownloadManager
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module>
from ..filesystems import COMPRESSION_FILESYSTEMS
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module>
import fsspec.asyn
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module>
ResourceEror = resource.error
AttributeError: module 'resource' has no attribute 'error'
Process finished with exit code 1
```
and the error codes are:
```
try:
import resource
except ImportError:
resource = None
ResourceError = OSError
else:
ResourceEror = resource.error
```
1. miss spelling : "ResourceEror " should be "ResourceErorr"
2. module 'resource' has no attribute 'error'
### Steps to reproduce the bug
only one step:
`from datasets import load_dataset`
### Expected behavior
slove error: module 'resource' has no attribute 'error'
### Environment info
python=3.10
datasets==2.14.5
This (Windows) issue was fixed in `fsspec` in https://github.com/fsspec/filesystem_spec/pull/1275. So, to avoid the error, update the `fsspec` installation with `pip install -U fsspec`. | [
-0.3986871838569641,
-0.19148069620132446,
-0.12688815593719482,
0.3200543522834778,
0.6016736626625061,
-0.017333589494228363,
0.11214470118284225,
0.34752100706100464,
-0.19669853150844574,
0.062872976064682,
0.0392395481467247,
0.4419638514518738,
-0.10753051936626434,
-0.14714926481246948,
-0.14010368287563324,
-0.11447444558143616,
0.06480234861373901,
0.260962575674057,
-0.0880909264087677,
-0.03188542276620865,
-0.36739176511764526,
0.2021857649087906,
-0.10201127082109451,
0.047752246260643005,
-0.21952451765537262,
-0.04417954385280609,
0.10654699057340622,
0.15111079812049866,
-0.2045445591211319,
-0.6687843203544617,
0.14584751427173615,
-0.23429903388023376,
0.028916023671627045,
0.26385486125946045,
-0.00010483679216122255,
-0.09192080795764923,
0.5043992400169373,
0.008851990103721619,
-0.4519427418708801,
-0.007060334086418152,
-0.11310628801584244,
-0.20801551640033722,
0.12791267037391663,
-0.21501636505126953,
-0.044825952500104904,
-0.4287731349468231,
-0.1606680005788803,
-0.40501102805137634,
0.23424802720546722,
0.4217064082622528,
0.34836190938949585,
0.24183562397956848,
0.1448751538991928,
-0.2604690194129944,
0.16497796773910522,
-0.0533805675804615,
0.03902014344930649,
0.16846546530723572,
0.12975946068763733,
0.015747182071208954,
0.11311238259077072,
0.31473028659820557,
-0.08487847447395325,
0.13144570589065552,
0.302755206823349,
-0.15515360236167908,
0.14862596988677979,
-0.2968238294124603,
0.05527511239051819,
-0.05779068544507027,
0.5392397046089172,
-0.034135714173316956,
-0.36789292097091675,
0.06743358075618744,
0.017345178872346878,
-0.23995618522167206,
0.19696465134620667,
0.30048757791519165,
-0.1930186152458191,
0.08963553607463837,
0.286438524723053,
-0.051690805703401566,
-0.06290028989315033,
0.0989265963435173,
0.08745156228542328,
0.12008987367153168,
-0.22417493164539337,
0.04634222388267517,
0.13342946767807007,
-0.12949509918689728,
0.2350088208913803,
0.02024158090353012,
-0.29285550117492676,
0.1330656111240387,
-0.44092464447021484,
0.024414561688899994,
0.05100492760539055,
0.012131383642554283,
0.01860540360212326,
0.3788936734199524,
-0.03765168786048889,
0.00023193657398223877,
0.17601843178272247,
0.18408989906311035,
0.1895536184310913,
0.10283287614583969,
0.07154086232185364,
0.0035066157579421997,
0.12637928128242493,
0.21012632548809052,
-0.04979006573557854,
-0.13064490258693695,
-0.1766434609889984,
-0.3413331210613251,
0.07800815254449844,
0.12137284874916077,
0.3286736011505127,
-0.05898531898856163,
-0.4270513355731964,
0.02394947037100792,
0.17235378921031952,
0.06902807950973511,
-0.08004437386989594,
0.4805881381034851,
-0.15534672141075134,
0.329429030418396,
0.1783149540424347,
0.22648975253105164,
-0.17851240932941437,
-0.30053019523620605,
-0.215915247797966,
0.14063119888305664,
-0.27959132194519043,
-0.14538903534412384,
0.029338106513023376,
0.024687573313713074,
0.4568535387516022,
-0.11171720176935196,
-0.222735196352005,
-0.1489749252796173,
0.22611063718795776,
-0.27641230821609497,
-0.12802374362945557,
0.3855404555797577,
-0.014411747455596924,
0.1719397008419037,
0.17336814105510712,
0.011520683765411377,
0.074625164270401,
-0.002746591344475746,
-0.2583906948566437,
-0.3184252679347992,
-0.22839117050170898,
0.3683519661426544,
0.07826777547597885,
0.1056184321641922,
-0.09796086698770523,
-0.04842836409807205,
0.11204215884208679,
-0.19315597414970398,
-0.03456122800707817,
-0.041569147258996964,
-0.17159491777420044,
-0.32063010334968567,
0.2160150110721588,
0.5213679075241089,
-0.1373402327299118,
-0.16828979551792145,
-0.24254797399044037,
-0.18697704374790192,
0.2844105660915375,
-0.030206605792045593,
-0.22740665078163147,
0.0901920422911644,
-0.25047287344932556,
0.046258628368377686,
0.5648531913757324,
-0.33318474888801575,
-0.4129411578178406,
0.2338258922100067,
-0.18880128860473633,
-0.26704880595207214,
0.24048277735710144,
0.019981399178504944,
0.2917977571487427,
-0.053338583558797836,
0.3668214678764343,
0.30355146527290344,
0.11220022290945053,
0.09092199057340622,
-0.28905799984931946,
-0.16056713461875916,
-0.055116258561611176,
0.036516204476356506,
-0.015350611880421638,
0.08678215742111206,
0.3798639476299286,
0.014846529811620712,
0.12530504167079926,
0.03634697198867798,
0.17941954731941223,
0.3228355050086975,
0.2983788549900055,
-0.04185072332620621,
-0.02910441905260086,
-0.17905525863170624,
-0.1014188602566719,
0.09706919640302658,
-0.14870862662792206,
-0.13952836394309998,
-0.1927272528409958,
-0.06654711812734604,
-0.2962522506713867,
-0.10102593898773193,
-0.33796244859695435,
-0.40390288829803467,
0.26073887944221497,
0.2557607591152191,
0.010291822254657745,
0.1903303861618042,
-0.1587284654378891,
0.2990480363368988,
-0.12815028429031372,
0.09859730303287506,
-0.044426631182432175,
0.13323085010051727,
-0.20837633311748505,
-0.19715864956378937,
0.04790857434272766,
-0.04191511496901512,
0.20967763662338257,
0.051320880651474,
-0.22130677103996277,
0.3515278697013855,
0.13364878296852112,
0.3526466488838196,
0.013181719928979874,
-0.29880303144454956,
0.27251961827278137,
-0.47287416458129883,
0.0004012109711766243,
0.13062113523483276,
0.2847999930381775,
-0.02720218151807785,
0.21377089619636536,
-0.06495235115289688,
0.09433408826589584,
0.13636913895606995,
0.222360759973526,
0.3125946819782257,
0.35975390672683716,
0.006679564714431763,
0.01977430284023285,
-0.15489694476127625,
0.1976737380027771,
0.09712933748960495,
0.12405706942081451,
-0.08774727582931519,
-0.14016833901405334,
0.04638201743364334,
0.45388486981391907,
0.17620255053043365,
0.034853339195251465,
0.0689816027879715,
-0.46566787362098694,
0.06784264743328094,
0.23514477908611298,
0.5774679780006409,
0.5735413432121277,
0.19620811939239502,
-0.09667365998029709,
0.11954762786626816,
0.26265379786491394,
-0.011760137975215912,
0.3910399377346039,
0.05885463207960129,
0.29732832312583923,
0.30188387632369995,
0.06957201659679413,
0.0655592530965805,
-0.24741758406162262,
-0.3473672568798065,
-0.017745796591043472,
0.2081046849489212,
-0.2101595401763916,
0.04224134236574173,
-0.18250373005867004,
0.037987321615219116,
-0.19277538359165192,
-0.06389997154474258,
0.16230875253677368,
-0.13721761107444763,
-0.09366515278816223,
0.20348602533340454,
-0.1252271980047226,
0.26980704069137573,
-0.25998038053512573,
-0.07745955884456635,
0.17376813292503357,
-0.04570259898900986,
-0.0702543705701828,
-0.1407497525215149,
-0.017585698515176773,
0.05963718146085739,
0.12874868512153625,
0.0441877581179142,
0.3856377899646759,
-0.10879819095134735,
0.1394970417022705,
-0.2698422372341156,
0.019003376364707947,
0.0959814041852951,
0.05380180478096008,
0.13128907978534698,
0.1382017284631729,
0.11238909512758255,
0.07462994754314423,
-0.22016967833042145,
0.42836764454841614,
-0.19458577036857605,
-0.2052070051431656,
0.18634647130966187,
0.02353888377547264,
-0.13801562786102295,
-0.26377904415130615,
-0.4884738624095917,
-0.4124785363674164,
-0.6430261731147766,
-0.03672435134649277,
0.04750678688287735,
0.09605056047439575,
0.22985637187957764,
0.3069297969341278,
0.22885356843471527,
0.06383587419986725,
0.2650013267993927,
-0.15014635026454926,
-0.11194655299186707,
0.319204717874527,
-0.36667829751968384,
-0.4397984743118286,
0.05553367733955383,
-0.10016590356826782,
0.20444096624851227,
0.30616647005081177,
-0.1695614606142044,
0.05344012379646301,
-0.13546708226203918,
-0.11284831166267395,
-0.1928335279226303,
0.21472567319869995,
0.3281360864639282,
0.28163236379623413,
-0.2832147777080536,
-0.19891352951526642,
0.17550691962242126,
-0.10355570912361145,
-0.025086283683776855,
0.21830442547798157,
0.03110937774181366,
0.27250683307647705,
-0.15272510051727295,
0.47176826000213623,
0.23121067881584167,
-0.004758144728839397,
0.5463314056396484,
-0.16185930371284485,
0.23490823805332184,
-0.09197065234184265,
-0.3276529312133789,
-0.11282053589820862,
-0.12778539955615997,
0.12687534093856812,
0.09309892356395721,
-0.0664772242307663,
-0.15356768667697906,
-0.22586995363235474,
-0.027622882276773453,
-0.3518002927303314,
0.024523869156837463,
-0.14036591351032257,
-0.1553347110748291,
0.2582381069660187,
-0.1341891586780548,
0.09026472270488739,
0.05438707396388054,
0.21625855565071106,
0.1886403113603592,
0.0913459062576294,
-0.15935540199279785,
0.022454775869846344,
-0.11565561592578888,
-0.10236471146345139,
-0.24347202479839325,
0.13453754782676697,
-0.10242906212806702,
0.33950501680374146,
0.059418320655822754,
-0.10687941312789917,
0.04164735972881317,
-0.1243746280670166,
0.4841497242450714,
-0.1642855852842331,
0.08949726819992065,
0.019013479351997375,
0.21633175015449524,
-0.42394769191741943,
-0.011655241250991821,
-0.060948193073272705,
0.0501217246055603,
-0.2389349341392517,
0.14439800381660461,
-0.2057364583015442,
-0.07361974567174911,
-0.10077854990959167,
0.05520864948630333,
-0.15522676706314087,
0.15147417783737183,
-0.33706945180892944,
-0.2913549542427063,
-0.5706391334533691,
-0.07889419049024582,
-0.06040922552347183,
0.17670713365077972,
0.16742752492427826,
-0.11410672217607498,
-0.19909228384494781,
0.059666238725185394,
-0.0975431278347969,
0.010022297501564026,
0.5705114006996155,
-0.33834415674209595,
0.1523469239473343,
0.03892131894826889,
0.05544844642281532,
0.530432939529419,
0.8282788991928101,
-0.01291879452764988,
-0.40164196491241455,
-0.042788002640008926,
-0.14498186111450195,
0.1748020201921463,
0.0034456923604011536,
-0.2307189702987671,
-0.02312638610601425,
-0.180494487285614,
0.20934417843818665,
-0.08178849518299103,
0.016674529761075974,
0.4775576889514923,
-0.017120786011219025,
-0.040978919714689255,
-0.3274292051792145,
0.25784412026405334,
-0.06416185200214386,
0.05417972803115845,
0.3487032651901245,
0.20437228679656982,
-0.061087995767593384,
0.19808165729045868,
-0.02690736949443817,
0.7757598161697388,
0.3213708698749542,
-0.015628965571522713,
0.30154693126678467,
-0.19606459140777588,
0.3399161696434021,
-0.31315097212791443,
0.1797807812690735,
-0.29715394973754883,
-0.023660294711589813,
0.008242763578891754,
-0.1804746687412262,
0.2441743165254593,
-0.05351950600743294,
-0.34070175886154175,
0.1377055048942566,
-0.3723523020744324,
-0.06400715559720993,
-0.11289745569229126,
0.06798258423805237,
-0.20302459597587585,
-0.17434045672416687,
-0.2316419780254364,
0.2852781414985657,
-0.07309538871049881,
0.31959155201911926,
-0.09175578504800797,
-0.09823864698410034,
-0.05971657857298851,
-0.39254841208457947,
-0.16108402609825134,
0.23592166602611542,
-0.25698989629745483,
0.22441323101520538,
-0.21450895071029663,
-0.1136239543557167,
0.07830995321273804,
0.2093053162097931,
-0.11662596464157104,
-0.07253365218639374,
-0.16346916556358337,
0.14833463728427887,
0.014172124676406384,
-0.009479228407144547,
-0.20777563750743866,
0.012999117374420166,
0.4080066382884979,
-0.23594367504119873,
-0.22264808416366577,
0.2557586431503296,
-0.22250865399837494,
0.01425468921661377,
0.45749104022979736,
0.01079617254436016,
0.05272100120782852,
-0.06154736876487732,
-0.28134217858314514,
-0.0720173716545105,
-0.18000775575637817,
-0.19125807285308838,
0.24518226087093353,
-0.054095543920993805,
-0.34883999824523926,
0.15232327580451965,
0.17695757746696472,
-0.07935263216495514,
-0.05687965825200081,
0.28506165742874146,
-0.006674742326140404,
0.24185405671596527,
0.47649580240249634,
-0.2127925455570221,
-0.23220565915107727,
-0.41951900720596313,
-0.1070905551314354,
-0.055150944739580154,
-0.5111711025238037,
0.21138709783554077,
0.016424551606178284,
-0.038467779755592346,
-0.01903839036822319,
0.016614403575658798,
0.02533203549683094,
0.1723659336566925,
-0.09741079807281494,
-0.4979722201824188,
-0.39595282077789307,
0.05148954689502716,
-0.24005237221717834,
0.061775218695402145,
-0.24976016581058502,
-0.09798770397901535,
0.07313715666532516,
-0.06971531361341476,
-0.4040500223636627,
0.1828288435935974,
-0.20531673729419708,
0.1996113508939743,
-0.051595695316791534,
0.018269632011651993,
0.15882867574691772,
-0.0011289939284324646,
0.22106516361236572,
0.197569340467453,
-0.1587972342967987,
-0.2863661050796509,
-0.19783839583396912,
0.11419734358787537,
-0.01598561368882656,
-0.08139632642269135,
0.0651310384273529,
-0.12826143205165863,
-0.10456453263759613,
-0.050713904201984406,
-0.07161639630794525,
0.04086058586835861,
-0.16875523328781128,
0.16979525983333588,
0.41683197021484375,
0.08637817949056625,
-0.056795790791511536,
0.15386207401752472,
-0.10148666054010391,
0.24449840188026428,
-0.06678969413042068,
-0.04074731469154358,
0.07250775396823883,
-0.08124629408121109,
-0.2558583915233612,
0.050296373665332794,
-0.11350388079881668,
-0.031821586191654205,
0.3195848762989044,
-0.23722538352012634,
0.05488264560699463,
-0.10961359739303589,
0.1936112642288208,
0.4763503670692444,
-0.1447421908378601,
0.11564403027296066,
0.1384304016828537,
0.38824668526649475,
-0.3836940824985504,
-0.04951441287994385,
-0.18392211198806763,
-0.1016739159822464,
0.014708727598190308,
-0.020257584750652313,
0.05832652747631073,
-0.36174505949020386,
0.15030238032341003,
0.1264718919992447,
0.20074696838855743,
-0.15592023730278015,
0.3028935492038727,
0.16053414344787598,
0.09336347132921219,
0.10178239643573761,
0.20252911746501923,
0.06529079377651215,
0.23944199085235596,
0.35326647758483887,
-0.44169819355010986,
0.26560279726982117,
0.1704549938440323,
-0.1458314061164856,
-0.21623700857162476,
-0.3706553876399994,
0.252347856760025,
-0.028182052075862885,
-0.10303159058094025,
0.035589344799518585,
0.03874198719859123,
0.4932486414909363,
-0.047742508351802826,
-0.1279888153076172,
0.0339098796248436,
0.21631067991256714,
-0.1289178729057312,
0.035221632570028305,
0.03889782726764679,
-0.10548081994056702,
-0.08193943649530411,
-0.001720920205116272,
0.2033388465642929,
-0.1286197006702423,
0.3866722881793976,
0.18832680583000183,
-0.10856546461582184,
-0.3419506549835205,
0.16440676152706146,
0.25837382674217224,
0.11169630289077759,
-0.31546181440353394,
0.1063237115740776,
0.33058223128318787,
0.054124943912029266,
-0.025649351999163628,
0.3148106634616852,
0.4991256296634674,
0.4961864650249481,
-0.17068350315093994,
-0.029441051185131073,
0.05215137451887131,
-0.11963872611522675,
-0.06625525653362274,
0.16697275638580322,
0.17284895479679108,
0.025566067546606064,
0.24974137544631958,
0.26764625310897827,
-0.30525755882263184,
-0.05631161481142044,
0.006862645503133535,
-0.05077617987990379,
0.011802222579717636,
0.38508403301239014,
-0.1430976539850235,
-0.12853267788887024,
-0.3502323627471924,
0.02011743374168873,
-0.5803683996200562,
0.06397183239459991,
0.426237016916275,
0.030369829386472702,
0.1290980875492096,
-0.17087627947330475,
0.12501119077205658,
-0.04311127960681915,
0.28161361813545227,
0.2715856730937958,
0.12326659262180328,
-0.15495158731937408,
-0.27960503101348877,
-0.5030543804168701,
0.20887941122055054,
-0.0874718427658081,
-0.010955721139907837,
-0.13077165186405182,
0.14621824026107788,
-0.18884673714637756,
0.15534183382987976,
0.27755439281463623,
0.029446963220834732,
0.23801104724407196,
0.1368388533592224,
-0.3771361708641052,
-0.20440374314785004,
0.039578795433044434,
0.14735576510429382,
-0.005093622952699661,
-0.5665702819824219,
-0.05419275164604187,
-0.4041847586631775,
0.24957041442394257,
-0.12916143238544464,
-0.17399990558624268,
-0.027819979935884476,
-0.11597851663827896,
0.6239943504333496,
-0.040862537920475006,
0.3399483561515808,
-0.2008569985628128,
-0.18384462594985962,
-0.11076320707798004,
-0.19156691431999207,
-0.01585063710808754,
-0.10257834196090698,
0.2877925634384155,
0.36566880345344543,
-0.04813653975725174,
-0.10172736644744873,
-0.4654783010482788,
0.3443028926849365,
0.010303705930709839,
-0.009595908224582672,
-0.25939124822616577,
0.3269040286540985,
-0.04156605899333954,
0.022762425243854523,
-0.019455447793006897,
0.0735897570848465,
-0.16258516907691956,
0.18728673458099365,
-0.5148113965988159,
-0.5351011753082275,
0.5774758458137512,
-0.19221234321594238,
-0.25275564193725586,
0.11978304386138916,
0.3851375877857208,
0.041007936000823975,
0.021608268842101097,
-0.4395599365234375,
0.12920811772346497,
0.3191491663455963,
-0.10070893913507462,
-0.2627981901168823,
0.24097350239753723,
-0.23580491542816162,
0.04525546729564667,
0.0525587797164917,
0.2706085741519928,
0.03627454861998558,
0.13536998629570007,
0.05155105143785477,
-0.18516260385513306
] |
https://github.com/huggingface/datasets/issues/6308 | > This (Windows) issue was fixed in `fsspec` in [fsspec/filesystem_spec#1275](https://github.com/fsspec/filesystem_spec/pull/1275). So, to avoid the error, update the `fsspec` installation with `pip install -U fsspec`.
after I run `pip install -U fsspec`
it occurs a new error:
```
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflict
s.
datasets 2.14.5 requires fsspec[http]<2023.9.0,>=2023.1.0, but you have fsspec 2023.9.2 which is incompatible.
``` | module 'resource' has no attribute 'error' | ### Describe the bug
just run import:
`from datasets import load_dataset`
and then:
```
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module>
from .arrow_dataset import Dataset
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module>
from .arrow_reader import ArrowReader
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module>
from .download.download_config import DownloadConfig
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module>
from .streaming_download_manager import StreamingDownloadManager
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module>
from ..filesystems import COMPRESSION_FILESYSTEMS
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module>
import fsspec.asyn
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module>
ResourceEror = resource.error
AttributeError: module 'resource' has no attribute 'error'
Process finished with exit code 1
```
and the error codes are:
```
try:
import resource
except ImportError:
resource = None
ResourceError = OSError
else:
ResourceEror = resource.error
```
1. miss spelling : "ResourceEror " should be "ResourceErorr"
2. module 'resource' has no attribute 'error'
### Steps to reproduce the bug
only one step:
`from datasets import load_dataset`
### Expected behavior
slove error: module 'resource' has no attribute 'error'
### Environment info
python=3.10
datasets==2.14.5
| 77 | module 'resource' has no attribute 'error'
### Describe the bug
just run import:
`from datasets import load_dataset`
and then:
```
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module>
from .arrow_dataset import Dataset
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module>
from .arrow_reader import ArrowReader
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module>
from .download.download_config import DownloadConfig
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module>
from .streaming_download_manager import StreamingDownloadManager
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module>
from ..filesystems import COMPRESSION_FILESYSTEMS
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module>
import fsspec.asyn
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module>
ResourceEror = resource.error
AttributeError: module 'resource' has no attribute 'error'
Process finished with exit code 1
```
and the error codes are:
```
try:
import resource
except ImportError:
resource = None
ResourceError = OSError
else:
ResourceEror = resource.error
```
1. miss spelling : "ResourceEror " should be "ResourceErorr"
2. module 'resource' has no attribute 'error'
### Steps to reproduce the bug
only one step:
`from datasets import load_dataset`
### Expected behavior
slove error: module 'resource' has no attribute 'error'
### Environment info
python=3.10
datasets==2.14.5
> This (Windows) issue was fixed in `fsspec` in [fsspec/filesystem_spec#1275](https://github.com/fsspec/filesystem_spec/pull/1275). So, to avoid the error, update the `fsspec` installation with `pip install -U fsspec`.
after I run `pip install -U fsspec`
it occurs a new error:
```
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflict
s.
datasets 2.14.5 requires fsspec[http]<2023.9.0,>=2023.1.0, but you have fsspec 2023.9.2 which is incompatible.
``` | [
-0.3986871838569641,
-0.19148069620132446,
-0.12688815593719482,
0.3200543522834778,
0.6016736626625061,
-0.017333589494228363,
0.11214470118284225,
0.34752100706100464,
-0.19669853150844574,
0.062872976064682,
0.0392395481467247,
0.4419638514518738,
-0.10753051936626434,
-0.14714926481246948,
-0.14010368287563324,
-0.11447444558143616,
0.06480234861373901,
0.260962575674057,
-0.0880909264087677,
-0.03188542276620865,
-0.36739176511764526,
0.2021857649087906,
-0.10201127082109451,
0.047752246260643005,
-0.21952451765537262,
-0.04417954385280609,
0.10654699057340622,
0.15111079812049866,
-0.2045445591211319,
-0.6687843203544617,
0.14584751427173615,
-0.23429903388023376,
0.028916023671627045,
0.26385486125946045,
-0.00010483679216122255,
-0.09192080795764923,
0.5043992400169373,
0.008851990103721619,
-0.4519427418708801,
-0.007060334086418152,
-0.11310628801584244,
-0.20801551640033722,
0.12791267037391663,
-0.21501636505126953,
-0.044825952500104904,
-0.4287731349468231,
-0.1606680005788803,
-0.40501102805137634,
0.23424802720546722,
0.4217064082622528,
0.34836190938949585,
0.24183562397956848,
0.1448751538991928,
-0.2604690194129944,
0.16497796773910522,
-0.0533805675804615,
0.03902014344930649,
0.16846546530723572,
0.12975946068763733,
0.015747182071208954,
0.11311238259077072,
0.31473028659820557,
-0.08487847447395325,
0.13144570589065552,
0.302755206823349,
-0.15515360236167908,
0.14862596988677979,
-0.2968238294124603,
0.05527511239051819,
-0.05779068544507027,
0.5392397046089172,
-0.034135714173316956,
-0.36789292097091675,
0.06743358075618744,
0.017345178872346878,
-0.23995618522167206,
0.19696465134620667,
0.30048757791519165,
-0.1930186152458191,
0.08963553607463837,
0.286438524723053,
-0.051690805703401566,
-0.06290028989315033,
0.0989265963435173,
0.08745156228542328,
0.12008987367153168,
-0.22417493164539337,
0.04634222388267517,
0.13342946767807007,
-0.12949509918689728,
0.2350088208913803,
0.02024158090353012,
-0.29285550117492676,
0.1330656111240387,
-0.44092464447021484,
0.024414561688899994,
0.05100492760539055,
0.012131383642554283,
0.01860540360212326,
0.3788936734199524,
-0.03765168786048889,
0.00023193657398223877,
0.17601843178272247,
0.18408989906311035,
0.1895536184310913,
0.10283287614583969,
0.07154086232185364,
0.0035066157579421997,
0.12637928128242493,
0.21012632548809052,
-0.04979006573557854,
-0.13064490258693695,
-0.1766434609889984,
-0.3413331210613251,
0.07800815254449844,
0.12137284874916077,
0.3286736011505127,
-0.05898531898856163,
-0.4270513355731964,
0.02394947037100792,
0.17235378921031952,
0.06902807950973511,
-0.08004437386989594,
0.4805881381034851,
-0.15534672141075134,
0.329429030418396,
0.1783149540424347,
0.22648975253105164,
-0.17851240932941437,
-0.30053019523620605,
-0.215915247797966,
0.14063119888305664,
-0.27959132194519043,
-0.14538903534412384,
0.029338106513023376,
0.024687573313713074,
0.4568535387516022,
-0.11171720176935196,
-0.222735196352005,
-0.1489749252796173,
0.22611063718795776,
-0.27641230821609497,
-0.12802374362945557,
0.3855404555797577,
-0.014411747455596924,
0.1719397008419037,
0.17336814105510712,
0.011520683765411377,
0.074625164270401,
-0.002746591344475746,
-0.2583906948566437,
-0.3184252679347992,
-0.22839117050170898,
0.3683519661426544,
0.07826777547597885,
0.1056184321641922,
-0.09796086698770523,
-0.04842836409807205,
0.11204215884208679,
-0.19315597414970398,
-0.03456122800707817,
-0.041569147258996964,
-0.17159491777420044,
-0.32063010334968567,
0.2160150110721588,
0.5213679075241089,
-0.1373402327299118,
-0.16828979551792145,
-0.24254797399044037,
-0.18697704374790192,
0.2844105660915375,
-0.030206605792045593,
-0.22740665078163147,
0.0901920422911644,
-0.25047287344932556,
0.046258628368377686,
0.5648531913757324,
-0.33318474888801575,
-0.4129411578178406,
0.2338258922100067,
-0.18880128860473633,
-0.26704880595207214,
0.24048277735710144,
0.019981399178504944,
0.2917977571487427,
-0.053338583558797836,
0.3668214678764343,
0.30355146527290344,
0.11220022290945053,
0.09092199057340622,
-0.28905799984931946,
-0.16056713461875916,
-0.055116258561611176,
0.036516204476356506,
-0.015350611880421638,
0.08678215742111206,
0.3798639476299286,
0.014846529811620712,
0.12530504167079926,
0.03634697198867798,
0.17941954731941223,
0.3228355050086975,
0.2983788549900055,
-0.04185072332620621,
-0.02910441905260086,
-0.17905525863170624,
-0.1014188602566719,
0.09706919640302658,
-0.14870862662792206,
-0.13952836394309998,
-0.1927272528409958,
-0.06654711812734604,
-0.2962522506713867,
-0.10102593898773193,
-0.33796244859695435,
-0.40390288829803467,
0.26073887944221497,
0.2557607591152191,
0.010291822254657745,
0.1903303861618042,
-0.1587284654378891,
0.2990480363368988,
-0.12815028429031372,
0.09859730303287506,
-0.044426631182432175,
0.13323085010051727,
-0.20837633311748505,
-0.19715864956378937,
0.04790857434272766,
-0.04191511496901512,
0.20967763662338257,
0.051320880651474,
-0.22130677103996277,
0.3515278697013855,
0.13364878296852112,
0.3526466488838196,
0.013181719928979874,
-0.29880303144454956,
0.27251961827278137,
-0.47287416458129883,
0.0004012109711766243,
0.13062113523483276,
0.2847999930381775,
-0.02720218151807785,
0.21377089619636536,
-0.06495235115289688,
0.09433408826589584,
0.13636913895606995,
0.222360759973526,
0.3125946819782257,
0.35975390672683716,
0.006679564714431763,
0.01977430284023285,
-0.15489694476127625,
0.1976737380027771,
0.09712933748960495,
0.12405706942081451,
-0.08774727582931519,
-0.14016833901405334,
0.04638201743364334,
0.45388486981391907,
0.17620255053043365,
0.034853339195251465,
0.0689816027879715,
-0.46566787362098694,
0.06784264743328094,
0.23514477908611298,
0.5774679780006409,
0.5735413432121277,
0.19620811939239502,
-0.09667365998029709,
0.11954762786626816,
0.26265379786491394,
-0.011760137975215912,
0.3910399377346039,
0.05885463207960129,
0.29732832312583923,
0.30188387632369995,
0.06957201659679413,
0.0655592530965805,
-0.24741758406162262,
-0.3473672568798065,
-0.017745796591043472,
0.2081046849489212,
-0.2101595401763916,
0.04224134236574173,
-0.18250373005867004,
0.037987321615219116,
-0.19277538359165192,
-0.06389997154474258,
0.16230875253677368,
-0.13721761107444763,
-0.09366515278816223,
0.20348602533340454,
-0.1252271980047226,
0.26980704069137573,
-0.25998038053512573,
-0.07745955884456635,
0.17376813292503357,
-0.04570259898900986,
-0.0702543705701828,
-0.1407497525215149,
-0.017585698515176773,
0.05963718146085739,
0.12874868512153625,
0.0441877581179142,
0.3856377899646759,
-0.10879819095134735,
0.1394970417022705,
-0.2698422372341156,
0.019003376364707947,
0.0959814041852951,
0.05380180478096008,
0.13128907978534698,
0.1382017284631729,
0.11238909512758255,
0.07462994754314423,
-0.22016967833042145,
0.42836764454841614,
-0.19458577036857605,
-0.2052070051431656,
0.18634647130966187,
0.02353888377547264,
-0.13801562786102295,
-0.26377904415130615,
-0.4884738624095917,
-0.4124785363674164,
-0.6430261731147766,
-0.03672435134649277,
0.04750678688287735,
0.09605056047439575,
0.22985637187957764,
0.3069297969341278,
0.22885356843471527,
0.06383587419986725,
0.2650013267993927,
-0.15014635026454926,
-0.11194655299186707,
0.319204717874527,
-0.36667829751968384,
-0.4397984743118286,
0.05553367733955383,
-0.10016590356826782,
0.20444096624851227,
0.30616647005081177,
-0.1695614606142044,
0.05344012379646301,
-0.13546708226203918,
-0.11284831166267395,
-0.1928335279226303,
0.21472567319869995,
0.3281360864639282,
0.28163236379623413,
-0.2832147777080536,
-0.19891352951526642,
0.17550691962242126,
-0.10355570912361145,
-0.025086283683776855,
0.21830442547798157,
0.03110937774181366,
0.27250683307647705,
-0.15272510051727295,
0.47176826000213623,
0.23121067881584167,
-0.004758144728839397,
0.5463314056396484,
-0.16185930371284485,
0.23490823805332184,
-0.09197065234184265,
-0.3276529312133789,
-0.11282053589820862,
-0.12778539955615997,
0.12687534093856812,
0.09309892356395721,
-0.0664772242307663,
-0.15356768667697906,
-0.22586995363235474,
-0.027622882276773453,
-0.3518002927303314,
0.024523869156837463,
-0.14036591351032257,
-0.1553347110748291,
0.2582381069660187,
-0.1341891586780548,
0.09026472270488739,
0.05438707396388054,
0.21625855565071106,
0.1886403113603592,
0.0913459062576294,
-0.15935540199279785,
0.022454775869846344,
-0.11565561592578888,
-0.10236471146345139,
-0.24347202479839325,
0.13453754782676697,
-0.10242906212806702,
0.33950501680374146,
0.059418320655822754,
-0.10687941312789917,
0.04164735972881317,
-0.1243746280670166,
0.4841497242450714,
-0.1642855852842331,
0.08949726819992065,
0.019013479351997375,
0.21633175015449524,
-0.42394769191741943,
-0.011655241250991821,
-0.060948193073272705,
0.0501217246055603,
-0.2389349341392517,
0.14439800381660461,
-0.2057364583015442,
-0.07361974567174911,
-0.10077854990959167,
0.05520864948630333,
-0.15522676706314087,
0.15147417783737183,
-0.33706945180892944,
-0.2913549542427063,
-0.5706391334533691,
-0.07889419049024582,
-0.06040922552347183,
0.17670713365077972,
0.16742752492427826,
-0.11410672217607498,
-0.19909228384494781,
0.059666238725185394,
-0.0975431278347969,
0.010022297501564026,
0.5705114006996155,
-0.33834415674209595,
0.1523469239473343,
0.03892131894826889,
0.05544844642281532,
0.530432939529419,
0.8282788991928101,
-0.01291879452764988,
-0.40164196491241455,
-0.042788002640008926,
-0.14498186111450195,
0.1748020201921463,
0.0034456923604011536,
-0.2307189702987671,
-0.02312638610601425,
-0.180494487285614,
0.20934417843818665,
-0.08178849518299103,
0.016674529761075974,
0.4775576889514923,
-0.017120786011219025,
-0.040978919714689255,
-0.3274292051792145,
0.25784412026405334,
-0.06416185200214386,
0.05417972803115845,
0.3487032651901245,
0.20437228679656982,
-0.061087995767593384,
0.19808165729045868,
-0.02690736949443817,
0.7757598161697388,
0.3213708698749542,
-0.015628965571522713,
0.30154693126678467,
-0.19606459140777588,
0.3399161696434021,
-0.31315097212791443,
0.1797807812690735,
-0.29715394973754883,
-0.023660294711589813,
0.008242763578891754,
-0.1804746687412262,
0.2441743165254593,
-0.05351950600743294,
-0.34070175886154175,
0.1377055048942566,
-0.3723523020744324,
-0.06400715559720993,
-0.11289745569229126,
0.06798258423805237,
-0.20302459597587585,
-0.17434045672416687,
-0.2316419780254364,
0.2852781414985657,
-0.07309538871049881,
0.31959155201911926,
-0.09175578504800797,
-0.09823864698410034,
-0.05971657857298851,
-0.39254841208457947,
-0.16108402609825134,
0.23592166602611542,
-0.25698989629745483,
0.22441323101520538,
-0.21450895071029663,
-0.1136239543557167,
0.07830995321273804,
0.2093053162097931,
-0.11662596464157104,
-0.07253365218639374,
-0.16346916556358337,
0.14833463728427887,
0.014172124676406384,
-0.009479228407144547,
-0.20777563750743866,
0.012999117374420166,
0.4080066382884979,
-0.23594367504119873,
-0.22264808416366577,
0.2557586431503296,
-0.22250865399837494,
0.01425468921661377,
0.45749104022979736,
0.01079617254436016,
0.05272100120782852,
-0.06154736876487732,
-0.28134217858314514,
-0.0720173716545105,
-0.18000775575637817,
-0.19125807285308838,
0.24518226087093353,
-0.054095543920993805,
-0.34883999824523926,
0.15232327580451965,
0.17695757746696472,
-0.07935263216495514,
-0.05687965825200081,
0.28506165742874146,
-0.006674742326140404,
0.24185405671596527,
0.47649580240249634,
-0.2127925455570221,
-0.23220565915107727,
-0.41951900720596313,
-0.1070905551314354,
-0.055150944739580154,
-0.5111711025238037,
0.21138709783554077,
0.016424551606178284,
-0.038467779755592346,
-0.01903839036822319,
0.016614403575658798,
0.02533203549683094,
0.1723659336566925,
-0.09741079807281494,
-0.4979722201824188,
-0.39595282077789307,
0.05148954689502716,
-0.24005237221717834,
0.061775218695402145,
-0.24976016581058502,
-0.09798770397901535,
0.07313715666532516,
-0.06971531361341476,
-0.4040500223636627,
0.1828288435935974,
-0.20531673729419708,
0.1996113508939743,
-0.051595695316791534,
0.018269632011651993,
0.15882867574691772,
-0.0011289939284324646,
0.22106516361236572,
0.197569340467453,
-0.1587972342967987,
-0.2863661050796509,
-0.19783839583396912,
0.11419734358787537,
-0.01598561368882656,
-0.08139632642269135,
0.0651310384273529,
-0.12826143205165863,
-0.10456453263759613,
-0.050713904201984406,
-0.07161639630794525,
0.04086058586835861,
-0.16875523328781128,
0.16979525983333588,
0.41683197021484375,
0.08637817949056625,
-0.056795790791511536,
0.15386207401752472,
-0.10148666054010391,
0.24449840188026428,
-0.06678969413042068,
-0.04074731469154358,
0.07250775396823883,
-0.08124629408121109,
-0.2558583915233612,
0.050296373665332794,
-0.11350388079881668,
-0.031821586191654205,
0.3195848762989044,
-0.23722538352012634,
0.05488264560699463,
-0.10961359739303589,
0.1936112642288208,
0.4763503670692444,
-0.1447421908378601,
0.11564403027296066,
0.1384304016828537,
0.38824668526649475,
-0.3836940824985504,
-0.04951441287994385,
-0.18392211198806763,
-0.1016739159822464,
0.014708727598190308,
-0.020257584750652313,
0.05832652747631073,
-0.36174505949020386,
0.15030238032341003,
0.1264718919992447,
0.20074696838855743,
-0.15592023730278015,
0.3028935492038727,
0.16053414344787598,
0.09336347132921219,
0.10178239643573761,
0.20252911746501923,
0.06529079377651215,
0.23944199085235596,
0.35326647758483887,
-0.44169819355010986,
0.26560279726982117,
0.1704549938440323,
-0.1458314061164856,
-0.21623700857162476,
-0.3706553876399994,
0.252347856760025,
-0.028182052075862885,
-0.10303159058094025,
0.035589344799518585,
0.03874198719859123,
0.4932486414909363,
-0.047742508351802826,
-0.1279888153076172,
0.0339098796248436,
0.21631067991256714,
-0.1289178729057312,
0.035221632570028305,
0.03889782726764679,
-0.10548081994056702,
-0.08193943649530411,
-0.001720920205116272,
0.2033388465642929,
-0.1286197006702423,
0.3866722881793976,
0.18832680583000183,
-0.10856546461582184,
-0.3419506549835205,
0.16440676152706146,
0.25837382674217224,
0.11169630289077759,
-0.31546181440353394,
0.1063237115740776,
0.33058223128318787,
0.054124943912029266,
-0.025649351999163628,
0.3148106634616852,
0.4991256296634674,
0.4961864650249481,
-0.17068350315093994,
-0.029441051185131073,
0.05215137451887131,
-0.11963872611522675,
-0.06625525653362274,
0.16697275638580322,
0.17284895479679108,
0.025566067546606064,
0.24974137544631958,
0.26764625310897827,
-0.30525755882263184,
-0.05631161481142044,
0.006862645503133535,
-0.05077617987990379,
0.011802222579717636,
0.38508403301239014,
-0.1430976539850235,
-0.12853267788887024,
-0.3502323627471924,
0.02011743374168873,
-0.5803683996200562,
0.06397183239459991,
0.426237016916275,
0.030369829386472702,
0.1290980875492096,
-0.17087627947330475,
0.12501119077205658,
-0.04311127960681915,
0.28161361813545227,
0.2715856730937958,
0.12326659262180328,
-0.15495158731937408,
-0.27960503101348877,
-0.5030543804168701,
0.20887941122055054,
-0.0874718427658081,
-0.010955721139907837,
-0.13077165186405182,
0.14621824026107788,
-0.18884673714637756,
0.15534183382987976,
0.27755439281463623,
0.029446963220834732,
0.23801104724407196,
0.1368388533592224,
-0.3771361708641052,
-0.20440374314785004,
0.039578795433044434,
0.14735576510429382,
-0.005093622952699661,
-0.5665702819824219,
-0.05419275164604187,
-0.4041847586631775,
0.24957041442394257,
-0.12916143238544464,
-0.17399990558624268,
-0.027819979935884476,
-0.11597851663827896,
0.6239943504333496,
-0.040862537920475006,
0.3399483561515808,
-0.2008569985628128,
-0.18384462594985962,
-0.11076320707798004,
-0.19156691431999207,
-0.01585063710808754,
-0.10257834196090698,
0.2877925634384155,
0.36566880345344543,
-0.04813653975725174,
-0.10172736644744873,
-0.4654783010482788,
0.3443028926849365,
0.010303705930709839,
-0.009595908224582672,
-0.25939124822616577,
0.3269040286540985,
-0.04156605899333954,
0.022762425243854523,
-0.019455447793006897,
0.0735897570848465,
-0.16258516907691956,
0.18728673458099365,
-0.5148113965988159,
-0.5351011753082275,
0.5774758458137512,
-0.19221234321594238,
-0.25275564193725586,
0.11978304386138916,
0.3851375877857208,
0.041007936000823975,
0.021608268842101097,
-0.4395599365234375,
0.12920811772346497,
0.3191491663455963,
-0.10070893913507462,
-0.2627981901168823,
0.24097350239753723,
-0.23580491542816162,
0.04525546729564667,
0.0525587797164917,
0.2706085741519928,
0.03627454861998558,
0.13536998629570007,
0.05155105143785477,
-0.18516260385513306
] |
https://github.com/huggingface/datasets/issues/6308 | The `fsspec<2023.9.0` upper bound will be removed in the next release. The `ResourceError` fix is also present in version 2023.6.0, so use that version in the meantime (`pip install fsspec==2023.6.0`). | module 'resource' has no attribute 'error' | ### Describe the bug
just run import:
`from datasets import load_dataset`
and then:
```
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module>
from .arrow_dataset import Dataset
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module>
from .arrow_reader import ArrowReader
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module>
from .download.download_config import DownloadConfig
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module>
from .streaming_download_manager import StreamingDownloadManager
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module>
from ..filesystems import COMPRESSION_FILESYSTEMS
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module>
import fsspec.asyn
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module>
ResourceEror = resource.error
AttributeError: module 'resource' has no attribute 'error'
Process finished with exit code 1
```
and the error codes are:
```
try:
import resource
except ImportError:
resource = None
ResourceError = OSError
else:
ResourceEror = resource.error
```
1. miss spelling : "ResourceEror " should be "ResourceErorr"
2. module 'resource' has no attribute 'error'
### Steps to reproduce the bug
only one step:
`from datasets import load_dataset`
### Expected behavior
slove error: module 'resource' has no attribute 'error'
### Environment info
python=3.10
datasets==2.14.5
| 30 | module 'resource' has no attribute 'error'
### Describe the bug
just run import:
`from datasets import load_dataset`
and then:
```
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module>
from .arrow_dataset import Dataset
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module>
from .arrow_reader import ArrowReader
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module>
from .download.download_config import DownloadConfig
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module>
from .streaming_download_manager import StreamingDownloadManager
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module>
from ..filesystems import COMPRESSION_FILESYSTEMS
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module>
import fsspec.asyn
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module>
ResourceEror = resource.error
AttributeError: module 'resource' has no attribute 'error'
Process finished with exit code 1
```
and the error codes are:
```
try:
import resource
except ImportError:
resource = None
ResourceError = OSError
else:
ResourceEror = resource.error
```
1. miss spelling : "ResourceEror " should be "ResourceErorr"
2. module 'resource' has no attribute 'error'
### Steps to reproduce the bug
only one step:
`from datasets import load_dataset`
### Expected behavior
slove error: module 'resource' has no attribute 'error'
### Environment info
python=3.10
datasets==2.14.5
The `fsspec<2023.9.0` upper bound will be removed in the next release. The `ResourceError` fix is also present in version 2023.6.0, so use that version in the meantime (`pip install fsspec==2023.6.0`). | [
-0.3986871838569641,
-0.19148069620132446,
-0.12688815593719482,
0.3200543522834778,
0.6016736626625061,
-0.017333589494228363,
0.11214470118284225,
0.34752100706100464,
-0.19669853150844574,
0.062872976064682,
0.0392395481467247,
0.4419638514518738,
-0.10753051936626434,
-0.14714926481246948,
-0.14010368287563324,
-0.11447444558143616,
0.06480234861373901,
0.260962575674057,
-0.0880909264087677,
-0.03188542276620865,
-0.36739176511764526,
0.2021857649087906,
-0.10201127082109451,
0.047752246260643005,
-0.21952451765537262,
-0.04417954385280609,
0.10654699057340622,
0.15111079812049866,
-0.2045445591211319,
-0.6687843203544617,
0.14584751427173615,
-0.23429903388023376,
0.028916023671627045,
0.26385486125946045,
-0.00010483679216122255,
-0.09192080795764923,
0.5043992400169373,
0.008851990103721619,
-0.4519427418708801,
-0.007060334086418152,
-0.11310628801584244,
-0.20801551640033722,
0.12791267037391663,
-0.21501636505126953,
-0.044825952500104904,
-0.4287731349468231,
-0.1606680005788803,
-0.40501102805137634,
0.23424802720546722,
0.4217064082622528,
0.34836190938949585,
0.24183562397956848,
0.1448751538991928,
-0.2604690194129944,
0.16497796773910522,
-0.0533805675804615,
0.03902014344930649,
0.16846546530723572,
0.12975946068763733,
0.015747182071208954,
0.11311238259077072,
0.31473028659820557,
-0.08487847447395325,
0.13144570589065552,
0.302755206823349,
-0.15515360236167908,
0.14862596988677979,
-0.2968238294124603,
0.05527511239051819,
-0.05779068544507027,
0.5392397046089172,
-0.034135714173316956,
-0.36789292097091675,
0.06743358075618744,
0.017345178872346878,
-0.23995618522167206,
0.19696465134620667,
0.30048757791519165,
-0.1930186152458191,
0.08963553607463837,
0.286438524723053,
-0.051690805703401566,
-0.06290028989315033,
0.0989265963435173,
0.08745156228542328,
0.12008987367153168,
-0.22417493164539337,
0.04634222388267517,
0.13342946767807007,
-0.12949509918689728,
0.2350088208913803,
0.02024158090353012,
-0.29285550117492676,
0.1330656111240387,
-0.44092464447021484,
0.024414561688899994,
0.05100492760539055,
0.012131383642554283,
0.01860540360212326,
0.3788936734199524,
-0.03765168786048889,
0.00023193657398223877,
0.17601843178272247,
0.18408989906311035,
0.1895536184310913,
0.10283287614583969,
0.07154086232185364,
0.0035066157579421997,
0.12637928128242493,
0.21012632548809052,
-0.04979006573557854,
-0.13064490258693695,
-0.1766434609889984,
-0.3413331210613251,
0.07800815254449844,
0.12137284874916077,
0.3286736011505127,
-0.05898531898856163,
-0.4270513355731964,
0.02394947037100792,
0.17235378921031952,
0.06902807950973511,
-0.08004437386989594,
0.4805881381034851,
-0.15534672141075134,
0.329429030418396,
0.1783149540424347,
0.22648975253105164,
-0.17851240932941437,
-0.30053019523620605,
-0.215915247797966,
0.14063119888305664,
-0.27959132194519043,
-0.14538903534412384,
0.029338106513023376,
0.024687573313713074,
0.4568535387516022,
-0.11171720176935196,
-0.222735196352005,
-0.1489749252796173,
0.22611063718795776,
-0.27641230821609497,
-0.12802374362945557,
0.3855404555797577,
-0.014411747455596924,
0.1719397008419037,
0.17336814105510712,
0.011520683765411377,
0.074625164270401,
-0.002746591344475746,
-0.2583906948566437,
-0.3184252679347992,
-0.22839117050170898,
0.3683519661426544,
0.07826777547597885,
0.1056184321641922,
-0.09796086698770523,
-0.04842836409807205,
0.11204215884208679,
-0.19315597414970398,
-0.03456122800707817,
-0.041569147258996964,
-0.17159491777420044,
-0.32063010334968567,
0.2160150110721588,
0.5213679075241089,
-0.1373402327299118,
-0.16828979551792145,
-0.24254797399044037,
-0.18697704374790192,
0.2844105660915375,
-0.030206605792045593,
-0.22740665078163147,
0.0901920422911644,
-0.25047287344932556,
0.046258628368377686,
0.5648531913757324,
-0.33318474888801575,
-0.4129411578178406,
0.2338258922100067,
-0.18880128860473633,
-0.26704880595207214,
0.24048277735710144,
0.019981399178504944,
0.2917977571487427,
-0.053338583558797836,
0.3668214678764343,
0.30355146527290344,
0.11220022290945053,
0.09092199057340622,
-0.28905799984931946,
-0.16056713461875916,
-0.055116258561611176,
0.036516204476356506,
-0.015350611880421638,
0.08678215742111206,
0.3798639476299286,
0.014846529811620712,
0.12530504167079926,
0.03634697198867798,
0.17941954731941223,
0.3228355050086975,
0.2983788549900055,
-0.04185072332620621,
-0.02910441905260086,
-0.17905525863170624,
-0.1014188602566719,
0.09706919640302658,
-0.14870862662792206,
-0.13952836394309998,
-0.1927272528409958,
-0.06654711812734604,
-0.2962522506713867,
-0.10102593898773193,
-0.33796244859695435,
-0.40390288829803467,
0.26073887944221497,
0.2557607591152191,
0.010291822254657745,
0.1903303861618042,
-0.1587284654378891,
0.2990480363368988,
-0.12815028429031372,
0.09859730303287506,
-0.044426631182432175,
0.13323085010051727,
-0.20837633311748505,
-0.19715864956378937,
0.04790857434272766,
-0.04191511496901512,
0.20967763662338257,
0.051320880651474,
-0.22130677103996277,
0.3515278697013855,
0.13364878296852112,
0.3526466488838196,
0.013181719928979874,
-0.29880303144454956,
0.27251961827278137,
-0.47287416458129883,
0.0004012109711766243,
0.13062113523483276,
0.2847999930381775,
-0.02720218151807785,
0.21377089619636536,
-0.06495235115289688,
0.09433408826589584,
0.13636913895606995,
0.222360759973526,
0.3125946819782257,
0.35975390672683716,
0.006679564714431763,
0.01977430284023285,
-0.15489694476127625,
0.1976737380027771,
0.09712933748960495,
0.12405706942081451,
-0.08774727582931519,
-0.14016833901405334,
0.04638201743364334,
0.45388486981391907,
0.17620255053043365,
0.034853339195251465,
0.0689816027879715,
-0.46566787362098694,
0.06784264743328094,
0.23514477908611298,
0.5774679780006409,
0.5735413432121277,
0.19620811939239502,
-0.09667365998029709,
0.11954762786626816,
0.26265379786491394,
-0.011760137975215912,
0.3910399377346039,
0.05885463207960129,
0.29732832312583923,
0.30188387632369995,
0.06957201659679413,
0.0655592530965805,
-0.24741758406162262,
-0.3473672568798065,
-0.017745796591043472,
0.2081046849489212,
-0.2101595401763916,
0.04224134236574173,
-0.18250373005867004,
0.037987321615219116,
-0.19277538359165192,
-0.06389997154474258,
0.16230875253677368,
-0.13721761107444763,
-0.09366515278816223,
0.20348602533340454,
-0.1252271980047226,
0.26980704069137573,
-0.25998038053512573,
-0.07745955884456635,
0.17376813292503357,
-0.04570259898900986,
-0.0702543705701828,
-0.1407497525215149,
-0.017585698515176773,
0.05963718146085739,
0.12874868512153625,
0.0441877581179142,
0.3856377899646759,
-0.10879819095134735,
0.1394970417022705,
-0.2698422372341156,
0.019003376364707947,
0.0959814041852951,
0.05380180478096008,
0.13128907978534698,
0.1382017284631729,
0.11238909512758255,
0.07462994754314423,
-0.22016967833042145,
0.42836764454841614,
-0.19458577036857605,
-0.2052070051431656,
0.18634647130966187,
0.02353888377547264,
-0.13801562786102295,
-0.26377904415130615,
-0.4884738624095917,
-0.4124785363674164,
-0.6430261731147766,
-0.03672435134649277,
0.04750678688287735,
0.09605056047439575,
0.22985637187957764,
0.3069297969341278,
0.22885356843471527,
0.06383587419986725,
0.2650013267993927,
-0.15014635026454926,
-0.11194655299186707,
0.319204717874527,
-0.36667829751968384,
-0.4397984743118286,
0.05553367733955383,
-0.10016590356826782,
0.20444096624851227,
0.30616647005081177,
-0.1695614606142044,
0.05344012379646301,
-0.13546708226203918,
-0.11284831166267395,
-0.1928335279226303,
0.21472567319869995,
0.3281360864639282,
0.28163236379623413,
-0.2832147777080536,
-0.19891352951526642,
0.17550691962242126,
-0.10355570912361145,
-0.025086283683776855,
0.21830442547798157,
0.03110937774181366,
0.27250683307647705,
-0.15272510051727295,
0.47176826000213623,
0.23121067881584167,
-0.004758144728839397,
0.5463314056396484,
-0.16185930371284485,
0.23490823805332184,
-0.09197065234184265,
-0.3276529312133789,
-0.11282053589820862,
-0.12778539955615997,
0.12687534093856812,
0.09309892356395721,
-0.0664772242307663,
-0.15356768667697906,
-0.22586995363235474,
-0.027622882276773453,
-0.3518002927303314,
0.024523869156837463,
-0.14036591351032257,
-0.1553347110748291,
0.2582381069660187,
-0.1341891586780548,
0.09026472270488739,
0.05438707396388054,
0.21625855565071106,
0.1886403113603592,
0.0913459062576294,
-0.15935540199279785,
0.022454775869846344,
-0.11565561592578888,
-0.10236471146345139,
-0.24347202479839325,
0.13453754782676697,
-0.10242906212806702,
0.33950501680374146,
0.059418320655822754,
-0.10687941312789917,
0.04164735972881317,
-0.1243746280670166,
0.4841497242450714,
-0.1642855852842331,
0.08949726819992065,
0.019013479351997375,
0.21633175015449524,
-0.42394769191741943,
-0.011655241250991821,
-0.060948193073272705,
0.0501217246055603,
-0.2389349341392517,
0.14439800381660461,
-0.2057364583015442,
-0.07361974567174911,
-0.10077854990959167,
0.05520864948630333,
-0.15522676706314087,
0.15147417783737183,
-0.33706945180892944,
-0.2913549542427063,
-0.5706391334533691,
-0.07889419049024582,
-0.06040922552347183,
0.17670713365077972,
0.16742752492427826,
-0.11410672217607498,
-0.19909228384494781,
0.059666238725185394,
-0.0975431278347969,
0.010022297501564026,
0.5705114006996155,
-0.33834415674209595,
0.1523469239473343,
0.03892131894826889,
0.05544844642281532,
0.530432939529419,
0.8282788991928101,
-0.01291879452764988,
-0.40164196491241455,
-0.042788002640008926,
-0.14498186111450195,
0.1748020201921463,
0.0034456923604011536,
-0.2307189702987671,
-0.02312638610601425,
-0.180494487285614,
0.20934417843818665,
-0.08178849518299103,
0.016674529761075974,
0.4775576889514923,
-0.017120786011219025,
-0.040978919714689255,
-0.3274292051792145,
0.25784412026405334,
-0.06416185200214386,
0.05417972803115845,
0.3487032651901245,
0.20437228679656982,
-0.061087995767593384,
0.19808165729045868,
-0.02690736949443817,
0.7757598161697388,
0.3213708698749542,
-0.015628965571522713,
0.30154693126678467,
-0.19606459140777588,
0.3399161696434021,
-0.31315097212791443,
0.1797807812690735,
-0.29715394973754883,
-0.023660294711589813,
0.008242763578891754,
-0.1804746687412262,
0.2441743165254593,
-0.05351950600743294,
-0.34070175886154175,
0.1377055048942566,
-0.3723523020744324,
-0.06400715559720993,
-0.11289745569229126,
0.06798258423805237,
-0.20302459597587585,
-0.17434045672416687,
-0.2316419780254364,
0.2852781414985657,
-0.07309538871049881,
0.31959155201911926,
-0.09175578504800797,
-0.09823864698410034,
-0.05971657857298851,
-0.39254841208457947,
-0.16108402609825134,
0.23592166602611542,
-0.25698989629745483,
0.22441323101520538,
-0.21450895071029663,
-0.1136239543557167,
0.07830995321273804,
0.2093053162097931,
-0.11662596464157104,
-0.07253365218639374,
-0.16346916556358337,
0.14833463728427887,
0.014172124676406384,
-0.009479228407144547,
-0.20777563750743866,
0.012999117374420166,
0.4080066382884979,
-0.23594367504119873,
-0.22264808416366577,
0.2557586431503296,
-0.22250865399837494,
0.01425468921661377,
0.45749104022979736,
0.01079617254436016,
0.05272100120782852,
-0.06154736876487732,
-0.28134217858314514,
-0.0720173716545105,
-0.18000775575637817,
-0.19125807285308838,
0.24518226087093353,
-0.054095543920993805,
-0.34883999824523926,
0.15232327580451965,
0.17695757746696472,
-0.07935263216495514,
-0.05687965825200081,
0.28506165742874146,
-0.006674742326140404,
0.24185405671596527,
0.47649580240249634,
-0.2127925455570221,
-0.23220565915107727,
-0.41951900720596313,
-0.1070905551314354,
-0.055150944739580154,
-0.5111711025238037,
0.21138709783554077,
0.016424551606178284,
-0.038467779755592346,
-0.01903839036822319,
0.016614403575658798,
0.02533203549683094,
0.1723659336566925,
-0.09741079807281494,
-0.4979722201824188,
-0.39595282077789307,
0.05148954689502716,
-0.24005237221717834,
0.061775218695402145,
-0.24976016581058502,
-0.09798770397901535,
0.07313715666532516,
-0.06971531361341476,
-0.4040500223636627,
0.1828288435935974,
-0.20531673729419708,
0.1996113508939743,
-0.051595695316791534,
0.018269632011651993,
0.15882867574691772,
-0.0011289939284324646,
0.22106516361236572,
0.197569340467453,
-0.1587972342967987,
-0.2863661050796509,
-0.19783839583396912,
0.11419734358787537,
-0.01598561368882656,
-0.08139632642269135,
0.0651310384273529,
-0.12826143205165863,
-0.10456453263759613,
-0.050713904201984406,
-0.07161639630794525,
0.04086058586835861,
-0.16875523328781128,
0.16979525983333588,
0.41683197021484375,
0.08637817949056625,
-0.056795790791511536,
0.15386207401752472,
-0.10148666054010391,
0.24449840188026428,
-0.06678969413042068,
-0.04074731469154358,
0.07250775396823883,
-0.08124629408121109,
-0.2558583915233612,
0.050296373665332794,
-0.11350388079881668,
-0.031821586191654205,
0.3195848762989044,
-0.23722538352012634,
0.05488264560699463,
-0.10961359739303589,
0.1936112642288208,
0.4763503670692444,
-0.1447421908378601,
0.11564403027296066,
0.1384304016828537,
0.38824668526649475,
-0.3836940824985504,
-0.04951441287994385,
-0.18392211198806763,
-0.1016739159822464,
0.014708727598190308,
-0.020257584750652313,
0.05832652747631073,
-0.36174505949020386,
0.15030238032341003,
0.1264718919992447,
0.20074696838855743,
-0.15592023730278015,
0.3028935492038727,
0.16053414344787598,
0.09336347132921219,
0.10178239643573761,
0.20252911746501923,
0.06529079377651215,
0.23944199085235596,
0.35326647758483887,
-0.44169819355010986,
0.26560279726982117,
0.1704549938440323,
-0.1458314061164856,
-0.21623700857162476,
-0.3706553876399994,
0.252347856760025,
-0.028182052075862885,
-0.10303159058094025,
0.035589344799518585,
0.03874198719859123,
0.4932486414909363,
-0.047742508351802826,
-0.1279888153076172,
0.0339098796248436,
0.21631067991256714,
-0.1289178729057312,
0.035221632570028305,
0.03889782726764679,
-0.10548081994056702,
-0.08193943649530411,
-0.001720920205116272,
0.2033388465642929,
-0.1286197006702423,
0.3866722881793976,
0.18832680583000183,
-0.10856546461582184,
-0.3419506549835205,
0.16440676152706146,
0.25837382674217224,
0.11169630289077759,
-0.31546181440353394,
0.1063237115740776,
0.33058223128318787,
0.054124943912029266,
-0.025649351999163628,
0.3148106634616852,
0.4991256296634674,
0.4961864650249481,
-0.17068350315093994,
-0.029441051185131073,
0.05215137451887131,
-0.11963872611522675,
-0.06625525653362274,
0.16697275638580322,
0.17284895479679108,
0.025566067546606064,
0.24974137544631958,
0.26764625310897827,
-0.30525755882263184,
-0.05631161481142044,
0.006862645503133535,
-0.05077617987990379,
0.011802222579717636,
0.38508403301239014,
-0.1430976539850235,
-0.12853267788887024,
-0.3502323627471924,
0.02011743374168873,
-0.5803683996200562,
0.06397183239459991,
0.426237016916275,
0.030369829386472702,
0.1290980875492096,
-0.17087627947330475,
0.12501119077205658,
-0.04311127960681915,
0.28161361813545227,
0.2715856730937958,
0.12326659262180328,
-0.15495158731937408,
-0.27960503101348877,
-0.5030543804168701,
0.20887941122055054,
-0.0874718427658081,
-0.010955721139907837,
-0.13077165186405182,
0.14621824026107788,
-0.18884673714637756,
0.15534183382987976,
0.27755439281463623,
0.029446963220834732,
0.23801104724407196,
0.1368388533592224,
-0.3771361708641052,
-0.20440374314785004,
0.039578795433044434,
0.14735576510429382,
-0.005093622952699661,
-0.5665702819824219,
-0.05419275164604187,
-0.4041847586631775,
0.24957041442394257,
-0.12916143238544464,
-0.17399990558624268,
-0.027819979935884476,
-0.11597851663827896,
0.6239943504333496,
-0.040862537920475006,
0.3399483561515808,
-0.2008569985628128,
-0.18384462594985962,
-0.11076320707798004,
-0.19156691431999207,
-0.01585063710808754,
-0.10257834196090698,
0.2877925634384155,
0.36566880345344543,
-0.04813653975725174,
-0.10172736644744873,
-0.4654783010482788,
0.3443028926849365,
0.010303705930709839,
-0.009595908224582672,
-0.25939124822616577,
0.3269040286540985,
-0.04156605899333954,
0.022762425243854523,
-0.019455447793006897,
0.0735897570848465,
-0.16258516907691956,
0.18728673458099365,
-0.5148113965988159,
-0.5351011753082275,
0.5774758458137512,
-0.19221234321594238,
-0.25275564193725586,
0.11978304386138916,
0.3851375877857208,
0.041007936000823975,
0.021608268842101097,
-0.4395599365234375,
0.12920811772346497,
0.3191491663455963,
-0.10070893913507462,
-0.2627981901168823,
0.24097350239753723,
-0.23580491542816162,
0.04525546729564667,
0.0525587797164917,
0.2706085741519928,
0.03627454861998558,
0.13536998629570007,
0.05155105143785477,
-0.18516260385513306
] |
https://github.com/huggingface/datasets/issues/6308 | > The `fsspec<2023.9.0` upper bound will be removed in the next release. The `ResourceError` fix is also present in version 2023.6.0, so use that version in the meantime (`pip install fsspec==2023.6.0`).
thanks for replyοΌ | module 'resource' has no attribute 'error' | ### Describe the bug
just run import:
`from datasets import load_dataset`
and then:
```
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module>
from .arrow_dataset import Dataset
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module>
from .arrow_reader import ArrowReader
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module>
from .download.download_config import DownloadConfig
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module>
from .streaming_download_manager import StreamingDownloadManager
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module>
from ..filesystems import COMPRESSION_FILESYSTEMS
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module>
import fsspec.asyn
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module>
ResourceEror = resource.error
AttributeError: module 'resource' has no attribute 'error'
Process finished with exit code 1
```
and the error codes are:
```
try:
import resource
except ImportError:
resource = None
ResourceError = OSError
else:
ResourceEror = resource.error
```
1. miss spelling : "ResourceEror " should be "ResourceErorr"
2. module 'resource' has no attribute 'error'
### Steps to reproduce the bug
only one step:
`from datasets import load_dataset`
### Expected behavior
slove error: module 'resource' has no attribute 'error'
### Environment info
python=3.10
datasets==2.14.5
| 34 | module 'resource' has no attribute 'error'
### Describe the bug
just run import:
`from datasets import load_dataset`
and then:
```
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module>
from .arrow_dataset import Dataset
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module>
from .arrow_reader import ArrowReader
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module>
from .download.download_config import DownloadConfig
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module>
from .streaming_download_manager import StreamingDownloadManager
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module>
from ..filesystems import COMPRESSION_FILESYSTEMS
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module>
import fsspec.asyn
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module>
ResourceEror = resource.error
AttributeError: module 'resource' has no attribute 'error'
Process finished with exit code 1
```
and the error codes are:
```
try:
import resource
except ImportError:
resource = None
ResourceError = OSError
else:
ResourceEror = resource.error
```
1. miss spelling : "ResourceEror " should be "ResourceErorr"
2. module 'resource' has no attribute 'error'
### Steps to reproduce the bug
only one step:
`from datasets import load_dataset`
### Expected behavior
slove error: module 'resource' has no attribute 'error'
### Environment info
python=3.10
datasets==2.14.5
> The `fsspec<2023.9.0` upper bound will be removed in the next release. The `ResourceError` fix is also present in version 2023.6.0, so use that version in the meantime (`pip install fsspec==2023.6.0`).
thanks for replyοΌ | [
-0.3986871838569641,
-0.19148069620132446,
-0.12688815593719482,
0.3200543522834778,
0.6016736626625061,
-0.017333589494228363,
0.11214470118284225,
0.34752100706100464,
-0.19669853150844574,
0.062872976064682,
0.0392395481467247,
0.4419638514518738,
-0.10753051936626434,
-0.14714926481246948,
-0.14010368287563324,
-0.11447444558143616,
0.06480234861373901,
0.260962575674057,
-0.0880909264087677,
-0.03188542276620865,
-0.36739176511764526,
0.2021857649087906,
-0.10201127082109451,
0.047752246260643005,
-0.21952451765537262,
-0.04417954385280609,
0.10654699057340622,
0.15111079812049866,
-0.2045445591211319,
-0.6687843203544617,
0.14584751427173615,
-0.23429903388023376,
0.028916023671627045,
0.26385486125946045,
-0.00010483679216122255,
-0.09192080795764923,
0.5043992400169373,
0.008851990103721619,
-0.4519427418708801,
-0.007060334086418152,
-0.11310628801584244,
-0.20801551640033722,
0.12791267037391663,
-0.21501636505126953,
-0.044825952500104904,
-0.4287731349468231,
-0.1606680005788803,
-0.40501102805137634,
0.23424802720546722,
0.4217064082622528,
0.34836190938949585,
0.24183562397956848,
0.1448751538991928,
-0.2604690194129944,
0.16497796773910522,
-0.0533805675804615,
0.03902014344930649,
0.16846546530723572,
0.12975946068763733,
0.015747182071208954,
0.11311238259077072,
0.31473028659820557,
-0.08487847447395325,
0.13144570589065552,
0.302755206823349,
-0.15515360236167908,
0.14862596988677979,
-0.2968238294124603,
0.05527511239051819,
-0.05779068544507027,
0.5392397046089172,
-0.034135714173316956,
-0.36789292097091675,
0.06743358075618744,
0.017345178872346878,
-0.23995618522167206,
0.19696465134620667,
0.30048757791519165,
-0.1930186152458191,
0.08963553607463837,
0.286438524723053,
-0.051690805703401566,
-0.06290028989315033,
0.0989265963435173,
0.08745156228542328,
0.12008987367153168,
-0.22417493164539337,
0.04634222388267517,
0.13342946767807007,
-0.12949509918689728,
0.2350088208913803,
0.02024158090353012,
-0.29285550117492676,
0.1330656111240387,
-0.44092464447021484,
0.024414561688899994,
0.05100492760539055,
0.012131383642554283,
0.01860540360212326,
0.3788936734199524,
-0.03765168786048889,
0.00023193657398223877,
0.17601843178272247,
0.18408989906311035,
0.1895536184310913,
0.10283287614583969,
0.07154086232185364,
0.0035066157579421997,
0.12637928128242493,
0.21012632548809052,
-0.04979006573557854,
-0.13064490258693695,
-0.1766434609889984,
-0.3413331210613251,
0.07800815254449844,
0.12137284874916077,
0.3286736011505127,
-0.05898531898856163,
-0.4270513355731964,
0.02394947037100792,
0.17235378921031952,
0.06902807950973511,
-0.08004437386989594,
0.4805881381034851,
-0.15534672141075134,
0.329429030418396,
0.1783149540424347,
0.22648975253105164,
-0.17851240932941437,
-0.30053019523620605,
-0.215915247797966,
0.14063119888305664,
-0.27959132194519043,
-0.14538903534412384,
0.029338106513023376,
0.024687573313713074,
0.4568535387516022,
-0.11171720176935196,
-0.222735196352005,
-0.1489749252796173,
0.22611063718795776,
-0.27641230821609497,
-0.12802374362945557,
0.3855404555797577,
-0.014411747455596924,
0.1719397008419037,
0.17336814105510712,
0.011520683765411377,
0.074625164270401,
-0.002746591344475746,
-0.2583906948566437,
-0.3184252679347992,
-0.22839117050170898,
0.3683519661426544,
0.07826777547597885,
0.1056184321641922,
-0.09796086698770523,
-0.04842836409807205,
0.11204215884208679,
-0.19315597414970398,
-0.03456122800707817,
-0.041569147258996964,
-0.17159491777420044,
-0.32063010334968567,
0.2160150110721588,
0.5213679075241089,
-0.1373402327299118,
-0.16828979551792145,
-0.24254797399044037,
-0.18697704374790192,
0.2844105660915375,
-0.030206605792045593,
-0.22740665078163147,
0.0901920422911644,
-0.25047287344932556,
0.046258628368377686,
0.5648531913757324,
-0.33318474888801575,
-0.4129411578178406,
0.2338258922100067,
-0.18880128860473633,
-0.26704880595207214,
0.24048277735710144,
0.019981399178504944,
0.2917977571487427,
-0.053338583558797836,
0.3668214678764343,
0.30355146527290344,
0.11220022290945053,
0.09092199057340622,
-0.28905799984931946,
-0.16056713461875916,
-0.055116258561611176,
0.036516204476356506,
-0.015350611880421638,
0.08678215742111206,
0.3798639476299286,
0.014846529811620712,
0.12530504167079926,
0.03634697198867798,
0.17941954731941223,
0.3228355050086975,
0.2983788549900055,
-0.04185072332620621,
-0.02910441905260086,
-0.17905525863170624,
-0.1014188602566719,
0.09706919640302658,
-0.14870862662792206,
-0.13952836394309998,
-0.1927272528409958,
-0.06654711812734604,
-0.2962522506713867,
-0.10102593898773193,
-0.33796244859695435,
-0.40390288829803467,
0.26073887944221497,
0.2557607591152191,
0.010291822254657745,
0.1903303861618042,
-0.1587284654378891,
0.2990480363368988,
-0.12815028429031372,
0.09859730303287506,
-0.044426631182432175,
0.13323085010051727,
-0.20837633311748505,
-0.19715864956378937,
0.04790857434272766,
-0.04191511496901512,
0.20967763662338257,
0.051320880651474,
-0.22130677103996277,
0.3515278697013855,
0.13364878296852112,
0.3526466488838196,
0.013181719928979874,
-0.29880303144454956,
0.27251961827278137,
-0.47287416458129883,
0.0004012109711766243,
0.13062113523483276,
0.2847999930381775,
-0.02720218151807785,
0.21377089619636536,
-0.06495235115289688,
0.09433408826589584,
0.13636913895606995,
0.222360759973526,
0.3125946819782257,
0.35975390672683716,
0.006679564714431763,
0.01977430284023285,
-0.15489694476127625,
0.1976737380027771,
0.09712933748960495,
0.12405706942081451,
-0.08774727582931519,
-0.14016833901405334,
0.04638201743364334,
0.45388486981391907,
0.17620255053043365,
0.034853339195251465,
0.0689816027879715,
-0.46566787362098694,
0.06784264743328094,
0.23514477908611298,
0.5774679780006409,
0.5735413432121277,
0.19620811939239502,
-0.09667365998029709,
0.11954762786626816,
0.26265379786491394,
-0.011760137975215912,
0.3910399377346039,
0.05885463207960129,
0.29732832312583923,
0.30188387632369995,
0.06957201659679413,
0.0655592530965805,
-0.24741758406162262,
-0.3473672568798065,
-0.017745796591043472,
0.2081046849489212,
-0.2101595401763916,
0.04224134236574173,
-0.18250373005867004,
0.037987321615219116,
-0.19277538359165192,
-0.06389997154474258,
0.16230875253677368,
-0.13721761107444763,
-0.09366515278816223,
0.20348602533340454,
-0.1252271980047226,
0.26980704069137573,
-0.25998038053512573,
-0.07745955884456635,
0.17376813292503357,
-0.04570259898900986,
-0.0702543705701828,
-0.1407497525215149,
-0.017585698515176773,
0.05963718146085739,
0.12874868512153625,
0.0441877581179142,
0.3856377899646759,
-0.10879819095134735,
0.1394970417022705,
-0.2698422372341156,
0.019003376364707947,
0.0959814041852951,
0.05380180478096008,
0.13128907978534698,
0.1382017284631729,
0.11238909512758255,
0.07462994754314423,
-0.22016967833042145,
0.42836764454841614,
-0.19458577036857605,
-0.2052070051431656,
0.18634647130966187,
0.02353888377547264,
-0.13801562786102295,
-0.26377904415130615,
-0.4884738624095917,
-0.4124785363674164,
-0.6430261731147766,
-0.03672435134649277,
0.04750678688287735,
0.09605056047439575,
0.22985637187957764,
0.3069297969341278,
0.22885356843471527,
0.06383587419986725,
0.2650013267993927,
-0.15014635026454926,
-0.11194655299186707,
0.319204717874527,
-0.36667829751968384,
-0.4397984743118286,
0.05553367733955383,
-0.10016590356826782,
0.20444096624851227,
0.30616647005081177,
-0.1695614606142044,
0.05344012379646301,
-0.13546708226203918,
-0.11284831166267395,
-0.1928335279226303,
0.21472567319869995,
0.3281360864639282,
0.28163236379623413,
-0.2832147777080536,
-0.19891352951526642,
0.17550691962242126,
-0.10355570912361145,
-0.025086283683776855,
0.21830442547798157,
0.03110937774181366,
0.27250683307647705,
-0.15272510051727295,
0.47176826000213623,
0.23121067881584167,
-0.004758144728839397,
0.5463314056396484,
-0.16185930371284485,
0.23490823805332184,
-0.09197065234184265,
-0.3276529312133789,
-0.11282053589820862,
-0.12778539955615997,
0.12687534093856812,
0.09309892356395721,
-0.0664772242307663,
-0.15356768667697906,
-0.22586995363235474,
-0.027622882276773453,
-0.3518002927303314,
0.024523869156837463,
-0.14036591351032257,
-0.1553347110748291,
0.2582381069660187,
-0.1341891586780548,
0.09026472270488739,
0.05438707396388054,
0.21625855565071106,
0.1886403113603592,
0.0913459062576294,
-0.15935540199279785,
0.022454775869846344,
-0.11565561592578888,
-0.10236471146345139,
-0.24347202479839325,
0.13453754782676697,
-0.10242906212806702,
0.33950501680374146,
0.059418320655822754,
-0.10687941312789917,
0.04164735972881317,
-0.1243746280670166,
0.4841497242450714,
-0.1642855852842331,
0.08949726819992065,
0.019013479351997375,
0.21633175015449524,
-0.42394769191741943,
-0.011655241250991821,
-0.060948193073272705,
0.0501217246055603,
-0.2389349341392517,
0.14439800381660461,
-0.2057364583015442,
-0.07361974567174911,
-0.10077854990959167,
0.05520864948630333,
-0.15522676706314087,
0.15147417783737183,
-0.33706945180892944,
-0.2913549542427063,
-0.5706391334533691,
-0.07889419049024582,
-0.06040922552347183,
0.17670713365077972,
0.16742752492427826,
-0.11410672217607498,
-0.19909228384494781,
0.059666238725185394,
-0.0975431278347969,
0.010022297501564026,
0.5705114006996155,
-0.33834415674209595,
0.1523469239473343,
0.03892131894826889,
0.05544844642281532,
0.530432939529419,
0.8282788991928101,
-0.01291879452764988,
-0.40164196491241455,
-0.042788002640008926,
-0.14498186111450195,
0.1748020201921463,
0.0034456923604011536,
-0.2307189702987671,
-0.02312638610601425,
-0.180494487285614,
0.20934417843818665,
-0.08178849518299103,
0.016674529761075974,
0.4775576889514923,
-0.017120786011219025,
-0.040978919714689255,
-0.3274292051792145,
0.25784412026405334,
-0.06416185200214386,
0.05417972803115845,
0.3487032651901245,
0.20437228679656982,
-0.061087995767593384,
0.19808165729045868,
-0.02690736949443817,
0.7757598161697388,
0.3213708698749542,
-0.015628965571522713,
0.30154693126678467,
-0.19606459140777588,
0.3399161696434021,
-0.31315097212791443,
0.1797807812690735,
-0.29715394973754883,
-0.023660294711589813,
0.008242763578891754,
-0.1804746687412262,
0.2441743165254593,
-0.05351950600743294,
-0.34070175886154175,
0.1377055048942566,
-0.3723523020744324,
-0.06400715559720993,
-0.11289745569229126,
0.06798258423805237,
-0.20302459597587585,
-0.17434045672416687,
-0.2316419780254364,
0.2852781414985657,
-0.07309538871049881,
0.31959155201911926,
-0.09175578504800797,
-0.09823864698410034,
-0.05971657857298851,
-0.39254841208457947,
-0.16108402609825134,
0.23592166602611542,
-0.25698989629745483,
0.22441323101520538,
-0.21450895071029663,
-0.1136239543557167,
0.07830995321273804,
0.2093053162097931,
-0.11662596464157104,
-0.07253365218639374,
-0.16346916556358337,
0.14833463728427887,
0.014172124676406384,
-0.009479228407144547,
-0.20777563750743866,
0.012999117374420166,
0.4080066382884979,
-0.23594367504119873,
-0.22264808416366577,
0.2557586431503296,
-0.22250865399837494,
0.01425468921661377,
0.45749104022979736,
0.01079617254436016,
0.05272100120782852,
-0.06154736876487732,
-0.28134217858314514,
-0.0720173716545105,
-0.18000775575637817,
-0.19125807285308838,
0.24518226087093353,
-0.054095543920993805,
-0.34883999824523926,
0.15232327580451965,
0.17695757746696472,
-0.07935263216495514,
-0.05687965825200081,
0.28506165742874146,
-0.006674742326140404,
0.24185405671596527,
0.47649580240249634,
-0.2127925455570221,
-0.23220565915107727,
-0.41951900720596313,
-0.1070905551314354,
-0.055150944739580154,
-0.5111711025238037,
0.21138709783554077,
0.016424551606178284,
-0.038467779755592346,
-0.01903839036822319,
0.016614403575658798,
0.02533203549683094,
0.1723659336566925,
-0.09741079807281494,
-0.4979722201824188,
-0.39595282077789307,
0.05148954689502716,
-0.24005237221717834,
0.061775218695402145,
-0.24976016581058502,
-0.09798770397901535,
0.07313715666532516,
-0.06971531361341476,
-0.4040500223636627,
0.1828288435935974,
-0.20531673729419708,
0.1996113508939743,
-0.051595695316791534,
0.018269632011651993,
0.15882867574691772,
-0.0011289939284324646,
0.22106516361236572,
0.197569340467453,
-0.1587972342967987,
-0.2863661050796509,
-0.19783839583396912,
0.11419734358787537,
-0.01598561368882656,
-0.08139632642269135,
0.0651310384273529,
-0.12826143205165863,
-0.10456453263759613,
-0.050713904201984406,
-0.07161639630794525,
0.04086058586835861,
-0.16875523328781128,
0.16979525983333588,
0.41683197021484375,
0.08637817949056625,
-0.056795790791511536,
0.15386207401752472,
-0.10148666054010391,
0.24449840188026428,
-0.06678969413042068,
-0.04074731469154358,
0.07250775396823883,
-0.08124629408121109,
-0.2558583915233612,
0.050296373665332794,
-0.11350388079881668,
-0.031821586191654205,
0.3195848762989044,
-0.23722538352012634,
0.05488264560699463,
-0.10961359739303589,
0.1936112642288208,
0.4763503670692444,
-0.1447421908378601,
0.11564403027296066,
0.1384304016828537,
0.38824668526649475,
-0.3836940824985504,
-0.04951441287994385,
-0.18392211198806763,
-0.1016739159822464,
0.014708727598190308,
-0.020257584750652313,
0.05832652747631073,
-0.36174505949020386,
0.15030238032341003,
0.1264718919992447,
0.20074696838855743,
-0.15592023730278015,
0.3028935492038727,
0.16053414344787598,
0.09336347132921219,
0.10178239643573761,
0.20252911746501923,
0.06529079377651215,
0.23944199085235596,
0.35326647758483887,
-0.44169819355010986,
0.26560279726982117,
0.1704549938440323,
-0.1458314061164856,
-0.21623700857162476,
-0.3706553876399994,
0.252347856760025,
-0.028182052075862885,
-0.10303159058094025,
0.035589344799518585,
0.03874198719859123,
0.4932486414909363,
-0.047742508351802826,
-0.1279888153076172,
0.0339098796248436,
0.21631067991256714,
-0.1289178729057312,
0.035221632570028305,
0.03889782726764679,
-0.10548081994056702,
-0.08193943649530411,
-0.001720920205116272,
0.2033388465642929,
-0.1286197006702423,
0.3866722881793976,
0.18832680583000183,
-0.10856546461582184,
-0.3419506549835205,
0.16440676152706146,
0.25837382674217224,
0.11169630289077759,
-0.31546181440353394,
0.1063237115740776,
0.33058223128318787,
0.054124943912029266,
-0.025649351999163628,
0.3148106634616852,
0.4991256296634674,
0.4961864650249481,
-0.17068350315093994,
-0.029441051185131073,
0.05215137451887131,
-0.11963872611522675,
-0.06625525653362274,
0.16697275638580322,
0.17284895479679108,
0.025566067546606064,
0.24974137544631958,
0.26764625310897827,
-0.30525755882263184,
-0.05631161481142044,
0.006862645503133535,
-0.05077617987990379,
0.011802222579717636,
0.38508403301239014,
-0.1430976539850235,
-0.12853267788887024,
-0.3502323627471924,
0.02011743374168873,
-0.5803683996200562,
0.06397183239459991,
0.426237016916275,
0.030369829386472702,
0.1290980875492096,
-0.17087627947330475,
0.12501119077205658,
-0.04311127960681915,
0.28161361813545227,
0.2715856730937958,
0.12326659262180328,
-0.15495158731937408,
-0.27960503101348877,
-0.5030543804168701,
0.20887941122055054,
-0.0874718427658081,
-0.010955721139907837,
-0.13077165186405182,
0.14621824026107788,
-0.18884673714637756,
0.15534183382987976,
0.27755439281463623,
0.029446963220834732,
0.23801104724407196,
0.1368388533592224,
-0.3771361708641052,
-0.20440374314785004,
0.039578795433044434,
0.14735576510429382,
-0.005093622952699661,
-0.5665702819824219,
-0.05419275164604187,
-0.4041847586631775,
0.24957041442394257,
-0.12916143238544464,
-0.17399990558624268,
-0.027819979935884476,
-0.11597851663827896,
0.6239943504333496,
-0.040862537920475006,
0.3399483561515808,
-0.2008569985628128,
-0.18384462594985962,
-0.11076320707798004,
-0.19156691431999207,
-0.01585063710808754,
-0.10257834196090698,
0.2877925634384155,
0.36566880345344543,
-0.04813653975725174,
-0.10172736644744873,
-0.4654783010482788,
0.3443028926849365,
0.010303705930709839,
-0.009595908224582672,
-0.25939124822616577,
0.3269040286540985,
-0.04156605899333954,
0.022762425243854523,
-0.019455447793006897,
0.0735897570848465,
-0.16258516907691956,
0.18728673458099365,
-0.5148113965988159,
-0.5351011753082275,
0.5774758458137512,
-0.19221234321594238,
-0.25275564193725586,
0.11978304386138916,
0.3851375877857208,
0.041007936000823975,
0.021608268842101097,
-0.4395599365234375,
0.12920811772346497,
0.3191491663455963,
-0.10070893913507462,
-0.2627981901168823,
0.24097350239753723,
-0.23580491542816162,
0.04525546729564667,
0.0525587797164917,
0.2706085741519928,
0.03627454861998558,
0.13536998629570007,
0.05155105143785477,
-0.18516260385513306
] |
https://github.com/huggingface/datasets/issues/6306 | more informationοΌ
```
File "text2vec\__init__.py", line 8, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "text2vec\bertmatching_model.py", line 19, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "text2vec\bertmatching_dataset.py", line 7, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\__init__.py", line 52, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\inspect.py", line 30, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\load.py", line 58, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\packaged_modules\__init__.py", line 31, in <module>
File "inspect.py", line 1147, in getsource
File "inspect.py", line 1129, in getsourcelines
File "inspect.py", line 958, in findsource
OSError: could not get source code
```
| pyinstaller : OSError: could not get source code | ### Describe the bug
I ran a package with pyinstaller and got the following errorοΌ
### Steps to reproduce the bug
```
...
File "datasets\__init__.py", line 52, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\inspect.py", line 30, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\load.py", line 58, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\packaged_modules\__init__.py", line 31, in <module>
File "inspect.py", line 1147, in getsource
File "inspect.py", line 1129, in getsourcelines
File "inspect.py", line 958, in findsource
OSError: could not get source code
```
### Expected behavior
I have looked up the relevant information, but I can't find a suitable reason
### Environment info
```python
python 3.10
datasets 2.14.4
pyinstaller 5.6.2
``` | 232 | pyinstaller : OSError: could not get source code
### Describe the bug
I ran a package with pyinstaller and got the following errorοΌ
### Steps to reproduce the bug
```
...
File "datasets\__init__.py", line 52, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\inspect.py", line 30, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\load.py", line 58, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\packaged_modules\__init__.py", line 31, in <module>
File "inspect.py", line 1147, in getsource
File "inspect.py", line 1129, in getsourcelines
File "inspect.py", line 958, in findsource
OSError: could not get source code
```
### Expected behavior
I have looked up the relevant information, but I can't find a suitable reason
### Environment info
```python
python 3.10
datasets 2.14.4
pyinstaller 5.6.2
```
more informationοΌ
```
File "text2vec\__init__.py", line 8, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "text2vec\bertmatching_model.py", line 19, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "text2vec\bertmatching_dataset.py", line 7, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\__init__.py", line 52, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\inspect.py", line 30, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\load.py", line 58, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\packaged_modules\__init__.py", line 31, in <module>
File "inspect.py", line 1147, in getsource
File "inspect.py", line 1129, in getsourcelines
File "inspect.py", line 958, in findsource
OSError: could not get source code
```
| [
-0.3243016004562378,
0.07443571090698242,
-0.07170689105987549,
0.27683448791503906,
0.45608460903167725,
-0.20892037451267242,
0.5486605763435364,
0.31559014320373535,
-0.3889833688735962,
0.24571028351783752,
0.0660596415400505,
0.4091797471046448,
-0.2875100374221802,
0.1656084954738617,
-0.0016395002603530884,
0.11002235859632492,
0.06560380011796951,
0.11236375570297241,
-0.20939412713050842,
0.0864059329032898,
-0.22910279035568237,
0.3869283199310303,
-0.28352031111717224,
0.16589611768722534,
-0.2507350444793701,
0.13338959217071533,
0.01281922310590744,
0.1913994550704956,
-0.4052448272705078,
-0.5468622446060181,
0.1436816155910492,
-0.10238265991210938,
-0.07451611757278442,
0.19417931139469147,
-0.00010314751125406474,
0.14266669750213623,
0.2465646117925644,
-0.023880094289779663,
-0.09377959370613098,
-0.15548443794250488,
0.18691472709178925,
-0.41184064745903015,
-0.02599552646279335,
-0.217686265707016,
-0.043040014803409576,
-0.056837741285562515,
-0.11100196838378906,
-0.03796590119600296,
0.24040117859840393,
0.30571693181991577,
0.35007455945014954,
0.27203595638275146,
0.44505518674850464,
0.05330254137516022,
0.2723222076892853,
-0.3637581467628479,
-0.014067504554986954,
0.3770342767238617,
0.13425368070602417,
-0.10353831946849823,
0.06313910335302353,
0.10244303196668625,
-0.12029842287302017,
-0.1548662781715393,
-0.08755698055028915,
0.00505906343460083,
0.11894019693136215,
-0.2579544186592102,
-0.020164167508482933,
-0.01774856634438038,
-0.07220681011676788,
-0.20010362565517426,
-0.1850849986076355,
-0.04450424015522003,
0.010337773710489273,
-0.3441539406776428,
0.291767954826355,
0.0070605650544166565,
-0.2759363055229187,
0.12424534559249878,
0.27479076385498047,
-0.005807366222143173,
-0.034291334450244904,
0.016701459884643555,
-0.12222161144018173,
0.2956743538379669,
-0.047228604555130005,
-0.03298686072230339,
0.03641846030950546,
0.005447776988148689,
0.26907965540885925,
0.12135995924472809,
-0.028921781107783318,
0.11753503978252411,
-0.25717228651046753,
0.0384446382522583,
0.18672306835651398,
-0.15428617596626282,
-0.037546902894973755,
-0.025850245729088783,
-0.5250489711761475,
-0.23481900990009308,
-0.045503467321395874,
0.1655634492635727,
-0.04533445090055466,
0.12449358403682709,
-0.1318819671869278,
0.3992007374763489,
0.22052085399627686,
0.482751727104187,
-0.02403617650270462,
0.1246080994606018,
-0.2448035627603531,
-0.5155587196350098,
-0.02384868636727333,
0.2208172082901001,
0.5077929496765137,
-0.19549638032913208,
-0.2175929844379425,
-0.06933753192424774,
-0.12264136970043182,
0.08764220774173737,
0.13194631040096283,
0.3788929283618927,
0.08301276713609695,
0.20361508429050446,
0.2592203915119171,
-0.08295823633670807,
-0.23071354627609253,
-0.14596374332904816,
-0.20309901237487793,
0.26008009910583496,
-0.12050194293260574,
-0.0434868298470974,
0.0642114132642746,
-0.4730110764503479,
0.3176957666873932,
0.08702421188354492,
0.026366686448454857,
-0.18418359756469727,
0.20489659905433655,
-0.04183993116021156,
-0.13200798630714417,
0.12569229304790497,
-0.2600868046283722,
0.04341355711221695,
0.26069170236587524,
-0.08447130769491196,
-0.005875542759895325,
0.196092426776886,
-0.33699581027030945,
-0.4965856075286865,
0.14358492195606232,
0.33314231038093567,
-0.16656595468521118,
0.14472642540931702,
0.3997706174850464,
-0.1785862296819687,
0.29452016949653625,
-0.18891587853431702,
0.25546994805336,
-0.38170087337493896,
0.21999865770339966,
-0.23929518461227417,
0.45032036304473877,
0.44059306383132935,
-0.20322291553020477,
-0.019971661269664764,
0.10073623061180115,
-0.4410451650619507,
0.24397915601730347,
-0.07232338190078735,
-0.09560041129589081,
0.2246594876050949,
-0.3667694926261902,
0.005915343761444092,
0.3718416392803192,
-0.18420656025409698,
-0.32782691717147827,
-0.3382493257522583,
-0.43937182426452637,
-0.08359726518392563,
0.32902371883392334,
-0.1328524351119995,
0.31472691893577576,
0.0010486654937267303,
0.2119911164045334,
0.12133888900279999,
0.06738247722387314,
0.01918374001979828,
-0.2375006377696991,
-0.24745310842990875,
-0.002847509691491723,
0.19546908140182495,
0.19266894459724426,
-0.13279129564762115,
0.03659139946103096,
0.1582290530204773,
0.21777215600013733,
0.004033086821436882,
-0.15541616082191467,
0.2607262134552002,
0.4248849153518677,
0.20979709923267365,
0.08863750100135803,
-0.1328592598438263,
0.2938787043094635,
0.18988068401813507,
-0.3464903235435486,
-0.06621331721544266,
-0.22137215733528137,
-0.10224363207817078,
0.10006802529096603,
0.2292858064174652,
-0.1631215363740921,
-0.40158146619796753,
0.2834165394306183,
0.15909793972969055,
-0.14912544190883636,
0.02884279191493988,
-0.11565680056810379,
-0.003813536837697029,
-0.056623030453920364,
0.09940770268440247,
-0.3094203472137451,
0.23966550827026367,
-0.30326998233795166,
-0.28635403513908386,
0.016074955463409424,
0.2163563072681427,
0.1384791135787964,
-0.1486165076494217,
-0.11615651845932007,
0.21332308650016785,
0.2028583437204361,
0.12224380671977997,
-0.3483874499797821,
-0.20362183451652527,
-0.015532385557889938,
0.0437038391828537,
-0.04386116564273834,
0.07751253247261047,
0.06523631513118744,
-0.004882432520389557,
0.6902897953987122,
0.1542268544435501,
-0.14534226059913635,
0.14575780928134918,
0.019876644015312195,
0.17900562286376953,
0.16030599176883698,
-0.05939169600605965,
0.062053754925727844,
-0.13622158765792847,
0.44852176308631897,
0.13693112134933472,
0.224922776222229,
0.013490475714206696,
-0.22675378620624542,
0.14332517981529236,
0.7327593564987183,
0.07919201254844666,
0.006651764735579491,
-0.1635003536939621,
-0.14733189344406128,
0.12356005609035492,
0.15393975377082825,
0.04248454421758652,
0.16418740153312683,
0.0796251967549324,
-0.44938400387763977,
0.1198391541838646,
0.21304059028625488,
-0.18237924575805664,
0.3507543206214905,
0.07915160059928894,
0.1019182801246643,
0.3357902765274048,
-0.03193068504333496,
-0.04439456760883331,
0.03094998002052307,
-0.3555915355682373,
-0.34089750051498413,
0.202564999461174,
-0.34882834553718567,
-0.02975631132721901,
-0.33885446190834045,
0.31943002343177795,
-0.4481987953186035,
-0.07803931832313538,
0.030197441577911377,
-0.09380143135786057,
0.005882986821234226,
0.18583494424819946,
-0.01851831004023552,
0.2776479721069336,
-0.013939611613750458,
0.12049029022455215,
-0.08486540615558624,
0.03620535135269165,
0.13492977619171143,
-0.17796950042247772,
-0.13772614300251007,
0.09542448818683624,
0.13737069070339203,
-0.11681513488292694,
0.2553015947341919,
-0.1986463963985443,
-0.20486706495285034,
-0.12846636772155762,
-0.18162456154823303,
0.12032070010900497,
-0.11752067506313324,
0.13098157942295074,
0.18839821219444275,
0.1809675246477127,
0.1399962157011032,
-0.06361117959022522,
0.16633793711662292,
-0.02194352075457573,
-0.3390641212463379,
0.19225676357746124,
-0.06864547729492188,
0.07367973029613495,
-0.2732234001159668,
-0.2966462969779968,
-0.379037082195282,
-0.4424515664577484,
0.021569913253188133,
-0.11547622084617615,
-0.03500818833708763,
0.10076096653938293,
0.2561013698577881,
0.4030359089374542,
0.10335072129964828,
0.12800507247447968,
0.07322131097316742,
-0.18368372321128845,
0.2988796830177307,
-0.2228468358516693,
-0.2576749920845032,
-0.06563565135002136,
-0.08907218277454376,
0.03319155052304268,
-0.19123566150665283,
-0.27413514256477356,
-0.14844448864459991,
0.09554440528154373,
0.2607882022857666,
-0.08392059803009033,
0.02321229688823223,
0.5352565050125122,
0.35438352823257446,
-0.0725361630320549,
-0.21231886744499207,
-0.08299235999584198,
0.024186739698052406,
-0.4213728606700897,
0.16251039505004883,
0.0006602853536605835,
0.5312035083770752,
-0.10938484966754913,
0.8353707194328308,
0.10520382225513458,
0.058753613382577896,
0.12234330922365189,
0.004305563867092133,
0.34709060192108154,
-0.03623855113983154,
-0.35114118456840515,
-0.0438639372587204,
0.0036990121006965637,
-0.2926081418991089,
-0.0729750543832779,
-0.23844538629055023,
0.34187671542167664,
-0.0008069425821304321,
0.07721738517284393,
-0.16502639651298523,
-0.00604923814535141,
-0.004278451204299927,
0.09489886462688446,
0.24022284150123596,
-0.16542552411556244,
0.2299729585647583,
0.05085159093141556,
0.0789325013756752,
0.25734812021255493,
0.25523680448532104,
-0.16482806205749512,
-0.06370538473129272,
0.040446288883686066,
-0.3180423080921173,
-0.3201494812965393,
0.09146778285503387,
0.02364058792591095,
-0.016266291961073875,
0.1711883693933487,
-0.03476713225245476,
0.12297974526882172,
-0.3494378626346588,
0.4060213565826416,
0.2978268265724182,
0.14236310124397278,
0.33949416875839233,
-0.16898885369300842,
-0.1474471390247345,
-0.2938787341117859,
-0.26393383741378784,
-0.0026122070848941803,
0.23105357587337494,
0.1328343152999878,
-0.3426125645637512,
0.11080410331487656,
0.32840949296951294,
0.3105694353580475,
-0.16515591740608215,
-0.004225090146064758,
-0.23594732582569122,
-0.3881275951862335,
-0.34370338916778564,
-0.21905900537967682,
-0.20115581154823303,
0.3355743885040283,
-0.17648589611053467,
-0.10137617588043213,
0.1168617457151413,
-0.09971730411052704,
-0.2561269998550415,
0.06612037122249603,
0.366338849067688,
-0.31100285053253174,
0.38910824060440063,
0.1508416384458542,
-0.06507047265768051,
0.40697377920150757,
0.37961938977241516,
-0.03239653632044792,
-0.44345664978027344,
-0.1090359166264534,
0.1219916045665741,
0.012248270213603973,
0.06215223670005798,
-0.5525786280632019,
0.21531018614768982,
-0.2332134246826172,
0.029567137360572815,
0.2345891147851944,
0.010964494198560715,
0.4475075602531433,
0.31854188442230225,
-0.010671284049749374,
-0.22725093364715576,
-0.1041206493973732,
-0.1580539494752884,
-0.05535745620727539,
0.5084089040756226,
-0.08738915622234344,
-0.14060579240322113,
0.271333783864975,
-0.007027599960565567,
0.6449008584022522,
0.18343590199947357,
0.056765757501125336,
0.6014686226844788,
0.012419462203979492,
0.18203014135360718,
0.008456036448478699,
0.1561424881219864,
-0.42296603322029114,
0.04282891005277634,
0.1863086074590683,
-0.30187201499938965,
0.09282402694225311,
-0.2783292531967163,
-0.19596925377845764,
-0.02401655726134777,
-0.2951645255088806,
0.21392299234867096,
-0.07635366171598434,
-0.047324974089860916,
0.35017848014831543,
0.03644741326570511,
-0.0948231965303421,
0.21650651097297668,
-0.09149990230798721,
0.21235597133636475,
-0.17115753889083862,
-0.0412481427192688,
-0.08892615884542465,
-0.29986903071403503,
-0.2881145477294922,
0.12862089276313782,
-0.20903581380844116,
0.4195554852485657,
0.2435203194618225,
-0.1336599737405777,
-0.1176508367061615,
0.049245744943618774,
0.053166743367910385,
0.17282763123512268,
0.05941145122051239,
-0.0071820588782429695,
0.2353353500366211,
-0.3131259083747864,
0.2163606584072113,
0.15232697129249573,
0.15470120310783386,
-0.28574973344802856,
-0.0907125398516655,
0.34790897369384766,
-0.163396418094635,
-0.2502979040145874,
0.17657478153705597,
0.03197222948074341,
0.21220067143440247,
-0.018470779061317444,
0.07508021593093872,
0.018585793673992157,
0.22575899958610535,
-0.27570250630378723,
0.2350110411643982,
0.17074701189994812,
-0.17771682143211365,
-0.06438636779785156,
-0.22821146249771118,
-0.11497356742620468,
-0.02366541139781475,
0.10093754529953003,
0.10142618417739868,
0.15470978617668152,
0.667202353477478,
-0.07510140538215637,
-0.14315170049667358,
-0.1997067779302597,
0.3527090549468994,
-0.30767184495925903,
-0.3195720314979553,
0.19133666157722473,
0.05601546913385391,
-0.03969442844390869,
-0.09980739653110504,
0.08161052316427231,
0.1492423564195633,
0.1025659590959549,
-0.28581053018569946,
-0.45524734258651733,
-0.38460904359817505,
-0.019867219030857086,
-0.16526472568511963,
-0.00916602648794651,
-0.1160050481557846,
0.20625802874565125,
-0.24924856424331665,
-0.1939876526594162,
-0.3727259933948517,
0.012843601405620575,
-0.32538530230522156,
-0.06742791831493378,
0.006558286026120186,
-0.08062668889760971,
-0.16604164242744446,
0.027720730751752853,
0.28466615080833435,
0.1539110690355301,
-0.06782032549381256,
-0.2848063111305237,
-0.18506242334842682,
0.06466441601514816,
-0.22513523697853088,
-0.06340408325195312,
0.09618956595659256,
0.009702019393444061,
-0.1255321055650711,
0.1368934065103531,
-0.0025555118918418884,
0.2534765601158142,
0.004072707146406174,
-0.0892944186925888,
0.12109702825546265,
0.22173146903514862,
-0.2486509382724762,
0.2153518944978714,
-0.11088773608207703,
0.21695896983146667,
0.01063711941242218,
0.279747873544693,
0.010742753744125366,
-0.043518975377082825,
0.005372870713472366,
0.0606100931763649,
-0.06499940156936646,
0.2851197123527527,
0.28990045189857483,
-0.10752998292446136,
0.1572551727294922,
-0.0015841536223888397,
0.010785624384880066,
0.4028279185295105,
-0.31703996658325195,
0.18846429884433746,
0.2742094099521637,
0.28433945775032043,
-0.2712947130203247,
0.18282167613506317,
-0.23595014214515686,
-0.2108713984489441,
-0.02594439685344696,
0.11953356862068176,
-0.1814766824245453,
-0.1610633283853531,
0.5355716943740845,
0.1944846510887146,
-0.007475022226572037,
0.5581656098365784,
0.21452008187770844,
0.12807008624076843,
-0.20752957463264465,
0.11800575256347656,
0.262347012758255,
-0.022604551166296005,
0.1760181486606598,
-0.030662760138511658,
-0.23571771383285522,
0.03088974393904209,
-0.3209124207496643,
-0.07949566841125488,
0.20839518308639526,
-0.24435299634933472,
-0.013544837944209576,
-0.24095648527145386,
-0.11134669184684753,
-0.13323409855365753,
-0.32268810272216797,
0.20913203060626984,
-0.2260519564151764,
-0.10962842404842377,
0.10322671383619308,
0.3322429955005646,
-0.24939095973968506,
0.0632438212633133,
0.04295550286769867,
0.007848605513572693,
-0.07193657010793686,
0.08187638223171234,
0.20287568867206573,
-0.02949211373925209,
0.0629517063498497,
0.06715235114097595,
-0.6053077578544617,
-0.154484361410141,
0.12721969187259674,
0.13368861377239227,
0.001419108361005783,
-0.15453189611434937,
0.0547541081905365,
0.047595445066690445,
0.10897353291511536,
0.060053735971450806,
0.3487080931663513,
0.4491996765136719,
0.40165024995803833,
0.05466749891638756,
-0.26690930128097534,
-0.19880138337612152,
0.06832960247993469,
-0.09321650117635727,
-0.02240855246782303,
-0.041710808873176575,
0.03008614107966423,
0.31553906202316284,
0.22341015934944153,
-0.3707687258720398,
-0.14002852141857147,
0.21473273634910583,
-0.0929093062877655,
-0.1724923849105835,
0.22746224701404572,
0.04581480100750923,
-0.1826607584953308,
-0.21166004240512848,
0.030682064592838287,
-0.4184826910495758,
-0.047725990414619446,
0.42154863476753235,
0.2853504419326782,
-0.19029518961906433,
-0.17906059324741364,
0.16713128983974457,
0.0961647629737854,
0.17048287391662598,
0.24149249494075775,
0.21204286813735962,
-0.12380384653806686,
-0.23315435647964478,
-0.5129252672195435,
0.3650985360145569,
-0.10049574077129364,
-0.28475654125213623,
-0.21064841747283936,
-0.16752055287361145,
-0.06896485388278961,
0.18903106451034546,
0.44706109166145325,
0.3906751871109009,
0.08342494070529938,
0.05314336717128754,
-0.18167057633399963,
-0.2601068913936615,
0.205730140209198,
-0.2942558825016022,
-0.002766631543636322,
-0.38884538412094116,
0.09775444120168686,
-0.4129140079021454,
0.2393399178981781,
0.09090325236320496,
-0.1405257284641266,
0.042993560433387756,
-0.29184627532958984,
0.4961647093296051,
0.08349785953760147,
0.10612659156322479,
-0.09993534535169601,
-0.01068897545337677,
-0.17805005609989166,
-0.2912772297859192,
-0.05297403037548065,
0.027503278106451035,
0.022361114621162415,
0.09974949061870575,
-0.026928195729851723,
-0.6098302006721497,
-0.45117419958114624,
0.3692110776901245,
-0.05072183534502983,
-0.1669246405363083,
-0.12322532385587692,
0.2561626434326172,
-0.06347595155239105,
0.07878577709197998,
0.1365116387605667,
0.18690834939479828,
-0.045430004596710205,
-0.008248265832662582,
-0.4761536717414856,
-0.23595008254051208,
0.3365320563316345,
-0.4489366114139557,
-0.10493481159210205,
-0.24163168668746948,
0.3690052032470703,
-0.16507527232170105,
0.058330878615379333,
-0.20032046735286713,
0.05391469597816467,
0.3151434063911438,
0.03700926527380943,
-0.22273221611976624,
0.15905815362930298,
-0.023300159722566605,
0.2926821708679199,
-0.07737641781568527,
0.12577581405639648,
0.16055914759635925,
0.21369218826293945,
0.29819363355636597,
-0.08626579493284225
] |
https://github.com/huggingface/datasets/issues/6306 | > > '
>
> thanks,I solve it.it's about pyinstaller.
I encountered the same error, how to solve it? | pyinstaller : OSError: could not get source code | ### Describe the bug
I ran a package with pyinstaller and got the following errorοΌ
### Steps to reproduce the bug
```
...
File "datasets\__init__.py", line 52, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\inspect.py", line 30, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\load.py", line 58, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\packaged_modules\__init__.py", line 31, in <module>
File "inspect.py", line 1147, in getsource
File "inspect.py", line 1129, in getsourcelines
File "inspect.py", line 958, in findsource
OSError: could not get source code
```
### Expected behavior
I have looked up the relevant information, but I can't find a suitable reason
### Environment info
```python
python 3.10
datasets 2.14.4
pyinstaller 5.6.2
``` | 19 | pyinstaller : OSError: could not get source code
### Describe the bug
I ran a package with pyinstaller and got the following errorοΌ
### Steps to reproduce the bug
```
...
File "datasets\__init__.py", line 52, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\inspect.py", line 30, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\load.py", line 58, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\packaged_modules\__init__.py", line 31, in <module>
File "inspect.py", line 1147, in getsource
File "inspect.py", line 1129, in getsourcelines
File "inspect.py", line 958, in findsource
OSError: could not get source code
```
### Expected behavior
I have looked up the relevant information, but I can't find a suitable reason
### Environment info
```python
python 3.10
datasets 2.14.4
pyinstaller 5.6.2
```
> > '
>
> thanks,I solve it.it's about pyinstaller.
I encountered the same error, how to solve it? | [
-0.3243016004562378,
0.07443571090698242,
-0.07170689105987549,
0.27683448791503906,
0.45608460903167725,
-0.20892037451267242,
0.5486605763435364,
0.31559014320373535,
-0.3889833688735962,
0.24571028351783752,
0.0660596415400505,
0.4091797471046448,
-0.2875100374221802,
0.1656084954738617,
-0.0016395002603530884,
0.11002235859632492,
0.06560380011796951,
0.11236375570297241,
-0.20939412713050842,
0.0864059329032898,
-0.22910279035568237,
0.3869283199310303,
-0.28352031111717224,
0.16589611768722534,
-0.2507350444793701,
0.13338959217071533,
0.01281922310590744,
0.1913994550704956,
-0.4052448272705078,
-0.5468622446060181,
0.1436816155910492,
-0.10238265991210938,
-0.07451611757278442,
0.19417931139469147,
-0.00010314751125406474,
0.14266669750213623,
0.2465646117925644,
-0.023880094289779663,
-0.09377959370613098,
-0.15548443794250488,
0.18691472709178925,
-0.41184064745903015,
-0.02599552646279335,
-0.217686265707016,
-0.043040014803409576,
-0.056837741285562515,
-0.11100196838378906,
-0.03796590119600296,
0.24040117859840393,
0.30571693181991577,
0.35007455945014954,
0.27203595638275146,
0.44505518674850464,
0.05330254137516022,
0.2723222076892853,
-0.3637581467628479,
-0.014067504554986954,
0.3770342767238617,
0.13425368070602417,
-0.10353831946849823,
0.06313910335302353,
0.10244303196668625,
-0.12029842287302017,
-0.1548662781715393,
-0.08755698055028915,
0.00505906343460083,
0.11894019693136215,
-0.2579544186592102,
-0.020164167508482933,
-0.01774856634438038,
-0.07220681011676788,
-0.20010362565517426,
-0.1850849986076355,
-0.04450424015522003,
0.010337773710489273,
-0.3441539406776428,
0.291767954826355,
0.0070605650544166565,
-0.2759363055229187,
0.12424534559249878,
0.27479076385498047,
-0.005807366222143173,
-0.034291334450244904,
0.016701459884643555,
-0.12222161144018173,
0.2956743538379669,
-0.047228604555130005,
-0.03298686072230339,
0.03641846030950546,
0.005447776988148689,
0.26907965540885925,
0.12135995924472809,
-0.028921781107783318,
0.11753503978252411,
-0.25717228651046753,
0.0384446382522583,
0.18672306835651398,
-0.15428617596626282,
-0.037546902894973755,
-0.025850245729088783,
-0.5250489711761475,
-0.23481900990009308,
-0.045503467321395874,
0.1655634492635727,
-0.04533445090055466,
0.12449358403682709,
-0.1318819671869278,
0.3992007374763489,
0.22052085399627686,
0.482751727104187,
-0.02403617650270462,
0.1246080994606018,
-0.2448035627603531,
-0.5155587196350098,
-0.02384868636727333,
0.2208172082901001,
0.5077929496765137,
-0.19549638032913208,
-0.2175929844379425,
-0.06933753192424774,
-0.12264136970043182,
0.08764220774173737,
0.13194631040096283,
0.3788929283618927,
0.08301276713609695,
0.20361508429050446,
0.2592203915119171,
-0.08295823633670807,
-0.23071354627609253,
-0.14596374332904816,
-0.20309901237487793,
0.26008009910583496,
-0.12050194293260574,
-0.0434868298470974,
0.0642114132642746,
-0.4730110764503479,
0.3176957666873932,
0.08702421188354492,
0.026366686448454857,
-0.18418359756469727,
0.20489659905433655,
-0.04183993116021156,
-0.13200798630714417,
0.12569229304790497,
-0.2600868046283722,
0.04341355711221695,
0.26069170236587524,
-0.08447130769491196,
-0.005875542759895325,
0.196092426776886,
-0.33699581027030945,
-0.4965856075286865,
0.14358492195606232,
0.33314231038093567,
-0.16656595468521118,
0.14472642540931702,
0.3997706174850464,
-0.1785862296819687,
0.29452016949653625,
-0.18891587853431702,
0.25546994805336,
-0.38170087337493896,
0.21999865770339966,
-0.23929518461227417,
0.45032036304473877,
0.44059306383132935,
-0.20322291553020477,
-0.019971661269664764,
0.10073623061180115,
-0.4410451650619507,
0.24397915601730347,
-0.07232338190078735,
-0.09560041129589081,
0.2246594876050949,
-0.3667694926261902,
0.005915343761444092,
0.3718416392803192,
-0.18420656025409698,
-0.32782691717147827,
-0.3382493257522583,
-0.43937182426452637,
-0.08359726518392563,
0.32902371883392334,
-0.1328524351119995,
0.31472691893577576,
0.0010486654937267303,
0.2119911164045334,
0.12133888900279999,
0.06738247722387314,
0.01918374001979828,
-0.2375006377696991,
-0.24745310842990875,
-0.002847509691491723,
0.19546908140182495,
0.19266894459724426,
-0.13279129564762115,
0.03659139946103096,
0.1582290530204773,
0.21777215600013733,
0.004033086821436882,
-0.15541616082191467,
0.2607262134552002,
0.4248849153518677,
0.20979709923267365,
0.08863750100135803,
-0.1328592598438263,
0.2938787043094635,
0.18988068401813507,
-0.3464903235435486,
-0.06621331721544266,
-0.22137215733528137,
-0.10224363207817078,
0.10006802529096603,
0.2292858064174652,
-0.1631215363740921,
-0.40158146619796753,
0.2834165394306183,
0.15909793972969055,
-0.14912544190883636,
0.02884279191493988,
-0.11565680056810379,
-0.003813536837697029,
-0.056623030453920364,
0.09940770268440247,
-0.3094203472137451,
0.23966550827026367,
-0.30326998233795166,
-0.28635403513908386,
0.016074955463409424,
0.2163563072681427,
0.1384791135787964,
-0.1486165076494217,
-0.11615651845932007,
0.21332308650016785,
0.2028583437204361,
0.12224380671977997,
-0.3483874499797821,
-0.20362183451652527,
-0.015532385557889938,
0.0437038391828537,
-0.04386116564273834,
0.07751253247261047,
0.06523631513118744,
-0.004882432520389557,
0.6902897953987122,
0.1542268544435501,
-0.14534226059913635,
0.14575780928134918,
0.019876644015312195,
0.17900562286376953,
0.16030599176883698,
-0.05939169600605965,
0.062053754925727844,
-0.13622158765792847,
0.44852176308631897,
0.13693112134933472,
0.224922776222229,
0.013490475714206696,
-0.22675378620624542,
0.14332517981529236,
0.7327593564987183,
0.07919201254844666,
0.006651764735579491,
-0.1635003536939621,
-0.14733189344406128,
0.12356005609035492,
0.15393975377082825,
0.04248454421758652,
0.16418740153312683,
0.0796251967549324,
-0.44938400387763977,
0.1198391541838646,
0.21304059028625488,
-0.18237924575805664,
0.3507543206214905,
0.07915160059928894,
0.1019182801246643,
0.3357902765274048,
-0.03193068504333496,
-0.04439456760883331,
0.03094998002052307,
-0.3555915355682373,
-0.34089750051498413,
0.202564999461174,
-0.34882834553718567,
-0.02975631132721901,
-0.33885446190834045,
0.31943002343177795,
-0.4481987953186035,
-0.07803931832313538,
0.030197441577911377,
-0.09380143135786057,
0.005882986821234226,
0.18583494424819946,
-0.01851831004023552,
0.2776479721069336,
-0.013939611613750458,
0.12049029022455215,
-0.08486540615558624,
0.03620535135269165,
0.13492977619171143,
-0.17796950042247772,
-0.13772614300251007,
0.09542448818683624,
0.13737069070339203,
-0.11681513488292694,
0.2553015947341919,
-0.1986463963985443,
-0.20486706495285034,
-0.12846636772155762,
-0.18162456154823303,
0.12032070010900497,
-0.11752067506313324,
0.13098157942295074,
0.18839821219444275,
0.1809675246477127,
0.1399962157011032,
-0.06361117959022522,
0.16633793711662292,
-0.02194352075457573,
-0.3390641212463379,
0.19225676357746124,
-0.06864547729492188,
0.07367973029613495,
-0.2732234001159668,
-0.2966462969779968,
-0.379037082195282,
-0.4424515664577484,
0.021569913253188133,
-0.11547622084617615,
-0.03500818833708763,
0.10076096653938293,
0.2561013698577881,
0.4030359089374542,
0.10335072129964828,
0.12800507247447968,
0.07322131097316742,
-0.18368372321128845,
0.2988796830177307,
-0.2228468358516693,
-0.2576749920845032,
-0.06563565135002136,
-0.08907218277454376,
0.03319155052304268,
-0.19123566150665283,
-0.27413514256477356,
-0.14844448864459991,
0.09554440528154373,
0.2607882022857666,
-0.08392059803009033,
0.02321229688823223,
0.5352565050125122,
0.35438352823257446,
-0.0725361630320549,
-0.21231886744499207,
-0.08299235999584198,
0.024186739698052406,
-0.4213728606700897,
0.16251039505004883,
0.0006602853536605835,
0.5312035083770752,
-0.10938484966754913,
0.8353707194328308,
0.10520382225513458,
0.058753613382577896,
0.12234330922365189,
0.004305563867092133,
0.34709060192108154,
-0.03623855113983154,
-0.35114118456840515,
-0.0438639372587204,
0.0036990121006965637,
-0.2926081418991089,
-0.0729750543832779,
-0.23844538629055023,
0.34187671542167664,
-0.0008069425821304321,
0.07721738517284393,
-0.16502639651298523,
-0.00604923814535141,
-0.004278451204299927,
0.09489886462688446,
0.24022284150123596,
-0.16542552411556244,
0.2299729585647583,
0.05085159093141556,
0.0789325013756752,
0.25734812021255493,
0.25523680448532104,
-0.16482806205749512,
-0.06370538473129272,
0.040446288883686066,
-0.3180423080921173,
-0.3201494812965393,
0.09146778285503387,
0.02364058792591095,
-0.016266291961073875,
0.1711883693933487,
-0.03476713225245476,
0.12297974526882172,
-0.3494378626346588,
0.4060213565826416,
0.2978268265724182,
0.14236310124397278,
0.33949416875839233,
-0.16898885369300842,
-0.1474471390247345,
-0.2938787341117859,
-0.26393383741378784,
-0.0026122070848941803,
0.23105357587337494,
0.1328343152999878,
-0.3426125645637512,
0.11080410331487656,
0.32840949296951294,
0.3105694353580475,
-0.16515591740608215,
-0.004225090146064758,
-0.23594732582569122,
-0.3881275951862335,
-0.34370338916778564,
-0.21905900537967682,
-0.20115581154823303,
0.3355743885040283,
-0.17648589611053467,
-0.10137617588043213,
0.1168617457151413,
-0.09971730411052704,
-0.2561269998550415,
0.06612037122249603,
0.366338849067688,
-0.31100285053253174,
0.38910824060440063,
0.1508416384458542,
-0.06507047265768051,
0.40697377920150757,
0.37961938977241516,
-0.03239653632044792,
-0.44345664978027344,
-0.1090359166264534,
0.1219916045665741,
0.012248270213603973,
0.06215223670005798,
-0.5525786280632019,
0.21531018614768982,
-0.2332134246826172,
0.029567137360572815,
0.2345891147851944,
0.010964494198560715,
0.4475075602531433,
0.31854188442230225,
-0.010671284049749374,
-0.22725093364715576,
-0.1041206493973732,
-0.1580539494752884,
-0.05535745620727539,
0.5084089040756226,
-0.08738915622234344,
-0.14060579240322113,
0.271333783864975,
-0.007027599960565567,
0.6449008584022522,
0.18343590199947357,
0.056765757501125336,
0.6014686226844788,
0.012419462203979492,
0.18203014135360718,
0.008456036448478699,
0.1561424881219864,
-0.42296603322029114,
0.04282891005277634,
0.1863086074590683,
-0.30187201499938965,
0.09282402694225311,
-0.2783292531967163,
-0.19596925377845764,
-0.02401655726134777,
-0.2951645255088806,
0.21392299234867096,
-0.07635366171598434,
-0.047324974089860916,
0.35017848014831543,
0.03644741326570511,
-0.0948231965303421,
0.21650651097297668,
-0.09149990230798721,
0.21235597133636475,
-0.17115753889083862,
-0.0412481427192688,
-0.08892615884542465,
-0.29986903071403503,
-0.2881145477294922,
0.12862089276313782,
-0.20903581380844116,
0.4195554852485657,
0.2435203194618225,
-0.1336599737405777,
-0.1176508367061615,
0.049245744943618774,
0.053166743367910385,
0.17282763123512268,
0.05941145122051239,
-0.0071820588782429695,
0.2353353500366211,
-0.3131259083747864,
0.2163606584072113,
0.15232697129249573,
0.15470120310783386,
-0.28574973344802856,
-0.0907125398516655,
0.34790897369384766,
-0.163396418094635,
-0.2502979040145874,
0.17657478153705597,
0.03197222948074341,
0.21220067143440247,
-0.018470779061317444,
0.07508021593093872,
0.018585793673992157,
0.22575899958610535,
-0.27570250630378723,
0.2350110411643982,
0.17074701189994812,
-0.17771682143211365,
-0.06438636779785156,
-0.22821146249771118,
-0.11497356742620468,
-0.02366541139781475,
0.10093754529953003,
0.10142618417739868,
0.15470978617668152,
0.667202353477478,
-0.07510140538215637,
-0.14315170049667358,
-0.1997067779302597,
0.3527090549468994,
-0.30767184495925903,
-0.3195720314979553,
0.19133666157722473,
0.05601546913385391,
-0.03969442844390869,
-0.09980739653110504,
0.08161052316427231,
0.1492423564195633,
0.1025659590959549,
-0.28581053018569946,
-0.45524734258651733,
-0.38460904359817505,
-0.019867219030857086,
-0.16526472568511963,
-0.00916602648794651,
-0.1160050481557846,
0.20625802874565125,
-0.24924856424331665,
-0.1939876526594162,
-0.3727259933948517,
0.012843601405620575,
-0.32538530230522156,
-0.06742791831493378,
0.006558286026120186,
-0.08062668889760971,
-0.16604164242744446,
0.027720730751752853,
0.28466615080833435,
0.1539110690355301,
-0.06782032549381256,
-0.2848063111305237,
-0.18506242334842682,
0.06466441601514816,
-0.22513523697853088,
-0.06340408325195312,
0.09618956595659256,
0.009702019393444061,
-0.1255321055650711,
0.1368934065103531,
-0.0025555118918418884,
0.2534765601158142,
0.004072707146406174,
-0.0892944186925888,
0.12109702825546265,
0.22173146903514862,
-0.2486509382724762,
0.2153518944978714,
-0.11088773608207703,
0.21695896983146667,
0.01063711941242218,
0.279747873544693,
0.010742753744125366,
-0.043518975377082825,
0.005372870713472366,
0.0606100931763649,
-0.06499940156936646,
0.2851197123527527,
0.28990045189857483,
-0.10752998292446136,
0.1572551727294922,
-0.0015841536223888397,
0.010785624384880066,
0.4028279185295105,
-0.31703996658325195,
0.18846429884433746,
0.2742094099521637,
0.28433945775032043,
-0.2712947130203247,
0.18282167613506317,
-0.23595014214515686,
-0.2108713984489441,
-0.02594439685344696,
0.11953356862068176,
-0.1814766824245453,
-0.1610633283853531,
0.5355716943740845,
0.1944846510887146,
-0.007475022226572037,
0.5581656098365784,
0.21452008187770844,
0.12807008624076843,
-0.20752957463264465,
0.11800575256347656,
0.262347012758255,
-0.022604551166296005,
0.1760181486606598,
-0.030662760138511658,
-0.23571771383285522,
0.03088974393904209,
-0.3209124207496643,
-0.07949566841125488,
0.20839518308639526,
-0.24435299634933472,
-0.013544837944209576,
-0.24095648527145386,
-0.11134669184684753,
-0.13323409855365753,
-0.32268810272216797,
0.20913203060626984,
-0.2260519564151764,
-0.10962842404842377,
0.10322671383619308,
0.3322429955005646,
-0.24939095973968506,
0.0632438212633133,
0.04295550286769867,
0.007848605513572693,
-0.07193657010793686,
0.08187638223171234,
0.20287568867206573,
-0.02949211373925209,
0.0629517063498497,
0.06715235114097595,
-0.6053077578544617,
-0.154484361410141,
0.12721969187259674,
0.13368861377239227,
0.001419108361005783,
-0.15453189611434937,
0.0547541081905365,
0.047595445066690445,
0.10897353291511536,
0.060053735971450806,
0.3487080931663513,
0.4491996765136719,
0.40165024995803833,
0.05466749891638756,
-0.26690930128097534,
-0.19880138337612152,
0.06832960247993469,
-0.09321650117635727,
-0.02240855246782303,
-0.041710808873176575,
0.03008614107966423,
0.31553906202316284,
0.22341015934944153,
-0.3707687258720398,
-0.14002852141857147,
0.21473273634910583,
-0.0929093062877655,
-0.1724923849105835,
0.22746224701404572,
0.04581480100750923,
-0.1826607584953308,
-0.21166004240512848,
0.030682064592838287,
-0.4184826910495758,
-0.047725990414619446,
0.42154863476753235,
0.2853504419326782,
-0.19029518961906433,
-0.17906059324741364,
0.16713128983974457,
0.0961647629737854,
0.17048287391662598,
0.24149249494075775,
0.21204286813735962,
-0.12380384653806686,
-0.23315435647964478,
-0.5129252672195435,
0.3650985360145569,
-0.10049574077129364,
-0.28475654125213623,
-0.21064841747283936,
-0.16752055287361145,
-0.06896485388278961,
0.18903106451034546,
0.44706109166145325,
0.3906751871109009,
0.08342494070529938,
0.05314336717128754,
-0.18167057633399963,
-0.2601068913936615,
0.205730140209198,
-0.2942558825016022,
-0.002766631543636322,
-0.38884538412094116,
0.09775444120168686,
-0.4129140079021454,
0.2393399178981781,
0.09090325236320496,
-0.1405257284641266,
0.042993560433387756,
-0.29184627532958984,
0.4961647093296051,
0.08349785953760147,
0.10612659156322479,
-0.09993534535169601,
-0.01068897545337677,
-0.17805005609989166,
-0.2912772297859192,
-0.05297403037548065,
0.027503278106451035,
0.022361114621162415,
0.09974949061870575,
-0.026928195729851723,
-0.6098302006721497,
-0.45117419958114624,
0.3692110776901245,
-0.05072183534502983,
-0.1669246405363083,
-0.12322532385587692,
0.2561626434326172,
-0.06347595155239105,
0.07878577709197998,
0.1365116387605667,
0.18690834939479828,
-0.045430004596710205,
-0.008248265832662582,
-0.4761536717414856,
-0.23595008254051208,
0.3365320563316345,
-0.4489366114139557,
-0.10493481159210205,
-0.24163168668746948,
0.3690052032470703,
-0.16507527232170105,
0.058330878615379333,
-0.20032046735286713,
0.05391469597816467,
0.3151434063911438,
0.03700926527380943,
-0.22273221611976624,
0.15905815362930298,
-0.023300159722566605,
0.2926821708679199,
-0.07737641781568527,
0.12577581405639648,
0.16055914759635925,
0.21369218826293945,
0.29819363355636597,
-0.08626579493284225
] |
https://github.com/huggingface/datasets/issues/6303 | You can find the reasoning behind this naming scheme [here](https://github.com/huggingface/transformers/pull/16343#discussion_r931182168).
This point has been raised several times, so I'd be okay with starting with `00001-` (also to be consistent with the `transformers` sharding), but I'm not sure @lhoestq agrees. | Parquet uploads off-by-one naming scheme | ### Describe the bug
I noticed this numbering scheme not matching up in a different project and wanted to raise it as an issue for discussion, what is the actual proper way to have these stored?
<img width="425" alt="image" src="https://github.com/huggingface/datasets/assets/1981179/3ffa2144-7c9a-446f-b521-a5e9db71e7ce">
The `-SSSSS-of-NNNNN` seems to be used widely across the codebase. The section that creates the part in my screenshot is here https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L5287
There are also some edits to this section in the single commit branch.
### Steps to reproduce the bug
1. Upload a dataset that requires at least two parquet files in it
2. Observe the naming scheme
### Expected behavior
The couple options here are of course **1. keeping it as is**
**2. Starting the index at 1:**
train-00001-of-00002-{hash}.parquet
train-00002-of-00002-{hash}.parquet
**3. My preferred option** (which would solve my specific issue), dropping the total entirely:
train-00000-{hash}.parquet
train-00001-{hash}.parquet
This also solves an issue that will occur with an `append` variable for `push_to_hub` (see https://github.com/huggingface/datasets/issues/6290) where as you add a new parquet file, you need to rename everything in the repo as well.
However, I know there are parts of the repo that use 0 as the starting file or may require the total, so raising the question for discussion.
### Environment info
- `datasets` version: 2.14.6.dev0
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.18.0
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 39 | Parquet uploads off-by-one naming scheme
### Describe the bug
I noticed this numbering scheme not matching up in a different project and wanted to raise it as an issue for discussion, what is the actual proper way to have these stored?
<img width="425" alt="image" src="https://github.com/huggingface/datasets/assets/1981179/3ffa2144-7c9a-446f-b521-a5e9db71e7ce">
The `-SSSSS-of-NNNNN` seems to be used widely across the codebase. The section that creates the part in my screenshot is here https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L5287
There are also some edits to this section in the single commit branch.
### Steps to reproduce the bug
1. Upload a dataset that requires at least two parquet files in it
2. Observe the naming scheme
### Expected behavior
The couple options here are of course **1. keeping it as is**
**2. Starting the index at 1:**
train-00001-of-00002-{hash}.parquet
train-00002-of-00002-{hash}.parquet
**3. My preferred option** (which would solve my specific issue), dropping the total entirely:
train-00000-{hash}.parquet
train-00001-{hash}.parquet
This also solves an issue that will occur with an `append` variable for `push_to_hub` (see https://github.com/huggingface/datasets/issues/6290) where as you add a new parquet file, you need to rename everything in the repo as well.
However, I know there are parts of the repo that use 0 as the starting file or may require the total, so raising the question for discussion.
### Environment info
- `datasets` version: 2.14.6.dev0
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.18.0
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
You can find the reasoning behind this naming scheme [here](https://github.com/huggingface/transformers/pull/16343#discussion_r931182168).
This point has been raised several times, so I'd be okay with starting with `00001-` (also to be consistent with the `transformers` sharding), but I'm not sure @lhoestq agrees. | [
0.24610058963298798,
-0.06340596079826355,
0.0809183269739151,
0.5036103129386902,
0.06562738865613937,
-0.12215150892734528,
0.3042208254337311,
-0.08270291984081268,
-0.20878185331821442,
0.159028559923172,
0.35009947419166565,
0.20905762910842896,
0.11546795070171356,
0.28047624230384827,
0.206056609749794,
0.043879326432943344,
0.29591310024261475,
-0.12454386055469513,
0.2279776930809021,
-0.026274561882019043,
-0.15178519487380981,
0.19172018766403198,
0.04202057421207428,
-0.047432418912649155,
-0.16429093480110168,
0.1066712811589241,
-0.23312585055828094,
0.09522531181573868,
0.04840213805437088,
-0.4822418689727783,
0.02250770479440689,
0.04625039920210838,
-0.2241978794336319,
0.5083217620849609,
-0.00012444239109754562,
-0.29295340180397034,
0.12601925432682037,
-0.2920629680156708,
-0.19847512245178223,
-0.11876203119754791,
-0.08398696780204773,
-0.28448501229286194,
0.05866386741399765,
-0.36518412828445435,
0.012105710804462433,
-0.15713214874267578,
0.20160388946533203,
-0.27179741859436035,
0.0036449097096920013,
-0.044668473303318024,
0.08755910396575928,
-0.16324488818645477,
0.21829134225845337,
0.04914436489343643,
0.3528149724006653,
0.08107040822505951,
-0.15283167362213135,
0.1557355672121048,
0.030451130121946335,
0.11260820180177689,
0.04868965968489647,
0.18330702185630798,
0.29638898372650146,
-0.27492833137512207,
0.32644417881965637,
0.2646208703517914,
0.1689366102218628,
-0.05525936558842659,
0.07506093382835388,
0.058816660195589066,
-0.014943812042474747,
-0.14866122603416443,
-0.388708233833313,
-0.5963141918182373,
-0.14939673244953156,
-0.238117516040802,
0.3475697338581085,
0.3731329143047333,
0.2694692313671112,
0.11410120874643326,
-0.017021197825670242,
0.07300713658332825,
-0.07940920442342758,
0.3544546365737915,
0.0735168606042862,
-0.153275728225708,
-0.23376519978046417,
0.18019770085811615,
-0.2954399585723877,
-0.48358434438705444,
-0.3016693890094757,
-0.38050633668899536,
0.17247022688388824,
0.024255875498056412,
-0.16435393691062927,
0.10695353150367737,
0.15807846188545227,
0.12620270252227783,
0.1555820256471634,
0.02535860240459442,
0.0013670548796653748,
-0.06339189410209656,
0.042750824242830276,
0.0020463461987674236,
0.409183144569397,
0.16983120143413544,
0.28520601987838745,
-0.26093631982803345,
0.06043989583849907,
0.4017764925956726,
0.3267468214035034,
-0.12080545723438263,
-0.06812405586242676,
0.11498621106147766,
-0.3048027753829956,
-0.456350713968277,
0.0879526287317276,
-0.15279561281204224,
-0.020127780735492706,
0.1548709273338318,
0.11394866555929184,
0.12314535677433014,
0.3196730613708496,
0.1451999396085739,
0.13410848379135132,
0.1497674584388733,
-0.17331089079380035,
0.060841433703899384,
-0.0234341099858284,
-0.3657238483428955,
-0.21130478382110596,
-0.09156088531017303,
-0.3494343161582947,
0.10771577060222626,
0.09195252507925034,
-0.4044599235057831,
0.16448882222175598,
0.23977945744991302,
0.16828124225139618,
-0.1854444295167923,
0.13124477863311768,
-0.11541799455881119,
0.20054805278778076,
0.08710061013698578,
-0.30860963463783264,
0.16425731778144836,
0.12592878937721252,
-0.19527819752693176,
-0.13154417276382446,
0.04655398428440094,
-0.6727334260940552,
-0.2869773507118225,
-0.003708900883793831,
0.045475587248802185,
-0.19318407773971558,
-0.10604869574308395,
-0.5483249425888062,
0.3426521122455597,
0.4568093419075012,
-0.07105216383934021,
0.04844965413212776,
0.11084602773189545,
-0.13153566420078278,
-0.2330607771873474,
0.001146562397480011,
0.42392197251319885,
-0.19985857605934143,
-0.14607049524784088,
0.02623165026307106,
0.032035212963819504,
0.3785470128059387,
0.2786431312561035,
-0.22044917941093445,
-0.22509795427322388,
-0.1880890280008316,
0.39055854082107544,
0.34903019666671753,
-0.13922403752803802,
-0.15330186486244202,
-0.030846495181322098,
-0.13166362047195435,
-0.14482484757900238,
0.33909156918525696,
0.012131962925195694,
0.2825883626937866,
-0.21344222128391266,
0.21331629157066345,
-0.25068920850753784,
-0.0752093568444252,
0.13810545206069946,
-0.2798803448677063,
-0.20227661728858948,
-0.1454363763332367,
-0.007609091699123383,
-0.18893645703792572,
-0.36566197872161865,
0.14011725783348083,
-0.2571522891521454,
0.038488760590553284,
-0.11182236671447754,
0.22083956003189087,
0.15488186478614807,
0.16914786398410797,
0.38243672251701355,
0.14176951348781586,
0.1420181840658188,
-0.5726287364959717,
0.3106376528739929,
0.21983975172042847,
-0.3028433918952942,
-0.1381051242351532,
-0.23555505275726318,
-0.11558327078819275,
-0.2629412114620209,
-0.04944363981485367,
0.018256500363349915,
-0.027460629120469093,
0.25952863693237305,
-0.2090478241443634,
-0.2477969229221344,
-0.4321822226047516,
0.2695562243461609,
-0.31103453040122986,
0.11307017505168915,
-0.4858039617538452,
0.32992124557495117,
0.06890822947025299,
-0.3853820562362671,
-0.08111346513032913,
0.22172079980373383,
0.30955615639686584,
-0.19349464774131775,
0.3194841742515564,
0.5939047932624817,
0.3903363347053528,
0.06031205877661705,
0.3030708134174347,
0.24501705169677734,
0.083772212266922,
0.03380125015974045,
-0.04730277508497238,
-0.0899723470211029,
-0.0475749596953392,
0.020718149840831757,
-0.6829320788383484,
0.3604968786239624,
-0.16280117630958557,
0.09897400438785553,
-0.06390971690416336,
-0.27589231729507446,
0.07256866246461868,
0.26688072085380554,
-0.3644721508026123,
-0.31821340322494507,
0.16308197379112244,
0.19348487257957458,
0.21940207481384277,
0.20388774573802948,
-0.41610434651374817,
0.22097426652908325,
0.5856571793556213,
0.23451146483421326,
-0.12488768994808197,
-0.00367877003736794,
0.17759287357330322,
-0.26962459087371826,
0.10543043166399002,
0.08194467425346375,
0.1435851901769638,
0.09316185116767883,
0.011547080241143703,
-0.18430021405220032,
0.22207722067832947,
-0.14280706644058228,
0.16235637664794922,
0.24507449567317963,
-0.2093600034713745,
0.08861163258552551,
0.48325756192207336,
-0.05852784961462021,
-0.44081389904022217,
0.039072297513484955,
0.11796140670776367,
0.020772038027644157,
-0.46299314498901367,
0.2208358645439148,
-0.11130782961845398,
0.08302691578865051,
-0.6106058955192566,
0.10380950570106506,
-0.6282723546028137,
-0.1207728385925293,
0.0876276046037674,
0.05444468557834625,
-0.29571864008903503,
0.14702969789505005,
-0.033977653831243515,
0.35266655683517456,
-0.3405493497848511,
-0.15077714622020721,
-0.11698923259973526,
-0.04756452888250351,
-0.13603805005550385,
-0.1328430026769638,
0.13991913199424744,
-0.20513099431991577,
0.3838435411453247,
-0.17397019267082214,
-0.3665933609008789,
-0.42881447076797485,
-0.5426891446113586,
0.08378580212593079,
-0.06899067014455795,
-0.07660939544439316,
0.2729850709438324,
-0.05841084197163582,
-0.3174750804901123,
-0.11840052902698517,
0.20343637466430664,
0.03240599483251572,
-0.22963130474090576,
0.1789010912179947,
0.08514496684074402,
0.15354856848716736,
-0.378146767616272,
-0.223523810505867,
0.25967177748680115,
-0.07806289941072464,
0.5481637120246887,
0.2680317759513855,
0.31893250346183777,
-0.07389870285987854,
-0.3221043050289154,
0.07049541175365448,
-0.3558966815471649,
0.16621948778629303,
-0.26420629024505615,
-0.5592427849769592,
0.29115012288093567,
0.10185781121253967,
-0.13042503595352173,
0.2525199055671692,
0.04703541845083237,
-0.10549131035804749,
0.029019799083471298,
-0.06543010473251343,
-0.4789592921733856,
0.1462434083223343,
0.013528041541576385,
0.2603784501552582,
0.24300356209278107,
0.27524155378341675,
-0.09281913936138153,
0.0063240304589271545,
-0.29725784063339233,
-0.020031556487083435,
0.39085671305656433,
0.23665490746498108,
0.3109551668167114,
0.19525013864040375,
0.2913709282875061,
0.3111209273338318,
0.7338731288909912,
0.4331395626068115,
0.12578436732292175,
0.3077804446220398,
-0.005306882783770561,
0.24474062025547028,
-0.12800151109695435,
0.23557603359222412,
0.08641354739665985,
0.20851990580558777,
0.08410321176052094,
0.4569603204727173,
0.1692381650209427,
0.1793060600757599,
-0.007444456219673157,
0.2741295099258423,
-0.16259241104125977,
-0.08632846921682358,
-0.21150749921798706,
0.22058753669261932,
0.2544267773628235,
-0.11184628307819366,
-0.2184731364250183,
-0.22741098701953888,
-0.09295199811458588,
-0.009699530899524689,
0.310797780752182,
-0.1397610455751419,
0.15987831354141235,
-0.2789704203605652,
0.30871832370758057,
-0.2422240674495697,
0.19733786582946777,
-0.09416405856609344,
0.04097788780927658,
0.15679210424423218,
-0.1282644122838974,
0.2823033630847931,
-0.20639677345752716,
0.6697162389755249,
0.42353445291519165,
-0.08611493557691574,
-0.19567988812923431,
0.03797429800033569,
-0.1961798518896103,
-0.08284462243318558,
-0.08411053568124771,
-0.38073569536209106,
0.3507923185825348,
0.5730158686637878,
-0.8922194242477417,
-0.2355331927537918,
0.14992067217826843,
-0.094943106174469,
-0.0956513062119484,
0.0784057229757309,
-0.4922606348991394,
-0.11103495210409164,
-0.11835571378469467,
-0.056152962148189545,
0.2861705422401428,
0.11929497867822647,
0.4248424172401428,
0.3039593994617462,
-0.0997643694281578,
-0.14444325864315033,
-0.09374743700027466,
-0.002277795225381851,
0.36801421642303467,
0.22495947778224945,
0.19602815806865692,
0.39238110184669495,
0.39979323744773865,
0.6628224849700928,
0.5268465280532837,
-0.18740606307983398,
-0.5031536817550659,
0.20061340928077698,
-0.19192370772361755,
0.32493677735328674,
0.5626316070556641,
-0.11825331300497055,
-0.15760229527950287,
-0.062100477516651154,
0.23030446469783783,
-0.13864906132221222,
-0.01468474417924881,
0.3109915554523468,
-0.24539990723133087,
0.04563792794942856,
-0.2749635875225067,
0.6521437764167786,
0.09665271639823914,
-0.1135997548699379,
-0.18199476599693298,
0.8432452082633972,
-0.36782217025756836,
0.18073515594005585,
0.07526719570159912,
1.1919646263122559,
-0.13601183891296387,
0.4098847210407257,
0.20107844471931458,
-0.3874260187149048,
0.4156365692615509,
-0.10298963636159897,
-0.08100762963294983,
-0.3189087510108948,
0.04231271520256996,
-0.02385006472468376,
-0.10528511554002762,
0.13406258821487427,
0.44418761134147644,
-0.03184095025062561,
0.43463101983070374,
-0.17301307618618011,
0.5200030207633972,
-0.2762790024280548,
-0.06039414554834366,
0.2552400827407837,
-0.19006642699241638,
-0.4981265962123871,
0.007370173931121826,
-0.00970936194062233,
-0.2109924852848053,
-0.16492775082588196,
0.04748581349849701,
-0.040483616292476654,
-0.08045025914907455,
0.11161835491657257,
-0.09437393397092819,
0.08044343441724777,
-0.07217514514923096,
0.3820323646068573,
-0.23121127486228943,
-0.15431854128837585,
0.12126995623111725,
0.3989734649658203,
-0.159097820520401,
-0.06028132885694504,
0.09017746150493622,
0.1523457020521164,
0.025922495871782303,
0.006924476474523544,
-0.03245599940419197,
0.203544482588768,
0.02689693123102188,
0.4264886975288391,
-0.3212517201900482,
0.01978764310479164,
0.23646757006645203,
-0.2927207052707672,
0.19810013473033905,
0.08817920833826065,
-0.3032858669757843,
0.12636584043502808,
0.1409410536289215,
0.23736371099948883,
-0.10874389857053757,
0.030915439128875732,
0.27221766114234924,
0.0038433969020843506,
-0.16274043917655945,
-0.31321126222610474,
-0.036115020513534546,
-0.0692068561911583,
0.2784644365310669,
-0.1932981014251709,
-0.21842923760414124,
0.21788643300533295,
-0.11303988099098206,
-0.2921772003173828,
0.13359335064888,
0.04997553676366806,
0.02904491499066353,
-0.3125517964363098,
0.07988391816616058,
0.06992607563734055,
-0.08051027357578278,
-0.01768830418586731,
0.08301389217376709,
0.2590011954307556,
0.0670376569032669,
0.09501601755619049,
0.15070465207099915,
-0.0732627809047699,
0.21360832452774048,
0.20887811481952667,
0.2724873423576355,
-0.15106691420078278,
-0.22033065557479858,
-0.18771307170391083,
-0.3267434239387512,
-0.2197100967168808,
0.29986506700515747,
-0.022875793278217316,
0.3675285875797272,
0.39752739667892456,
-0.059443872421979904,
-0.0007718168199062347,
-0.1377369612455368,
0.03336767107248306,
-0.1573338508605957,
-0.2550918161869049,
-0.04879316687583923,
-0.2867322564125061,
0.15512320399284363,
0.23725232481956482,
0.11665952205657959,
0.005456201732158661,
-0.20904934406280518,
-0.32997700572013855,
-0.3086724579334259,
0.234034463763237,
0.325736939907074,
0.07106322050094604,
0.03579721599817276,
0.6860944032669067,
0.15121956169605255,
-0.0833515003323555,
0.025876902043819427,
0.15586483478546143,
0.36772385239601135,
-0.18094474077224731,
0.16884362697601318,
-0.5383613705635071,
-0.07998999953269958,
0.07524523884057999,
0.5386026501655579,
0.15309220552444458,
0.23905883729457855,
-0.01857108436524868,
-0.13024401664733887,
-0.1050831750035286,
0.432241290807724,
0.34490540623664856,
0.49883905053138733,
-0.12265685200691223,
-0.2916271388530731,
0.07029469311237335,
0.07151567935943604,
-0.028718650341033936,
-0.15565058588981628,
0.19953003525733948,
0.21022316813468933,
-0.0322139710187912,
0.31629329919815063,
0.1698327511548996,
0.08936019241809845,
-0.3758455812931061,
0.11392246186733246,
0.3235374987125397,
0.04278077557682991,
0.2220713496208191,
-0.008940299972891808,
-0.10369856655597687,
0.17197512090206146,
0.275750994682312,
0.19713643193244934,
0.05129382759332657,
0.32121947407722473,
0.04482737183570862,
0.04450027644634247,
0.5407053232192993,
-0.005242321640253067,
-0.0393713153898716,
0.1094428300857544,
-0.10832424461841583,
0.5963361859321594,
0.20982764661312103,
-0.09245093166828156,
0.06625685840845108,
0.2836817800998688,
0.3731742203235626,
-0.14369553327560425,
-0.005757026374340057,
0.16861528158187866,
-0.020341243594884872,
-0.3463069796562195,
-0.1014394462108612,
-0.2905188798904419,
-0.4267819821834564,
0.08827711641788483,
-0.1780971884727478,
-0.1181555986404419,
0.22226591408252716,
0.2646865248680115,
0.2997857332229614,
-0.3979046940803528,
-0.25106149911880493,
0.23412930965423584,
0.7418279647827148,
-0.375246524810791,
0.28961434960365295,
0.11117802560329437,
-0.29086390137672424,
0.16580039262771606,
0.06775612384080887,
0.21520672738552094,
-0.21945953369140625,
0.39811697602272034,
-0.13588398694992065,
0.06459233909845352,
0.1238267570734024,
-0.11004786938428879,
-0.05575210601091385,
-0.2341378629207611,
0.1411464512348175,
0.06600281596183777,
-0.033514730632305145,
-0.04415380209684372,
-0.3345501124858856,
-0.09378233551979065,
-0.19096645712852478,
-0.641363263130188,
0.3185739815235138,
-0.41464218497276306,
-0.14153429865837097,
0.04513696953654289,
-0.025628577917814255,
-0.10248131304979324,
-0.522122323513031,
0.12210370600223541,
0.2687907814979553,
0.11622744053602219,
0.2131766378879547,
0.030793625861406326,
-0.026259135454893112,
0.270251601934433,
0.051565203815698624,
-0.38442301750183105,
-0.23829343914985657,
-0.3725675940513611,
-0.4756196141242981,
0.21359968185424805,
-0.04245644435286522,
-0.10297371447086334,
0.012405980378389359,
0.3866528868675232,
0.049918610602617264,
-0.028026850894093513,
0.01303783804178238,
-0.22594058513641357,
-0.19890248775482178,
0.1932474970817566,
-0.06773361563682556,
-0.020611898973584175,
-0.11394257843494415,
-0.27856090664863586,
0.1327977329492569,
-0.05204601585865021,
-0.021655838936567307,
0.025860760360956192,
-0.16296011209487915,
0.23149320483207703,
0.07607422769069672,
-0.09094446897506714,
-0.40714454650878906,
-0.037782490253448486,
-0.0778627097606659,
-0.018649358302354813,
0.10444701462984085,
-0.1668737530708313,
-0.05598749592900276,
-0.2713402509689331,
-0.25628572702407837,
0.5123069882392883,
-0.509433925151825,
0.1665985882282257,
-0.20370399951934814,
-0.16999739408493042,
-0.18337026238441467,
0.05480954423546791,
0.08778344094753265,
-0.17837631702423096,
-0.26356518268585205,
0.2336387038230896,
0.1430235207080841,
0.04433345049619675,
-0.01145697757601738,
0.27601945400238037,
0.029868943616747856,
0.09171616286039352,
-0.08038432151079178,
-0.4297031760215759,
0.3459045886993408,
-0.30564990639686584,
-0.09018351137638092,
-0.34656089544296265,
0.359244167804718,
0.3747652769088745,
-0.042152076959609985,
-0.26379460096359253,
-0.08040834218263626,
0.44094377756118774,
-0.09588854014873505,
-0.5779609680175781,
-0.020502695813775063,
-0.2820858657360077,
-0.2779659032821655,
-0.11163681745529175,
0.15149474143981934,
0.09319399297237396,
-0.023756079375743866,
0.2695959210395813,
-0.21719132363796234
] |
https://github.com/huggingface/datasets/issues/6303 | We start at 0 in `datasets` for consistency with Apache Spark, Apache Beam, Dask and others.
Also note `transformers` isn't a good reference on this topic. I talked with the maintainers when they added shards but it was already released this way. Though we found that there is a backward-compatible way in `transformers` to start at 0, but no request from `transformers` users to changes this AFAIK. | Parquet uploads off-by-one naming scheme | ### Describe the bug
I noticed this numbering scheme not matching up in a different project and wanted to raise it as an issue for discussion, what is the actual proper way to have these stored?
<img width="425" alt="image" src="https://github.com/huggingface/datasets/assets/1981179/3ffa2144-7c9a-446f-b521-a5e9db71e7ce">
The `-SSSSS-of-NNNNN` seems to be used widely across the codebase. The section that creates the part in my screenshot is here https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L5287
There are also some edits to this section in the single commit branch.
### Steps to reproduce the bug
1. Upload a dataset that requires at least two parquet files in it
2. Observe the naming scheme
### Expected behavior
The couple options here are of course **1. keeping it as is**
**2. Starting the index at 1:**
train-00001-of-00002-{hash}.parquet
train-00002-of-00002-{hash}.parquet
**3. My preferred option** (which would solve my specific issue), dropping the total entirely:
train-00000-{hash}.parquet
train-00001-{hash}.parquet
This also solves an issue that will occur with an `append` variable for `push_to_hub` (see https://github.com/huggingface/datasets/issues/6290) where as you add a new parquet file, you need to rename everything in the repo as well.
However, I know there are parts of the repo that use 0 as the starting file or may require the total, so raising the question for discussion.
### Environment info
- `datasets` version: 2.14.6.dev0
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.18.0
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 67 | Parquet uploads off-by-one naming scheme
### Describe the bug
I noticed this numbering scheme not matching up in a different project and wanted to raise it as an issue for discussion, what is the actual proper way to have these stored?
<img width="425" alt="image" src="https://github.com/huggingface/datasets/assets/1981179/3ffa2144-7c9a-446f-b521-a5e9db71e7ce">
The `-SSSSS-of-NNNNN` seems to be used widely across the codebase. The section that creates the part in my screenshot is here https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L5287
There are also some edits to this section in the single commit branch.
### Steps to reproduce the bug
1. Upload a dataset that requires at least two parquet files in it
2. Observe the naming scheme
### Expected behavior
The couple options here are of course **1. keeping it as is**
**2. Starting the index at 1:**
train-00001-of-00002-{hash}.parquet
train-00002-of-00002-{hash}.parquet
**3. My preferred option** (which would solve my specific issue), dropping the total entirely:
train-00000-{hash}.parquet
train-00001-{hash}.parquet
This also solves an issue that will occur with an `append` variable for `push_to_hub` (see https://github.com/huggingface/datasets/issues/6290) where as you add a new parquet file, you need to rename everything in the repo as well.
However, I know there are parts of the repo that use 0 as the starting file or may require the total, so raising the question for discussion.
### Environment info
- `datasets` version: 2.14.6.dev0
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.18.0
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
We start at 0 in `datasets` for consistency with Apache Spark, Apache Beam, Dask and others.
Also note `transformers` isn't a good reference on this topic. I talked with the maintainers when they added shards but it was already released this way. Though we found that there is a backward-compatible way in `transformers` to start at 0, but no request from `transformers` users to changes this AFAIK. | [
0.24610058963298798,
-0.06340596079826355,
0.0809183269739151,
0.5036103129386902,
0.06562738865613937,
-0.12215150892734528,
0.3042208254337311,
-0.08270291984081268,
-0.20878185331821442,
0.159028559923172,
0.35009947419166565,
0.20905762910842896,
0.11546795070171356,
0.28047624230384827,
0.206056609749794,
0.043879326432943344,
0.29591310024261475,
-0.12454386055469513,
0.2279776930809021,
-0.026274561882019043,
-0.15178519487380981,
0.19172018766403198,
0.04202057421207428,
-0.047432418912649155,
-0.16429093480110168,
0.1066712811589241,
-0.23312585055828094,
0.09522531181573868,
0.04840213805437088,
-0.4822418689727783,
0.02250770479440689,
0.04625039920210838,
-0.2241978794336319,
0.5083217620849609,
-0.00012444239109754562,
-0.29295340180397034,
0.12601925432682037,
-0.2920629680156708,
-0.19847512245178223,
-0.11876203119754791,
-0.08398696780204773,
-0.28448501229286194,
0.05866386741399765,
-0.36518412828445435,
0.012105710804462433,
-0.15713214874267578,
0.20160388946533203,
-0.27179741859436035,
0.0036449097096920013,
-0.044668473303318024,
0.08755910396575928,
-0.16324488818645477,
0.21829134225845337,
0.04914436489343643,
0.3528149724006653,
0.08107040822505951,
-0.15283167362213135,
0.1557355672121048,
0.030451130121946335,
0.11260820180177689,
0.04868965968489647,
0.18330702185630798,
0.29638898372650146,
-0.27492833137512207,
0.32644417881965637,
0.2646208703517914,
0.1689366102218628,
-0.05525936558842659,
0.07506093382835388,
0.058816660195589066,
-0.014943812042474747,
-0.14866122603416443,
-0.388708233833313,
-0.5963141918182373,
-0.14939673244953156,
-0.238117516040802,
0.3475697338581085,
0.3731329143047333,
0.2694692313671112,
0.11410120874643326,
-0.017021197825670242,
0.07300713658332825,
-0.07940920442342758,
0.3544546365737915,
0.0735168606042862,
-0.153275728225708,
-0.23376519978046417,
0.18019770085811615,
-0.2954399585723877,
-0.48358434438705444,
-0.3016693890094757,
-0.38050633668899536,
0.17247022688388824,
0.024255875498056412,
-0.16435393691062927,
0.10695353150367737,
0.15807846188545227,
0.12620270252227783,
0.1555820256471634,
0.02535860240459442,
0.0013670548796653748,
-0.06339189410209656,
0.042750824242830276,
0.0020463461987674236,
0.409183144569397,
0.16983120143413544,
0.28520601987838745,
-0.26093631982803345,
0.06043989583849907,
0.4017764925956726,
0.3267468214035034,
-0.12080545723438263,
-0.06812405586242676,
0.11498621106147766,
-0.3048027753829956,
-0.456350713968277,
0.0879526287317276,
-0.15279561281204224,
-0.020127780735492706,
0.1548709273338318,
0.11394866555929184,
0.12314535677433014,
0.3196730613708496,
0.1451999396085739,
0.13410848379135132,
0.1497674584388733,
-0.17331089079380035,
0.060841433703899384,
-0.0234341099858284,
-0.3657238483428955,
-0.21130478382110596,
-0.09156088531017303,
-0.3494343161582947,
0.10771577060222626,
0.09195252507925034,
-0.4044599235057831,
0.16448882222175598,
0.23977945744991302,
0.16828124225139618,
-0.1854444295167923,
0.13124477863311768,
-0.11541799455881119,
0.20054805278778076,
0.08710061013698578,
-0.30860963463783264,
0.16425731778144836,
0.12592878937721252,
-0.19527819752693176,
-0.13154417276382446,
0.04655398428440094,
-0.6727334260940552,
-0.2869773507118225,
-0.003708900883793831,
0.045475587248802185,
-0.19318407773971558,
-0.10604869574308395,
-0.5483249425888062,
0.3426521122455597,
0.4568093419075012,
-0.07105216383934021,
0.04844965413212776,
0.11084602773189545,
-0.13153566420078278,
-0.2330607771873474,
0.001146562397480011,
0.42392197251319885,
-0.19985857605934143,
-0.14607049524784088,
0.02623165026307106,
0.032035212963819504,
0.3785470128059387,
0.2786431312561035,
-0.22044917941093445,
-0.22509795427322388,
-0.1880890280008316,
0.39055854082107544,
0.34903019666671753,
-0.13922403752803802,
-0.15330186486244202,
-0.030846495181322098,
-0.13166362047195435,
-0.14482484757900238,
0.33909156918525696,
0.012131962925195694,
0.2825883626937866,
-0.21344222128391266,
0.21331629157066345,
-0.25068920850753784,
-0.0752093568444252,
0.13810545206069946,
-0.2798803448677063,
-0.20227661728858948,
-0.1454363763332367,
-0.007609091699123383,
-0.18893645703792572,
-0.36566197872161865,
0.14011725783348083,
-0.2571522891521454,
0.038488760590553284,
-0.11182236671447754,
0.22083956003189087,
0.15488186478614807,
0.16914786398410797,
0.38243672251701355,
0.14176951348781586,
0.1420181840658188,
-0.5726287364959717,
0.3106376528739929,
0.21983975172042847,
-0.3028433918952942,
-0.1381051242351532,
-0.23555505275726318,
-0.11558327078819275,
-0.2629412114620209,
-0.04944363981485367,
0.018256500363349915,
-0.027460629120469093,
0.25952863693237305,
-0.2090478241443634,
-0.2477969229221344,
-0.4321822226047516,
0.2695562243461609,
-0.31103453040122986,
0.11307017505168915,
-0.4858039617538452,
0.32992124557495117,
0.06890822947025299,
-0.3853820562362671,
-0.08111346513032913,
0.22172079980373383,
0.30955615639686584,
-0.19349464774131775,
0.3194841742515564,
0.5939047932624817,
0.3903363347053528,
0.06031205877661705,
0.3030708134174347,
0.24501705169677734,
0.083772212266922,
0.03380125015974045,
-0.04730277508497238,
-0.0899723470211029,
-0.0475749596953392,
0.020718149840831757,
-0.6829320788383484,
0.3604968786239624,
-0.16280117630958557,
0.09897400438785553,
-0.06390971690416336,
-0.27589231729507446,
0.07256866246461868,
0.26688072085380554,
-0.3644721508026123,
-0.31821340322494507,
0.16308197379112244,
0.19348487257957458,
0.21940207481384277,
0.20388774573802948,
-0.41610434651374817,
0.22097426652908325,
0.5856571793556213,
0.23451146483421326,
-0.12488768994808197,
-0.00367877003736794,
0.17759287357330322,
-0.26962459087371826,
0.10543043166399002,
0.08194467425346375,
0.1435851901769638,
0.09316185116767883,
0.011547080241143703,
-0.18430021405220032,
0.22207722067832947,
-0.14280706644058228,
0.16235637664794922,
0.24507449567317963,
-0.2093600034713745,
0.08861163258552551,
0.48325756192207336,
-0.05852784961462021,
-0.44081389904022217,
0.039072297513484955,
0.11796140670776367,
0.020772038027644157,
-0.46299314498901367,
0.2208358645439148,
-0.11130782961845398,
0.08302691578865051,
-0.6106058955192566,
0.10380950570106506,
-0.6282723546028137,
-0.1207728385925293,
0.0876276046037674,
0.05444468557834625,
-0.29571864008903503,
0.14702969789505005,
-0.033977653831243515,
0.35266655683517456,
-0.3405493497848511,
-0.15077714622020721,
-0.11698923259973526,
-0.04756452888250351,
-0.13603805005550385,
-0.1328430026769638,
0.13991913199424744,
-0.20513099431991577,
0.3838435411453247,
-0.17397019267082214,
-0.3665933609008789,
-0.42881447076797485,
-0.5426891446113586,
0.08378580212593079,
-0.06899067014455795,
-0.07660939544439316,
0.2729850709438324,
-0.05841084197163582,
-0.3174750804901123,
-0.11840052902698517,
0.20343637466430664,
0.03240599483251572,
-0.22963130474090576,
0.1789010912179947,
0.08514496684074402,
0.15354856848716736,
-0.378146767616272,
-0.223523810505867,
0.25967177748680115,
-0.07806289941072464,
0.5481637120246887,
0.2680317759513855,
0.31893250346183777,
-0.07389870285987854,
-0.3221043050289154,
0.07049541175365448,
-0.3558966815471649,
0.16621948778629303,
-0.26420629024505615,
-0.5592427849769592,
0.29115012288093567,
0.10185781121253967,
-0.13042503595352173,
0.2525199055671692,
0.04703541845083237,
-0.10549131035804749,
0.029019799083471298,
-0.06543010473251343,
-0.4789592921733856,
0.1462434083223343,
0.013528041541576385,
0.2603784501552582,
0.24300356209278107,
0.27524155378341675,
-0.09281913936138153,
0.0063240304589271545,
-0.29725784063339233,
-0.020031556487083435,
0.39085671305656433,
0.23665490746498108,
0.3109551668167114,
0.19525013864040375,
0.2913709282875061,
0.3111209273338318,
0.7338731288909912,
0.4331395626068115,
0.12578436732292175,
0.3077804446220398,
-0.005306882783770561,
0.24474062025547028,
-0.12800151109695435,
0.23557603359222412,
0.08641354739665985,
0.20851990580558777,
0.08410321176052094,
0.4569603204727173,
0.1692381650209427,
0.1793060600757599,
-0.007444456219673157,
0.2741295099258423,
-0.16259241104125977,
-0.08632846921682358,
-0.21150749921798706,
0.22058753669261932,
0.2544267773628235,
-0.11184628307819366,
-0.2184731364250183,
-0.22741098701953888,
-0.09295199811458588,
-0.009699530899524689,
0.310797780752182,
-0.1397610455751419,
0.15987831354141235,
-0.2789704203605652,
0.30871832370758057,
-0.2422240674495697,
0.19733786582946777,
-0.09416405856609344,
0.04097788780927658,
0.15679210424423218,
-0.1282644122838974,
0.2823033630847931,
-0.20639677345752716,
0.6697162389755249,
0.42353445291519165,
-0.08611493557691574,
-0.19567988812923431,
0.03797429800033569,
-0.1961798518896103,
-0.08284462243318558,
-0.08411053568124771,
-0.38073569536209106,
0.3507923185825348,
0.5730158686637878,
-0.8922194242477417,
-0.2355331927537918,
0.14992067217826843,
-0.094943106174469,
-0.0956513062119484,
0.0784057229757309,
-0.4922606348991394,
-0.11103495210409164,
-0.11835571378469467,
-0.056152962148189545,
0.2861705422401428,
0.11929497867822647,
0.4248424172401428,
0.3039593994617462,
-0.0997643694281578,
-0.14444325864315033,
-0.09374743700027466,
-0.002277795225381851,
0.36801421642303467,
0.22495947778224945,
0.19602815806865692,
0.39238110184669495,
0.39979323744773865,
0.6628224849700928,
0.5268465280532837,
-0.18740606307983398,
-0.5031536817550659,
0.20061340928077698,
-0.19192370772361755,
0.32493677735328674,
0.5626316070556641,
-0.11825331300497055,
-0.15760229527950287,
-0.062100477516651154,
0.23030446469783783,
-0.13864906132221222,
-0.01468474417924881,
0.3109915554523468,
-0.24539990723133087,
0.04563792794942856,
-0.2749635875225067,
0.6521437764167786,
0.09665271639823914,
-0.1135997548699379,
-0.18199476599693298,
0.8432452082633972,
-0.36782217025756836,
0.18073515594005585,
0.07526719570159912,
1.1919646263122559,
-0.13601183891296387,
0.4098847210407257,
0.20107844471931458,
-0.3874260187149048,
0.4156365692615509,
-0.10298963636159897,
-0.08100762963294983,
-0.3189087510108948,
0.04231271520256996,
-0.02385006472468376,
-0.10528511554002762,
0.13406258821487427,
0.44418761134147644,
-0.03184095025062561,
0.43463101983070374,
-0.17301307618618011,
0.5200030207633972,
-0.2762790024280548,
-0.06039414554834366,
0.2552400827407837,
-0.19006642699241638,
-0.4981265962123871,
0.007370173931121826,
-0.00970936194062233,
-0.2109924852848053,
-0.16492775082588196,
0.04748581349849701,
-0.040483616292476654,
-0.08045025914907455,
0.11161835491657257,
-0.09437393397092819,
0.08044343441724777,
-0.07217514514923096,
0.3820323646068573,
-0.23121127486228943,
-0.15431854128837585,
0.12126995623111725,
0.3989734649658203,
-0.159097820520401,
-0.06028132885694504,
0.09017746150493622,
0.1523457020521164,
0.025922495871782303,
0.006924476474523544,
-0.03245599940419197,
0.203544482588768,
0.02689693123102188,
0.4264886975288391,
-0.3212517201900482,
0.01978764310479164,
0.23646757006645203,
-0.2927207052707672,
0.19810013473033905,
0.08817920833826065,
-0.3032858669757843,
0.12636584043502808,
0.1409410536289215,
0.23736371099948883,
-0.10874389857053757,
0.030915439128875732,
0.27221766114234924,
0.0038433969020843506,
-0.16274043917655945,
-0.31321126222610474,
-0.036115020513534546,
-0.0692068561911583,
0.2784644365310669,
-0.1932981014251709,
-0.21842923760414124,
0.21788643300533295,
-0.11303988099098206,
-0.2921772003173828,
0.13359335064888,
0.04997553676366806,
0.02904491499066353,
-0.3125517964363098,
0.07988391816616058,
0.06992607563734055,
-0.08051027357578278,
-0.01768830418586731,
0.08301389217376709,
0.2590011954307556,
0.0670376569032669,
0.09501601755619049,
0.15070465207099915,
-0.0732627809047699,
0.21360832452774048,
0.20887811481952667,
0.2724873423576355,
-0.15106691420078278,
-0.22033065557479858,
-0.18771307170391083,
-0.3267434239387512,
-0.2197100967168808,
0.29986506700515747,
-0.022875793278217316,
0.3675285875797272,
0.39752739667892456,
-0.059443872421979904,
-0.0007718168199062347,
-0.1377369612455368,
0.03336767107248306,
-0.1573338508605957,
-0.2550918161869049,
-0.04879316687583923,
-0.2867322564125061,
0.15512320399284363,
0.23725232481956482,
0.11665952205657959,
0.005456201732158661,
-0.20904934406280518,
-0.32997700572013855,
-0.3086724579334259,
0.234034463763237,
0.325736939907074,
0.07106322050094604,
0.03579721599817276,
0.6860944032669067,
0.15121956169605255,
-0.0833515003323555,
0.025876902043819427,
0.15586483478546143,
0.36772385239601135,
-0.18094474077224731,
0.16884362697601318,
-0.5383613705635071,
-0.07998999953269958,
0.07524523884057999,
0.5386026501655579,
0.15309220552444458,
0.23905883729457855,
-0.01857108436524868,
-0.13024401664733887,
-0.1050831750035286,
0.432241290807724,
0.34490540623664856,
0.49883905053138733,
-0.12265685200691223,
-0.2916271388530731,
0.07029469311237335,
0.07151567935943604,
-0.028718650341033936,
-0.15565058588981628,
0.19953003525733948,
0.21022316813468933,
-0.0322139710187912,
0.31629329919815063,
0.1698327511548996,
0.08936019241809845,
-0.3758455812931061,
0.11392246186733246,
0.3235374987125397,
0.04278077557682991,
0.2220713496208191,
-0.008940299972891808,
-0.10369856655597687,
0.17197512090206146,
0.275750994682312,
0.19713643193244934,
0.05129382759332657,
0.32121947407722473,
0.04482737183570862,
0.04450027644634247,
0.5407053232192993,
-0.005242321640253067,
-0.0393713153898716,
0.1094428300857544,
-0.10832424461841583,
0.5963361859321594,
0.20982764661312103,
-0.09245093166828156,
0.06625685840845108,
0.2836817800998688,
0.3731742203235626,
-0.14369553327560425,
-0.005757026374340057,
0.16861528158187866,
-0.020341243594884872,
-0.3463069796562195,
-0.1014394462108612,
-0.2905188798904419,
-0.4267819821834564,
0.08827711641788483,
-0.1780971884727478,
-0.1181555986404419,
0.22226591408252716,
0.2646865248680115,
0.2997857332229614,
-0.3979046940803528,
-0.25106149911880493,
0.23412930965423584,
0.7418279647827148,
-0.375246524810791,
0.28961434960365295,
0.11117802560329437,
-0.29086390137672424,
0.16580039262771606,
0.06775612384080887,
0.21520672738552094,
-0.21945953369140625,
0.39811697602272034,
-0.13588398694992065,
0.06459233909845352,
0.1238267570734024,
-0.11004786938428879,
-0.05575210601091385,
-0.2341378629207611,
0.1411464512348175,
0.06600281596183777,
-0.033514730632305145,
-0.04415380209684372,
-0.3345501124858856,
-0.09378233551979065,
-0.19096645712852478,
-0.641363263130188,
0.3185739815235138,
-0.41464218497276306,
-0.14153429865837097,
0.04513696953654289,
-0.025628577917814255,
-0.10248131304979324,
-0.522122323513031,
0.12210370600223541,
0.2687907814979553,
0.11622744053602219,
0.2131766378879547,
0.030793625861406326,
-0.026259135454893112,
0.270251601934433,
0.051565203815698624,
-0.38442301750183105,
-0.23829343914985657,
-0.3725675940513611,
-0.4756196141242981,
0.21359968185424805,
-0.04245644435286522,
-0.10297371447086334,
0.012405980378389359,
0.3866528868675232,
0.049918610602617264,
-0.028026850894093513,
0.01303783804178238,
-0.22594058513641357,
-0.19890248775482178,
0.1932474970817566,
-0.06773361563682556,
-0.020611898973584175,
-0.11394257843494415,
-0.27856090664863586,
0.1327977329492569,
-0.05204601585865021,
-0.021655838936567307,
0.025860760360956192,
-0.16296011209487915,
0.23149320483207703,
0.07607422769069672,
-0.09094446897506714,
-0.40714454650878906,
-0.037782490253448486,
-0.0778627097606659,
-0.018649358302354813,
0.10444701462984085,
-0.1668737530708313,
-0.05598749592900276,
-0.2713402509689331,
-0.25628572702407837,
0.5123069882392883,
-0.509433925151825,
0.1665985882282257,
-0.20370399951934814,
-0.16999739408493042,
-0.18337026238441467,
0.05480954423546791,
0.08778344094753265,
-0.17837631702423096,
-0.26356518268585205,
0.2336387038230896,
0.1430235207080841,
0.04433345049619675,
-0.01145697757601738,
0.27601945400238037,
0.029868943616747856,
0.09171616286039352,
-0.08038432151079178,
-0.4297031760215759,
0.3459045886993408,
-0.30564990639686584,
-0.09018351137638092,
-0.34656089544296265,
0.359244167804718,
0.3747652769088745,
-0.042152076959609985,
-0.26379460096359253,
-0.08040834218263626,
0.44094377756118774,
-0.09588854014873505,
-0.5779609680175781,
-0.020502695813775063,
-0.2820858657360077,
-0.2779659032821655,
-0.11163681745529175,
0.15149474143981934,
0.09319399297237396,
-0.023756079375743866,
0.2695959210395813,
-0.21719132363796234
] |
https://github.com/huggingface/datasets/issues/6303 | Makes sense to start at 0 for plenty of good reasons so I'm on board.
What about the second part `-of-0000X`? With single commit PR #6269 just getting merged, there was a note about issues with 100+ file edits https://github.com/huggingface/datasets/pull/6269#issuecomment-1755428581.
That would be my last remaining concern in the context of the `push_to_hub(..., append=True)` work to be done, where appending a single file to the full dataset will require renaming every other existing file in the dataset. If it doesn't seem like a big issue for this work then all the better π | Parquet uploads off-by-one naming scheme | ### Describe the bug
I noticed this numbering scheme not matching up in a different project and wanted to raise it as an issue for discussion, what is the actual proper way to have these stored?
<img width="425" alt="image" src="https://github.com/huggingface/datasets/assets/1981179/3ffa2144-7c9a-446f-b521-a5e9db71e7ce">
The `-SSSSS-of-NNNNN` seems to be used widely across the codebase. The section that creates the part in my screenshot is here https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L5287
There are also some edits to this section in the single commit branch.
### Steps to reproduce the bug
1. Upload a dataset that requires at least two parquet files in it
2. Observe the naming scheme
### Expected behavior
The couple options here are of course **1. keeping it as is**
**2. Starting the index at 1:**
train-00001-of-00002-{hash}.parquet
train-00002-of-00002-{hash}.parquet
**3. My preferred option** (which would solve my specific issue), dropping the total entirely:
train-00000-{hash}.parquet
train-00001-{hash}.parquet
This also solves an issue that will occur with an `append` variable for `push_to_hub` (see https://github.com/huggingface/datasets/issues/6290) where as you add a new parquet file, you need to rename everything in the repo as well.
However, I know there are parts of the repo that use 0 as the starting file or may require the total, so raising the question for discussion.
### Environment info
- `datasets` version: 2.14.6.dev0
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.18.0
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 93 | Parquet uploads off-by-one naming scheme
### Describe the bug
I noticed this numbering scheme not matching up in a different project and wanted to raise it as an issue for discussion, what is the actual proper way to have these stored?
<img width="425" alt="image" src="https://github.com/huggingface/datasets/assets/1981179/3ffa2144-7c9a-446f-b521-a5e9db71e7ce">
The `-SSSSS-of-NNNNN` seems to be used widely across the codebase. The section that creates the part in my screenshot is here https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L5287
There are also some edits to this section in the single commit branch.
### Steps to reproduce the bug
1. Upload a dataset that requires at least two parquet files in it
2. Observe the naming scheme
### Expected behavior
The couple options here are of course **1. keeping it as is**
**2. Starting the index at 1:**
train-00001-of-00002-{hash}.parquet
train-00002-of-00002-{hash}.parquet
**3. My preferred option** (which would solve my specific issue), dropping the total entirely:
train-00000-{hash}.parquet
train-00001-{hash}.parquet
This also solves an issue that will occur with an `append` variable for `push_to_hub` (see https://github.com/huggingface/datasets/issues/6290) where as you add a new parquet file, you need to rename everything in the repo as well.
However, I know there are parts of the repo that use 0 as the starting file or may require the total, so raising the question for discussion.
### Environment info
- `datasets` version: 2.14.6.dev0
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.18.0
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
Makes sense to start at 0 for plenty of good reasons so I'm on board.
What about the second part `-of-0000X`? With single commit PR #6269 just getting merged, there was a note about issues with 100+ file edits https://github.com/huggingface/datasets/pull/6269#issuecomment-1755428581.
That would be my last remaining concern in the context of the `push_to_hub(..., append=True)` work to be done, where appending a single file to the full dataset will require renaming every other existing file in the dataset. If it doesn't seem like a big issue for this work then all the better π | [
0.24610058963298798,
-0.06340596079826355,
0.0809183269739151,
0.5036103129386902,
0.06562738865613937,
-0.12215150892734528,
0.3042208254337311,
-0.08270291984081268,
-0.20878185331821442,
0.159028559923172,
0.35009947419166565,
0.20905762910842896,
0.11546795070171356,
0.28047624230384827,
0.206056609749794,
0.043879326432943344,
0.29591310024261475,
-0.12454386055469513,
0.2279776930809021,
-0.026274561882019043,
-0.15178519487380981,
0.19172018766403198,
0.04202057421207428,
-0.047432418912649155,
-0.16429093480110168,
0.1066712811589241,
-0.23312585055828094,
0.09522531181573868,
0.04840213805437088,
-0.4822418689727783,
0.02250770479440689,
0.04625039920210838,
-0.2241978794336319,
0.5083217620849609,
-0.00012444239109754562,
-0.29295340180397034,
0.12601925432682037,
-0.2920629680156708,
-0.19847512245178223,
-0.11876203119754791,
-0.08398696780204773,
-0.28448501229286194,
0.05866386741399765,
-0.36518412828445435,
0.012105710804462433,
-0.15713214874267578,
0.20160388946533203,
-0.27179741859436035,
0.0036449097096920013,
-0.044668473303318024,
0.08755910396575928,
-0.16324488818645477,
0.21829134225845337,
0.04914436489343643,
0.3528149724006653,
0.08107040822505951,
-0.15283167362213135,
0.1557355672121048,
0.030451130121946335,
0.11260820180177689,
0.04868965968489647,
0.18330702185630798,
0.29638898372650146,
-0.27492833137512207,
0.32644417881965637,
0.2646208703517914,
0.1689366102218628,
-0.05525936558842659,
0.07506093382835388,
0.058816660195589066,
-0.014943812042474747,
-0.14866122603416443,
-0.388708233833313,
-0.5963141918182373,
-0.14939673244953156,
-0.238117516040802,
0.3475697338581085,
0.3731329143047333,
0.2694692313671112,
0.11410120874643326,
-0.017021197825670242,
0.07300713658332825,
-0.07940920442342758,
0.3544546365737915,
0.0735168606042862,
-0.153275728225708,
-0.23376519978046417,
0.18019770085811615,
-0.2954399585723877,
-0.48358434438705444,
-0.3016693890094757,
-0.38050633668899536,
0.17247022688388824,
0.024255875498056412,
-0.16435393691062927,
0.10695353150367737,
0.15807846188545227,
0.12620270252227783,
0.1555820256471634,
0.02535860240459442,
0.0013670548796653748,
-0.06339189410209656,
0.042750824242830276,
0.0020463461987674236,
0.409183144569397,
0.16983120143413544,
0.28520601987838745,
-0.26093631982803345,
0.06043989583849907,
0.4017764925956726,
0.3267468214035034,
-0.12080545723438263,
-0.06812405586242676,
0.11498621106147766,
-0.3048027753829956,
-0.456350713968277,
0.0879526287317276,
-0.15279561281204224,
-0.020127780735492706,
0.1548709273338318,
0.11394866555929184,
0.12314535677433014,
0.3196730613708496,
0.1451999396085739,
0.13410848379135132,
0.1497674584388733,
-0.17331089079380035,
0.060841433703899384,
-0.0234341099858284,
-0.3657238483428955,
-0.21130478382110596,
-0.09156088531017303,
-0.3494343161582947,
0.10771577060222626,
0.09195252507925034,
-0.4044599235057831,
0.16448882222175598,
0.23977945744991302,
0.16828124225139618,
-0.1854444295167923,
0.13124477863311768,
-0.11541799455881119,
0.20054805278778076,
0.08710061013698578,
-0.30860963463783264,
0.16425731778144836,
0.12592878937721252,
-0.19527819752693176,
-0.13154417276382446,
0.04655398428440094,
-0.6727334260940552,
-0.2869773507118225,
-0.003708900883793831,
0.045475587248802185,
-0.19318407773971558,
-0.10604869574308395,
-0.5483249425888062,
0.3426521122455597,
0.4568093419075012,
-0.07105216383934021,
0.04844965413212776,
0.11084602773189545,
-0.13153566420078278,
-0.2330607771873474,
0.001146562397480011,
0.42392197251319885,
-0.19985857605934143,
-0.14607049524784088,
0.02623165026307106,
0.032035212963819504,
0.3785470128059387,
0.2786431312561035,
-0.22044917941093445,
-0.22509795427322388,
-0.1880890280008316,
0.39055854082107544,
0.34903019666671753,
-0.13922403752803802,
-0.15330186486244202,
-0.030846495181322098,
-0.13166362047195435,
-0.14482484757900238,
0.33909156918525696,
0.012131962925195694,
0.2825883626937866,
-0.21344222128391266,
0.21331629157066345,
-0.25068920850753784,
-0.0752093568444252,
0.13810545206069946,
-0.2798803448677063,
-0.20227661728858948,
-0.1454363763332367,
-0.007609091699123383,
-0.18893645703792572,
-0.36566197872161865,
0.14011725783348083,
-0.2571522891521454,
0.038488760590553284,
-0.11182236671447754,
0.22083956003189087,
0.15488186478614807,
0.16914786398410797,
0.38243672251701355,
0.14176951348781586,
0.1420181840658188,
-0.5726287364959717,
0.3106376528739929,
0.21983975172042847,
-0.3028433918952942,
-0.1381051242351532,
-0.23555505275726318,
-0.11558327078819275,
-0.2629412114620209,
-0.04944363981485367,
0.018256500363349915,
-0.027460629120469093,
0.25952863693237305,
-0.2090478241443634,
-0.2477969229221344,
-0.4321822226047516,
0.2695562243461609,
-0.31103453040122986,
0.11307017505168915,
-0.4858039617538452,
0.32992124557495117,
0.06890822947025299,
-0.3853820562362671,
-0.08111346513032913,
0.22172079980373383,
0.30955615639686584,
-0.19349464774131775,
0.3194841742515564,
0.5939047932624817,
0.3903363347053528,
0.06031205877661705,
0.3030708134174347,
0.24501705169677734,
0.083772212266922,
0.03380125015974045,
-0.04730277508497238,
-0.0899723470211029,
-0.0475749596953392,
0.020718149840831757,
-0.6829320788383484,
0.3604968786239624,
-0.16280117630958557,
0.09897400438785553,
-0.06390971690416336,
-0.27589231729507446,
0.07256866246461868,
0.26688072085380554,
-0.3644721508026123,
-0.31821340322494507,
0.16308197379112244,
0.19348487257957458,
0.21940207481384277,
0.20388774573802948,
-0.41610434651374817,
0.22097426652908325,
0.5856571793556213,
0.23451146483421326,
-0.12488768994808197,
-0.00367877003736794,
0.17759287357330322,
-0.26962459087371826,
0.10543043166399002,
0.08194467425346375,
0.1435851901769638,
0.09316185116767883,
0.011547080241143703,
-0.18430021405220032,
0.22207722067832947,
-0.14280706644058228,
0.16235637664794922,
0.24507449567317963,
-0.2093600034713745,
0.08861163258552551,
0.48325756192207336,
-0.05852784961462021,
-0.44081389904022217,
0.039072297513484955,
0.11796140670776367,
0.020772038027644157,
-0.46299314498901367,
0.2208358645439148,
-0.11130782961845398,
0.08302691578865051,
-0.6106058955192566,
0.10380950570106506,
-0.6282723546028137,
-0.1207728385925293,
0.0876276046037674,
0.05444468557834625,
-0.29571864008903503,
0.14702969789505005,
-0.033977653831243515,
0.35266655683517456,
-0.3405493497848511,
-0.15077714622020721,
-0.11698923259973526,
-0.04756452888250351,
-0.13603805005550385,
-0.1328430026769638,
0.13991913199424744,
-0.20513099431991577,
0.3838435411453247,
-0.17397019267082214,
-0.3665933609008789,
-0.42881447076797485,
-0.5426891446113586,
0.08378580212593079,
-0.06899067014455795,
-0.07660939544439316,
0.2729850709438324,
-0.05841084197163582,
-0.3174750804901123,
-0.11840052902698517,
0.20343637466430664,
0.03240599483251572,
-0.22963130474090576,
0.1789010912179947,
0.08514496684074402,
0.15354856848716736,
-0.378146767616272,
-0.223523810505867,
0.25967177748680115,
-0.07806289941072464,
0.5481637120246887,
0.2680317759513855,
0.31893250346183777,
-0.07389870285987854,
-0.3221043050289154,
0.07049541175365448,
-0.3558966815471649,
0.16621948778629303,
-0.26420629024505615,
-0.5592427849769592,
0.29115012288093567,
0.10185781121253967,
-0.13042503595352173,
0.2525199055671692,
0.04703541845083237,
-0.10549131035804749,
0.029019799083471298,
-0.06543010473251343,
-0.4789592921733856,
0.1462434083223343,
0.013528041541576385,
0.2603784501552582,
0.24300356209278107,
0.27524155378341675,
-0.09281913936138153,
0.0063240304589271545,
-0.29725784063339233,
-0.020031556487083435,
0.39085671305656433,
0.23665490746498108,
0.3109551668167114,
0.19525013864040375,
0.2913709282875061,
0.3111209273338318,
0.7338731288909912,
0.4331395626068115,
0.12578436732292175,
0.3077804446220398,
-0.005306882783770561,
0.24474062025547028,
-0.12800151109695435,
0.23557603359222412,
0.08641354739665985,
0.20851990580558777,
0.08410321176052094,
0.4569603204727173,
0.1692381650209427,
0.1793060600757599,
-0.007444456219673157,
0.2741295099258423,
-0.16259241104125977,
-0.08632846921682358,
-0.21150749921798706,
0.22058753669261932,
0.2544267773628235,
-0.11184628307819366,
-0.2184731364250183,
-0.22741098701953888,
-0.09295199811458588,
-0.009699530899524689,
0.310797780752182,
-0.1397610455751419,
0.15987831354141235,
-0.2789704203605652,
0.30871832370758057,
-0.2422240674495697,
0.19733786582946777,
-0.09416405856609344,
0.04097788780927658,
0.15679210424423218,
-0.1282644122838974,
0.2823033630847931,
-0.20639677345752716,
0.6697162389755249,
0.42353445291519165,
-0.08611493557691574,
-0.19567988812923431,
0.03797429800033569,
-0.1961798518896103,
-0.08284462243318558,
-0.08411053568124771,
-0.38073569536209106,
0.3507923185825348,
0.5730158686637878,
-0.8922194242477417,
-0.2355331927537918,
0.14992067217826843,
-0.094943106174469,
-0.0956513062119484,
0.0784057229757309,
-0.4922606348991394,
-0.11103495210409164,
-0.11835571378469467,
-0.056152962148189545,
0.2861705422401428,
0.11929497867822647,
0.4248424172401428,
0.3039593994617462,
-0.0997643694281578,
-0.14444325864315033,
-0.09374743700027466,
-0.002277795225381851,
0.36801421642303467,
0.22495947778224945,
0.19602815806865692,
0.39238110184669495,
0.39979323744773865,
0.6628224849700928,
0.5268465280532837,
-0.18740606307983398,
-0.5031536817550659,
0.20061340928077698,
-0.19192370772361755,
0.32493677735328674,
0.5626316070556641,
-0.11825331300497055,
-0.15760229527950287,
-0.062100477516651154,
0.23030446469783783,
-0.13864906132221222,
-0.01468474417924881,
0.3109915554523468,
-0.24539990723133087,
0.04563792794942856,
-0.2749635875225067,
0.6521437764167786,
0.09665271639823914,
-0.1135997548699379,
-0.18199476599693298,
0.8432452082633972,
-0.36782217025756836,
0.18073515594005585,
0.07526719570159912,
1.1919646263122559,
-0.13601183891296387,
0.4098847210407257,
0.20107844471931458,
-0.3874260187149048,
0.4156365692615509,
-0.10298963636159897,
-0.08100762963294983,
-0.3189087510108948,
0.04231271520256996,
-0.02385006472468376,
-0.10528511554002762,
0.13406258821487427,
0.44418761134147644,
-0.03184095025062561,
0.43463101983070374,
-0.17301307618618011,
0.5200030207633972,
-0.2762790024280548,
-0.06039414554834366,
0.2552400827407837,
-0.19006642699241638,
-0.4981265962123871,
0.007370173931121826,
-0.00970936194062233,
-0.2109924852848053,
-0.16492775082588196,
0.04748581349849701,
-0.040483616292476654,
-0.08045025914907455,
0.11161835491657257,
-0.09437393397092819,
0.08044343441724777,
-0.07217514514923096,
0.3820323646068573,
-0.23121127486228943,
-0.15431854128837585,
0.12126995623111725,
0.3989734649658203,
-0.159097820520401,
-0.06028132885694504,
0.09017746150493622,
0.1523457020521164,
0.025922495871782303,
0.006924476474523544,
-0.03245599940419197,
0.203544482588768,
0.02689693123102188,
0.4264886975288391,
-0.3212517201900482,
0.01978764310479164,
0.23646757006645203,
-0.2927207052707672,
0.19810013473033905,
0.08817920833826065,
-0.3032858669757843,
0.12636584043502808,
0.1409410536289215,
0.23736371099948883,
-0.10874389857053757,
0.030915439128875732,
0.27221766114234924,
0.0038433969020843506,
-0.16274043917655945,
-0.31321126222610474,
-0.036115020513534546,
-0.0692068561911583,
0.2784644365310669,
-0.1932981014251709,
-0.21842923760414124,
0.21788643300533295,
-0.11303988099098206,
-0.2921772003173828,
0.13359335064888,
0.04997553676366806,
0.02904491499066353,
-0.3125517964363098,
0.07988391816616058,
0.06992607563734055,
-0.08051027357578278,
-0.01768830418586731,
0.08301389217376709,
0.2590011954307556,
0.0670376569032669,
0.09501601755619049,
0.15070465207099915,
-0.0732627809047699,
0.21360832452774048,
0.20887811481952667,
0.2724873423576355,
-0.15106691420078278,
-0.22033065557479858,
-0.18771307170391083,
-0.3267434239387512,
-0.2197100967168808,
0.29986506700515747,
-0.022875793278217316,
0.3675285875797272,
0.39752739667892456,
-0.059443872421979904,
-0.0007718168199062347,
-0.1377369612455368,
0.03336767107248306,
-0.1573338508605957,
-0.2550918161869049,
-0.04879316687583923,
-0.2867322564125061,
0.15512320399284363,
0.23725232481956482,
0.11665952205657959,
0.005456201732158661,
-0.20904934406280518,
-0.32997700572013855,
-0.3086724579334259,
0.234034463763237,
0.325736939907074,
0.07106322050094604,
0.03579721599817276,
0.6860944032669067,
0.15121956169605255,
-0.0833515003323555,
0.025876902043819427,
0.15586483478546143,
0.36772385239601135,
-0.18094474077224731,
0.16884362697601318,
-0.5383613705635071,
-0.07998999953269958,
0.07524523884057999,
0.5386026501655579,
0.15309220552444458,
0.23905883729457855,
-0.01857108436524868,
-0.13024401664733887,
-0.1050831750035286,
0.432241290807724,
0.34490540623664856,
0.49883905053138733,
-0.12265685200691223,
-0.2916271388530731,
0.07029469311237335,
0.07151567935943604,
-0.028718650341033936,
-0.15565058588981628,
0.19953003525733948,
0.21022316813468933,
-0.0322139710187912,
0.31629329919815063,
0.1698327511548996,
0.08936019241809845,
-0.3758455812931061,
0.11392246186733246,
0.3235374987125397,
0.04278077557682991,
0.2220713496208191,
-0.008940299972891808,
-0.10369856655597687,
0.17197512090206146,
0.275750994682312,
0.19713643193244934,
0.05129382759332657,
0.32121947407722473,
0.04482737183570862,
0.04450027644634247,
0.5407053232192993,
-0.005242321640253067,
-0.0393713153898716,
0.1094428300857544,
-0.10832424461841583,
0.5963361859321594,
0.20982764661312103,
-0.09245093166828156,
0.06625685840845108,
0.2836817800998688,
0.3731742203235626,
-0.14369553327560425,
-0.005757026374340057,
0.16861528158187866,
-0.020341243594884872,
-0.3463069796562195,
-0.1014394462108612,
-0.2905188798904419,
-0.4267819821834564,
0.08827711641788483,
-0.1780971884727478,
-0.1181555986404419,
0.22226591408252716,
0.2646865248680115,
0.2997857332229614,
-0.3979046940803528,
-0.25106149911880493,
0.23412930965423584,
0.7418279647827148,
-0.375246524810791,
0.28961434960365295,
0.11117802560329437,
-0.29086390137672424,
0.16580039262771606,
0.06775612384080887,
0.21520672738552094,
-0.21945953369140625,
0.39811697602272034,
-0.13588398694992065,
0.06459233909845352,
0.1238267570734024,
-0.11004786938428879,
-0.05575210601091385,
-0.2341378629207611,
0.1411464512348175,
0.06600281596183777,
-0.033514730632305145,
-0.04415380209684372,
-0.3345501124858856,
-0.09378233551979065,
-0.19096645712852478,
-0.641363263130188,
0.3185739815235138,
-0.41464218497276306,
-0.14153429865837097,
0.04513696953654289,
-0.025628577917814255,
-0.10248131304979324,
-0.522122323513031,
0.12210370600223541,
0.2687907814979553,
0.11622744053602219,
0.2131766378879547,
0.030793625861406326,
-0.026259135454893112,
0.270251601934433,
0.051565203815698624,
-0.38442301750183105,
-0.23829343914985657,
-0.3725675940513611,
-0.4756196141242981,
0.21359968185424805,
-0.04245644435286522,
-0.10297371447086334,
0.012405980378389359,
0.3866528868675232,
0.049918610602617264,
-0.028026850894093513,
0.01303783804178238,
-0.22594058513641357,
-0.19890248775482178,
0.1932474970817566,
-0.06773361563682556,
-0.020611898973584175,
-0.11394257843494415,
-0.27856090664863586,
0.1327977329492569,
-0.05204601585865021,
-0.021655838936567307,
0.025860760360956192,
-0.16296011209487915,
0.23149320483207703,
0.07607422769069672,
-0.09094446897506714,
-0.40714454650878906,
-0.037782490253448486,
-0.0778627097606659,
-0.018649358302354813,
0.10444701462984085,
-0.1668737530708313,
-0.05598749592900276,
-0.2713402509689331,
-0.25628572702407837,
0.5123069882392883,
-0.509433925151825,
0.1665985882282257,
-0.20370399951934814,
-0.16999739408493042,
-0.18337026238441467,
0.05480954423546791,
0.08778344094753265,
-0.17837631702423096,
-0.26356518268585205,
0.2336387038230896,
0.1430235207080841,
0.04433345049619675,
-0.01145697757601738,
0.27601945400238037,
0.029868943616747856,
0.09171616286039352,
-0.08038432151079178,
-0.4297031760215759,
0.3459045886993408,
-0.30564990639686584,
-0.09018351137638092,
-0.34656089544296265,
0.359244167804718,
0.3747652769088745,
-0.042152076959609985,
-0.26379460096359253,
-0.08040834218263626,
0.44094377756118774,
-0.09588854014873505,
-0.5779609680175781,
-0.020502695813775063,
-0.2820858657360077,
-0.2779659032821655,
-0.11163681745529175,
0.15149474143981934,
0.09319399297237396,
-0.023756079375743866,
0.2695959210395813,
-0.21719132363796234
] |
https://github.com/huggingface/datasets/issues/6302 | `writer._num_bytes` is updated every `writer_batch_size`-th call to the `write` method (default `writer_batch_size` is 1000 (examples)). You should be able to see the update by passing a smaller `writer_batch_size` to the `load_dataset_builder`.
We could improve this by supporting the string `writer_batch_size` version as we do with `max_shard_size`, and capping `writer_batch_size` to `max_shard_size` in scenarios where the default `writer_batch_size` > `max_shard_size`. | ArrowWriter/ParquetWriter `write` method does not increase `_num_bytes` and hence datasets not sharding at `max_shard_size` | ### Describe the bug
An example from [1], does not work when limiting shards with `max_shard_size`.
Try the following example with low `max_shard_size`, such as:
```python
builder.download_and_prepare(output_dir, storage_options=storage_options, file_format="parquet", max_shard_size="10MB")
```
The reason for this is that, in line [2] `writer._num_bytes > max_shard_size` is never true, because the `write` method of `ArrowWriter` [3] does not increase `self._num_bytes`.
Such that respective Arrow/Parquet shards are only written to file based on the `writer_batch_size` or `config.DEFAULT_MAX_BATCH_SIZE`, but not based on `max_shard_size`.
[1] https://huggingface.co/docs/datasets/filesystems#download-and-prepare-a-dataset-into-a-cloud-storage
[2] https://github.com/huggingface/datasets/blob/3e8d420808718c9a1453a2e7ee3484ca12c9c70d/src/datasets/builder.py#L1677
[3] https://github.com/huggingface/datasets/blob/3e8d420808718c9a1453a2e7ee3484ca12c9c70d/src/datasets/arrow_writer.py#L459
### Steps to reproduce the bug
Get example from: https://huggingface.co/docs/datasets/filesystems#download-and-prepare-a-dataset-into-a-cloud-storage
Call `builder.download_and_prepare` with low `max_shard_size` such as `10MB`, e.g.:
```python
builder.download_and_prepare(output_dir, storage_options=storage_options, file_format="parquet", max_shard_size="10MB")
```
### Expected behavior
Shards should be written based on `max_shard_size` instead of batch size.
### Environment info
```
>>> import datasets
>>> datasets.__version__
'2.14.6.dev0
``` | 59 | ArrowWriter/ParquetWriter `write` method does not increase `_num_bytes` and hence datasets not sharding at `max_shard_size`
### Describe the bug
An example from [1], does not work when limiting shards with `max_shard_size`.
Try the following example with low `max_shard_size`, such as:
```python
builder.download_and_prepare(output_dir, storage_options=storage_options, file_format="parquet", max_shard_size="10MB")
```
The reason for this is that, in line [2] `writer._num_bytes > max_shard_size` is never true, because the `write` method of `ArrowWriter` [3] does not increase `self._num_bytes`.
Such that respective Arrow/Parquet shards are only written to file based on the `writer_batch_size` or `config.DEFAULT_MAX_BATCH_SIZE`, but not based on `max_shard_size`.
[1] https://huggingface.co/docs/datasets/filesystems#download-and-prepare-a-dataset-into-a-cloud-storage
[2] https://github.com/huggingface/datasets/blob/3e8d420808718c9a1453a2e7ee3484ca12c9c70d/src/datasets/builder.py#L1677
[3] https://github.com/huggingface/datasets/blob/3e8d420808718c9a1453a2e7ee3484ca12c9c70d/src/datasets/arrow_writer.py#L459
### Steps to reproduce the bug
Get example from: https://huggingface.co/docs/datasets/filesystems#download-and-prepare-a-dataset-into-a-cloud-storage
Call `builder.download_and_prepare` with low `max_shard_size` such as `10MB`, e.g.:
```python
builder.download_and_prepare(output_dir, storage_options=storage_options, file_format="parquet", max_shard_size="10MB")
```
### Expected behavior
Shards should be written based on `max_shard_size` instead of batch size.
### Environment info
```
>>> import datasets
>>> datasets.__version__
'2.14.6.dev0
```
`writer._num_bytes` is updated every `writer_batch_size`-th call to the `write` method (default `writer_batch_size` is 1000 (examples)). You should be able to see the update by passing a smaller `writer_batch_size` to the `load_dataset_builder`.
We could improve this by supporting the string `writer_batch_size` version as we do with `max_shard_size`, and capping `writer_batch_size` to `max_shard_size` in scenarios where the default `writer_batch_size` > `max_shard_size`. | [
-0.21688036620616913,
-0.32925087213516235,
0.040966473519802094,
0.35702764987945557,
-0.010450192727148533,
-0.2793327271938324,
0.1783680021762848,
-0.06482735276222229,
-0.11833866685628891,
0.05089190602302551,
0.21760544180870056,
0.0646483302116394,
-0.09433740377426147,
0.31870290637016296,
0.12382624298334122,
0.016952546313405037,
0.02613992989063263,
-0.09833624958992004,
-0.05397767946124077,
-0.02741774171590805,
-0.007186912000179291,
0.19015197455883026,
-0.11206372082233429,
-0.27921828627586365,
-0.370741069316864,
0.18335512280464172,
0.01492483913898468,
0.31804159283638,
-0.32027536630630493,
-0.14656710624694824,
0.09487354755401611,
-0.11340181529521942,
-0.03615584224462509,
0.18609359860420227,
-0.00012676983897108585,
0.005071043968200684,
0.5412495136260986,
-0.13530343770980835,
-0.21894046664237976,
-0.13968400657176971,
-0.2006797343492508,
-0.34374305605888367,
0.07239913940429688,
-0.19804996252059937,
0.16966284811496735,
0.11236575245857239,
0.0538729652762413,
0.06432661414146423,
0.43130162358283997,
0.3158801794052124,
0.08104993402957916,
0.21689742803573608,
0.6099499464035034,
0.10146914422512054,
0.41705602407455444,
0.3841778635978699,
-0.3191128969192505,
0.08536364138126373,
0.08728094398975372,
0.4539170265197754,
-0.18393376469612122,
-0.016560494899749756,
0.20416957139968872,
-0.038440555334091187,
0.3078960180282593,
0.26376980543136597,
-0.047097932547330856,
-0.08206133544445038,
0.18601056933403015,
-0.004085805267095566,
0.11731075495481491,
-0.45471030473709106,
-0.3826600909233093,
-0.3497677445411682,
-0.11976908147335052,
-0.37491634488105774,
0.44886359572410583,
0.3270584046840668,
-0.20352591574192047,
-0.020057201385498047,
-0.28031623363494873,
-0.2664374113082886,
-0.15031319856643677,
0.007004011422395706,
0.15968340635299683,
0.06585431098937988,
-0.34970900416374207,
0.005423415452241898,
0.0014158249832689762,
-0.3056335747241974,
-0.00018075108528137207,
-0.22467896342277527,
-0.21271729469299316,
0.13534729182720184,
-0.39354097843170166,
-0.04141267016530037,
-0.11975903064012527,
0.3713589310646057,
0.21947640180587769,
0.1859368234872818,
0.3010740578174591,
0.17719370126724243,
0.4129800498485565,
0.1276215761899948,
0.060827113687992096,
-0.13516460359096527,
0.3830014765262604,
0.19895821809768677,
-0.12676885724067688,
0.4405997097492218,
0.13056448101997375,
-0.14139994978904724,
0.28864461183547974,
-0.3940103054046631,
-0.0302823968231678,
-0.44247156381607056,
0.3088093400001526,
-0.20666036009788513,
0.2747689187526703,
0.2037496268749237,
0.2115670144557953,
0.09962837398052216,
0.028624210506677628,
0.2422276735305786,
0.16221195459365845,
-0.39909613132476807,
-0.35282498598098755,
0.22706153988838196,
-0.1645081788301468,
-0.20872478187084198,
-0.14040270447731018,
-0.074726901948452,
-0.047875162214040756,
0.08515617251396179,
0.22028833627700806,
-0.03187521547079086,
0.15860897302627563,
0.2577623128890991,
0.21564683318138123,
-0.27076295018196106,
-0.05035267770290375,
-0.18260124325752258,
0.12286670506000519,
0.3218921422958374,
-0.18409094214439392,
0.03879611939191818,
-0.16986918449401855,
-0.2385820895433426,
-0.07057884335517883,
0.005972648039460182,
-0.4421292245388031,
-0.2563121020793915,
0.04033218324184418,
0.07027867436408997,
-0.133383646607399,
-0.006915472447872162,
-0.6820191144943237,
-0.038192905485630035,
0.4581752121448517,
-0.04477105662226677,
0.05033888667821884,
-0.13318227231502533,
-0.2638844847679138,
-0.2854531407356262,
0.289137601852417,
0.3063276708126068,
-0.03590774163603783,
-0.08039746433496475,
-0.15727317333221436,
0.02580854296684265,
0.4069422781467438,
0.28898340463638306,
0.06523889303207397,
-0.34650251269340515,
-0.15331128239631653,
0.28085726499557495,
0.5679259300231934,
0.2035776525735855,
-0.4128599762916565,
0.19680826365947723,
-0.029808878898620605,
0.03743191808462143,
0.43236756324768066,
-0.34251129627227783,
0.3931124806404114,
-0.02684152126312256,
-0.14514486491680145,
0.15333430469036102,
0.2758987843990326,
-0.12561114132404327,
-0.47928357124328613,
-0.19731681048870087,
-0.42455002665519714,
-0.006744399666786194,
-0.05922473594546318,
-0.19067271053791046,
0.3566437065601349,
-0.10940878093242645,
0.2072216272354126,
-0.060740791261196136,
0.4717194437980652,
0.33216986060142517,
0.09183888137340546,
-0.10336514562368393,
0.05821026489138603,
-0.10030795633792877,
-0.41613900661468506,
0.1560535728931427,
-0.4528983533382416,
-0.26201727986335754,
-0.22187036275863647,
-0.07779927551746368,
-0.02152416482567787,
0.10291415452957153,
0.011654140427708626,
-0.157298281788826,
-0.032786786556243896,
-0.06336447596549988,
0.2968232035636902,
0.04532162845134735,
-0.09904652088880539,
-0.08639809489250183,
-0.512031614780426,
0.32388418912887573,
-0.3432208001613617,
0.23504769802093506,
0.08432949334383011,
-0.570469856262207,
-0.20503583550453186,
0.07510250806808472,
-0.032028019428253174,
-0.13780322670936584,
0.038851819932460785,
0.4068399965763092,
0.065829336643219,
0.46394914388656616,
-0.28570428490638733,
0.10041444003582001,
0.2054046094417572,
0.1393708884716034,
0.06866708397865295,
-0.01569182239472866,
0.023049961775541306,
0.10013589262962341,
-0.33193713426589966,
0.30816248059272766,
0.04690183326601982,
0.3658546805381775,
0.09501899778842926,
-0.15772300958633423,
-0.18127211928367615,
0.024957239627838135,
0.19466948509216309,
-0.34046560525894165,
0.1402231752872467,
-0.019225986674427986,
0.07423283904790878,
0.04387971758842468,
-0.02126501500606537,
0.03365549445152283,
0.509203314781189,
0.11173088848590851,
0.021297121420502663,
0.24203993380069733,
-0.029552016407251358,
-0.20655900239944458,
0.13315266370773315,
0.5798852443695068,
0.33548521995544434,
0.17310769855976105,
0.11327338218688965,
-0.1229037195444107,
0.09048300981521606,
-0.33243289589881897,
0.3217887282371521,
0.08703777939081192,
-0.17644433677196503,
0.3590913712978363,
0.20185470581054688,
-0.23324619233608246,
-0.32143497467041016,
0.1304791420698166,
0.10837525874376297,
-0.05828817933797836,
-0.35414618253707886,
-0.09338662028312683,
-0.14424000680446625,
0.24826680123806,
-0.41785120964050293,
0.32908889651298523,
-0.3975580930709839,
-0.21832680702209473,
-0.09770507365465164,
0.1924603134393692,
-0.19665071368217468,
-0.24169890582561493,
0.08027763664722443,
0.007786974310874939,
-0.0501398965716362,
-0.005907073616981506,
-0.32216715812683105,
0.2283652275800705,
-0.04060838744044304,
-0.002991940826177597,
0.2949129045009613,
0.014150720089673996,
-0.026161404326558113,
-0.1080886572599411,
-0.12453904747962952,
-0.45713454484939575,
-0.21598118543624878,
0.0942826122045517,
-0.029813049361109734,
0.3415347635746002,
0.09091980755329132,
-0.15094800293445587,
-0.07113917917013168,
0.0643739402294159,
0.1692061722278595,
-0.0965733528137207,
-0.08791391551494598,
0.18149566650390625,
0.24316412210464478,
0.12547385692596436,
-0.13513301312923431,
0.16614550352096558,
0.011121796444058418,
-0.4129752218723297,
0.5417866706848145,
0.47292888164520264,
0.33993709087371826,
-0.06118006259202957,
0.16844442486763,
0.024576354771852493,
-0.39996159076690674,
0.3203752040863037,
0.22643467783927917,
-0.34204548597335815,
0.4483383595943451,
-0.20827189087867737,
-0.451297402381897,
-0.0408201590180397,
0.16163726150989532,
0.12163242697715759,
0.3393522799015045,
-0.14183814823627472,
0.08046618103981018,
-0.476407915353775,
-0.06619355082511902,
-0.022679636254906654,
0.3168899416923523,
0.2802707552909851,
-0.1603720337152481,
0.04385223984718323,
-0.06681807339191437,
0.15738123655319214,
0.19587230682373047,
0.10216718912124634,
0.04475676268339157,
0.23816268146038055,
0.44507020711898804,
0.011189281940460205,
0.7618284225463867,
0.38693344593048096,
0.055001117289066315,
0.4053981304168701,
-0.07548857480287552,
0.15746521949768066,
-0.28359001874923706,
0.06204347312450409,
0.26540622115135193,
0.03097323328256607,
0.11099672317504883,
0.09110115468502045,
0.07465687394142151,
0.3637462854385376,
0.21775993704795837,
-0.3305550217628479,
-0.008651860058307648,
-0.3447544574737549,
0.24297712743282318,
0.015344982966780663,
0.23319925367832184,
-0.16755259037017822,
0.13002564013004303,
0.042298443615436554,
-0.18473869562149048,
-0.16769728064537048,
0.26916640996932983,
0.198530912399292,
0.15581703186035156,
0.09139899909496307,
0.34238308668136597,
-0.5503037571907043,
0.23610743880271912,
-0.1299164742231369,
0.1596607267856598,
0.03073062002658844,
-0.3354031443595886,
0.2582038640975952,
-0.22251394391059875,
0.39317813515663147,
-0.11950894445180893,
0.0061383615247905254,
-0.12850910425186157,
-0.0909004658460617,
-0.546398937702179,
0.0856432318687439,
-0.1613280326128006,
0.2262161374092102,
-0.01609257608652115,
0.47342950105667114,
-0.27951496839523315,
-0.10932986438274384,
0.04552767425775528,
-0.07512436807155609,
0.0510370135307312,
-0.08603428304195404,
-0.18582825362682343,
0.2457040548324585,
-0.5228105187416077,
0.027901196852326393,
0.08915790915489197,
0.45657071471214294,
-0.07165125012397766,
0.06024893373250961,
-0.32341358065605164,
-0.20018701255321503,
0.007554732263088226,
-0.12033621966838837,
0.44757080078125,
-0.3800513744354248,
0.013431012630462646,
-0.09363943338394165,
0.0200952235609293,
0.2676348090171814,
0.4132220149040222,
0.2405196577310562,
-0.03815482184290886,
0.10380685329437256,
-0.1142711341381073,
0.2728690505027771,
0.2099149078130722,
-0.12273240834474564,
0.3175320327281952,
-0.039769288152456284,
0.3363475799560547,
-0.31250321865081787,
-0.28473716974258423,
0.13006770610809326,
-0.02171536535024643,
0.017252709716558456,
0.027073554694652557,
0.7212401032447815,
0.08997051417827606,
0.17766202986240387,
-0.004187471233308315,
0.7801333665847778,
-0.3578808903694153,
0.3465224504470825,
0.41685229539871216,
0.8265665173530579,
0.10566496104001999,
0.3137463927268982,
-0.2604813575744629,
-0.301850289106369,
0.17228740453720093,
-0.13217571377754211,
0.13140316307544708,
-0.27374809980392456,
-0.018184645101428032,
0.0065404921770095825,
-0.26393014192581177,
0.306749552488327,
0.013338666409254074,
-0.18275517225265503,
0.11410064995288849,
-0.022891178727149963,
0.12635384500026703,
-0.17836643755435944,
0.18671154975891113,
-0.7650612592697144,
-0.3009183704853058,
-0.21626752614974976,
0.021989062428474426,
0.1803121566772461,
-0.05728945881128311,
0.0816878080368042,
-0.13017819821834564,
-0.08069980889558792,
-0.24968306720256805,
-0.22740457952022552,
0.05438867211341858,
-0.1374533474445343,
-0.036810778081417084,
0.2885773181915283,
-0.5619322657585144,
0.42216044664382935,
0.009154921397566795,
0.011959565803408623,
0.23072834312915802,
-0.13409321010112762,
-0.06780706346035004,
-0.02081851288676262,
-0.015606854110956192,
-0.015534965321421623,
-0.19745001196861267,
-0.04408890753984451,
0.02792707085609436,
0.14356744289398193,
-0.28500932455062866,
-0.022612392902374268,
-0.06824861466884613,
-0.1424008458852768,
0.1758415848016739,
-0.051899254322052,
-0.315868079662323,
-0.20086246728897095,
-0.3564155399799347,
-0.2801762819290161,
-0.14979566633701324,
0.018558625131845474,
0.12571147084236145,
-0.06647170335054398,
-0.07393050193786621,
-0.27246546745300293,
-0.12929534912109375,
-0.13664141297340393,
0.5402883887290955,
-0.08328616619110107,
0.268022745847702,
0.5874531865119934,
-0.02296384423971176,
-0.03635035455226898,
-0.1667969524860382,
-0.008432343602180481,
0.21904487907886505,
-0.5152043104171753,
0.3351534307003021,
-0.25438928604125977,
0.07538062334060669,
-0.03752678632736206,
0.2773350179195404,
0.06889036297798157,
-0.026925478130578995,
-0.41889089345932007,
-0.30118533968925476,
-0.32645609974861145,
0.16924795508384705,
-0.10295772552490234,
0.0816761776804924,
-0.25043806433677673,
-0.1907159984111786,
0.101814404129982,
0.11585153639316559,
-0.19506309926509857,
0.08391880989074707,
0.09922263771295547,
0.03311368450522423,
0.5006799101829529,
-0.11141933500766754,
0.042656224220991135,
-0.07055796682834625,
-0.08012257516384125,
0.12215613573789597,
-0.2183646559715271,
-0.08602073788642883,
-0.1482989639043808,
0.13232575356960297,
0.16018947958946228,
0.06277111172676086,
-0.3639759421348572,
0.13234125077724457,
-0.18890444934368134,
-0.20825330913066864,
0.21648137271404266,
-0.16671156883239746,
-0.11674091219902039,
-0.1137884259223938,
0.6676087379455566,
0.17986011505126953,
-0.3330063223838806,
-0.09737160056829453,
-0.0861356258392334,
0.15338405966758728,
-0.28207919001579285,
0.2349434196949005,
0.011712595820426941,
0.08239387720823288,
0.11205636709928513,
0.30190345644950867,
0.12880243360996246,
-0.11785557866096497,
0.30321988463401794,
-0.21634109318256378,
-0.22050081193447113,
-0.0849364846944809,
0.41648221015930176,
0.509781002998352,
0.11575597524642944,
-0.34369325637817383,
0.12873786687850952,
0.12372879683971405,
0.09502020478248596,
-0.07764731347560883,
0.16172252595424652,
0.021438714116811752,
0.034469619393348694,
0.2822108864784241,
0.18908628821372986,
-0.25319570302963257,
-0.35022032260894775,
0.3687252402305603,
-0.007502302527427673,
-0.39819496870040894,
-0.01531258225440979,
0.2734972834587097,
0.050647467374801636,
0.1145000010728836,
0.5238081216812134,
-0.042360082268714905,
0.352827787399292,
0.36890462040901184,
-0.07487417012453079,
0.6654798984527588,
0.06708668172359467,
0.04746755585074425,
0.11337561905384064,
-0.41274315118789673,
0.10965609550476074,
0.1233924925327301,
0.28519588708877563,
0.29746508598327637,
-0.02772614359855652,
0.5212588310241699,
0.25320616364479065,
-0.12513336539268494,
-0.39967280626296997,
0.18444935977458954,
-0.18795065581798553,
-0.4566619098186493,
-0.02437647059559822,
-0.30057621002197266,
-0.3505535125732422,
0.1500345766544342,
-0.09044180810451508,
-0.004812965169548988,
0.38678810000419617,
-0.034575991332530975,
0.09940667450428009,
-0.22405441105365753,
0.11071817576885223,
0.17273852229118347,
0.2526218891143799,
-0.3594614267349243,
0.49317666888237,
0.04628609120845795,
-0.044804271310567856,
-0.1878504604101181,
0.31555935740470886,
0.5722616314888,
0.19394759833812714,
0.28586435317993164,
0.14788535237312317,
0.26652637124061584,
-0.04785482585430145,
-0.13805603981018066,
0.5163196921348572,
0.013542037457227707,
0.20157229900360107,
0.24175167083740234,
0.060707710683345795,
-0.1184438019990921,
-0.3270435333251953,
0.06276620179414749,
0.016758661717176437,
-0.3203430473804474,
0.3143521845340729,
-0.1424572467803955,
-0.3531630039215088,
0.01077323965728283,
-0.007855288684368134,
-0.4107905924320221,
-0.12715965509414673,
0.30947113037109375,
-0.17536325752735138,
0.03377335146069527,
-0.19896110892295837,
-0.006763685494661331,
0.1859581023454666,
0.6357821226119995,
0.24969932436943054,
-0.1725967526435852,
-0.1730394959449768,
-0.10874401032924652,
-0.24447524547576904,
0.014398489147424698,
-0.1139674037694931,
-0.0037048161029815674,
-0.06284633278846741,
0.37771695852279663,
-0.1319141685962677,
-0.10528934001922607,
0.19580519199371338,
0.1866505742073059,
-0.21893224120140076,
0.2789783179759979,
-0.09635189175605774,
0.005558785982429981,
0.14763875305652618,
-0.4651171565055847,
-0.03480938822031021,
-0.3472414016723633,
0.4944363236427307,
-0.26700952649116516,
-0.04709082096815109,
0.06613625586032867,
0.26639679074287415,
0.1435709297657013,
-0.6494230628013611,
0.3350639045238495,
0.17213299870491028,
-0.0744272768497467,
-0.0913022831082344,
-0.2058679461479187,
-0.5846136808395386,
0.024577386677265167,
-0.23541198670864105,
0.21432727575302124,
-0.10922405868768692,
0.47055840492248535,
-0.18070290982723236,
-0.22721590101718903,
-0.15178510546684265,
0.2090086042881012,
-0.06300697475671768,
-0.19838947057724,
0.32762300968170166,
-0.01646026223897934,
-0.05199108645319939,
-0.0019450187683105469,
0.24490271508693695,
0.31424325704574585,
0.01344442367553711,
0.019908830523490906,
-0.2168361395597458,
-0.4913470447063446,
0.24582357704639435,
-0.36401692032814026,
-0.1058650091290474,
-0.037282735109329224,
0.2829474210739136,
0.22847527265548706,
-0.29008179903030396,
-0.6638177633285522,
-0.07091055810451508,
0.2257365882396698,
-0.08757235109806061,
0.11944413930177689,
0.294716477394104,
0.13071134686470032,
-0.10703190416097641,
-0.15615150332450867,
0.2915397584438324,
0.08021342754364014,
-0.2469552606344223,
0.0074340105056762695,
-0.29452332854270935
] |
https://github.com/huggingface/datasets/issues/6294 | It looks to be the same issue as the one reported in https://discuss.huggingface.co/t/indexerror-invalid-key-16-is-out-of-bounds-for-size-0.
Can you check the length of `train_dataset` before the `train_sampler = self._get_train_sampler()` (and after `_remove_unused_columns`) line? | IndexError: Invalid key is out of bounds for size 0 despite having a populated dataset | ### Describe the bug
I am encountering an `IndexError` when trying to access data from a DataLoader which wraps around a dataset I've loaded using the `datasets` library. The error suggests that the dataset size is `0`, but when I check the length and print the dataset, it's clear that it has `1166` entries.
### Steps to reproduce the bug
1. Load a dataset with `1166` entries.
2. Create a DataLoader using this dataset.
3. Try iterating over the DataLoader.
code:
```python
def get_train_dataloader(self) -> DataLoader:
if self.train_dataset is None:
raise ValueError("Trainer: training requires a train_dataset.")
train_dataset = self.train_dataset
data_collator = self.data_collator
print(len(train_dataset))
print(train_dataset)
if is_datasets_available() and isinstance(train_dataset, datasets.Dataset):
train_dataset = self._remove_unused_columns(train_dataset, description="training")
else:
data_collator = self._get_collator_with_removed_columns(data_collator, description="training")
train_sampler = self._get_train_sampler()
dl = DataLoader(
train_dataset,
batch_size=self._train_batch_size,
sampler=train_sampler,
collate_fn=data_collator,
drop_last=self.args.dataloader_drop_last,
num_workers=self.args.dataloader_num_workers,
pin_memory=self.args.dataloader_pin_memory,
worker_init_fn=seed_worker,
)
print(dl)
print(len(dl))
for i in dl:
print(i)
break
return dl
```
output :
```
1166
Dataset({
features: ['input_ids', 'special_tokens_mask'],
num_rows: 1166
})
<torch.utils.data.dataloader.DataLoader object ...>
146
```
Error:
```
Traceback (most recent call last):
File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 266, in <module>
train()
File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 260, in train
trainer.train()
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/transformers/trainer.py", line 1506, in train
return inner_training_loop(
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/transformers/trainer.py", line 1520, in _inner_training_loop
train_dataloader = self.get_train_dataloader()
File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 80, in get_train_dataloader
for i in dl:
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in __next__
data = self._next_data()
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 674, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = self.dataset.__getitems__(possibly_batched_index)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2807, in __getitems__
batch = self.__getitem__(keys)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__
return self._getitem(key)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2787, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 583, in query_table
_check_valid_index_key(key, size)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 536, in _check_valid_index_key
_check_valid_index_key(int(max(key)), size=size)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 526, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 1116 is out of bounds for size 0
```
### Expected behavior
I expect to be able to iterate over the DataLoader without encountering an IndexError since the dataset is populated.
### Environment info
- `datasets` library version: [2.14.5]
- Platform: [Linux]
- Python version: 3.10
- Other libraries involved: HuggingFace Transformers | 29 | IndexError: Invalid key is out of bounds for size 0 despite having a populated dataset
### Describe the bug
I am encountering an `IndexError` when trying to access data from a DataLoader which wraps around a dataset I've loaded using the `datasets` library. The error suggests that the dataset size is `0`, but when I check the length and print the dataset, it's clear that it has `1166` entries.
### Steps to reproduce the bug
1. Load a dataset with `1166` entries.
2. Create a DataLoader using this dataset.
3. Try iterating over the DataLoader.
code:
```python
def get_train_dataloader(self) -> DataLoader:
if self.train_dataset is None:
raise ValueError("Trainer: training requires a train_dataset.")
train_dataset = self.train_dataset
data_collator = self.data_collator
print(len(train_dataset))
print(train_dataset)
if is_datasets_available() and isinstance(train_dataset, datasets.Dataset):
train_dataset = self._remove_unused_columns(train_dataset, description="training")
else:
data_collator = self._get_collator_with_removed_columns(data_collator, description="training")
train_sampler = self._get_train_sampler()
dl = DataLoader(
train_dataset,
batch_size=self._train_batch_size,
sampler=train_sampler,
collate_fn=data_collator,
drop_last=self.args.dataloader_drop_last,
num_workers=self.args.dataloader_num_workers,
pin_memory=self.args.dataloader_pin_memory,
worker_init_fn=seed_worker,
)
print(dl)
print(len(dl))
for i in dl:
print(i)
break
return dl
```
output :
```
1166
Dataset({
features: ['input_ids', 'special_tokens_mask'],
num_rows: 1166
})
<torch.utils.data.dataloader.DataLoader object ...>
146
```
Error:
```
Traceback (most recent call last):
File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 266, in <module>
train()
File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 260, in train
trainer.train()
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/transformers/trainer.py", line 1506, in train
return inner_training_loop(
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/transformers/trainer.py", line 1520, in _inner_training_loop
train_dataloader = self.get_train_dataloader()
File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 80, in get_train_dataloader
for i in dl:
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in __next__
data = self._next_data()
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 674, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = self.dataset.__getitems__(possibly_batched_index)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2807, in __getitems__
batch = self.__getitem__(keys)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__
return self._getitem(key)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2787, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 583, in query_table
_check_valid_index_key(key, size)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 536, in _check_valid_index_key
_check_valid_index_key(int(max(key)), size=size)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 526, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 1116 is out of bounds for size 0
```
### Expected behavior
I expect to be able to iterate over the DataLoader without encountering an IndexError since the dataset is populated.
### Environment info
- `datasets` library version: [2.14.5]
- Platform: [Linux]
- Python version: 3.10
- Other libraries involved: HuggingFace Transformers
It looks to be the same issue as the one reported in https://discuss.huggingface.co/t/indexerror-invalid-key-16-is-out-of-bounds-for-size-0.
Can you check the length of `train_dataset` before the `train_sampler = self._get_train_sampler()` (and after `_remove_unused_columns`) line? | [
-0.18687286972999573,
0.07448868453502655,
-0.002622019499540329,
0.4387747645378113,
0.02467706799507141,
0.019085943698883057,
0.5693433880805969,
0.3245084583759308,
0.36027199029922485,
0.2870757579803467,
0.16168470680713654,
0.13154295086860657,
-0.33575376868247986,
0.14254388213157654,
-0.18681655824184418,
-0.011081699281930923,
-0.07687652111053467,
0.049056779593229294,
-0.01473497599363327,
0.20917348563671112,
-0.2925035059452057,
-0.14679847657680511,
-0.4300647974014282,
0.08821888267993927,
-0.09142227470874786,
-0.14485789835453033,
-0.13359008729457855,
0.0898330882191658,
-0.1396147906780243,
-0.5051162838935852,
0.31996864080429077,
-0.4132396876811981,
0.2514437735080719,
0.7732954025268555,
-0.00011325812374707311,
0.22614914178848267,
0.20213788747787476,
0.022495560348033905,
-0.3249804973602295,
-0.11483336985111237,
-0.05523025244474411,
-0.46165066957473755,
0.0754048302769661,
-0.36494436860084534,
0.07779718935489655,
-0.2932063341140747,
-0.17306658625602722,
-0.18292862176895142,
-0.03573394939303398,
0.3804967403411865,
0.1938772052526474,
0.4721148610115051,
0.14429643750190735,
-0.04622722417116165,
0.16315636038780212,
-0.0038323625922203064,
-0.10880063474178314,
0.09604310989379883,
0.23860138654708862,
-0.22936218976974487,
-0.29445895552635193,
0.25671663880348206,
0.06294459849596024,
-0.08480226993560791,
0.1900402009487152,
-0.10085205733776093,
0.0005295481532812119,
-0.19532421231269836,
0.10699732601642609,
0.22030167281627655,
0.3780726492404938,
-0.20321986079216003,
-0.458810031414032,
-0.5336993336677551,
0.08343907445669174,
-0.09287799149751663,
0.1948215365409851,
0.06901267170906067,
0.03537220507860184,
0.1427948772907257,
-0.1700754314661026,
0.14514875411987305,
-0.07606936246156693,
0.04711861535906792,
-0.3798006772994995,
0.2629487216472626,
-0.026108305901288986,
0.21597431600093842,
0.13083423674106598,
-0.34011611342430115,
0.23406967520713806,
-0.043043967336416245,
0.01309998519718647,
0.28110116720199585,
-0.34748369455337524,
0.0391601026058197,
0.27808505296707153,
0.009274529293179512,
0.10023549944162369,
-0.041730307042598724,
-0.07804396748542786,
-0.264068067073822,
0.06837654113769531,
-0.014686675742268562,
0.392380952835083,
0.3147800862789154,
0.0016187895089387894,
0.325382798910141,
0.10650373995304108,
0.12952466309070587,
-0.05549129471182823,
-0.12388649582862854,
0.009995244443416595,
-0.24302580952644348,
0.30788126587867737,
0.015469886362552643,
0.17093569040298462,
0.1139744222164154,
-0.21108615398406982,
0.2983938157558441,
-0.2711349427700043,
0.06254620850086212,
0.36800211668014526,
0.0695008635520935,
0.030357934534549713,
0.3222656846046448,
0.18603596091270447,
0.23054878413677216,
-0.24284464120864868,
-0.08640090376138687,
-0.3674923777580261,
0.18062908947467804,
-0.08628673106431961,
-0.2083175778388977,
-0.016604483127593994,
-0.3327949643135071,
0.13043610751628876,
0.0007104314863681793,
0.052113503217697144,
-0.18213878571987152,
0.055502913892269135,
-0.20773367583751678,
0.006473831832408905,
0.27851060032844543,
-0.02936803549528122,
0.13630184531211853,
0.40243250131607056,
-0.29405906796455383,
-0.05932977795600891,
0.27086561918258667,
-0.6874529123306274,
-0.3475148677825928,
-0.06287956982851028,
0.18067319691181183,
-0.34153687953948975,
0.2832706570625305,
-0.08974265307188034,
-0.07300982624292374,
0.23428061604499817,
-0.10035151243209839,
0.11418963968753815,
-0.28139644861221313,
-0.08673730492591858,
-0.228135347366333,
0.008324526250362396,
0.3329335153102875,
-0.49945497512817383,
-0.04825613647699356,
-0.06461566686630249,
-0.02318614348769188,
-0.056863125413656235,
0.023342881351709366,
-0.3761104345321655,
0.4104827046394348,
-0.4133777618408203,
0.31932657957077026,
0.24183940887451172,
-0.1972266137599945,
-0.7955644726753235,
0.27270573377609253,
-0.28362196683883667,
0.1595519334077835,
0.018327198922634125,
0.12781813740730286,
0.10139039158821106,
0.05863737314939499,
0.48805859684944153,
-0.025262944400310516,
-0.0877249613404274,
-0.011572185903787613,
-0.16273188591003418,
-0.17053651809692383,
0.40921932458877563,
0.0320233553647995,
0.366264283657074,
-0.04736651852726936,
-0.08392961323261261,
0.14731749892234802,
0.09815474599599838,
-0.026663605123758316,
0.060311682522296906,
0.2931113839149475,
0.014331762678921223,
-0.004411263391375542,
0.14269527792930603,
-0.08348037302494049,
-0.20650994777679443,
0.4303925037384033,
0.18824085593223572,
0.05320441350340843,
-0.1951524317264557,
-0.028722088783979416,
-0.25718969106674194,
0.34910815954208374,
-0.07954935729503632,
-0.053441841155290604,
0.1120898574590683,
0.0026588141918182373,
-0.18281355500221252,
-0.07707064598798752,
-0.028912372887134552,
0.051883675158023834,
-0.33233773708343506,
0.06219256669282913,
-0.46733465790748596,
0.1574282944202423,
-0.050035156309604645,
0.051243070513010025,
-0.14742767810821533,
0.030969854444265366,
0.02556638978421688,
0.0433260016143322,
-0.057535234838724136,
0.3101528286933899,
0.1848682016134262,
-0.18686819076538086,
-0.13713349401950836,
0.10532578825950623,
0.1839662343263626,
-0.060176800936460495,
-0.003635878674685955,
0.0719657689332962,
0.2900124788284302,
-0.06851610541343689,
0.06417828798294067,
0.5735937356948853,
-0.13216280937194824,
0.43788906931877136,
-0.244495689868927,
-0.07781166583299637,
-0.009300872683525085,
0.048616960644721985,
-0.15044163167476654,
0.025855019688606262,
0.14201192557811737,
-0.15902727842330933,
0.13729363679885864,
0.03925666958093643,
-0.037406206130981445,
-0.1964680403470993,
-0.12637197971343994,
0.10523472726345062,
0.13488198816776276,
0.22887417674064636,
-0.2001209855079651,
0.13014748692512512,
-0.03448738902807236,
0.18963706493377686,
0.23257586359977722,
0.19326619803905487,
0.026471134275197983,
-0.1262955665588379,
0.14919841289520264,
-0.06197868660092354,
-0.011892549693584442,
0.2081197202205658,
-0.057543329894542694,
0.3049679696559906,
0.15849240124225616,
-0.012059682980179787,
0.1155901625752449,
-0.06634710729122162,
0.015495248138904572,
0.5577200651168823,
-0.5113663673400879,
0.2978222072124481,
-0.1315530687570572,
-0.14978796243667603,
0.06036756932735443,
-0.13042481243610382,
-0.2787240743637085,
-0.4647524058818817,
-0.2497084140777588,
-0.06381784379482269,
-0.15986457467079163,
-0.1103103905916214,
-0.6112942695617676,
-0.09757325053215027,
0.33483925461769104,
-0.0974927470088005,
0.4901354908943176,
-0.037959322333335876,
-0.15476574003696442,
0.04594418779015541,
0.15874113142490387,
-0.25805073976516724,
0.03916873037815094,
0.05027444660663605,
0.0829555094242096,
-0.1614871472120285,
-0.18124529719352722,
0.1347217708826065,
-0.10727785527706146,
0.21328085660934448,
0.29181012511253357,
0.3374437093734741,
-0.06616761535406113,
-0.14788025617599487,
0.24833838641643524,
0.03374152630567551,
-0.2022121697664261,
0.2701781094074249,
0.0822572186589241,
0.3313988149166107,
-0.037423595786094666,
-0.015206415206193924,
-0.06890799105167389,
-0.28772199153900146,
0.03269283100962639,
0.03559093922376633,
0.10482335835695267,
0.34966689348220825,
0.2821143567562103,
0.2265009880065918,
0.4842206835746765,
-0.1671818047761917,
-0.079191192984581,
-0.22070848941802979,
0.325451523065567,
0.16983270645141602,
-0.12324076890945435,
0.038368672132492065,
-0.32856816053390503,
-0.035619091242551804,
0.24351494014263153,
-0.658225953578949,
-0.13272780179977417,
-0.04047001898288727,
0.08580546081066132,
-0.03749358281493187,
0.25355061888694763,
0.2569832503795624,
-0.16306306421756744,
-0.04141570255160332,
-0.06448828428983688,
-0.18402570486068726,
-0.011510990560054779,
-0.12358666956424713,
0.37566742300987244,
0.122751384973526,
0.4594409465789795,
0.13025134801864624,
0.45140597224235535,
0.03829164803028107,
0.09562662243843079,
0.12817266583442688,
-0.18129955232143402,
0.3098441958427429,
-0.06996039301156998,
-0.367475688457489,
-0.044072553515434265,
0.11428975313901901,
-0.35683172941207886,
0.3056589663028717,
0.009826604276895523,
-0.06026657670736313,
-0.05105391517281532,
-0.32913848757743835,
-0.3416430354118347,
-0.2283327579498291,
0.35518091917037964,
-0.1548599898815155,
0.1310223937034607,
-0.18653011322021484,
0.26326707005500793,
-0.40317007899284363,
-0.12369416654109955,
-0.22502849996089935,
-0.2424674928188324,
0.14108088612556458,
-0.1477658450603485,
-0.13108418881893158,
-0.11712819337844849,
-0.3925044536590576,
0.1553550660610199,
0.13096736371517181,
0.520939826965332,
0.2576965093612671,
-0.39168882369995117,
-0.03380974009633064,
0.02131945639848709,
0.7066930532455444,
-0.017271699383854866,
-0.060028158128261566,
0.21081484854221344,
-0.05437055975198746,
-0.5839642286300659,
-0.12151885777711868,
-0.17775174975395203,
0.43453168869018555,
0.017376836389303207,
0.5248051881790161,
-0.06697478145360947,
0.1454119235277176,
0.10805107653141022,
0.2655333876609802,
-0.18555745482444763,
-0.28434547781944275,
-0.2027970850467682,
-0.1886202096939087,
-0.0841810554265976,
0.20376843214035034,
0.028771959245204926,
0.30406057834625244,
0.16937777400016785,
0.3943619430065155,
-0.38570430874824524,
-0.25629836320877075,
0.19298945367336273,
0.07021506130695343,
0.38935694098472595,
-0.04502934217453003,
0.20552301406860352,
0.23981764912605286,
-0.002261439338326454,
0.38864216208457947,
0.6283199191093445,
0.01460503600537777,
-0.09316960722208023,
0.2837076187133789,
-0.018014661967754364,
0.16216757893562317,
0.31406641006469727,
-0.03707757219672203,
0.20558443665504456,
-0.06868812441825867,
0.12241044640541077,
-0.3377075791358948,
-0.0890171080827713,
0.26621711254119873,
-0.1561216115951538,
-0.4752882421016693,
-0.3029636740684509,
0.40951043367385864,
0.10632452368736267,
0.09954433143138885,
0.29170116782188416,
0.43051230907440186,
-0.3039643168449402,
0.32406795024871826,
0.001009579747915268,
0.7819786667823792,
-0.035687655210494995,
0.08948120474815369,
0.29531437158584595,
0.35603487491607666,
0.46963414549827576,
-0.09974271059036255,
0.03390827029943466,
-0.3073350787162781,
-0.4944886863231659,
-0.08575424551963806,
-0.140933558344841,
-0.09803960472345352,
-0.0035487767308950424,
0.06949855387210846,
0.18637831509113312,
-0.4967310428619385,
0.16421672701835632,
-0.20495565235614777,
0.025707252323627472,
-0.12639887630939484,
-0.1536450833082199,
-0.11632393300533295,
0.12127000093460083,
-0.17123396694660187,
0.10519659519195557,
-0.06284144520759583,
0.06613346934318542,
-0.17052078247070312,
-0.3466590642929077,
-0.24600642919540405,
-0.07227315753698349,
-0.09077798575162888,
0.12622934579849243,
0.24533861875534058,
-0.2797980308532715,
0.1485920548439026,
0.2830825448036194,
-0.007237233221530914,
0.27593186497688293,
-0.0027477797120809555,
0.10422872006893158,
-0.05508063733577728,
0.1014096811413765,
0.21159963309764862,
0.0674734115600586,
0.2099650651216507,
0.24361124634742737,
-0.10698825120925903,
0.22305217385292053,
-0.21189939975738525,
-0.3559027314186096,
0.16508813202381134,
0.44910603761672974,
0.043234288692474365,
-0.5335509777069092,
-0.23295475542545319,
-0.34315454959869385,
0.12419024109840393,
-0.0972123071551323,
0.10041554272174835,
0.2360135018825531,
-0.09894934296607971,
-0.07849204540252686,
0.0223008431494236,
-0.382354199886322,
0.045112237334251404,
0.5498968362808228,
0.3464156687259674,
0.08653201162815094,
0.6820725202560425,
0.2858491837978363,
-0.18186451494693756,
-0.1236705556511879,
0.28362107276916504,
0.5991261005401611,
-0.033253028988838196,
-0.0043369196355342865,
-0.1915632039308548,
0.18749229609966278,
0.03749673068523407,
-0.005139732733368874,
0.35191792249679565,
0.10515225678682327,
-0.2463192343711853,
-0.44957852363586426,
-0.4835091531276703,
0.3535120189189911,
0.07417722046375275,
0.14251819252967834,
-0.07190046459436417,
-0.2824479639530182,
-0.08839953690767288,
-0.07420194894075394,
-0.28232741355895996,
0.08234206587076187,
-0.38316822052001953,
0.19598695635795593,
0.1436750292778015,
0.1760789155960083,
0.1498773992061615,
-0.13803279399871826,
0.0885101929306984,
0.14079956710338593,
0.011271804571151733,
-0.21107131242752075,
-0.14862248301506042,
0.0842488631606102,
0.0905960202217102,
-0.14685925841331482,
0.11040034890174866,
-0.4061042368412018,
-0.014023109339177608,
-0.2278217077255249,
-0.05762584134936333,
0.3493373692035675,
0.05769994109869003,
0.1389382779598236,
0.195438951253891,
0.13651838898658752,
-0.1353866159915924,
0.2653614282608032,
-0.028821438550949097,
0.40057146549224854,
0.1145908385515213,
0.3264617323875427,
0.08187291026115417,
0.10392867028713226,
-0.37131136655807495,
0.16659292578697205,
-0.2773735523223877,
0.08628091216087341,
0.011011309921741486,
-0.3804164528846741,
0.27875179052352905,
0.4232218861579895,
0.30814969539642334,
0.2816167175769806,
-0.3296937942504883,
0.08307887613773346,
0.2005857229232788,
0.16701547801494598,
-0.18039080500602722,
-0.08047355711460114,
-0.0015285331755876541,
0.06398705393075943,
0.005964778363704681,
0.3837798833847046,
-0.0011354535818099976,
-0.015574425458908081,
-0.30844593048095703,
0.07118450105190277,
0.0794195607304573,
0.14091622829437256,
0.10587979853153229,
0.7587765455245972,
-0.19888123869895935,
-0.2900792062282562,
0.3788124620914459,
0.10038454830646515,
0.3156622350215912,
0.47278091311454773,
-0.079947829246521,
0.056948088109493256,
0.08244810998439789,
-0.039088401943445206,
-0.27796614170074463,
-0.5398757457733154,
0.05500970035791397,
0.19622448086738586,
-0.004776898771524429,
-0.1484106481075287,
-0.12109299004077911,
0.22552886605262756,
-0.22776593267917633,
0.05487481504678726,
-0.20128026604652405,
0.02158193662762642,
-0.27771714329719543,
-0.04700619727373123,
-0.11263135075569153,
-0.3370246887207031,
-0.12942703068256378,
-0.17104440927505493,
-0.04130418598651886,
-0.3674677610397339,
-0.1487053781747818,
-0.05952050909399986,
-0.3113246560096741,
-0.283345103263855,
-0.1788986176252365,
0.5068833231925964,
0.0010929442942142487,
-0.5319690108299255,
0.011891299858689308,
0.1695924699306488,
0.15807349979877472,
0.34464704990386963,
0.0782705694437027,
0.5605948567390442,
0.18593034148216248,
-0.10185693204402924,
-0.01052943617105484,
-0.0023142490535974503,
-0.17635753750801086,
-0.19276046752929688,
-0.02325894869863987,
-0.17658109962940216,
0.09479977190494537,
0.4613662660121918,
0.10810782760381699,
-0.22688648104667664,
0.040154311805963516,
0.1381790190935135,
0.28699302673339844,
-0.18109571933746338,
0.001878049224615097,
-0.2178015559911728,
-0.08930234611034393,
-0.18394461274147034,
-0.11535603553056717,
-0.25374191999435425,
-0.14449670910835266,
0.40700602531433105,
0.0014181137084960938,
0.2892064154148102,
0.15013684332370758,
0.06528551876544952,
-0.1748691350221634,
0.3597868084907532,
0.6175994873046875,
-0.1405046135187149,
-0.28328371047973633,
0.02184469997882843,
-0.6244023442268372,
0.03660964220762253,
-0.679661214351654,
-0.13466843962669373,
0.17401131987571716,
0.2826160192489624,
-0.010513778775930405,
0.01984161138534546,
0.07870018482208252,
-0.04878665879368782,
0.13019725680351257,
0.23103925585746765,
-0.17619186639785767,
-0.5360811352729797,
-0.012112528085708618,
-0.0982469916343689,
0.03578495979309082,
-0.23198288679122925,
-0.02731214463710785,
-0.28666502237319946,
0.08870536834001541,
0.047341179102659225,
0.07892432808876038,
-0.04837885499000549,
-0.0012077032588422298,
0.45466768741607666,
0.06685357540845871,
0.3050927221775055,
0.1835537701845169,
0.027462132275104523,
-0.39343321323394775,
-0.183700293302536,
-0.20881901681423187,
0.22683990001678467,
0.12671372294425964,
0.5314158201217651,
-0.2629711925983429,
-0.1660604178905487,
-0.07032851129770279,
0.046840060502290726,
0.029740937054157257,
-0.07636835426092148,
-0.29589834809303284,
0.2159826159477234,
-0.30267614126205444,
0.04515957459807396,
0.0599757544696331,
0.09020844846963882,
0.11726033687591553,
0.18869948387145996,
0.13687480986118317,
-0.4810020923614502,
0.28221768140792847,
-0.619875967502594,
-0.22944241762161255,
0.01296793669462204,
-0.0322408527135849,
0.13274773955345154,
0.082783043384552,
-0.4576842188835144,
0.10102550685405731,
0.406777560710907,
0.040372855961322784,
-0.2758498191833496,
-0.1922251582145691,
-0.19930751621723175,
0.2030860185623169,
-0.07724490761756897,
0.17941288650035858,
-0.12827228009700775,
-0.06739021837711334,
0.1621740162372589,
-0.1459633857011795
] |
https://github.com/huggingface/datasets/issues/6292 | Hi! Can you provide a code that reproduces the issue?
Also, which version of `datasets` are you using? You can check this by running `python -c "import datasets; print(datasets.__version__)"` inside the env. We added support for "float images" in `datasets 2.9`. | how to load the image of dtype float32 or float64 | _FEATURES = datasets.Features(
{
"image": datasets.Image(),
"text": datasets.Value("string"),
},
)
The datasets builder seems only support the unit8 data. How to load the float dtype data? | 41 | how to load the image of dtype float32 or float64
_FEATURES = datasets.Features(
{
"image": datasets.Image(),
"text": datasets.Value("string"),
},
)
The datasets builder seems only support the unit8 data. How to load the float dtype data?
Hi! Can you provide a code that reproduces the issue?
Also, which version of `datasets` are you using? You can check this by running `python -c "import datasets; print(datasets.__version__)"` inside the env. We added support for "float images" in `datasets 2.9`. | [
-0.3456231653690338,
-0.2985003888607025,
-0.10477280616760254,
0.603319525718689,
0.50831139087677,
0.1976892352104187,
0.32766076922416687,
0.18763986229896545,
0.057741984724998474,
0.02569972351193428,
-0.1285153329372406,
-0.022169915959239006,
-0.14426574110984802,
0.21751625835895538,
-0.09825161844491959,
-0.21880678832530975,
0.0568024218082428,
0.4344085454940796,
-0.23794344067573547,
-0.05542462319135666,
-0.23301365971565247,
-0.0429583303630352,
-0.10981910675764084,
-0.2049514651298523,
-0.2149619460105896,
0.18302598595619202,
0.034146107733249664,
0.2810482680797577,
-0.37808001041412354,
-0.4352126121520996,
0.25242146849632263,
0.1287360042333603,
0.683386504650116,
0.5604467391967773,
-0.00011310377158224583,
0.16193333268165588,
0.4778042733669281,
-0.1017867773771286,
-0.16989873349666595,
-0.18000786006450653,
0.025195427238941193,
-0.1801406443119049,
0.09613592177629471,
-0.14027653634548187,
-0.322346568107605,
-0.3961176872253418,
0.04933881759643555,
-0.24452823400497437,
0.329238623380661,
0.26509496569633484,
0.2196100950241089,
0.257509708404541,
0.3431672751903534,
0.0343855656683445,
-0.19168086349964142,
0.06726086139678955,
-0.0002913922071456909,
0.30916041135787964,
0.24335025250911713,
0.3898645341396332,
0.1584322154521942,
0.18253162503242493,
-0.07790639251470566,
0.31813856959342957,
0.2112145721912384,
0.05992845445871353,
0.3858765959739685,
-0.496321439743042,
0.35824716091156006,
0.36136046051979065,
0.6571468114852905,
0.2413138747215271,
-0.21570497751235962,
0.13456395268440247,
-0.313398152589798,
0.017085693776607513,
0.1399521827697754,
0.13704624772071838,
0.08209148049354553,
-0.09156139940023422,
-0.2729501724243164,
-0.15332722663879395,
-0.31969016790390015,
0.32892951369285583,
-0.4251933991909027,
0.019545290619134903,
-0.3746054172515869,
0.25841039419174194,
0.1076284870505333,
-0.20457200706005096,
0.3043549656867981,
-0.07069134712219238,
0.14622822403907776,
0.29441550374031067,
0.02539713680744171,
0.12143805623054504,
-0.08434067666530609,
-0.1885806769132614,
0.0007270947098731995,
-0.3996572196483612,
-0.23787736892700195,
0.09064586460590363,
-0.4589375853538513,
0.14116722345352173,
0.2650577425956726,
-0.11124780029058456,
0.020007221028208733,
0.25293204188346863,
0.1047956719994545,
0.2760002315044403,
-0.11829355359077454,
-0.16924549639225006,
-0.4253137707710266,
-0.16073077917099,
0.12627144157886505,
-0.09618084132671356,
0.2558920383453369,
-0.26628991961479187,
-0.2337382435798645,
-0.03438359871506691,
0.12313146889209747,
0.17157429456710815,
0.25243431329727173,
0.392280250787735,
-0.13839364051818848,
0.33541610836982727,
0.04575350880622864,
0.12438112497329712,
-0.09805930405855179,
-0.24011290073394775,
-0.22751739621162415,
-0.044538550078868866,
0.14351536333560944,
-0.33524057269096375,
0.20736046135425568,
-0.27885138988494873,
0.26403266191482544,
0.1631668657064438,
-0.039530619978904724,
-0.08126532286405563,
-0.05264110118150711,
-0.1522434949874878,
0.2045256644487381,
0.13727614283561707,
-0.0383736751973629,
-0.08830110728740692,
0.3115991950035095,
-0.3265964686870575,
-0.02682671695947647,
0.33555999398231506,
-0.3050233721733093,
-0.007255591452121735,
-0.48450759053230286,
0.1295349895954132,
-0.1336764395236969,
0.014472339302301407,
-0.17782363295555115,
0.38776156306266785,
-0.005738861858844757,
-0.10081346333026886,
-0.21639388799667358,
-0.2807580828666687,
-0.32313376665115356,
-0.13734912872314453,
0.3988582491874695,
0.09126926213502884,
-0.4792715907096863,
0.02539987862110138,
-0.10063343495130539,
-0.18419718742370605,
0.14959226548671722,
-0.02904757857322693,
-0.06721498817205429,
-0.02694859728217125,
-0.2131369560956955,
-0.17995961010456085,
0.4192426800727844,
-0.2196829915046692,
-0.10619299858808517,
0.06468825042247772,
0.34079253673553467,
-0.08820287138223648,
-0.22953814268112183,
0.2346286177635193,
0.15454372763633728,
0.01655621826648712,
-0.10748633742332458,
0.5183045864105225,
-0.2387860119342804,
0.12402469664812088,
0.08014319092035294,
-0.1559138149023056,
0.2937871515750885,
0.3947286605834961,
0.04717550799250603,
0.1908370852470398,
-0.029807593673467636,
-0.010204050689935684,
-0.08000506460666656,
-0.16458764672279358,
-0.11418508738279343,
0.05786646530032158,
0.20347993075847626,
0.19830960035324097,
0.08250979334115982,
-0.27840423583984375,
-0.470546692609787,
0.24879638850688934,
0.022978223860263824,
-0.009156936779618263,
-0.019207779318094254,
0.18081678450107574,
-0.24630366265773773,
-0.013517193496227264,
-0.41367363929748535,
0.099887914955616,
0.13808032870292664,
-0.010948557406663895,
0.044152334332466125,
-0.011608749628067017,
-0.08009794354438782,
-0.21245922148227692,
0.048301681876182556,
0.113457590341568,
0.06646941602230072,
0.4254434108734131,
0.1367720514535904,
-0.14581675827503204,
0.1734347939491272,
0.10287646949291229,
0.14323106408119202,
-0.13855300843715668,
-0.28900018334388733,
0.3613935112953186,
0.20460107922554016,
0.0018476471304893494,
-0.18022799491882324,
0.184754878282547,
0.3386858105659485,
-0.210056871175766,
0.26252275705337524,
0.3238831162452698,
0.19181323051452637,
0.059110596776008606,
-0.2532236576080322,
0.48841604590415955,
-0.0669202208518982,
0.12160246074199677,
0.06813614070415497,
0.011106438934803009,
0.301106333732605,
0.1998499631881714,
0.12714973092079163,
-0.19907283782958984,
-0.18161827325820923,
-0.03841708227992058,
0.2804296016693115,
0.029069876298308372,
-0.2692819833755493,
-0.073100745677948,
0.14490491151809692,
-0.013366926461458206,
-0.1022445484995842,
0.028842013329267502,
-0.39262181520462036,
-0.09610754996538162,
0.23821385204792023,
-0.2858295440673828,
0.18787044286727905,
0.010075252503156662,
-0.09598373621702194,
-0.11128901690244675,
0.053862959146499634,
0.11246561259031296,
0.17026709020137787,
-0.09966221451759338,
0.19273272156715393,
0.019732868298888206,
0.11054131388664246,
-0.08136115968227386,
-0.39153817296028137,
0.20391394197940826,
-0.16651761531829834,
0.1717708855867386,
-0.17782148718833923,
-0.04211044684052467,
-0.3063647747039795,
-0.4339057207107544,
0.02266404777765274,
0.22982028126716614,
-0.23779098689556122,
0.003277227282524109,
-0.0876258835196495,
0.18852461874485016,
0.23584789037704468,
0.12928998470306396,
0.12336746603250504,
0.15458600223064423,
0.32766592502593994,
-0.014400492422282696,
0.11905644834041595,
0.13498146831989288,
-0.322595477104187,
0.06329768151044846,
0.1680479645729065,
0.17372700572013855,
0.4347572922706604,
-0.11815938353538513,
0.13642838597297668,
-0.38015690445899963,
-0.6309899687767029,
0.07226735353469849,
0.01003219187259674,
0.5697416663169861,
0.09530912339687347,
0.3388359844684601,
0.04291291534900665,
0.36754870414733887,
0.4432695209980011,
-0.02345491573214531,
-0.038872912526130676,
0.1272217482328415,
-0.1729310154914856,
-0.14674144983291626,
-0.0006332471966743469,
-0.059451062232255936,
-0.30821242928504944,
-0.1894795000553131,
-0.1450943946838379,
0.35368895530700684,
0.17411834001541138,
-0.02590552344918251,
0.36595189571380615,
-0.11030160635709763,
0.15168380737304688,
0.22683371603488922,
-0.3029322028160095,
-0.19828489422798157,
0.26608651876449585,
-0.21521949768066406,
-0.341166615486145,
0.10210120677947998,
0.17203933000564575,
0.019178394228219986,
-0.13519227504730225,
-0.24840623140335083,
-0.4008576273918152,
-0.29814743995666504,
0.31211137771606445,
-0.03712286427617073,
0.15234872698783875,
-0.057264503091573715,
0.059371668845415115,
0.053225595504045486,
-0.1895107626914978,
0.020014293491840363,
-0.06853695213794708,
0.04544082283973694,
-0.013806205242872238,
0.37579113245010376,
0.3468296229839325,
-0.3462577164173126,
0.1573844701051712,
0.21432921290397644,
-0.4648042917251587,
0.39729899168014526,
-0.3018113374710083,
0.438200443983078,
-0.35118207335472107,
-0.2910653352737427,
0.07456311583518982,
0.3892446458339691,
-0.028056077659130096,
0.2329481542110443,
0.17699843645095825,
0.06965533643960953,
-0.2431037724018097,
0.27328187227249146,
-0.12788669764995575,
0.023639678955078125,
0.027943188324570656,
0.035245154052972794,
0.052872221916913986,
-0.24262914061546326,
-0.07593923807144165,
-0.15139654278755188,
-0.1629522144794464,
-0.165048748254776,
0.34968650341033936,
0.17990723252296448,
0.16516152024269104,
-0.055931270122528076,
-0.0362967848777771,
-0.17824730277061462,
0.22280441224575043,
-0.05705235153436661,
0.33318573236465454,
-0.11148687452077866,
0.21441657841205597,
0.1825493574142456,
0.16780972480773926,
0.2134564220905304,
-0.05685052275657654,
0.27466875314712524,
-0.02569291740655899,
-0.29548388719558716,
-0.1793082058429718,
-0.15154676139354706,
-0.18186117708683014,
0.5006848573684692,
-0.20636166632175446,
0.7343871593475342,
-0.3102177381515503,
-0.2806672155857086,
0.09500440210103989,
0.2918793261051178,
-0.3329777419567108,
-0.16965214908123016,
-0.3142853379249573,
-0.08131574094295502,
-0.14530295133590698,
-0.5062207579612732,
0.11606796830892563,
0.3898281455039978,
-0.10387063026428223,
-0.19556640088558197,
-0.2906095087528229,
-0.10929230600595474,
0.03959501534700394,
0.1324150264263153,
0.2867738604545593,
-0.0984429270029068,
0.0006554499268531799,
0.2257346212863922,
0.023333925753831863,
0.06820369511842728,
0.5375944972038269,
0.18319138884544373,
-0.5097122192382812,
-0.012784815393388271,
0.018942594528198242,
-0.03163568675518036,
0.0028229951858520508,
-0.07253099232912064,
-0.24872960150241852,
0.04544900357723236,
0.1670786589384079,
-0.4664316773414612,
0.19036337733268738,
0.3383480906486511,
0.12161032110452652,
-0.1646961122751236,
-0.41159185767173767,
0.47865691781044006,
0.03472986817359924,
0.17748674750328064,
0.15346893668174744,
-0.08835545927286148,
-0.3221263885498047,
0.32283514738082886,
0.23892982304096222,
0.40175724029541016,
-0.3462631106376648,
0.054396163672208786,
0.31138426065444946,
0.37194937467575073,
0.3731527626514435,
0.10605239868164062,
-0.3288947343826294,
-0.44495081901550293,
-0.11720464378595352,
-0.08495330065488815,
0.021505877375602722,
0.13533732295036316,
-0.08535013347864151,
-0.2908911406993866,
0.2034362405538559,
-0.16592109203338623,
0.42582425475120544,
0.09030473977327347,
0.08427521586418152,
-0.10771691054105759,
-0.049123503267765045,
-0.07167062163352966,
0.20744138956069946,
-0.1906876564025879,
-0.08462588489055634,
-0.08288787305355072,
0.0216219425201416,
0.019041411578655243,
-0.030237510800361633,
-0.20877183973789215,
-0.12277883291244507,
-0.3498314321041107,
0.2559300661087036,
0.16829536855220795,
-0.12181713432073593,
-0.09136805683374405,
0.31004637479782104,
0.34482455253601074,
0.05371153727173805,
-0.3434021472930908,
0.15107038617134094,
0.14819630980491638,
-0.06694164872169495,
-0.09085483849048615,
0.05223667249083519,
0.24812325835227966,
-0.0010670647025108337,
-0.15648691356182098,
0.015462793409824371,
0.017013508826494217,
0.011174805462360382,
-0.22013548016548157,
-0.15591762959957123,
-0.040474046021699905,
-0.20933708548545837,
-0.5128771662712097,
-0.486703097820282,
0.10141661763191223,
0.10805663466453552,
0.15130522847175598,
0.1888929158449173,
-0.020675934851169586,
-0.09271066635847092,
0.5713904500007629,
-0.1938287913799286,
0.09118548035621643,
0.03293120488524437,
-0.0485328771173954,
0.0508066862821579,
0.3068896532058716,
0.2982286810874939,
-0.11880169808864594,
-0.12703648209571838,
0.23169587552547455,
0.021734114736318588,
-0.24635058641433716,
0.3065822720527649,
0.2527588903903961,
-0.1079859584569931,
-0.10915571451187134,
0.22852002084255219,
0.06256502866744995,
-0.18073026835918427,
-0.08593253791332245,
-0.3343203365802765,
-0.15239006280899048,
-0.10490167886018753,
-0.27774378657341003,
0.37208664417266846,
-0.2162376344203949,
-0.2707138955593109,
-0.08393997699022293,
-0.18703819811344147,
-0.30417007207870483,
0.17382565140724182,
-0.09140024334192276,
0.16414602100849152,
-0.13015706837177277,
0.1543901264667511,
-0.1771567016839981,
0.016334164887666702,
0.15918780863285065,
-0.21895653009414673,
-0.18341048061847687,
-0.17753277719020844,
-0.07437510788440704,
0.1508561670780182,
0.1936310976743698,
-0.42662423849105835,
-0.05484607443213463,
-0.31728488206863403,
-0.4698399603366852,
-0.10643980652093887,
0.11046455800533295,
-0.06839399039745331,
-0.09196628630161285,
0.24497562646865845,
0.027818486094474792,
0.09225565195083618,
0.15332277119159698,
0.3983096182346344,
-0.09608949720859528,
0.6010334491729736,
-0.002799157053232193,
0.1324784755706787,
0.08965525031089783,
-0.1145942285656929,
-0.008434861898422241,
0.1668335348367691,
-0.0910448282957077,
-0.17295390367507935,
0.5351617336273193,
-0.15258127450942993,
0.3913767337799072,
0.09098885953426361,
0.22545143961906433,
0.2955358028411865,
-0.25275281071662903,
0.34375670552253723,
-0.005532324314117432,
0.21345576643943787,
-0.15823328495025635,
0.030554242432117462,
0.010914389044046402,
-0.08833862096071243,
0.006601855158805847,
0.26947087049484253,
0.06121160089969635,
0.418361634016037,
-0.1092715859413147,
-0.045595183968544006,
0.3490477204322815,
-0.08968821167945862,
0.16634388267993927,
0.36635780334472656,
-0.10648274421691895,
0.09463613480329514,
0.10023736208677292,
0.14582374691963196,
-0.11685290932655334,
0.31020936369895935,
-0.25603896379470825,
0.0016024913638830185,
0.0735381618142128,
0.010425729677081108,
0.32152727246284485,
-0.17735983431339264,
0.026272248476743698,
0.2336777150630951,
-0.22220034897327423,
0.22092387080192566,
-0.14837229251861572,
0.41799551248550415,
-0.37961187958717346,
-0.17723292112350464,
-0.45762473344802856,
-0.005790334660559893,
-0.13560956716537476,
-0.21622006595134735,
-0.40657371282577515,
-0.13881690800189972,
-0.5726748108863831,
0.28520578145980835,
-0.25938698649406433,
-0.20254665613174438,
-0.1937982738018036,
0.1946646273136139,
-0.16804274916648865,
-0.3956059515476227,
-0.1311107873916626,
0.19650830328464508,
-0.196356862783432,
0.06637555360794067,
0.3306466042995453,
0.34113654494285583,
0.0946807712316513,
0.5140661597251892,
0.37187886238098145,
0.24298593401908875,
0.3584511876106262,
-0.2637878358364105,
-0.10743049532175064,
-0.035678088665008545,
-0.3209148645401001,
-0.10830400139093399,
0.04408895969390869,
-0.13642561435699463,
0.11914506554603577,
0.11816229671239853,
0.1771131008863449,
-0.05291152745485306,
0.02925054170191288,
-0.2169235646724701,
-0.04404500499367714,
-0.2412252426147461,
0.13848116993904114,
-0.12430870532989502,
0.04571594297885895,
-0.05165763571858406,
-0.29327988624572754,
-0.48505324125289917,
-0.20033733546733856,
0.44269371032714844,
-0.05549788475036621,
0.18285854160785675,
0.0717991441488266,
0.03850115090608597,
-0.2603256404399872,
0.39729925990104675,
0.2873806059360504,
0.23545631766319275,
-0.06434187293052673,
-0.054201871156692505,
-0.5076941847801208,
-0.0474679172039032,
0.3046637773513794,
-0.4225116968154907,
0.3922737240791321,
-0.018747154623270035,
0.07042062282562256,
0.22266626358032227,
0.32254642248153687,
-0.2677097022533417,
0.5789732336997986,
-0.035252366214990616,
-0.12222768366336823,
-0.3284592032432556,
0.0748593807220459,
0.3013487756252289,
-0.36816737055778503,
-0.41820958256721497,
0.24280937016010284,
-0.2330375611782074,
0.04594391584396362,
-0.23185354471206665,
0.14577947556972504,
-0.12210360169410706,
-0.4773039221763611,
0.3327416181564331,
0.1790640950202942,
0.2777247726917267,
-0.17918068170547485,
0.22813211381435394,
-0.08232656121253967,
-0.05139755830168724,
-0.3269968628883362,
0.106608547270298,
-0.060775574296712875,
0.47498542070388794,
-0.11082185804843903,
-0.015867039561271667,
-0.3162170350551605,
0.12943828105926514,
-0.1446094810962677,
-0.13741526007652283,
-0.31002187728881836,
0.11814317107200623,
-0.2706676423549652,
-0.08726330101490021,
0.16830703616142273,
0.03868672996759415,
-0.003709902986884117,
0.10085759311914444,
-0.07285233587026596,
-0.28235089778900146,
0.512635350227356,
-0.3284270167350769,
-0.31424441933631897,
-0.0052909888327121735,
-0.2317500114440918,
0.2693447470664978,
0.13309350609779358,
-0.42080503702163696,
0.17729730904102325,
0.26680347323417664,
-0.01888294704258442,
-0.24027971923351288,
0.3729960322380066,
0.2290540337562561,
0.06683513522148132,
-0.028072506189346313,
0.5038681030273438,
-0.02364630252122879,
-0.021559901535511017,
-0.17282763123512268,
-0.1536174863576889
] |
https://github.com/huggingface/datasets/issues/6290 | Yea I think waiting for #6269 would be best, or branching from it. For reference, this [PR](https://github.com/LAION-AI/Discord-Scrapers/pull/2) is progressing pretty well which will do similar using the hf hub for our LAION dataset bot https://github.com/LAION-AI/Discord-Scrapers/pull/2. | Incremental dataset (e.g. `.push_to_hub(..., append=True)`) | ### Feature request
Have the possibility to do `ds.push_to_hub(..., append=True)`.
### Motivation
Requested in this [comment](https://huggingface.co/datasets/laion/dalle-3-dataset/discussions/3#65252597c4edc168202a5eaa) and
this [comment](https://huggingface.co/datasets/laion/dalle-3-dataset/discussions/4#6524f675c9607bdffb208d8f). Discussed internally on [slack](https://huggingface.slack.com/archives/C02EMARJ65P/p1696950642610639?thread_ts=1690554266.830949&cid=C02EMARJ65P).
### Your contribution
What I suggest to do for parquet datasets is to use `CommitOperationCopy` + `CommitOperationDelete` from `huggingface_hub`:
1. list files
2. copy files from parquet-0001-of-0004 to parquet-0001-of-0005
3. delete files like parquet-0001-of-0004
4. generate + add last parquet file parquet-0005-of-0005
=> make a single commit with all commit operations at once
I think it should be quite straightforward to implement. Happy to review a PR (maybe conflicting with the ongoing "1 commit push_to_hub" PR https://github.com/huggingface/datasets/pull/6269) | 35 | Incremental dataset (e.g. `.push_to_hub(..., append=True)`)
### Feature request
Have the possibility to do `ds.push_to_hub(..., append=True)`.
### Motivation
Requested in this [comment](https://huggingface.co/datasets/laion/dalle-3-dataset/discussions/3#65252597c4edc168202a5eaa) and
this [comment](https://huggingface.co/datasets/laion/dalle-3-dataset/discussions/4#6524f675c9607bdffb208d8f). Discussed internally on [slack](https://huggingface.slack.com/archives/C02EMARJ65P/p1696950642610639?thread_ts=1690554266.830949&cid=C02EMARJ65P).
### Your contribution
What I suggest to do for parquet datasets is to use `CommitOperationCopy` + `CommitOperationDelete` from `huggingface_hub`:
1. list files
2. copy files from parquet-0001-of-0004 to parquet-0001-of-0005
3. delete files like parquet-0001-of-0004
4. generate + add last parquet file parquet-0005-of-0005
=> make a single commit with all commit operations at once
I think it should be quite straightforward to implement. Happy to review a PR (maybe conflicting with the ongoing "1 commit push_to_hub" PR https://github.com/huggingface/datasets/pull/6269)
Yea I think waiting for #6269 would be best, or branching from it. For reference, this [PR](https://github.com/LAION-AI/Discord-Scrapers/pull/2) is progressing pretty well which will do similar using the hf hub for our LAION dataset bot https://github.com/LAION-AI/Discord-Scrapers/pull/2. | [
-0.21518103778362274,
-0.287100225687027,
0.014854256063699722,
-0.12502942979335785,
-0.1908857822418213,
-0.23461253941059113,
-0.04710090532898903,
0.16226772964000702,
0.1339532732963562,
0.12089119851589203,
-0.12534359097480774,
0.47378888726234436,
-0.1289738416671753,
0.5491952300071716,
0.050047002732753754,
0.11659098416566849,
0.1731070578098297,
0.058896586298942566,
0.07219058275222778,
-0.21382173895835876,
-0.22502903640270233,
-0.1426679641008377,
0.15974470973014832,
-0.3145877420902252,
-0.024920901283621788,
-0.24183440208435059,
-0.5399260520935059,
0.16485950350761414,
-0.19102740287780762,
-0.20831060409545898,
0.07342075556516647,
0.42141610383987427,
0.18422986567020416,
0.1792323738336563,
-0.0001142630135291256,
-0.1313357949256897,
0.07828042656183243,
-0.0022998154163360596,
-0.35167941451072693,
-0.021392010152339935,
-0.1755611002445221,
-0.1192510798573494,
0.07147468626499176,
-0.30182045698165894,
0.12335364520549774,
0.36768460273742676,
0.12927010655403137,
-0.21267277002334595,
0.4312627613544464,
-0.008444182574748993,
0.14619240164756775,
0.2025885134935379,
0.07366730272769928,
-0.09341047704219818,
0.3998349606990814,
0.3623979091644287,
-0.11887906491756439,
0.197786346077919,
0.31300631165504456,
0.025404192507267,
-0.07986840605735779,
0.12897099554538727,
0.2858006954193115,
-0.26057863235473633,
0.3479854464530945,
-0.035640932619571686,
0.2521379590034485,
-0.24655136466026306,
0.03795662149786949,
0.04128403589129448,
0.06916815787553787,
-0.5066752433776855,
-0.617697536945343,
-0.4081571698188782,
0.27569514513015747,
-0.5193467736244202,
-0.3529748320579529,
0.3487662374973297,
-0.062055204063653946,
0.013581870123744011,
0.10042804479598999,
-0.6706462502479553,
-0.2157311737537384,
-0.12054940313100815,
0.16009165346622467,
0.03930915147066116,
-0.008382294327020645,
-0.0664287805557251,
0.04931449145078659,
-0.0910060927271843,
0.0033133327960968018,
-0.03922414779663086,
0.07767900079488754,
0.046008698642253876,
-0.30276793241500854,
-0.22676171362400055,
-0.11063252389431,
0.31343695521354675,
0.42513737082481384,
0.4064103066921234,
0.08003081381320953,
-0.00663522444665432,
-0.11109773814678192,
0.043716683983802795,
0.29654961824417114,
0.024299785494804382,
0.12300828099250793,
-0.040872931480407715,
0.014151887968182564,
0.07309120148420334,
0.1479785293340683,
0.11748190224170685,
-0.009286601096391678,
0.2867821753025055,
-0.16765400767326355,
-0.2304362952709198,
0.0471588671207428,
0.0364634245634079,
-0.28405702114105225,
0.13974714279174805,
0.22434371709823608,
-0.028692906722426414,
-0.20401787757873535,
0.34439989924430847,
-0.037376873195171356,
-0.12177348136901855,
-0.23141320049762726,
0.4181053638458252,
0.08350065350532532,
0.01555158942937851,
-0.23474782705307007,
0.29740819334983826,
0.10105471312999725,
0.050125233829021454,
0.06838172674179077,
-0.5086278915405273,
-0.08404536545276642,
0.28922638297080994,
0.12981069087982178,
0.14542123675346375,
0.05668449401855469,
-0.07282845675945282,
-0.08408427238464355,
-0.07309584319591522,
-0.02353133261203766,
-0.23494026064872742,
-0.019564364105463028,
-0.2920953333377838,
-0.2498624324798584,
-0.046816062182188034,
-0.11951647698879242,
0.0011642426252365112,
-0.30016884207725525,
0.15322795510292053,
-0.1942155510187149,
-0.23304986953735352,
-0.5407053828239441,
0.38839590549468994,
-0.1539817750453949,
0.23499161005020142,
-0.13529935479164124,
0.14302325248718262,
-0.1972929835319519,
-0.091424360871315,
0.011396676301956177,
0.5631370544433594,
-0.08472216129302979,
-0.15478742122650146,
0.014396898448467255,
0.10631637275218964,
0.09318197518587112,
0.05081142485141754,
0.06845041364431381,
-0.08207494020462036,
-0.17580604553222656,
0.16810522973537445,
0.1316855549812317,
-0.4682726562023163,
-0.017424942925572395,
0.033148277550935745,
-0.23782256245613098,
-0.014951519668102264,
0.12149831652641296,
-0.030587222427129745,
0.47999781370162964,
-0.038730915635824203,
0.09147989749908447,
-0.043215684592723846,
0.04042959213256836,
-0.1439451426267624,
-0.3701852560043335,
-0.28659600019454956,
-0.04768168553709984,
0.17129884660243988,
0.13552500307559967,
0.1471908837556839,
0.42763346433639526,
0.09883689880371094,
0.2900954484939575,
-0.21919631958007812,
0.4161815643310547,
-0.13326527178287506,
0.47498807311058044,
0.15967340767383575,
-0.16445553302764893,
-0.26438629627227783,
-0.6085696220397949,
0.01199234277009964,
0.13396921753883362,
0.009326130151748657,
0.00005998089909553528,
-0.37135159969329834,
-0.015711519867181778,
0.2547607421875,
-0.056657932698726654,
0.0841427594423294,
0.15416580438613892,
0.1261511743068695,
0.07860563695430756,
-0.17808905243873596,
-0.48495161533355713,
0.42904675006866455,
-0.2017531394958496,
0.3858402371406555,
-0.34089213609695435,
0.5997830629348755,
0.02484123967587948,
-0.2394094467163086,
0.2699196934700012,
0.23126621544361115,
0.0732351690530777,
-0.2513720691204071,
0.4049939513206482,
0.22074058651924133,
0.11267198622226715,
0.3413666784763336,
0.5384902954101562,
0.12512974441051483,
0.3385111093521118,
0.32001227140426636,
0.05232270807027817,
-0.479835569858551,
-0.17382562160491943,
-0.004952132701873779,
-0.3764808177947998,
0.41439172625541687,
0.006048554554581642,
0.1375366449356079,
0.23351360857486725,
-0.06357593834400177,
-0.05206570401787758,
0.06710430979728699,
-0.15088847279548645,
-0.27657318115234375,
0.15469883382320404,
0.24545367062091827,
0.22567123174667358,
-0.10139056295156479,
-0.4260503053665161,
0.39863529801368713,
0.20384564995765686,
-0.05425691977143288,
0.08898145705461502,
0.23776933550834656,
0.055513106286525726,
-0.045016348361968994,
0.1324094831943512,
0.18343839049339294,
0.09086733311414719,
0.2307075709104538,
0.1660614013671875,
0.09934081882238388,
0.09360609203577042,
-0.0011467188596725464,
-0.09606502950191498,
-0.04369199648499489,
0.12806670367717743,
0.3784061670303345,
0.4562458395957947,
0.015449125319719315,
-0.39206749200820923,
-0.23017583787441254,
0.03581266850233078,
0.24421468377113342,
0.057639867067337036,
-0.3621627390384674,
-0.03802761808037758,
0.13763421773910522,
-0.30888888239860535,
-0.042242005467414856,
-0.2837676703929901,
-0.30384641885757446,
0.19643646478652954,
0.1308664083480835,
-0.036534007638692856,
-0.033686313778162,
-0.06869608163833618,
0.5216338634490967,
-0.2542210817337036,
0.04447115957736969,
-0.4072740077972412,
-0.1872445046901703,
0.292599618434906,
0.06602334976196289,
0.06657564640045166,
0.0273573100566864,
0.5196309089660645,
0.0196971595287323,
0.04498615115880966,
-0.5452741384506226,
-0.34891295433044434,
0.17628593742847443,
-0.1465282440185547,
-0.06025869399309158,
0.3465046286582947,
-0.14876507222652435,
0.06147505342960358,
-0.2993243336677551,
-0.04020174220204353,
-0.12471317499876022,
-0.35238197445869446,
-0.2516774535179138,
0.03653009608387947,
0.18137826025485992,
-0.010007619857788086,
-0.0680466890335083,
-0.31520941853523254,
-0.4663393497467041,
0.8351721167564392,
0.446597158908844,
0.12311337888240814,
-0.1906525194644928,
-0.32751137018203735,
0.1086321771144867,
0.07072347402572632,
0.05915874242782593,
-0.07933914661407471,
-0.1679830551147461,
0.10690532624721527,
-0.16922372579574585,
-0.10806936770677567,
0.04391758143901825,
-0.17714473605155945,
0.07398831099271774,
0.10208459943532944,
-0.19785284996032715,
-0.661385715007782,
0.047212764620780945,
0.27697300910949707,
-0.21952036023139954,
0.09813731163740158,
0.24980728328227997,
-0.06491769850254059,
-0.031603433191776276,
-0.09460239857435226,
-0.009056247770786285,
0.27186185121536255,
0.44767987728118896,
-0.2677399814128876,
-0.017469195649027824,
0.1164923757314682,
0.2737075686454773,
0.3887745440006256,
0.2831960916519165,
-0.022753920406103134,
0.3299359083175659,
-0.10324206203222275,
0.2975291609764099,
-0.07867448031902313,
0.016973040997982025,
0.15035389363765717,
-0.22323209047317505,
-0.0903959795832634,
0.22129563987255096,
-0.0656760036945343,
-0.03040757216513157,
-0.005435831844806671,
-0.2396065890789032,
0.2053956538438797,
-0.20430251955986023,
-0.24177584052085876,
-0.16373035311698914,
0.048860326409339905,
-0.083167664706707,
-0.13540464639663696,
-0.20422020554542542,
0.08405691385269165,
0.2517699599266052,
0.16623832285404205,
0.2133699208498001,
0.035292528569698334,
-0.22877350449562073,
-0.08718441426753998,
-0.8362804055213928,
0.1943274885416031,
0.07091069966554642,
-0.004877962172031403,
0.09812987595796585,
-0.3196670413017273,
0.022863265126943588,
-0.2867296040058136,
0.6257912516593933,
-0.16662146151065826,
-0.03956623375415802,
-0.2837672829627991,
-0.2205858677625656,
-0.39990735054016113,
0.14197172224521637,
-0.2882307767868042,
0.06590910255908966,
0.25286394357681274,
0.9697200059890747,
-0.6567047238349915,
-0.18179896473884583,
0.1682521104812622,
-0.20974867045879364,
-0.01939074695110321,
0.22862328588962555,
-0.05276535823941231,
-0.2553335130214691,
-0.325005441904068,
0.2149287909269333,
0.13653913140296936,
0.17421391606330872,
0.028001852333545685,
-0.05138638988137245,
-0.17814451456069946,
0.06496609002351761,
-0.012756399810314178,
-0.22973260283470154,
-0.06705266237258911,
0.2684401869773865,
0.1081492006778717,
0.10384002327919006,
0.3679635226726532,
0.47352540493011475,
0.4055488705635071,
-0.26268547773361206,
-0.1708078533411026,
0.1180245652794838,
-0.20915712416172028,
0.20078596472740173,
0.2850092351436615,
0.4068560302257538,
0.40523451566696167,
-0.3930639624595642,
0.2603670358657837,
-0.3876325786113739,
0.03817395120859146,
0.06725712865591049,
-0.21602563560009003,
-0.22696739435195923,
-0.024524230509996414,
0.24977728724479675,
-0.04695245623588562,
-0.05438932031393051,
-0.22141949832439423,
0.463546484708786,
-0.1526031792163849,
0.317003071308136,
0.24154023826122284,
0.9805777072906494,
-0.10483269393444061,
0.25757667422294617,
0.15915779769420624,
-0.5599592924118042,
0.42753562331199646,
-0.2211529016494751,
-0.12476379424333572,
-0.36649289727211,
-0.34246277809143066,
0.0643121749162674,
0.055149145424366,
-0.0880035012960434,
-0.027333762496709824,
-0.257265567779541,
0.12531372904777527,
0.1837019920349121,
0.3670138716697693,
-0.09293736517429352,
0.38891270756721497,
-0.39621850848197937,
-0.1886076033115387,
-0.17814263701438904,
0.14853700995445251,
0.06520794332027435,
0.011510806158185005,
-0.09768769890069962,
-0.19331805408000946,
0.0637664720416069,
0.03073132038116455,
-0.10384657979011536,
0.08139625191688538,
-0.10211847722530365,
-0.015018017962574959,
-0.09903708845376968,
-0.17707373201847076,
-0.03465694934129715,
0.0643506646156311,
0.5861017107963562,
0.03270680084824562,
-0.02589733898639679,
-0.19508899748325348,
0.009363101795315742,
0.03949398547410965,
-0.023201733827590942,
-0.18752023577690125,
0.10015728324651718,
-0.05454093962907791,
0.085478276014328,
0.049762386828660965,
0.08783697336912155,
-0.2227814793586731,
-0.1346728801727295,
0.012332184240221977,
-0.0680803656578064,
0.02283342555165291,
0.34478914737701416,
0.4456741213798523,
-0.23540076613426208,
-0.23679393529891968,
0.07935618609189987,
-0.09502249211072922,
-0.25152337551116943,
0.009041422978043556,
-0.1511666625738144,
-0.07061225175857544,
-0.17970415949821472,
0.3963066339492798,
0.027067068964242935,
0.14431074261665344,
0.07127350568771362,
0.04451298713684082,
-0.2270168513059616,
-0.2877544164657593,
-0.22718137502670288,
0.15563346445560455,
-0.19783908128738403,
0.26677611470222473,
-0.24204421043395996,
0.012739911675453186,
0.14598283171653748,
0.08524933457374573,
0.05827026069164276,
-0.0752427875995636,
-0.17917749285697937,
0.020962804555892944,
-0.17717808485031128,
0.2780843675136566,
0.1591392159461975,
0.5298098921775818,
0.13291046023368835,
0.05548319220542908,
-0.11637768149375916,
0.2192569375038147,
-0.35844069719314575,
0.08495879173278809,
-0.166822612285614,
0.13227784633636475,
0.1933380514383316,
-0.25133273005485535,
0.004742834717035294,
-0.04670540615916252,
0.09250669926404953,
-0.0016389908269047737,
-0.1319069266319275,
-0.15390446782112122,
-0.021620523184537888,
0.06457529217004776,
0.0878264382481575,
0.49674439430236816,
-0.08528199791908264,
0.15329548716545105,
-0.0641876682639122,
-0.16592976450920105,
0.4052618145942688,
0.11458773910999298,
-0.12821558117866516,
-0.03558832034468651,
0.8602405190467834,
0.1042727380990982,
0.10198473930358887,
0.07556906342506409,
0.5672286152839661,
0.13562485575675964,
-0.3882937729358673,
0.33288896083831787,
-0.31987032294273376,
-0.00030709803104400635,
0.3878406286239624,
0.3335645794868469,
0.4880223572254181,
0.07629498839378357,
0.09178284555673599,
-0.1092967540025711,
-0.35251957178115845,
0.08502285927534103,
0.5634265542030334,
0.15391409397125244,
0.07335218787193298,
-0.06592639535665512,
0.12898747622966766,
0.24790067970752716,
-0.2307155430316925,
-0.22281304001808167,
0.4280218482017517,
-0.3233320116996765,
0.27030307054519653,
0.4636784791946411,
0.31843551993370056,
0.07685336470603943,
-0.22135686874389648,
0.07388877868652344,
0.28789424896240234,
-0.23804813623428345,
0.06472168117761612,
0.1984407901763916,
0.10689960420131683,
-0.05065297335386276,
0.10081948339939117,
0.2446976900100708,
0.3172220289707184,
0.14567017555236816,
-0.020748931914567947,
0.40179938077926636,
0.33317843079566956,
0.06174653023481369,
0.525780200958252,
0.0058477893471717834,
-0.11236175149679184,
0.3649928867816925,
0.24158939719200134,
0.08384295552968979,
0.0417659655213356,
0.5894775986671448,
0.32128801941871643,
-0.37555840611457825,
-0.25751468539237976,
0.43823352456092834,
-0.044631365686655045,
-0.1284879744052887,
-0.039671994745731354,
-0.28342926502227783,
-0.40040814876556396,
0.14267674088478088,
-0.1242707371711731,
-0.24904827773571014,
-0.055016618221998215,
0.019725479185581207,
0.5017216205596924,
-0.1475682258605957,
0.08329388499259949,
0.10784758627414703,
0.3196745812892914,
-0.25784778594970703,
0.09182633459568024,
-0.05225403979420662,
-0.2709454298019409,
-0.2591920793056488,
0.15019817650318146,
0.035319432616233826,
-0.013698175549507141,
-0.12571598589420319,
0.18251633644104004,
0.3559015393257141,
0.08461368829011917,
-0.10593258589506149,
-0.11779239773750305,
-0.16051983833312988,
-0.029109980911016464,
0.43881726264953613,
0.1036096066236496,
-0.16480760276317596,
0.09506912529468536,
-0.014866890385746956,
-0.16057603061199188,
-0.3517666459083557,
0.16941246390342712,
0.13549834489822388,
-0.1462571620941162,
0.09950338304042816,
0.02735241688787937,
-0.313737690448761,
-0.07919885218143463,
-0.16728408634662628,
-0.3504219651222229,
0.09146846830844879,
0.024865280836820602,
0.09613695740699768,
-0.29417091608047485,
0.35610610246658325,
0.40548908710479736,
-0.3282211124897003,
-0.15971654653549194,
-0.3958040773868561,
-0.09614912420511246,
0.16760897636413574,
0.1062707006931305,
-0.11564728617668152,
0.0532071590423584,
0.23884481191635132,
0.010050896555185318,
-0.08896142244338989,
-0.23282694816589355,
-0.13490736484527588,
-0.3040560483932495,
0.3390968441963196,
-0.26179659366607666,
0.1615702509880066,
0.11753712594509125,
-0.21079698204994202,
0.26162010431289673,
-0.17923930287361145,
0.16336658596992493,
0.17641624808311462,
-0.05850045010447502,
0.14997726678848267,
0.22479480504989624,
0.09427864849567413,
-0.6095225811004639,
0.24153664708137512,
-0.08205842226743698,
-0.1098036915063858,
-0.20298846065998077,
-0.22856874763965607,
-0.11098067462444305,
-0.28015124797821045,
-0.48140910267829895,
0.09752499312162399,
-0.29345613718032837,
0.23657941818237305,
-0.05975464731454849,
-0.22445379197597504,
0.056014999747276306,
0.05990319326519966,
0.3988026976585388,
0.058647725731134415,
-0.07661588490009308,
0.21097594499588013,
-0.03764820843935013,
0.026142559945583344,
-0.021837376058101654,
0.2317584753036499,
0.06843817234039307,
0.18819427490234375,
-0.1447608917951584,
-0.29693126678466797,
0.3070460259914398,
-0.23371544480323792,
-0.2060474008321762,
-0.22578305006027222,
0.30077922344207764,
0.44087809324264526,
-0.3469746708869934,
-0.12735988199710846,
-0.015666283667087555,
0.13925926387310028,
0.0037369634956121445,
-0.2707592248916626,
0.3456036448478699,
-0.1033090204000473,
-0.3588382601737976,
-0.08701466768980026,
0.09821722656488419,
0.16463986039161682,
-0.21815037727355957,
0.06123825162649155,
-0.42700234055519104
] |
https://github.com/huggingface/datasets/issues/6288 | A duplicate of https://github.com/huggingface/datasets/issues/4796.
We could get this for free by implementing the `Image` feature as an extension type, as shown in [this](https://colab.research.google.com/drive/1Uzm_tXVpGTwbzleDConWcNjacwO1yxE4?usp=sharing) Colab (example with UUIDs).
| Dataset.from_pandas with a DataFrame of PIL.Images | Currently type inference doesn't know what to do with a Pandas Series of PIL.Image objects, though it would be nice to get a Dataset with the Image type this way | 27 | Dataset.from_pandas with a DataFrame of PIL.Images
Currently type inference doesn't know what to do with a Pandas Series of PIL.Image objects, though it would be nice to get a Dataset with the Image type this way
A duplicate of https://github.com/huggingface/datasets/issues/4796.
We could get this for free by implementing the `Image` feature as an extension type, as shown in [this](https://colab.research.google.com/drive/1Uzm_tXVpGTwbzleDConWcNjacwO1yxE4?usp=sharing) Colab (example with UUIDs).
| [
-0.4201357960700989,
-0.12456895411014557,
-0.008255213499069214,
0.2601349353790283,
0.024284623563289642,
0.0293055921792984,
0.4310656785964966,
0.14413632452487946,
0.0204058438539505,
0.05679609626531601,
-0.16976922750473022,
0.28375980257987976,
-0.09335245192050934,
0.35780295729637146,
0.17620757222175598,
-0.4538641571998596,
0.11961670964956284,
0.006854187697172165,
-0.28452184796333313,
-0.11028328537940979,
-0.41039925813674927,
0.1380932480096817,
-0.09357909113168716,
0.14169800281524658,
-0.28991493582725525,
-0.45190224051475525,
-0.2708073556423187,
-0.05375583469867706,
-0.2488088309764862,
-0.1766696274280548,
0.19220128655433655,
0.060076870024204254,
0.4214746654033661,
0.12731871008872986,
-0.0001067579141817987,
-0.23394760489463806,
0.21939249336719513,
-0.04643084853887558,
0.23909728229045868,
-0.12243746966123581,
-0.26944077014923096,
0.05762176960706711,
0.25114935636520386,
-0.2665754556655884,
-0.12753747403621674,
-0.26783570647239685,
0.375007688999176,
0.1756666600704193,
0.13151225447654724,
0.14646649360656738,
0.21827489137649536,
0.09132036566734314,
0.024516455829143524,
-0.17710566520690918,
-0.20909714698791504,
0.40698346495628357,
0.0748642161488533,
-0.05522076040506363,
0.0811675637960434,
-0.004494126886129379,
0.2133747935295105,
0.2961258292198181,
0.032431840896606445,
0.013728074729442596,
0.11056649684906006,
0.13447953760623932,
-0.09685740619897842,
-0.34991830587387085,
-0.05865223705768585,
0.3561111390590668,
0.12494782358407974,
0.02480061538517475,
-0.24039101600646973,
-0.24040566384792328,
0.08755306899547577,
0.14736926555633545,
0.05829326808452606,
0.02673671767115593,
-0.26698532700538635,
0.04318707436323166,
0.14000749588012695,
-0.024730989709496498,
-0.1889602392911911,
0.15065822005271912,
-0.3853394389152527,
-0.10690711438655853,
-0.030527617782354355,
0.11401739716529846,
0.10460814833641052,
-0.003789100330322981,
0.04617572948336601,
-0.041673384606838226,
0.10459831357002258,
0.10097996145486832,
-0.018212325870990753,
-0.14972470700740814,
0.0916190817952156,
0.20899096131324768,
0.14326071739196777,
-0.25402167439460754,
-0.21746468544006348,
-0.0669112429022789,
-0.41042983531951904,
0.26193246245384216,
0.5066686272621155,
-0.19754274189472198,
-0.27602797746658325,
0.13507013022899628,
0.2286587357521057,
0.2055119425058365,
-0.04192696139216423,
-0.09082257002592087,
-0.28194519877433777,
0.028818432241678238,
-0.03441409766674042,
-0.1898866593837738,
0.18633675575256348,
-0.08295479416847229,
-0.21784162521362305,
-0.21655981242656708,
-0.09587074816226959,
0.26098522543907166,
0.18036721646785736,
0.18130958080291748,
-0.09374688565731049,
0.4880848228931427,
0.42079541087150574,
0.15542057156562805,
0.05088312178850174,
-0.03411872684955597,
-0.1558646261692047,
0.14903731644153595,
-0.1478952020406723,
-0.19112035632133484,
-0.16242051124572754,
0.30337822437286377,
-0.044862136244773865,
-0.12992581725120544,
0.04358392208814621,
0.39787423610687256,
0.08914884924888611,
-0.21468667685985565,
0.17632900178432465,
0.06797398626804352,
-0.17800834774971008,
-0.31061527132987976,
0.09820079803466797,
-0.13638180494308472,
-0.3476848006248474,
0.008124384097754955,
-0.11233796179294586,
0.014255598187446594,
-0.35092100501060486,
0.2070212960243225,
-0.4336005747318268,
-0.1604142189025879,
-0.776835024356842,
0.5151118636131287,
-0.140678271651268,
0.1790103316307068,
0.08368474245071411,
-0.2508682608604431,
-0.052848897874355316,
-0.0399550125002861,
0.09428182244300842,
0.0702221468091011,
-0.28357547521591187,
-0.1187262237071991,
-0.35646724700927734,
-0.35458269715309143,
0.0402594618499279,
0.09036768972873688,
0.0394069068133831,
0.05481334030628204,
-0.19976505637168884,
0.17929166555404663,
-0.023605607450008392,
-0.0002851337194442749,
0.08529175817966461,
-0.09320715069770813,
0.17404413223266602,
0.05992797762155533,
0.06236749887466431,
0.3180931806564331,
0.018891558051109314,
0.033110808581113815,
-0.038259077817201614,
0.6344765424728394,
-0.29378119111061096,
0.024448059499263763,
0.0401039645075798,
-0.3032403588294983,
-0.2571372389793396,
0.1579238921403885,
0.30400550365448,
0.23681586980819702,
0.06777795404195786,
0.018141213804483414,
-0.012104276567697525,
-0.14872078597545624,
-0.09312473982572556,
-0.31326285004615784,
0.7365121245384216,
-0.056635353714227676,
0.06758704781532288,
-0.41040340065956116,
-0.06854735314846039,
0.06089068949222565,
-0.0801616832613945,
0.28712934255599976,
-0.40828484296798706,
-0.3150360584259033,
0.08600256592035294,
0.0770162045955658,
0.1444399207830429,
0.018164094537496567,
0.1843702346086502,
0.07699885964393616,
-0.10767831653356552,
0.04022304713726044,
-0.095187708735466,
0.14069288969039917,
-0.03245022892951965,
-0.03404507786035538,
-0.10210179537534714,
0.13799715042114258,
0.05398844927549362,
0.09472865611314774,
-0.03254886344075203,
-0.00014488957822322845,
-0.3445367217063904,
-0.036617837846279144,
0.12585517764091492,
0.059082478284835815,
0.19938617944717407,
0.26655519008636475,
0.1722603142261505,
0.12963388860225677,
0.022041289135813713,
-0.39291247725486755,
-0.2939299941062927,
-0.18840299546718597,
0.11381082236766815,
0.24704265594482422,
-0.061103809624910355,
0.3809242248535156,
-0.0557289756834507,
-0.02074786275625229,
-0.14651796221733093,
0.2536196708679199,
0.25682052969932556,
0.16602632403373718,
-0.012264374643564224,
-0.10904410481452942,
-0.274713933467865,
0.3501136004924774,
-0.162560373544693,
0.11652123183012009,
-0.5655738711357117,
-0.10210756957530975,
0.12012353539466858,
-0.009390898048877716,
0.3121100664138794,
-0.02556733787059784,
0.0011098552495241165,
0.20229566097259521,
0.4361768364906311,
0.27550917863845825,
0.2235502302646637,
0.19286829233169556,
0.003838801756501198,
-0.04255840927362442,
-0.25181707739830017,
0.04326989874243736,
0.20412340760231018,
0.157954603433609,
0.05606677383184433,
-0.4390513598918915,
0.07090914249420166,
0.13189482688903809,
-0.4874251186847687,
-0.14979983866214752,
-0.18221727013587952,
0.1400175541639328,
-0.0346960574388504,
0.018355347216129303,
-0.22403976321220398,
-0.5321938991546631,
0.06510783731937408,
0.3171740472316742,
-0.10225200653076172,
-0.15880894660949707,
0.006790243089199066,
0.12211433053016663,
-0.08387897163629532,
0.06792782247066498,
-0.3009336292743683,
0.4311066269874573,
0.1557977795600891,
-0.32963335514068604,
-0.35111203789711,
-0.09876029938459396,
-0.11684686690568924,
0.2606391906738281,
0.15972796082496643,
0.08256778120994568,
0.40546587109565735,
-0.1893828809261322,
0.05181574821472168,
-0.23106735944747925,
-0.6174407005310059,
0.1860070675611496,
-0.1664869338274002,
0.44759002327919006,
0.565129816532135,
0.1279357671737671,
-0.21386441588401794,
-0.0998699814081192,
0.1133825033903122,
-0.2620398700237274,
-0.2678413391113281,
-0.2308451533317566,
-0.2776699364185333,
0.08612752705812454,
-0.042653895914554596,
0.07529716193675995,
-0.15803596377372742,
-0.23163846135139465,
0.37040960788726807,
0.1917259246110916,
-0.08227984607219696,
0.20927640795707703,
0.21314704418182373,
0.16403715312480927,
0.16589806973934174,
-0.011068593710660934,
-0.16832083463668823,
-0.09624959528446198,
0.16678225994110107,
0.13341133296489716,
-0.2265416383743286,
-0.13000279664993286,
-0.48181912302970886,
0.161544531583786,
0.18791745603084564,
-0.3068094551563263,
-0.910801351070404,
-0.12385250627994537,
0.3963070511817932,
0.3362182378768921,
0.0060310084372758865,
-0.12334422767162323,
0.12265944480895996,
-0.08339842408895493,
-0.1652509868144989,
0.015576504170894623,
0.18058611452579498,
-0.05400284379720688,
0.22580361366271973,
0.17625117301940918,
0.06358517706394196,
0.24938255548477173,
0.11672396957874298,
-0.2586721181869507,
-0.3800506591796875,
0.4792174994945526,
-0.1101079061627388,
0.3243953287601471,
-0.03250458464026451,
-0.1688830554485321,
0.10316000878810883,
0.03267184644937515,
-0.030764568597078323,
-0.0774398148059845,
-0.042547523975372314,
-0.30978262424468994,
-0.1738949418067932,
0.29341286420822144,
-0.377239853143692,
-0.21310631930828094,
0.11367776989936829,
-0.003464045003056526,
-0.019982725381851196,
-0.06658421456813812,
-0.19424541294574738,
-0.2585173547267914,
0.00212164968252182,
0.05881284549832344,
0.23458626866340637,
0.14418144524097443,
0.008120100945234299,
-0.17311397194862366,
-0.2278822809457779,
-0.2604958117008209,
0.44685277342796326,
0.17321741580963135,
-0.01133551262319088,
-0.004514381289482117,
-0.03429145738482475,
0.041686855256557465,
0.03806357830762863,
0.7559911608695984,
-0.04472890496253967,
-0.34309762716293335,
-0.06646459549665451,
-0.4564378261566162,
-0.16444042325019836,
0.3581942021846771,
-0.3599609136581421,
-0.27568402886390686,
-0.2008751481771469,
0.2877575755119324,
-0.29580873250961304,
-0.02879306860268116,
0.21816188097000122,
0.00472615659236908,
0.052438169717788696,
-0.038036592304706573,
0.03192634880542755,
-0.2755535840988159,
-0.07330142706632614,
0.16038033366203308,
0.3482336401939392,
0.20529191195964813,
0.07373770326375961,
-0.0001098141074180603,
-0.528602123260498,
0.08011525869369507,
0.26795685291290283,
0.30285343527793884,
0.07437589764595032,
0.009879328310489655,
-0.018658742308616638,
-0.10194919258356094,
0.12092176824808121,
0.5745509266853333,
0.2245652973651886,
-0.24257859587669373,
-0.4952452480792999,
0.08386892080307007,
0.36476948857307434,
0.13906553387641907,
0.07550117373466492,
-0.1652238965034485,
-0.0027843154966831207,
0.07151319086551666,
-0.13032811880111694,
0.04722894728183746,
0.5446634888648987,
0.4082876443862915,
0.2582069933414459,
-0.01554609090089798,
-0.4396425485610962,
0.3730972409248352,
0.28185856342315674,
-0.15508972108364105,
0.1625727266073227,
0.1489560455083847,
-0.3497539162635803,
0.2644948661327362,
0.4960460066795349,
0.6581739783287048,
-0.2739148736000061,
0.11036530137062073,
0.3202582895755768,
0.19682577252388,
0.810160756111145,
0.3487814962863922,
0.003461720421910286,
-0.07386596500873566,
-0.2247353196144104,
-0.09044705331325531,
-0.006776578724384308,
0.013356049545109272,
0.16935035586357117,
-0.16292792558670044,
-0.16287024319171906,
0.08334606885910034,
-0.11631891131401062,
0.14900174736976624,
0.11661305278539658,
-0.38235610723495483,
-0.1403569132089615,
-0.630424976348877,
0.18097366392612457,
0.08909207582473755,
-0.11188408732414246,
-0.11415497958660126,
-0.09383991360664368,
-0.02803798019886017,
-0.0001545548439025879,
-0.21752390265464783,
0.08515618741512299,
-0.27578628063201904,
0.09873614460229874,
0.18162082135677338,
-0.08624332398176193,
-0.09733685106039047,
0.4315987825393677,
0.27005311846733093,
-0.11019785702228546,
-0.13980218768119812,
0.3345716893672943,
0.09404104202985764,
-0.0916123166680336,
0.028311531990766525,
-0.2592988610267639,
0.5981626510620117,
0.10024331510066986,
-0.004980027675628662,
-0.14815208315849304,
0.19226393103599548,
-0.22843390703201294,
0.05120323598384857,
0.15162470936775208,
0.29576754570007324,
0.17285923659801483,
-0.19433021545410156,
-0.18446843326091766,
0.005121089518070221,
-0.0356774777173996,
0.15645720064640045,
0.40977662801742554,
-0.005000032484531403,
0.2368353307247162,
0.15400093793869019,
-0.18600159883499146,
-0.04190734401345253,
0.03496478125452995,
0.06403793394565582,
0.13583239912986755,
0.11410484462976456,
0.05139473080635071,
-0.024700090289115906,
-0.2044127881526947,
0.21076922118663788,
0.2527504563331604,
-0.31074967980384827,
0.315582811832428,
0.21067370474338531,
-0.4729166626930237,
-0.34359416365623474,
0.33365753293037415,
0.19191864132881165,
-0.23316678404808044,
-0.08281011879444122,
-0.2917712330818176,
-0.33542418479919434,
0.5911595225334167,
-0.34528258442878723,
0.39646390080451965,
0.21537314355373383,
0.3666888177394867,
-0.14703547954559326,
-0.22784219682216644,
-0.33565497398376465,
0.15451830625534058,
-0.28705447912216187,
0.18744437396526337,
0.06874474883079529,
0.09663039445877075,
0.3484482169151306,
-0.08368732780218124,
0.17141848802566528,
0.09597820043563843,
-0.11917805671691895,
-0.1625850349664688,
-0.22663839161396027,
0.08560004085302353,
0.06580569595098495,
-0.06670361757278442,
0.3021467626094818,
-0.012164581567049026,
-0.2926477789878845,
-0.06403094530105591,
-0.000009275972843170166,
0.1361638903617859,
-0.20574209094047546,
0.10117656737565994,
0.17251965403556824,
-0.14042721688747406,
-0.09520024061203003,
0.17979523539543152,
-0.07699660956859589,
0.021276814863085747,
0.11718769371509552,
0.21695128083229065,
-0.2452426552772522,
-0.05483563244342804,
0.25767579674720764,
0.22923696041107178,
0.045479752123355865,
-0.015496655367314816,
0.23396939039230347,
0.37882810831069946,
-0.2107401043176651,
-0.034669432789087296,
0.4031667113304138,
-0.11834139376878738,
0.20855741202831268,
0.12743894755840302,
0.19986630976200104,
0.22553369402885437,
-0.3646332323551178,
0.36180219054222107,
0.012628644704818726,
-0.034627486020326614,
0.3637796640396118,
0.4112117886543274,
-0.03466913104057312,
0.506004810333252,
-0.011564869433641434,
-0.22578999400138855,
0.29251983761787415,
0.07930098474025726,
0.27510544657707214,
0.38842320442199707,
-0.27427685260772705,
0.24040015041828156,
0.2861561179161072,
0.4034523665904999,
0.2555573582649231,
0.0878988578915596,
-0.11632150411605835,
0.03346402198076248,
-0.36885255575180054,
0.027466751635074615,
0.7011369466781616,
-0.2462841123342514,
0.3234981298446655,
0.1619848906993866,
0.03542818874120712,
0.3012234568595886,
0.059185583144426346,
0.5569716691970825,
-0.38778266310691833,
-0.11771745979785919,
-0.14619170129299164,
0.25025609135627747,
-0.01675928384065628,
-0.08265222609043121,
-0.40166789293289185,
-0.09816690534353256,
-0.2288873791694641,
-0.16426777839660645,
0.11260440945625305,
-0.320832759141922,
0.18624666333198547,
-0.005497198551893234,
0.08162194490432739,
-0.2146802544593811,
-0.13006560504436493,
0.13729383051395416,
0.2072812020778656,
-0.04656117036938667,
0.18014171719551086,
-0.07155465334653854,
-0.08817361295223236,
0.4011458158493042,
0.7001861333847046,
0.11837071180343628,
0.0940866470336914,
0.2395337074995041,
-0.19645661115646362,
-0.09573325514793396,
-0.1667984575033188,
-0.31848466396331787,
-0.2391357719898224,
0.17987807095050812,
0.13447336852550507,
0.3097015917301178,
0.21201260387897491,
-0.13064047694206238,
-0.15635541081428528,
-0.0704064816236496,
0.2007715255022049,
-0.36473312973976135,
0.29689279198646545,
-0.23164793848991394,
0.06015932559967041,
-0.18864455819129944,
0.04427190497517586,
-0.18493309617042542,
0.003478679805994034,
-0.13089600205421448,
-0.4990723431110382,
0.08894744515419006,
0.15184545516967773,
0.10603366792201996,
-0.08315609395503998,
0.0903276652097702,
0.4778677523136139,
0.31963562965393066,
0.05366344004869461,
0.08635257184505463,
-0.5607412457466125,
0.16427761316299438,
0.1721462607383728,
-0.1665845662355423,
-0.016503743827342987,
0.16732561588287354,
0.032617852091789246,
0.10925120115280151,
0.046173207461833954,
0.02407931536436081,
0.07601061463356018,
0.2796400189399719,
-0.306027352809906,
-0.2745375335216522,
-0.23725900053977966,
-0.032832082360982895,
0.019623927772045135,
-0.19879792630672455,
0.0871177613735199,
-0.04645008593797684,
0.1126917377114296,
-0.0938243567943573,
-0.2992870807647705,
-0.2893005907535553,
0.08278683573007584,
0.32913529872894287,
0.5089902877807617,
0.35331255197525024,
-0.21990959346294403,
0.0035001635551452637,
0.2138773798942566,
-0.3985399603843689,
-0.5544432997703552,
0.08046068251132965,
-0.14915812015533447,
0.36863458156585693,
-0.0019322969019412994,
-0.0965573787689209,
0.11369020491838455,
0.29368045926094055,
0.1199636310338974,
-0.22819958627223969,
-0.6186215877532959,
0.3492279350757599,
-0.5830203890800476,
-0.1470569670200348,
-0.034719355404376984,
0.30465182662010193,
-0.10488776117563248,
-0.2524360418319702,
-0.08848164975643158,
-0.3108404576778412,
0.3684278130531311,
-0.5662703514099121,
-0.3001723289489746,
-0.17451214790344238,
-0.20706190168857574,
-0.13140949606895447,
-0.12694157660007477,
-0.13213986158370972,
-0.15817566215991974,
0.23197509348392487,
-0.013837529346346855,
-0.09587802737951279,
-0.04210733249783516,
0.10052069276571274,
0.07445061206817627,
-0.29336825013160706,
0.1884218454360962,
-0.013234156183898449,
-0.15429288148880005,
0.07007628679275513,
-0.20903734862804413
] |
https://github.com/huggingface/datasets/issues/6288 | +1 to this
Calling this line with a df that contains a PIL image (as they are returned from load_dataset)
`ds = Dataset.from_pandas(df)`
Results in this error:
`ArrowInvalid: ('Could not convert <PIL.PngImagePlugin.PngImageFile image mode=RGB size=1024x1024 at 0x2B41F2D70> with type PngImageFile: did not recognize Python value type when inferring an Arrow data type', 'Conversion failed for column image with type object')` | Dataset.from_pandas with a DataFrame of PIL.Images | Currently type inference doesn't know what to do with a Pandas Series of PIL.Image objects, though it would be nice to get a Dataset with the Image type this way | 60 | Dataset.from_pandas with a DataFrame of PIL.Images
Currently type inference doesn't know what to do with a Pandas Series of PIL.Image objects, though it would be nice to get a Dataset with the Image type this way
+1 to this
Calling this line with a df that contains a PIL image (as they are returned from load_dataset)
`ds = Dataset.from_pandas(df)`
Results in this error:
`ArrowInvalid: ('Could not convert <PIL.PngImagePlugin.PngImageFile image mode=RGB size=1024x1024 at 0x2B41F2D70> with type PngImageFile: did not recognize Python value type when inferring an Arrow data type', 'Conversion failed for column image with type object')` | [
-0.3911357522010803,
-0.08418998122215271,
0.009003184735774994,
0.47536322474479675,
0.03803984820842743,
0.02484600991010666,
0.40055182576179504,
0.14469166100025177,
0.0236116424202919,
0.012867003679275513,
0.030200615525245667,
0.42527878284454346,
-0.02612229436635971,
0.303045392036438,
-0.1840541660785675,
-0.4468327462673187,
0.06928034871816635,
-0.021016791462898254,
-0.29782235622406006,
-0.15752071142196655,
-0.4859035611152649,
0.022328821942210197,
-0.08050192892551422,
0.2807941734790802,
-0.30788686871528625,
-0.4326457381248474,
-0.12276923656463623,
-0.06373041868209839,
-0.10600855201482773,
-0.22117726504802704,
0.19003093242645264,
-0.10345719754695892,
0.6373921036720276,
0.08642876148223877,
-0.00011750101111829281,
-0.15354637801647186,
0.4569436311721802,
-0.042275719344615936,
0.23821425437927246,
-0.09435580670833588,
-0.2873983383178711,
-0.10759194195270538,
0.26676374673843384,
-0.30125218629837036,
0.10059261322021484,
-0.5683093070983887,
0.19055117666721344,
0.08915561437606812,
0.1436108946800232,
0.2318088263273239,
0.13828852772712708,
0.005357131361961365,
0.12625464797019958,
0.08312343060970306,
-0.2026337832212448,
0.21623282134532928,
0.20044030249118805,
-0.006652455776929855,
-0.05836045369505882,
-0.05959416553378105,
0.3622921109199524,
0.25422045588493347,
0.06499163061380386,
0.11844359338283539,
0.16324111819267273,
0.13909660279750824,
0.2200602889060974,
-0.316686749458313,
-0.07844532281160355,
0.1782401204109192,
0.1894432008266449,
0.08755746483802795,
-0.33139002323150635,
-0.2459159791469574,
0.025789890438318253,
0.18154200911521912,
-0.07208579778671265,
-0.09865915030241013,
-0.30055996775627136,
0.045132093131542206,
0.2067461907863617,
-0.0686427652835846,
-0.32582247257232666,
0.180618017911911,
-0.37552547454833984,
-0.16775435209274292,
0.0026297494769096375,
0.2632933557033539,
0.02351563237607479,
-0.09519058465957642,
0.15964236855506897,
-0.04747424274682999,
0.24474433064460754,
0.10473353415727615,
-0.010992981493473053,
0.0764298141002655,
0.028203031048178673,
0.09538997709751129,
-0.23571565747261047,
-0.2461663782596588,
-0.11292272806167603,
-0.017577413469552994,
-0.29893288016319275,
0.3594491481781006,
0.6036716103553772,
-0.15552209317684174,
-0.3080558478832245,
0.38562458753585815,
0.013953430578112602,
0.0009537786245346069,
-0.06733446568250656,
-0.207727313041687,
-0.36160650849342346,
-0.317449688911438,
0.19595269858837128,
-0.2298271805047989,
0.3123098611831665,
-0.1595400869846344,
-0.16027534008026123,
-0.1679324209690094,
-0.2312871515750885,
0.22516250610351562,
0.02864016219973564,
0.26868224143981934,
0.012379266321659088,
0.841267466545105,
0.512262225151062,
0.35409730672836304,
0.07517505437135696,
0.09952747821807861,
0.005238130688667297,
0.052182625979185104,
-0.10838121920824051,
-0.2366073727607727,
-0.2522633969783783,
0.2907902002334595,
-0.1793486475944519,
-0.15074723958969116,
-0.04636544734239578,
0.19390709698200226,
0.16814067959785461,
-0.2403731495141983,
0.33321720361709595,
-0.03547554090619087,
-0.24800382554531097,
-0.15855522453784943,
0.20168469846248627,
-0.005612686276435852,
-0.2533958852291107,
0.26589998602867126,
-0.2390027642250061,
0.04057462513446808,
-0.4313364624977112,
0.13113996386528015,
-0.16759765148162842,
-0.23995216190814972,
-0.7702768445014954,
0.26452672481536865,
-0.03756077215075493,
0.004404664039611816,
0.07971469312906265,
-0.4574053883552551,
0.2710393965244293,
-0.0547073669731617,
-0.0499902218580246,
-0.05519269406795502,
-0.5464040040969849,
-0.017989657819271088,
-0.3105353116989136,
-0.2612091302871704,
0.2386755496263504,
0.16355931758880615,
-0.037716567516326904,
-0.0758209377527237,
-0.040354348719120026,
0.14269103109836578,
0.15754182636737823,
-0.1602882593870163,
0.14409181475639343,
0.11439722776412964,
0.3055592477321625,
-0.03518975153565407,
-0.013794425874948502,
0.2979732155799866,
0.06796195358037949,
0.0900321900844574,
-0.2040053904056549,
0.5405365228652954,
-0.2471889704465866,
0.10713114589452744,
-0.015095502138137817,
-0.16353431344032288,
-0.09833292663097382,
0.13786464929580688,
0.2942602336406708,
0.26753532886505127,
0.15792705118656158,
-0.04195847362279892,
0.03402979299426079,
-0.060516372323036194,
-0.04006551578640938,
-0.28999897837638855,
0.44620829820632935,
-0.04338129609823227,
0.14401179552078247,
-0.2378947138786316,
-0.007389325648546219,
-0.04299480840563774,
-0.10320527106523514,
0.045150402933359146,
-0.5145828127861023,
-0.23951739072799683,
-0.06630250066518784,
0.25970259308815,
0.08639684319496155,
0.1912161260843277,
0.1221834272146225,
0.030707059428095818,
-0.2323925793170929,
-0.16520079970359802,
-0.1944369375705719,
0.09544464200735092,
-0.15542444586753845,
-0.0013597384095191956,
-0.04204317182302475,
0.13605362176895142,
0.010687330737709999,
0.031377315521240234,
-0.1742057204246521,
-0.09120401740074158,
-0.16178040206432343,
0.08173003792762756,
-0.015851814299821854,
0.2075798362493515,
0.21633687615394592,
0.39732667803764343,
0.06527020037174225,
-0.07625237107276917,
-0.0641261637210846,
-0.5744411945343018,
-0.1483301967382431,
-0.0776110291481018,
0.237580344080925,
0.20989444851875305,
0.05112672597169876,
0.37300601601600647,
-0.15959276258945465,
0.24115461111068726,
-0.0954100489616394,
0.26628562808036804,
0.08825713396072388,
0.17941707372665405,
-0.07734878361225128,
-0.09529396891593933,
-0.4136734902858734,
0.3410133123397827,
-0.16477127373218536,
0.0738871693611145,
-0.5030012726783752,
-0.18106494843959808,
0.0403035506606102,
-0.09465920180082321,
0.13834130764007568,
0.002535521751269698,
0.018570397049188614,
0.21819564700126648,
0.6130250692367554,
0.33381253480911255,
0.15978287160396576,
0.178525909781456,
0.10417881608009338,
-0.09999998658895493,
-0.34035155177116394,
0.11185190826654434,
0.20127582550048828,
0.17585885524749756,
0.12080156058073044,
-0.26898735761642456,
0.05107163265347481,
0.1298135668039322,
-0.32732126116752625,
-0.1162358745932579,
-0.09072229266166687,
0.16864708065986633,
-0.24177296459674835,
0.21689794957637787,
-0.22839897871017456,
-0.4083268344402313,
-0.025647424161434174,
0.15923236310482025,
0.062023065984249115,
-0.18765893578529358,
-0.15326815843582153,
0.06460464000701904,
-0.03483391925692558,
-0.027867136523127556,
-0.4429602026939392,
0.24042674899101257,
0.19640854001045227,
-0.3576909005641937,
-0.3532308340072632,
-0.1143699586391449,
-0.08912146091461182,
0.1257988065481186,
0.25538116693496704,
0.13809819519519806,
0.2978561222553253,
-0.03227315470576286,
0.038745030760765076,
-0.16293203830718994,
-0.28950637578964233,
-0.0009286552667617798,
0.014012515544891357,
0.202228382229805,
0.35420963168144226,
0.21988408267498016,
-0.007760621607303619,
-0.16453367471694946,
0.05147993937134743,
-0.08998950570821762,
-0.18502748012542725,
-0.1383468061685562,
-0.3211616575717926,
0.16280947625637054,
0.05958881974220276,
-0.010043732821941376,
-0.1895013451576233,
-0.236644446849823,
0.20519384741783142,
0.38802969455718994,
-0.0627351775765419,
0.047976475208997726,
0.49844470620155334,
0.2148997187614441,
0.3064631223678589,
-0.047408755868673325,
-0.08976763486862183,
0.1828140765428543,
0.1582120954990387,
0.18500307202339172,
-0.19734343886375427,
-0.06761020421981812,
-0.43740832805633545,
0.22438499331474304,
0.27787837386131287,
-0.1350668966770172,
-0.6551010012626648,
-0.12846845388412476,
0.3377896845340729,
0.11640425026416779,
0.03767184168100357,
-0.003977436572313309,
0.24518820643424988,
-0.06494086980819702,
-0.08863578736782074,
0.26068347692489624,
0.1477748602628708,
-0.18358299136161804,
0.2734684348106384,
0.1618127077817917,
0.2633962333202362,
0.16286280751228333,
0.06547926366329193,
-0.31390857696533203,
-0.5151103138923645,
0.5116161704063416,
-0.18121305108070374,
0.3244655728340149,
0.05110684782266617,
0.011504419147968292,
-0.17367924749851227,
-0.07941100746393204,
-0.14757998287677765,
-0.3625270128250122,
-0.16341863572597504,
-0.429735004901886,
-0.1363862007856369,
0.4061107039451599,
-0.49156516790390015,
-0.1236778050661087,
0.1286163479089737,
-0.27772241830825806,
-0.05797377973794937,
-0.14233610033988953,
-0.16632021963596344,
-0.35128870606422424,
0.020980462431907654,
0.0047878697514534,
0.07129283249378204,
0.2964940667152405,
-0.03583104535937309,
-0.08750665187835693,
-0.3316934108734131,
-0.09575612097978592,
0.5383741855621338,
0.0806611031293869,
0.1629793494939804,
0.09535031020641327,
-0.05113055557012558,
0.13551154732704163,
-0.08085143566131592,
0.6459003686904907,
-0.12331840395927429,
-0.34567299485206604,
-0.023477882146835327,
-0.25401681661605835,
-0.3617124557495117,
0.2884584963321686,
-0.3270593285560608,
-0.26029860973358154,
-0.42698705196380615,
0.32516124844551086,
-0.2881737947463989,
-0.017340637743473053,
0.2400595247745514,
-0.03506607562303543,
-0.012270018458366394,
0.024692993611097336,
0.06991651654243469,
-0.16881471872329712,
-0.1912562996149063,
0.02769801951944828,
0.4174998700618744,
0.175827294588089,
-0.02696024440228939,
-0.055949337780475616,
-0.6725043058395386,
0.12821727991104126,
0.2041701376438141,
0.3388329744338989,
0.22247333824634552,
-0.06312884390354156,
-0.19091209769248962,
0.024513989686965942,
0.2618598937988281,
0.5738646984100342,
0.18527457118034363,
-0.10132864117622375,
-0.46743983030319214,
0.0072418637573719025,
0.42265892028808594,
0.15295284986495972,
0.05017896741628647,
-0.24563419818878174,
-0.13762007653713226,
0.037010207772254944,
-0.2052973508834839,
0.12431205064058304,
0.428805410861969,
0.5045437812805176,
0.1930570751428604,
0.04686960577964783,
-0.3373717665672302,
0.6339282989501953,
0.254777193069458,
-0.12914015352725983,
0.2570471167564392,
0.19070377945899963,
-0.29573380947113037,
0.4514048099517822,
0.4500494599342346,
0.6686384677886963,
-0.17409664392471313,
0.09976598620414734,
0.37966570258140564,
0.0910385474562645,
0.5948113203048706,
0.4596238434314728,
-0.2099749743938446,
-0.0828065425157547,
0.06911460310220718,
-0.1574784517288208,
0.008399948477745056,
0.02010038122534752,
0.3821982443332672,
-0.14337579905986786,
-0.231504887342453,
-0.20885701477527618,
-0.3809577524662018,
0.23818056285381317,
0.07901003956794739,
-0.3725354075431824,
-0.043151941150426865,
-0.5383026003837585,
0.13809816539287567,
0.1509745568037033,
-0.17752087116241455,
-0.17128346860408783,
-0.12439768016338348,
-0.1366451382637024,
0.02614082396030426,
-0.10795129835605621,
0.09224295616149902,
-0.22818678617477417,
0.14881747961044312,
0.0963711142539978,
-0.1013873741030693,
-0.1510940045118332,
0.49243104457855225,
0.07410164177417755,
-0.4728321433067322,
-0.13754643499851227,
0.21054041385650635,
0.08543966710567474,
-0.12792934477329254,
0.05509382486343384,
-0.22311927378177643,
0.6388224959373474,
0.1076669991016388,
-0.11601616442203522,
0.06276579946279526,
0.11467401683330536,
-0.35612770915031433,
0.23055900633335114,
0.14960895478725433,
0.17573288083076477,
0.19107311964035034,
-0.4621497690677643,
-0.2958190441131592,
-0.21547305583953857,
0.10430538654327393,
0.09531471133232117,
0.1768205463886261,
0.05227876454591751,
0.26294952630996704,
0.23837848007678986,
-0.2200174331665039,
0.12119944393634796,
0.029211077839136124,
-0.08535247296094894,
0.1558820754289627,
0.2743220031261444,
0.009802207350730896,
-0.023810703307390213,
-0.06696385145187378,
0.1883680671453476,
0.37762728333473206,
-0.39990365505218506,
0.21240170300006866,
0.25521937012672424,
-0.35475173592567444,
-0.2747567296028137,
0.21706563234329224,
0.2118142545223236,
-0.03438491374254227,
-0.2819330394268036,
-0.2585636377334595,
-0.263428270816803,
0.5602302551269531,
-0.29903101921081543,
0.41366708278656006,
-0.0626770481467247,
0.20441529154777527,
-0.21400457620620728,
-0.3558189570903778,
-0.20118887722492218,
0.1935420036315918,
-0.1568896472454071,
0.24494785070419312,
0.06702464818954468,
0.20319785177707672,
0.23362448811531067,
-0.10830065608024597,
0.08144910633563995,
0.1510884165763855,
0.11059311777353287,
-0.06446991860866547,
-0.08987874537706375,
0.15823090076446533,
0.21058142185211182,
-0.15350648760795593,
0.18498152494430542,
-0.12892751395702362,
-0.29655933380126953,
0.07080371677875519,
-0.15610378980636597,
0.20245051383972168,
-0.25782230496406555,
0.18099500238895416,
0.12504732608795166,
-0.03426895663142204,
-0.11735950410366058,
0.19071178138256073,
-0.02670496702194214,
0.19609969854354858,
-0.09085527807474136,
0.3193599581718445,
-0.1394248902797699,
-0.017226897180080414,
-0.026356447488069534,
0.21222516894340515,
-0.09164030849933624,
0.03938471898436546,
0.3301159143447876,
0.21257585287094116,
-0.08269282430410385,
-0.06538578122854233,
0.40431487560272217,
0.12846587598323822,
0.18676838278770447,
0.06072266399860382,
0.056370120495557785,
0.15545882284641266,
-0.31708139181137085,
0.41764146089553833,
-0.24043723940849304,
-0.1973070651292801,
0.16804686188697815,
0.3532344698905945,
-0.23618867993354797,
0.4787123501300812,
-0.11890022456645966,
-0.14396095275878906,
0.11598393321037292,
-0.10360470414161682,
0.18711470067501068,
0.5790956616401672,
-0.22760099172592163,
0.19186654686927795,
0.3912869095802307,
0.43170005083084106,
0.2668823003768921,
0.14562778174877167,
-0.2162233293056488,
0.019133063033223152,
-0.10781270265579224,
0.009291396476328373,
0.43967756628990173,
-0.2379755675792694,
0.2340061068534851,
0.16935481131076813,
0.0890256017446518,
0.22923383116722107,
0.13156342506408691,
0.4050551652908325,
-0.19688452780246735,
-0.1547093689441681,
-0.0645342767238617,
0.035264112055301666,
0.01460881344974041,
-0.12363547086715698,
-0.5980907678604126,
-0.08244350552558899,
-0.334911584854126,
-0.28187480568885803,
-0.033175498247146606,
-0.30164894461631775,
0.15345604717731476,
0.1510569006204605,
0.06970204412937164,
-0.24159055948257446,
-0.0847305953502655,
-0.01852356269955635,
0.2525883615016937,
-0.10169907659292221,
0.05875300616025925,
-0.12712408602237701,
-0.004068542271852493,
0.4460199177265167,
0.5104312896728516,
0.26330867409706116,
0.336112916469574,
0.09500505030155182,
-0.12320679426193237,
0.027008093893527985,
-0.18384045362472534,
-0.13227321207523346,
-0.24738459289073944,
0.22617539763450623,
0.1480495035648346,
0.20945565402507782,
0.17103826999664307,
-0.06931807845830917,
-0.09694160521030426,
-0.14531154930591583,
0.2615002691745758,
-0.4117077589035034,
0.4058507978916168,
-0.3145858645439148,
-0.006146758794784546,
-0.27789148688316345,
-0.015215333551168442,
-0.14114540815353394,
-0.17949821054935455,
-0.008812103420495987,
-0.4421011209487915,
0.10382530093193054,
0.20077189803123474,
0.05667825788259506,
-0.2270573377609253,
0.11561042070388794,
0.5379384756088257,
0.45129966735839844,
0.10534198582172394,
0.31164661049842834,
-0.6991228461265564,
0.08381593227386475,
0.2014361023902893,
-0.18346945941448212,
0.24444282054901123,
0.25531548261642456,
0.0460042878985405,
0.20040643215179443,
0.2524270713329315,
0.1816217303276062,
0.03199337422847748,
0.4695136547088623,
-0.10723087191581726,
-0.2679475247859955,
-0.1431715190410614,
0.041782885789871216,
-0.029172629117965698,
-0.41804173588752747,
0.11990208923816681,
-0.0386771485209465,
0.06114290654659271,
0.06668467819690704,
-0.35886186361312866,
-0.17181113362312317,
0.17866550385951996,
0.3589695990085602,
0.4033243954181671,
0.5174245238304138,
-0.0658496767282486,
0.08625371009111404,
0.16419512033462524,
-0.4179428219795227,
-0.552477240562439,
0.20001642405986786,
-0.26036518812179565,
0.35778820514678955,
0.05933993309736252,
-0.020089734345674515,
-0.013225559145212173,
0.05201033875346184,
-0.03168926388025284,
-0.33534231781959534,
-0.6403250694274902,
0.284381240606308,
-0.5175274610519409,
-0.19972820580005646,
-0.03545297682285309,
0.11280538141727448,
0.0016302568838000298,
-0.022596534341573715,
-0.21217204630374908,
-0.33297353982925415,
0.2784050703048706,
-0.5062391757965088,
-0.33588725328445435,
0.03408264368772507,
-0.2108195573091507,
0.010358383879065514,
-0.08842312544584274,
-0.11983941495418549,
-0.10609366744756699,
0.3021475374698639,
-0.0949283167719841,
0.02553335577249527,
-0.2660956382751465,
0.17899653315544128,
0.21084319055080414,
-0.3327668607234955,
0.27881094813346863,
-0.03190883994102478,
0.0900733470916748,
-0.14194509387016296,
-0.20448040962219238
] |
https://github.com/huggingface/datasets/issues/6287 | There is no "text" column in the `amazon_reviews_multi`, hence the `KeyError`. You can get the column names by running `dataset.column_names`. | map() not recognizing "text" | ### Describe the bug
The [map() documentation](https://huggingface.co/docs/datasets/v2.14.5/en/package_reference/main_classes#datasets.Dataset.map) reads:
`
ds = ds.map(lambda x: tokenizer(x['text'], truncation=True, padding=True), batched=True)`
I have been trying to reproduce it in my code as:
`tokenizedDataset = dataset.map(lambda x: tokenizer(x['text']), batched=True)`
But it doesn't work as it throws the error:
> KeyError: 'text'
Can you please guide me on how to fix it?
### Steps to reproduce the bug
1. `from datasets import load_dataset
dataset = load_dataset("amazon_reviews_multi")`
2. Then this code: `from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")`
3. The line I quoted above (which I have been trying)
### Expected behavior
As mentioned in the documentation, it should run without any error and map the tokenization on the whole dataset.
### Environment info
Python 3.10.2 | 20 | map() not recognizing "text"
### Describe the bug
The [map() documentation](https://huggingface.co/docs/datasets/v2.14.5/en/package_reference/main_classes#datasets.Dataset.map) reads:
`
ds = ds.map(lambda x: tokenizer(x['text'], truncation=True, padding=True), batched=True)`
I have been trying to reproduce it in my code as:
`tokenizedDataset = dataset.map(lambda x: tokenizer(x['text']), batched=True)`
But it doesn't work as it throws the error:
> KeyError: 'text'
Can you please guide me on how to fix it?
### Steps to reproduce the bug
1. `from datasets import load_dataset
dataset = load_dataset("amazon_reviews_multi")`
2. Then this code: `from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")`
3. The line I quoted above (which I have been trying)
### Expected behavior
As mentioned in the documentation, it should run without any error and map the tokenization on the whole dataset.
### Environment info
Python 3.10.2
There is no "text" column in the `amazon_reviews_multi`, hence the `KeyError`. You can get the column names by running `dataset.column_names`. | [
-0.03713560849428177,
-0.44958731532096863,
0.08712776005268097,
0.33627554774284363,
0.29069218039512634,
0.08487538248300552,
0.4233836531639099,
-0.010057666338980198,
-0.004520781338214874,
-0.0318005308508873,
-0.08329243957996368,
0.4743611216545105,
-0.07211464643478394,
0.135245680809021,
0.01411684975028038,
0.017036326229572296,
0.2434145212173462,
0.12151660025119781,
0.16579307615756989,
0.05039152503013611,
-0.28703802824020386,
0.2395963817834854,
-0.4157686233520508,
0.3717988431453705,
-0.23562733829021454,
-0.13432066142559052,
-0.13117794692516327,
-0.3516364097595215,
-0.04025476053357124,
-0.4201921820640564,
0.014270171523094177,
0.05634073168039322,
0.2779388427734375,
0.511238694190979,
-0.00013030122499912977,
-0.1826760172843933,
0.1977466344833374,
-0.0145505890250206,
0.024338699877262115,
-0.40775200724601746,
0.11290929466485977,
0.02029205858707428,
0.23622313141822815,
-0.23141279816627502,
0.035125672817230225,
-0.06930074095726013,
0.01821068488061428,
-0.15191324055194855,
0.3665226399898529,
0.06768070161342621,
0.08994808048009872,
0.26120543479919434,
0.33638113737106323,
0.2150062620639801,
0.05820406600832939,
0.2611316740512848,
-0.11031162738800049,
-0.004048485308885574,
0.39539045095443726,
-0.26939353346824646,
-0.14157062768936157,
0.3817101716995239,
-0.09455747902393341,
0.01680757850408554,
0.31293541193008423,
0.3003006875514984,
-0.07745489478111267,
-0.47563308477401733,
-0.033201754093170166,
0.02930627390742302,
0.5459914803504944,
-0.391383558511734,
-0.30251333117485046,
-0.26348716020584106,
-0.20830097794532776,
-0.027350708842277527,
0.1363222748041153,
-0.3275502026081085,
-0.09678609669208527,
-0.07795100659132004,
-0.4623749256134033,
-0.18807601928710938,
0.05626995116472244,
0.3605166971683502,
-0.17039355635643005,
0.5313963890075684,
-0.18091632425785065,
0.27571409940719604,
0.09133107960224152,
-0.3444090485572815,
-0.26699236035346985,
0.00492190383374691,
0.21569910645484924,
0.4806748628616333,
-0.22428807616233826,
-0.4189069867134094,
-0.15870995819568634,
-0.12976837158203125,
0.1359628140926361,
-0.07939201593399048,
-0.3639713525772095,
0.2859588861465454,
-0.2116255760192871,
0.14145146310329437,
0.2866078019142151,
0.37594136595726013,
0.388483464717865,
0.5486539006233215,
0.1968911737203598,
0.13575422763824463,
-0.1653658151626587,
-0.1538519710302353,
-0.10626978427171707,
0.02167019620537758,
0.23419985175132751,
-0.03774641454219818,
0.09125802665948868,
0.024261265993118286,
0.05540827661752701,
0.03910383954644203,
-0.44564440846443176,
0.04834682494401932,
0.056084442883729935,
0.3796399235725403,
0.21588069200515747,
-0.06633901596069336,
0.07420434802770615,
0.25832241773605347,
0.01807476580142975,
-0.10673332214355469,
-0.023036913946270943,
-0.1471336930990219,
-0.19682064652442932,
0.20394302904605865,
-0.07711545377969742,
0.009115971624851227,
0.27176862955093384,
-0.10399870574474335,
0.05929896607995033,
-0.172328919172287,
-0.27572670578956604,
-0.1750858575105667,
-0.01750088855624199,
-0.05451280623674393,
-0.149987131357193,
0.5281567573547363,
0.30349093675613403,
-0.22986465692520142,
-0.04018056392669678,
0.24332965910434723,
-0.3243718445301056,
0.001098737120628357,
-0.05919106304645538,
-0.03063112124800682,
-0.06165413185954094,
-0.21354347467422485,
-0.457763135433197,
0.2219366431236267,
0.4998723268508911,
-0.17925117909908295,
0.0381910465657711,
0.024164341390132904,
-0.12772144377231598,
-0.05059244483709335,
0.18752643465995789,
0.3852689266204834,
-0.1539144665002823,
-0.21063649654388428,
-0.2849222719669342,
0.15942955017089844,
0.2013341784477234,
0.27042335271835327,
-0.017864728346467018,
0.4791620373725891,
-0.11121322214603424,
0.5635282397270203,
0.1418989598751068,
-0.23578345775604248,
-0.3270675241947174,
0.179975226521492,
-0.1589326560497284,
0.014865152537822723,
-0.3477312922477722,
-0.2459551990032196,
0.19008418917655945,
0.10777470469474792,
0.28975531458854675,
-0.11672738194465637,
0.08663028478622437,
0.2127227485179901,
-0.1007862463593483,
-0.08357986807823181,
0.37631750106811523,
0.0362032875418663,
0.20888715982437134,
0.17360082268714905,
-0.12206186354160309,
0.12846821546554565,
0.11753246188163757,
0.14364978671073914,
0.26613831520080566,
0.1610560417175293,
0.32194700837135315,
0.28122010827064514,
0.09960287809371948,
-0.2548278272151947,
-0.07943002134561539,
-0.05870748311281204,
0.1744198352098465,
0.15760427713394165,
-0.5634720921516418,
-0.15623164176940918,
-0.28786134719848633,
0.07078017294406891,
-0.09777731448411942,
-0.11398769915103912,
-0.03776581585407257,
0.07462356239557266,
-0.18992659449577332,
0.1531851440668106,
-0.21689534187316895,
-0.2064552903175354,
0.06278440356254578,
0.43083032965660095,
-0.1525210589170456,
-0.11196102201938629,
-0.15357300639152527,
-0.11579645425081253,
-0.24709412455558777,
0.15118882060050964,
0.308169424533844,
-0.07127507030963898,
-0.1008061096072197,
0.4121907651424408,
-0.12463255226612091,
0.1144825890660286,
-0.3679962456226349,
0.11285620927810669,
0.3122338056564331,
-0.08540118485689163,
-0.14964549243450165,
0.25678369402885437,
0.2829507887363434,
-0.14243008196353912,
0.07789109647274017,
0.13200466334819794,
0.1871146559715271,
0.24394257366657257,
-0.2770082652568817,
0.3554258942604065,
0.06437072902917862,
0.1106249988079071,
-0.027038872241973877,
-0.3646668791770935,
-0.13544955849647522,
-0.4090154767036438,
0.19334782660007477,
-0.1523919552564621,
0.07417711615562439,
-0.041258975863456726,
0.43070027232170105,
-0.09953078627586365,
0.2623363733291626,
0.18949483335018158,
-0.48018497228622437,
0.1441725790500641,
0.0612776055932045,
-0.033618658781051636,
0.2640017867088318,
0.02085266262292862,
0.033534761518239975,
0.02585492469370365,
0.007776327431201935,
0.11787202954292297,
0.17574450373649597,
0.21836388111114502,
-0.026695197448134422,
-0.10239505767822266,
0.047629475593566895,
0.14644618332386017,
-0.10078109800815582,
-0.05080869793891907,
0.1980617642402649,
0.4270240068435669,
-0.532967746257782,
-0.021170102059841156,
-0.17452237010002136,
-0.20267008244991302,
-0.190737783908844,
-0.22572912275791168,
-0.10674448311328888,
-0.32562172412872314,
-0.05491117388010025,
0.14533333480358124,
0.05227804183959961,
0.2944315969944,
0.3375712037086487,
0.08084069192409515,
0.06316394358873367,
-0.13259948790073395,
-0.19632047414779663,
-0.20505748689174652,
-0.2618679106235504,
-0.09860284626483917,
0.07703931629657745,
-0.21876592934131622,
-0.038666047155857086,
-0.10917188227176666,
0.09027578681707382,
-0.2586333453655243,
-0.5632899403572083,
0.124152772128582,
-0.3979980945587158,
0.15735147893428802,
0.07730056345462799,
0.09909077733755112,
-0.4222843050956726,
-0.2581586241722107,
0.29333484172821045,
-0.2672055661678314,
-0.3531818389892578,
0.05639033019542694,
0.16073811054229736,
-0.24944713711738586,
0.05207410454750061,
-0.2638431787490845,
0.05405446141958237,
-0.008294709026813507,
0.36269813776016235,
-0.22303205728530884,
0.0320625826716423,
0.01880006492137909,
-0.2225291132926941,
0.18776991963386536,
-0.27121487259864807,
-0.11054681241512299,
-0.14041079580783844,
-0.052860863506793976,
0.4526510238647461,
-0.10967583954334259,
-0.057423122227191925,
-0.08674798905849457,
0.15562745928764343,
-0.10375091433525085,
-0.08918067812919617,
-0.17044392228126526,
-0.08213823288679123,
-0.23492920398712158,
-0.08696220815181732,
0.12250768393278122,
0.20977464318275452,
0.4227087199687958,
0.17953179776668549,
0.1670287549495697,
0.027995266020298004,
-0.30495935678482056,
0.1569291353225708,
0.09298483282327652,
0.32208162546157837,
0.08933955430984497,
0.40820297598838806,
0.059101685881614685,
0.6008356809616089,
0.22533275187015533,
-0.05619557946920395,
0.3013608157634735,
-0.2200593203306198,
0.06853963434696198,
-0.18949738144874573,
-0.4640238881111145,
-0.2168516218662262,
-0.27051401138305664,
0.1891229748725891,
0.2701781988143921,
-0.11343815922737122,
-0.13568906486034393,
0.08503681421279907,
-0.14224573969841003,
-0.5891356468200684,
-0.2823355793952942,
-0.013961179181933403,
-0.3676399290561676,
0.10913576185703278,
0.013662964105606079,
0.13875845074653625,
-0.13663998246192932,
-0.2390257567167282,
-0.0491500198841095,
0.08772397041320801,
0.17280572652816772,
-0.08534720540046692,
-0.6041381359100342,
-0.10156339406967163,
-0.3573012351989746,
0.3699027895927429,
-0.026844264939427376,
0.5058983564376831,
-0.14989061653614044,
-0.015353158116340637,
0.1546633094549179,
0.17652542889118195,
0.6075463891029358,
-0.2286621481180191,
-0.1290479302406311,
-0.13443106412887573,
-0.1905493587255478,
-0.3313712775707245,
0.11004272103309631,
-0.17670178413391113,
0.3401663601398468,
0.12006913125514984,
0.9002410769462585,
-0.35289257764816284,
0.0493084155023098,
-0.11873019486665726,
0.0031075142323970795,
-0.04336925595998764,
-0.03699200972914696,
-0.014849059283733368,
0.02056559920310974,
-0.4326203763484955,
0.08600267767906189,
0.3654029965400696,
0.2763561010360718,
0.3554244637489319,
0.0681411474943161,
0.13558277487754822,
-0.12477618455886841,
0.09701046347618103,
0.10779206454753876,
0.25799766182899475,
-0.09803107380867004,
0.12117361277341843,
0.4803600609302521,
0.0040730200707912445,
-0.08699214458465576,
0.22155071794986725,
0.10093444585800171,
-0.6630523800849915,
-0.048983246088027954,
-0.1250361204147339,
0.4673381745815277,
0.2008923888206482,
0.055816031992435455,
0.3132554888725281,
-0.02181103825569153,
0.14772425591945648,
-0.26218074560165405,
-0.023328766226768494,
0.39646050333976746,
0.3196530044078827,
-0.29795846343040466,
-0.12219695746898651,
0.16042107343673706,
-0.030116870999336243,
-0.18382087349891663,
0.3497139513492584,
0.40073493123054504,
-0.4638195335865021,
0.5766898989677429,
-0.019814979285001755,
1.1103076934814453,
-0.23536726832389832,
0.09045378863811493,
-0.2528494894504547,
0.1586848795413971,
0.4918246865272522,
-0.3600082993507385,
0.08101432025432587,
-0.4778304100036621,
0.10194479674100876,
-0.07652664184570312,
0.11511429399251938,
0.24061071872711182,
0.265209436416626,
-0.2842884063720703,
0.17457769811153412,
0.0976453572511673,
0.5137397050857544,
0.012232746928930283,
-0.07382719218730927,
0.09887607395648956,
-0.3846402168273926,
0.0939163938164711,
-0.03833051770925522,
0.05393773689866066,
0.4135628044605255,
0.10320454090833664,
0.06949451565742493,
-0.1388690322637558,
-0.5697712898254395,
-0.46962955594062805,
-0.26298534870147705,
-0.23431983590126038,
0.02215162292122841,
0.5093727707862854,
-0.001552298665046692,
0.436524361371994,
0.5955120921134949,
0.44958555698394775,
0.271908164024353,
-0.2656644880771637,
-0.07024791836738586,
0.008109559305012226,
0.15589186549186707,
-0.04288600757718086,
-0.13401132822036743,
0.059814587235450745,
0.1192009374499321,
-0.21314111351966858,
-0.04290230944752693,
0.11756425350904465,
-0.31189605593681335,
-0.3687518835067749,
0.019275136291980743,
0.0472867414355278,
-0.4526282548904419,
-0.015342988073825836,
-0.11416231840848923,
0.1672995686531067,
-0.21853092312812805,
-0.018065575510263443,
-0.0886477679014206,
-0.24587470293045044,
0.20948080718517303,
-0.01678217574954033,
-0.043038345873355865,
0.1022503525018692,
0.5669659376144409,
-0.13417360186576843,
-0.11336015164852142,
0.5373242497444153,
0.03644929826259613,
-0.23750193417072296,
-0.11050188541412354,
0.42925310134887695,
0.4193190038204193,
-0.27958858013153076,
-0.06788992881774902,
-0.27072903513908386,
-0.15416964888572693,
0.0575048103928566,
0.5278944969177246,
0.12001514434814453,
-0.021403823047876358,
-0.0894678384065628,
-0.47881990671157837,
-0.4485023021697998,
0.27336013317108154,
-0.029659835621714592,
0.003594951005652547,
0.1189158484339714,
0.13691827654838562,
0.19335779547691345,
0.22471974790096283,
-0.13981710374355316,
0.14893785119056702,
-0.14872737228870392,
0.28690528869628906,
0.1693067103624344,
-0.0032003275118768215,
0.13041821122169495,
-0.20524895191192627,
-0.03078397363424301,
0.5622972846031189,
0.25228869915008545,
-0.022415410727262497,
-0.20686160027980804,
0.20319119095802307,
0.2695006728172302,
-0.09853231906890869,
0.019274208694696426,
-0.04919285699725151,
-0.043746814131736755,
-0.4136279821395874,
0.07517510652542114,
0.2547764778137207,
0.13614630699157715,
0.349273145198822,
0.12942145764827728,
0.14157316088676453,
-0.27218276262283325,
-0.3396129906177521,
-0.09936673939228058,
0.02182612381875515,
0.19687502086162567,
-0.07640814036130905,
0.14836253225803375,
0.09128408133983612,
-0.05613647401332855,
0.1900644153356552,
0.19523359835147858,
0.0003406573086977005,
0.46210768818855286,
-0.20090915262699127,
0.0277564600110054,
0.11903149634599686,
0.27904191613197327,
0.16033050417900085,
-0.2992215156555176,
-0.14880593121051788,
0.6174467206001282,
-0.001440495252609253,
-0.33650028705596924,
-0.1592373549938202,
0.29007965326309204,
-0.19166845083236694,
-0.01651618629693985,
0.1883077323436737,
-0.004975087940692902,
0.12083849310874939,
-0.07611143589019775,
-0.10683910548686981,
0.6367716193199158,
-0.11121189594268799,
0.14989343285560608,
0.3430008292198181,
-0.23671409487724304,
0.20920059084892273,
0.4825010895729065,
0.25120604038238525,
-0.022158227860927582,
0.41047483682632446,
-0.1161256730556488,
0.17412130534648895,
-0.2595923840999603,
0.2356245070695877,
0.2581484317779541,
-0.23947910964488983,
0.23042792081832886,
0.07355064153671265,
0.14133332669734955,
0.1170702874660492,
-0.09035468101501465,
0.43352460861206055,
-0.24963220953941345,
0.009472880512475967,
-0.08323463052511215,
0.0184014905244112,
-0.35239309072494507,
-0.28150203824043274,
-0.0894494354724884,
-0.13710522651672363,
-0.1242012307047844,
-0.24276745319366455,
-0.15223796665668488,
-0.3989037275314331,
0.3818677067756653,
-0.23196318745613098,
-0.07182255387306213,
-0.4486716687679291,
-0.3540399372577667,
-0.004294541664421558,
0.37333524227142334,
-0.31127166748046875,
0.23800316452980042,
-0.377676784992218,
0.0033165104687213898,
-0.011244074441492558,
0.2851544916629791,
0.34394553303718567,
0.22778135538101196,
-0.16611424088478088,
0.3395490050315857,
-0.4165327250957489,
-0.0656379759311676,
0.20443373918533325,
0.41313713788986206,
0.253685861825943,
0.09783672541379929,
0.13719837367534637,
-0.09802192449569702,
-0.0025034695863723755,
0.01962844468653202,
0.3305218815803528,
0.39171507954597473,
0.16668494045734406,
0.27741894125938416,
-0.39708882570266724,
-0.2024511694908142,
-0.049804918467998505,
-0.11963504552841187,
-0.3071901500225067,
0.11719100922346115,
0.21569639444351196,
-0.04248189553618431,
0.17178097367286682,
-0.22594283521175385,
-0.007096141576766968,
0.35008251667022705,
0.1567327082157135,
0.46817171573638916,
-0.32634568214416504,
-0.2872994542121887,
-0.12609124183654785,
-0.6474803686141968,
0.14961598813533783,
0.1603565216064453,
0.09684773534536362,
-0.07246801257133484,
-0.1491030901670456,
0.32983943819999695,
0.14418619871139526,
-0.09709890186786652,
-0.18140281736850739,
-0.3774397671222687,
0.38178613781929016,
-0.0005429834127426147,
-0.07873796671628952,
-0.05617806315422058,
0.23347905278205872,
0.05029135197401047,
0.046565525233745575,
0.33095431327819824,
0.1166296973824501,
-0.15177100896835327,
-0.3034653663635254,
0.21696385741233826,
-0.15629446506500244,
-0.35510170459747314,
0.2875237762928009,
0.09631649404764175,
0.34405386447906494,
-0.029572226107120514,
0.25129932165145874,
-0.06799530982971191,
-0.14257973432540894,
-0.24774806201457977,
0.30086225271224976,
0.09005555510520935,
0.3809104561805725,
-0.17661979794502258,
-0.13966019451618195,
-0.3909154534339905,
-0.3106779456138611,
0.05090393126010895,
-0.2421639859676361,
-0.4431724548339844,
0.1070583164691925,
-0.07454697787761688,
-0.22729018330574036,
0.10287275165319443,
0.31645703315734863,
-0.1441793441772461,
0.15999214351177216,
-0.15243111550807953,
-0.3818695545196533,
0.36031219363212585,
-0.6803948879241943,
-0.4824531674385071,
0.044376157224178314,
0.03749261423945427,
0.3604148328304291,
-0.2634679079055786,
-0.7928863763809204,
-0.1504666656255722,
0.3336908221244812,
0.1019376739859581,
-0.3072064518928528,
0.04923158138990402,
0.02528887242078781,
-0.07292815297842026,
-0.2398308515548706,
0.4982761740684509,
0.04106968268752098,
0.16628970205783844,
0.10966774821281433,
-0.23761095106601715
] |
https://github.com/huggingface/datasets/issues/6285 | You should be able to load the images by modifying the `load_dataset` call like this:
```python
dataset = load_dataset("imagefolder", data_dir="/content/datasets/PotholeDetectionYOLOv8-1")
```
The `imagefolder` builder expects the image files to be in `path/label/image_file` (e.g. .`.../train/dog/image_1.jpg`), so the solution for the labels in your case is to create metadata files (one for each split; as explained [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder)) that map the images to their labels. | TypeError: expected str, bytes or os.PathLike object, not dict | ### Describe the bug
my dataset is in form : train- image /n -labels
and tried the code:
```
from datasets import load_dataset
data_files = {
"train": "/content/datasets/PotholeDetectionYOLOv8-1/train/",
"validation": "/content/datasets/PotholeDetectionYOLOv8-1/valid/",
"test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
}
dataset = load_dataset("imagefolder", data_dir=data_files)
dataset
```
got error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-29-2ef1926f73d9>](https://localhost:8080/#) in <cell line: 8>()
6 "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
7 }
----> 8 dataset = load_dataset("imagefolder", data_dir=data_files)
9 dataset
6 frames
[/usr/lib/python3.10/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args)
576 parts += a._parts
577 else:
--> 578 a = os.fspath(a)
579 if isinstance(a, str):
580 # Force-cast str subclasses to str (issue #21127)
TypeError: expected str, bytes or os.PathLike object, not dict
```
### Steps to reproduce the bug
as share above
### Expected behavior
load images and labels , but my dataset only uploads images
- https://huggingface.co/datasets/Andyrasika/potholes-dataset
### Environment info
colab pro | 62 | TypeError: expected str, bytes or os.PathLike object, not dict
### Describe the bug
my dataset is in form : train- image /n -labels
and tried the code:
```
from datasets import load_dataset
data_files = {
"train": "/content/datasets/PotholeDetectionYOLOv8-1/train/",
"validation": "/content/datasets/PotholeDetectionYOLOv8-1/valid/",
"test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
}
dataset = load_dataset("imagefolder", data_dir=data_files)
dataset
```
got error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-29-2ef1926f73d9>](https://localhost:8080/#) in <cell line: 8>()
6 "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
7 }
----> 8 dataset = load_dataset("imagefolder", data_dir=data_files)
9 dataset
6 frames
[/usr/lib/python3.10/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args)
576 parts += a._parts
577 else:
--> 578 a = os.fspath(a)
579 if isinstance(a, str):
580 # Force-cast str subclasses to str (issue #21127)
TypeError: expected str, bytes or os.PathLike object, not dict
```
### Steps to reproduce the bug
as share above
### Expected behavior
load images and labels , but my dataset only uploads images
- https://huggingface.co/datasets/Andyrasika/potholes-dataset
### Environment info
colab pro
You should be able to load the images by modifying the `load_dataset` call like this:
```python
dataset = load_dataset("imagefolder", data_dir="/content/datasets/PotholeDetectionYOLOv8-1")
```
The `imagefolder` builder expects the image files to be in `path/label/image_file` (e.g. .`.../train/dog/image_1.jpg`), so the solution for the labels in your case is to create metadata files (one for each split; as explained [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder)) that map the images to their labels. | [
-0.08925832808017731,
-0.10927513986825943,
0.024575650691986084,
0.3565120995044708,
0.614642858505249,
0.05151888728141785,
0.21652670204639435,
0.32387787103652954,
0.1509816199541092,
0.20537492632865906,
0.06611413508653641,
0.478313148021698,
-0.4957769513130188,
0.12190347909927368,
-0.13280463218688965,
-0.4285096526145935,
0.020260699093341827,
0.03538119047880173,
-0.43395861983299255,
-0.047198086977005005,
-0.3027794361114502,
0.2233598828315735,
-0.06913009285926819,
0.15214212238788605,
-0.237575501203537,
-0.10790266841650009,
-0.05413350462913513,
0.24454477429389954,
-0.3525506556034088,
-0.33117973804473877,
0.3368203043937683,
-0.15419244766235352,
0.5073310136795044,
0.49825456738471985,
-0.00011383779929019511,
0.29892632365226746,
0.09997918456792831,
0.059462159872055054,
-0.2963932752609253,
-0.5588001012802124,
-0.5509284734725952,
0.1397949755191803,
0.1921442300081253,
-0.3203241229057312,
0.1148788332939148,
-0.17419147491455078,
0.11200947314500809,
-0.3624354898929596,
0.391472190618515,
0.5828685760498047,
0.18368647992610931,
0.14754758775234222,
-0.004095248878002167,
0.04348631575703621,
0.27999088168144226,
0.5245286226272583,
-0.12256596982479095,
0.08698142319917679,
-0.24650660157203674,
0.08320488780736923,
0.0180314090102911,
0.18997375667095184,
-0.09567274898290634,
-0.00904889963567257,
0.2812351584434509,
0.20907631516456604,
0.06294120103120804,
-0.2919441759586334,
-0.4249308109283447,
0.12835486233234406,
0.09079745411872864,
-0.27703386545181274,
-0.25207963585853577,
-0.08177991211414337,
-0.2763961851596832,
-0.27584224939346313,
0.17276549339294434,
0.22997108101844788,
-0.00932062417268753,
0.33487194776535034,
-0.20279163122177124,
0.4185909032821655,
-0.23466777801513672,
0.2072625607252121,
-0.08881234377622604,
0.19087335467338562,
0.06885823607444763,
0.026344429701566696,
0.008156793192029,
0.03889499977231026,
0.010014139115810394,
-0.14882196485996246,
0.0381542406976223,
0.022865545004606247,
-0.030147574841976166,
-0.0014227554202079773,
0.05273891240358353,
-0.12361281365156174,
-0.09245892614126205,
-0.07006318867206573,
0.3294808566570282,
-0.021923266351222992,
-0.10315951704978943,
0.2701849341392517,
0.2036682814359665,
0.06959769129753113,
-0.09458985924720764,
0.5558082461357117,
0.13050930202007294,
0.33419886231422424,
-0.37167149782180786,
-0.076581671833992,
-0.2711661458015442,
0.03696635738015175,
0.2180117815732956,
0.10747383534908295,
0.4971633851528168,
-0.05865594744682312,
-0.488050639629364,
0.0984347015619278,
-0.3220740556716919,
-0.06110953912138939,
0.18804311752319336,
0.22044208645820618,
0.015549443662166595,
0.3216906785964966,
0.2159859538078308,
0.021382607519626617,
0.04302512854337692,
0.017791979014873505,
-0.17847059667110443,
0.3061414957046509,
-0.11229158937931061,
-0.2413177788257599,
-0.11934612691402435,
0.14955885708332062,
0.03175558149814606,
0.04872910678386688,
-0.13431128859519958,
-0.25706690549850464,
0.06111907958984375,
-0.27172136306762695,
0.07028843462467194,
0.19236555695533752,
-0.2957468032836914,
0.07660083472728729,
0.2530460059642792,
-0.0887984186410904,
-0.11142047494649887,
0.3032885491847992,
-0.3173966109752655,
-0.29003652930259705,
-0.25248485803604126,
0.2699914276599884,
0.00001204758882522583,
-0.11569686233997345,
-0.3271111249923706,
-0.1838880479335785,
0.06994907557964325,
-0.06905285269021988,
0.00038908421993255615,
-0.5530564188957214,
-0.22994917631149292,
-0.14835487306118011,
0.2479299008846283,
0.1517229527235031,
-0.1627437025308609,
-0.18335352838039398,
-0.09922415763139725,
-0.0011463779956102371,
0.719136118888855,
0.24417968094348907,
-0.03732078894972801,
0.37544670701026917,
-0.3040310740470886,
0.21806636452674866,
0.46670934557914734,
-0.3581663966178894,
-0.1487460732460022,
0.17641375958919525,
0.048179030418395996,
0.08435419201850891,
0.2895805537700653,
0.11102582514286041,
0.22483424842357635,
0.08529314398765564,
-0.027403946965932846,
0.42044299840927124,
-0.012897126376628876,
0.13198110461235046,
-0.2633868157863617,
-0.01739293336868286,
0.2603665888309479,
0.3205587863922119,
0.11431759595870972,
0.09871084988117218,
0.013035237789154053,
0.06940026581287384,
0.3013345003128052,
-0.26748883724212646,
-0.07145695388317108,
0.1143651083111763,
0.41156482696533203,
-0.04643816500902176,
-0.006206054240465164,
-0.562056303024292,
-0.10170504450798035,
-0.016790486872196198,
-0.050138600170612335,
0.19732725620269775,
-0.2444288730621338,
-0.11320634186267853,
-0.3061619699001312,
0.03914502263069153,
-0.4672463536262512,
0.04412374645471573,
0.14074930548667908,
0.09695130586624146,
-0.07639657706022263,
-0.14382487535476685,
-0.1407034546136856,
0.15626579523086548,
-0.3757579028606415,
0.29831331968307495,
0.1002165824174881,
0.4361574649810791,
-0.22959750890731812,
-0.11816760152578354,
-0.19543185830116272,
0.17774684727191925,
0.14283213019371033,
-0.13037759065628052,
-0.18382036685943604,
0.26006022095680237,
0.3931797444820404,
-0.14772021770477295,
-0.2556595206260681,
0.041414521634578705,
0.013508344069123268,
-0.04125908017158508,
-0.2599005699157715,
0.24102629721164703,
0.17162838578224182,
0.08481081575155258,
-0.09369632601737976,
0.2500615119934082,
0.0077548157423734665,
0.262398898601532,
0.04141758382320404,
0.18381014466285706,
0.13097533583641052,
-0.12101040780544281,
-0.033601947128772736,
-0.20607444643974304,
0.17902424931526184,
-0.08402824401855469,
0.04752751439809799,
0.11300326138734818,
-0.2546992301940918,
-0.14029669761657715,
0.48253360390663147,
0.035050928592681885,
0.22449210286140442,
0.3179815411567688,
0.024528328329324722,
0.18668502569198608,
-0.037844620645046234,
0.4247395694255829,
0.2725066542625427,
0.11337000876665115,
-0.0718129500746727,
-0.019718032330274582,
-0.00704755075275898,
0.0970296710729599,
0.3163343071937561,
0.16617168486118317,
0.08381374925374985,
0.0014252150431275368,
0.19605976343154907,
0.22209708392620087,
-0.2462211549282074,
-0.28704842925071716,
-0.12354525923728943,
0.2592170238494873,
-0.4398540258407593,
0.2105807363986969,
-0.4228529930114746,
-0.11886651813983917,
-0.4256539046764374,
-0.0844888985157013,
0.1573902666568756,
-0.26844027638435364,
-0.2010023593902588,
0.005276167765259743,
-0.21109922230243683,
0.29737523198127747,
-0.1598811000585556,
-0.04141668975353241,
0.163543701171875,
-0.2949609160423279,
-0.014328010380268097,
0.17732703685760498,
-0.21609875559806824,
0.047653928399086,
0.3168341815471649,
-0.051443085074424744,
0.11987045407295227,
-0.33688485622406006,
-0.0321706160902977,
-0.18986566364765167,
-0.2844069004058838,
0.08420640230178833,
-0.15884491801261902,
0.15282709896564484,
0.3641224801540375,
0.18852494657039642,
-0.015877418220043182,
-0.3853820860385895,
0.37287622690200806,
-0.0447632260620594,
-0.3096177279949188,
0.29492026567459106,
0.11730986833572388,
0.09992658346891403,
-0.1945081651210785,
-0.31963786482810974,
-0.4377686083316803,
-0.31482622027397156,
0.03948957473039627,
0.2991688847541809,
0.3116409182548523,
0.27967900037765503,
0.2188480645418167,
-0.008930008858442307,
-0.013877706602215767,
0.2197534739971161,
0.06790947169065475,
-0.184524267911911,
0.3070013225078583,
0.0769772082567215,
-0.1540580689907074,
-0.3288120627403259,
-0.13576489686965942,
0.0641971156001091,
0.164696604013443,
-0.5805144309997559,
-0.2679210305213928,
-0.4046953618526459,
0.2601160407066345,
-0.12116394937038422,
0.011230971664190292,
0.40931951999664307,
0.32183554768562317,
-0.09031027555465698,
-0.10949664562940598,
0.0379706546664238,
0.10136997699737549,
0.1689983308315277,
0.09364552050828934,
0.07424087822437286,
0.6535634398460388,
0.011114947497844696,
0.2366318702697754,
0.01839432865381241,
-0.2685944437980652,
0.4938046932220459,
-0.2665194869041443,
0.12654836475849152,
-0.16744662821292877,
-0.4117526412010193,
0.21298585832118988,
-0.15071992576122284,
-0.27210140228271484,
-0.0136830173432827,
-0.12720949947834015,
-0.04690024256706238,
-0.029273509979248047,
0.1018684059381485,
-0.07547652721405029,
-0.13986319303512573,
0.18352828919887543,
-0.02571021020412445,
0.12111777812242508,
-0.14834867417812347,
-0.06315415352582932,
-0.0677386149764061,
0.06377571821212769,
0.25828999280929565,
0.25376051664352417,
0.18581780791282654,
-0.09174363315105438,
-0.17888617515563965,
0.05334063619375229,
-0.10886776447296143,
0.10709699988365173,
0.1848156601190567,
0.2710379660129547,
-0.1382952332496643,
-0.17497113347053528,
-0.025859743356704712,
0.11599276959896088,
0.5174344778060913,
0.11181008815765381,
0.32132118940353394,
0.07609079778194427,
-0.055213507264852524,
-0.3256898820400238,
-0.2104935348033905,
-0.46427369117736816,
0.06080472841858864,
0.25770893692970276,
0.35933542251586914,
-0.20144252479076385,
-0.02851896546781063,
0.47791701555252075,
0.14366267621517181,
-0.08299031853675842,
-0.04460877552628517,
-0.28740769624710083,
-0.3573649525642395,
-0.1868976354598999,
-0.09402522444725037,
0.3395174443721771,
0.4082048535346985,
0.05115541070699692,
-0.20189642906188965,
-0.29050007462501526,
-0.19120949506759644,
0.24202236533164978,
-0.04877958446741104,
0.2629353702068329,
-0.11595617234706879,
0.15802313387393951,
-0.2172607183456421,
0.30305585265159607,
0.3543366491794586,
0.5800001621246338,
-0.21955305337905884,
-0.44162824749946594,
0.06637942790985107,
0.09432506561279297,
0.18061941862106323,
-0.03294479846954346,
-0.21000578999519348,
-0.0016558170318603516,
0.1179429143667221,
0.19115030765533447,
-0.3949137032032013,
0.4615153670310974,
0.5076972246170044,
0.22551250457763672,
-0.33602020144462585,
-0.4731598496437073,
0.22552621364593506,
0.36030083894729614,
-0.09042543917894363,
0.22475674748420715,
-0.10619384050369263,
-0.4967966079711914,
0.4115881323814392,
0.2122790664434433,
0.8405228853225708,
0.13034307956695557,
0.3029680848121643,
0.3676663339138031,
-0.13159942626953125,
0.19007614254951477,
0.29340988397598267,
0.01445707306265831,
-0.33607181906700134,
-0.18134480714797974,
-0.2903408706188202,
-0.2062983512878418,
0.12539894878864288,
0.0694408193230629,
-0.33351677656173706,
0.08965093642473221,
-0.22688959538936615,
0.43782317638397217,
0.07065598666667938,
0.08756698668003082,
-0.04241947829723358,
-0.17599166929721832,
-0.3143031895160675,
0.0758323147892952,
-0.2537304162979126,
-0.0026381947100162506,
0.09610005468130112,
-0.15397951006889343,
-0.16122809052467346,
-0.2966946065425873,
-0.14777562022209167,
0.009419329464435577,
-0.3810679614543915,
0.2848321795463562,
0.013831395655870438,
-0.3497597575187683,
0.09506042301654816,
0.295960009098053,
0.008583109825849533,
0.13585805892944336,
0.0891544371843338,
0.047630250453948975,
-0.13265930116176605,
0.058900658041238785,
0.08614540845155716,
-0.06193459406495094,
0.3294554054737091,
0.051007285714149475,
0.004528537392616272,
-0.18941152095794678,
-0.13122326135635376,
-0.2643543779850006,
-0.0374651700258255,
-0.05630527436733246,
0.2421530783176422,
-0.5696209669113159,
-0.19001984596252441,
-0.3812994956970215,
-0.0039100125432014465,
-0.34275007247924805,
0.1526920646429062,
-0.17513839900493622,
-0.05307789519429207,
0.2031038999557495,
0.30554696917533875,
-0.26841554045677185,
-0.04243692383170128,
0.18814027309417725,
0.05714346840977669,
0.39136645197868347,
0.6465758085250854,
0.04811116307973862,
-0.14451177418231964,
-0.22108803689479828,
0.45865973830223083,
0.23517607152462006,
-0.17416076362133026,
0.42817237973213196,
-0.06490343809127808,
-0.11688082665205002,
-0.2332300841808319,
0.3037765324115753,
0.1465037763118744,
0.23987480998039246,
-0.14669324457645416,
-0.5512107014656067,
-0.3743366599082947,
0.1250789761543274,
-0.2704543173313141,
0.26334571838378906,
-0.0958937257528305,
0.22987684607505798,
-0.21024394035339355,
-0.28278848528862,
-0.30248066782951355,
-0.03096078708767891,
-0.3829779624938965,
0.008635472506284714,
0.07074972987174988,
-0.07782304286956787,
0.1367991417646408,
-0.020015325397253036,
0.19661326706409454,
0.05963638424873352,
0.07618372142314911,
-0.1388770043849945,
-0.3564700484275818,
0.11404237151145935,
0.06688567996025085,
-0.025582747533917427,
0.09069858491420746,
0.008889518678188324,
-0.20834389328956604,
-0.1838398277759552,
-0.17914381623268127,
0.1881968230009079,
-0.15711748600006104,
0.2855696976184845,
0.1482059508562088,
-0.20188647508621216,
0.08214448392391205,
0.03408261761069298,
-0.27517837285995483,
0.10572610050439835,
0.19629380106925964,
0.14169660210609436,
0.02249346300959587,
-0.0360037237405777,
0.0669335424900055,
-0.019093435257673264,
0.08257686346769333,
0.05229825899004936,
0.3752169609069824,
-0.44669991731643677,
-0.008215799927711487,
0.2009214609861374,
0.5091618895530701,
0.25937724113464355,
-0.40407395362854004,
-0.03874184936285019,
0.017479076981544495,
0.2009749710559845,
-0.2562311291694641,
-0.10656120628118515,
0.30808699131011963,
-0.12022332847118378,
0.014809757471084595,
0.36294445395469666,
-0.31953832507133484,
0.03273396193981171,
-0.23854924738407135,
0.050281282514333725,
0.495045006275177,
0.09179385006427765,
0.05864984169602394,
0.2602331042289734,
-0.17212797701358795,
-0.09718704968690872,
0.2525652050971985,
0.03744083642959595,
0.13324910402297974,
0.42005348205566406,
-0.16543909907341003,
0.19971230626106262,
0.10993623733520508,
-0.06947061419487,
0.29207730293273926,
-0.1330127865076065,
0.09468568861484528,
0.19273854792118073,
-0.13999298214912415,
-0.017047256231307983,
-0.019042909145355225,
0.11872851848602295,
-0.3305736184120178,
-0.15843147039413452,
-0.030804738402366638,
0.08332625776529312,
-0.2047230303287506,
0.01235010102391243,
-0.5230586528778076,
-0.10604169964790344,
-0.21159371733665466,
-0.2621004581451416,
-0.07630196213722229,
-0.08213629573583603,
0.1726495772600174,
0.2082708775997162,
0.047270968556404114,
-0.224640354514122,
-0.24332968890666962,
0.06350281089544296,
0.3196655213832855,
-0.47177839279174805,
0.37650755047798157,
0.30544963479042053,
-0.04836894944310188,
0.21287910640239716,
0.1498156189918518,
0.643300473690033,
0.5598905086517334,
-0.07815711200237274,
-0.19649285078048706,
-0.20630137622356415,
-0.14024558663368225,
0.014567159116268158,
0.21368102729320526,
-0.0017418153584003448,
0.26225510239601135,
0.2587113380432129,
0.11945263296365738,
-0.1817447990179062,
0.05656944587826729,
0.12582889199256897,
0.05075643211603165,
-0.16138850152492523,
0.5155683159828186,
0.07670952379703522,
-0.11430440843105316,
-0.04066004604101181,
-0.09815439581871033,
-0.4315042197704315,
-0.18069297075271606,
0.3463585376739502,
0.047724660485982895,
0.24332505464553833,
0.1734587550163269,
0.08215378224849701,
0.060972996056079865,
0.368722528219223,
0.22394976019859314,
0.02441086806356907,
-0.3766196668148041,
-0.02662099152803421,
-0.3567883372306824,
0.09105301648378372,
-0.06276684999465942,
-0.4428914785385132,
0.0700845792889595,
-0.13275538384914398,
0.026513073593378067,
0.13223113119602203,
0.284187376499176,
0.33268001675605774,
-0.06667830049991608,
0.06981213390827179,
-0.30757156014442444,
-0.16343143582344055,
0.12226013839244843,
0.09219951927661896,
-0.032087139785289764,
-0.405447781085968,
0.10952312499284744,
0.010858181864023209,
0.10727585852146149,
0.0695352703332901,
-0.15590964257717133,
-0.19947728514671326,
-0.21705980598926544,
0.12449359148740768,
0.21569475531578064,
0.49318361282348633,
-0.1367795765399933,
-0.0412311926484108,
0.21740218997001648,
-0.4033986032009125,
-0.1189931184053421,
0.288048654794693,
-0.09200591593980789,
0.6007328033447266,
0.037216588854789734,
-0.1707531213760376,
-0.5542503595352173,
0.1519303023815155,
-0.04507693275809288,
-0.2768142521381378,
-0.33280280232429504,
0.31495529413223267,
-0.15418945252895355,
-0.07935252785682678,
-0.026163268834352493,
0.09795035421848297,
0.05328137427568436,
0.11506541818380356,
-0.1689833700656891,
-0.8320198059082031,
0.5784415602684021,
-0.5032221078872681,
-0.30252647399902344,
-0.0026175379753112793,
-0.06033274531364441,
-0.04169526696205139,
0.1650238186120987,
-0.5943441987037659,
-0.022433310747146606,
0.3838600218296051,
-0.05773859843611717,
-0.21738240122795105,
0.08587044477462769,
0.1489030122756958,
0.2657690644264221,
0.029644079506397247,
0.3110945522785187,
-0.14460276067256927,
-0.10509282350540161,
0.10545352101325989,
-0.22207331657409668
] |
https://github.com/huggingface/datasets/issues/6285 | > You should be able to load the images by modifying the `load_dataset` call like this:
>
> ```python
> dataset = load_dataset("imagefolder", data_dir="/content/datasets/PotholeDetectionYOLOv8-1")
> ```
>
> The `imagefolder` builder expects the image files to be in `path/label/image_file` (e.g. .`.../train/dog/image_1.jpg`), so the solution for the labels in your case is to create metadata files (one for each split; as explained [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder)) that map the images to their labels.
I tried like this but only uploads images and not labels, Andyrasika/potholes-dataset | TypeError: expected str, bytes or os.PathLike object, not dict | ### Describe the bug
my dataset is in form : train- image /n -labels
and tried the code:
```
from datasets import load_dataset
data_files = {
"train": "/content/datasets/PotholeDetectionYOLOv8-1/train/",
"validation": "/content/datasets/PotholeDetectionYOLOv8-1/valid/",
"test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
}
dataset = load_dataset("imagefolder", data_dir=data_files)
dataset
```
got error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-29-2ef1926f73d9>](https://localhost:8080/#) in <cell line: 8>()
6 "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
7 }
----> 8 dataset = load_dataset("imagefolder", data_dir=data_files)
9 dataset
6 frames
[/usr/lib/python3.10/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args)
576 parts += a._parts
577 else:
--> 578 a = os.fspath(a)
579 if isinstance(a, str):
580 # Force-cast str subclasses to str (issue #21127)
TypeError: expected str, bytes or os.PathLike object, not dict
```
### Steps to reproduce the bug
as share above
### Expected behavior
load images and labels , but my dataset only uploads images
- https://huggingface.co/datasets/Andyrasika/potholes-dataset
### Environment info
colab pro | 81 | TypeError: expected str, bytes or os.PathLike object, not dict
### Describe the bug
my dataset is in form : train- image /n -labels
and tried the code:
```
from datasets import load_dataset
data_files = {
"train": "/content/datasets/PotholeDetectionYOLOv8-1/train/",
"validation": "/content/datasets/PotholeDetectionYOLOv8-1/valid/",
"test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
}
dataset = load_dataset("imagefolder", data_dir=data_files)
dataset
```
got error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-29-2ef1926f73d9>](https://localhost:8080/#) in <cell line: 8>()
6 "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
7 }
----> 8 dataset = load_dataset("imagefolder", data_dir=data_files)
9 dataset
6 frames
[/usr/lib/python3.10/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args)
576 parts += a._parts
577 else:
--> 578 a = os.fspath(a)
579 if isinstance(a, str):
580 # Force-cast str subclasses to str (issue #21127)
TypeError: expected str, bytes or os.PathLike object, not dict
```
### Steps to reproduce the bug
as share above
### Expected behavior
load images and labels , but my dataset only uploads images
- https://huggingface.co/datasets/Andyrasika/potholes-dataset
### Environment info
colab pro
> You should be able to load the images by modifying the `load_dataset` call like this:
>
> ```python
> dataset = load_dataset("imagefolder", data_dir="/content/datasets/PotholeDetectionYOLOv8-1")
> ```
>
> The `imagefolder` builder expects the image files to be in `path/label/image_file` (e.g. .`.../train/dog/image_1.jpg`), so the solution for the labels in your case is to create metadata files (one for each split; as explained [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder)) that map the images to their labels.
I tried like this but only uploads images and not labels, Andyrasika/potholes-dataset | [
-0.08925832808017731,
-0.10927513986825943,
0.024575650691986084,
0.3565120995044708,
0.614642858505249,
0.05151888728141785,
0.21652670204639435,
0.32387787103652954,
0.1509816199541092,
0.20537492632865906,
0.06611413508653641,
0.478313148021698,
-0.4957769513130188,
0.12190347909927368,
-0.13280463218688965,
-0.4285096526145935,
0.020260699093341827,
0.03538119047880173,
-0.43395861983299255,
-0.047198086977005005,
-0.3027794361114502,
0.2233598828315735,
-0.06913009285926819,
0.15214212238788605,
-0.237575501203537,
-0.10790266841650009,
-0.05413350462913513,
0.24454477429389954,
-0.3525506556034088,
-0.33117973804473877,
0.3368203043937683,
-0.15419244766235352,
0.5073310136795044,
0.49825456738471985,
-0.00011383779929019511,
0.29892632365226746,
0.09997918456792831,
0.059462159872055054,
-0.2963932752609253,
-0.5588001012802124,
-0.5509284734725952,
0.1397949755191803,
0.1921442300081253,
-0.3203241229057312,
0.1148788332939148,
-0.17419147491455078,
0.11200947314500809,
-0.3624354898929596,
0.391472190618515,
0.5828685760498047,
0.18368647992610931,
0.14754758775234222,
-0.004095248878002167,
0.04348631575703621,
0.27999088168144226,
0.5245286226272583,
-0.12256596982479095,
0.08698142319917679,
-0.24650660157203674,
0.08320488780736923,
0.0180314090102911,
0.18997375667095184,
-0.09567274898290634,
-0.00904889963567257,
0.2812351584434509,
0.20907631516456604,
0.06294120103120804,
-0.2919441759586334,
-0.4249308109283447,
0.12835486233234406,
0.09079745411872864,
-0.27703386545181274,
-0.25207963585853577,
-0.08177991211414337,
-0.2763961851596832,
-0.27584224939346313,
0.17276549339294434,
0.22997108101844788,
-0.00932062417268753,
0.33487194776535034,
-0.20279163122177124,
0.4185909032821655,
-0.23466777801513672,
0.2072625607252121,
-0.08881234377622604,
0.19087335467338562,
0.06885823607444763,
0.026344429701566696,
0.008156793192029,
0.03889499977231026,
0.010014139115810394,
-0.14882196485996246,
0.0381542406976223,
0.022865545004606247,
-0.030147574841976166,
-0.0014227554202079773,
0.05273891240358353,
-0.12361281365156174,
-0.09245892614126205,
-0.07006318867206573,
0.3294808566570282,
-0.021923266351222992,
-0.10315951704978943,
0.2701849341392517,
0.2036682814359665,
0.06959769129753113,
-0.09458985924720764,
0.5558082461357117,
0.13050930202007294,
0.33419886231422424,
-0.37167149782180786,
-0.076581671833992,
-0.2711661458015442,
0.03696635738015175,
0.2180117815732956,
0.10747383534908295,
0.4971633851528168,
-0.05865594744682312,
-0.488050639629364,
0.0984347015619278,
-0.3220740556716919,
-0.06110953912138939,
0.18804311752319336,
0.22044208645820618,
0.015549443662166595,
0.3216906785964966,
0.2159859538078308,
0.021382607519626617,
0.04302512854337692,
0.017791979014873505,
-0.17847059667110443,
0.3061414957046509,
-0.11229158937931061,
-0.2413177788257599,
-0.11934612691402435,
0.14955885708332062,
0.03175558149814606,
0.04872910678386688,
-0.13431128859519958,
-0.25706690549850464,
0.06111907958984375,
-0.27172136306762695,
0.07028843462467194,
0.19236555695533752,
-0.2957468032836914,
0.07660083472728729,
0.2530460059642792,
-0.0887984186410904,
-0.11142047494649887,
0.3032885491847992,
-0.3173966109752655,
-0.29003652930259705,
-0.25248485803604126,
0.2699914276599884,
0.00001204758882522583,
-0.11569686233997345,
-0.3271111249923706,
-0.1838880479335785,
0.06994907557964325,
-0.06905285269021988,
0.00038908421993255615,
-0.5530564188957214,
-0.22994917631149292,
-0.14835487306118011,
0.2479299008846283,
0.1517229527235031,
-0.1627437025308609,
-0.18335352838039398,
-0.09922415763139725,
-0.0011463779956102371,
0.719136118888855,
0.24417968094348907,
-0.03732078894972801,
0.37544670701026917,
-0.3040310740470886,
0.21806636452674866,
0.46670934557914734,
-0.3581663966178894,
-0.1487460732460022,
0.17641375958919525,
0.048179030418395996,
0.08435419201850891,
0.2895805537700653,
0.11102582514286041,
0.22483424842357635,
0.08529314398765564,
-0.027403946965932846,
0.42044299840927124,
-0.012897126376628876,
0.13198110461235046,
-0.2633868157863617,
-0.01739293336868286,
0.2603665888309479,
0.3205587863922119,
0.11431759595870972,
0.09871084988117218,
0.013035237789154053,
0.06940026581287384,
0.3013345003128052,
-0.26748883724212646,
-0.07145695388317108,
0.1143651083111763,
0.41156482696533203,
-0.04643816500902176,
-0.006206054240465164,
-0.562056303024292,
-0.10170504450798035,
-0.016790486872196198,
-0.050138600170612335,
0.19732725620269775,
-0.2444288730621338,
-0.11320634186267853,
-0.3061619699001312,
0.03914502263069153,
-0.4672463536262512,
0.04412374645471573,
0.14074930548667908,
0.09695130586624146,
-0.07639657706022263,
-0.14382487535476685,
-0.1407034546136856,
0.15626579523086548,
-0.3757579028606415,
0.29831331968307495,
0.1002165824174881,
0.4361574649810791,
-0.22959750890731812,
-0.11816760152578354,
-0.19543185830116272,
0.17774684727191925,
0.14283213019371033,
-0.13037759065628052,
-0.18382036685943604,
0.26006022095680237,
0.3931797444820404,
-0.14772021770477295,
-0.2556595206260681,
0.041414521634578705,
0.013508344069123268,
-0.04125908017158508,
-0.2599005699157715,
0.24102629721164703,
0.17162838578224182,
0.08481081575155258,
-0.09369632601737976,
0.2500615119934082,
0.0077548157423734665,
0.262398898601532,
0.04141758382320404,
0.18381014466285706,
0.13097533583641052,
-0.12101040780544281,
-0.033601947128772736,
-0.20607444643974304,
0.17902424931526184,
-0.08402824401855469,
0.04752751439809799,
0.11300326138734818,
-0.2546992301940918,
-0.14029669761657715,
0.48253360390663147,
0.035050928592681885,
0.22449210286140442,
0.3179815411567688,
0.024528328329324722,
0.18668502569198608,
-0.037844620645046234,
0.4247395694255829,
0.2725066542625427,
0.11337000876665115,
-0.0718129500746727,
-0.019718032330274582,
-0.00704755075275898,
0.0970296710729599,
0.3163343071937561,
0.16617168486118317,
0.08381374925374985,
0.0014252150431275368,
0.19605976343154907,
0.22209708392620087,
-0.2462211549282074,
-0.28704842925071716,
-0.12354525923728943,
0.2592170238494873,
-0.4398540258407593,
0.2105807363986969,
-0.4228529930114746,
-0.11886651813983917,
-0.4256539046764374,
-0.0844888985157013,
0.1573902666568756,
-0.26844027638435364,
-0.2010023593902588,
0.005276167765259743,
-0.21109922230243683,
0.29737523198127747,
-0.1598811000585556,
-0.04141668975353241,
0.163543701171875,
-0.2949609160423279,
-0.014328010380268097,
0.17732703685760498,
-0.21609875559806824,
0.047653928399086,
0.3168341815471649,
-0.051443085074424744,
0.11987045407295227,
-0.33688485622406006,
-0.0321706160902977,
-0.18986566364765167,
-0.2844069004058838,
0.08420640230178833,
-0.15884491801261902,
0.15282709896564484,
0.3641224801540375,
0.18852494657039642,
-0.015877418220043182,
-0.3853820860385895,
0.37287622690200806,
-0.0447632260620594,
-0.3096177279949188,
0.29492026567459106,
0.11730986833572388,
0.09992658346891403,
-0.1945081651210785,
-0.31963786482810974,
-0.4377686083316803,
-0.31482622027397156,
0.03948957473039627,
0.2991688847541809,
0.3116409182548523,
0.27967900037765503,
0.2188480645418167,
-0.008930008858442307,
-0.013877706602215767,
0.2197534739971161,
0.06790947169065475,
-0.184524267911911,
0.3070013225078583,
0.0769772082567215,
-0.1540580689907074,
-0.3288120627403259,
-0.13576489686965942,
0.0641971156001091,
0.164696604013443,
-0.5805144309997559,
-0.2679210305213928,
-0.4046953618526459,
0.2601160407066345,
-0.12116394937038422,
0.011230971664190292,
0.40931951999664307,
0.32183554768562317,
-0.09031027555465698,
-0.10949664562940598,
0.0379706546664238,
0.10136997699737549,
0.1689983308315277,
0.09364552050828934,
0.07424087822437286,
0.6535634398460388,
0.011114947497844696,
0.2366318702697754,
0.01839432865381241,
-0.2685944437980652,
0.4938046932220459,
-0.2665194869041443,
0.12654836475849152,
-0.16744662821292877,
-0.4117526412010193,
0.21298585832118988,
-0.15071992576122284,
-0.27210140228271484,
-0.0136830173432827,
-0.12720949947834015,
-0.04690024256706238,
-0.029273509979248047,
0.1018684059381485,
-0.07547652721405029,
-0.13986319303512573,
0.18352828919887543,
-0.02571021020412445,
0.12111777812242508,
-0.14834867417812347,
-0.06315415352582932,
-0.0677386149764061,
0.06377571821212769,
0.25828999280929565,
0.25376051664352417,
0.18581780791282654,
-0.09174363315105438,
-0.17888617515563965,
0.05334063619375229,
-0.10886776447296143,
0.10709699988365173,
0.1848156601190567,
0.2710379660129547,
-0.1382952332496643,
-0.17497113347053528,
-0.025859743356704712,
0.11599276959896088,
0.5174344778060913,
0.11181008815765381,
0.32132118940353394,
0.07609079778194427,
-0.055213507264852524,
-0.3256898820400238,
-0.2104935348033905,
-0.46427369117736816,
0.06080472841858864,
0.25770893692970276,
0.35933542251586914,
-0.20144252479076385,
-0.02851896546781063,
0.47791701555252075,
0.14366267621517181,
-0.08299031853675842,
-0.04460877552628517,
-0.28740769624710083,
-0.3573649525642395,
-0.1868976354598999,
-0.09402522444725037,
0.3395174443721771,
0.4082048535346985,
0.05115541070699692,
-0.20189642906188965,
-0.29050007462501526,
-0.19120949506759644,
0.24202236533164978,
-0.04877958446741104,
0.2629353702068329,
-0.11595617234706879,
0.15802313387393951,
-0.2172607183456421,
0.30305585265159607,
0.3543366491794586,
0.5800001621246338,
-0.21955305337905884,
-0.44162824749946594,
0.06637942790985107,
0.09432506561279297,
0.18061941862106323,
-0.03294479846954346,
-0.21000578999519348,
-0.0016558170318603516,
0.1179429143667221,
0.19115030765533447,
-0.3949137032032013,
0.4615153670310974,
0.5076972246170044,
0.22551250457763672,
-0.33602020144462585,
-0.4731598496437073,
0.22552621364593506,
0.36030083894729614,
-0.09042543917894363,
0.22475674748420715,
-0.10619384050369263,
-0.4967966079711914,
0.4115881323814392,
0.2122790664434433,
0.8405228853225708,
0.13034307956695557,
0.3029680848121643,
0.3676663339138031,
-0.13159942626953125,
0.19007614254951477,
0.29340988397598267,
0.01445707306265831,
-0.33607181906700134,
-0.18134480714797974,
-0.2903408706188202,
-0.2062983512878418,
0.12539894878864288,
0.0694408193230629,
-0.33351677656173706,
0.08965093642473221,
-0.22688959538936615,
0.43782317638397217,
0.07065598666667938,
0.08756698668003082,
-0.04241947829723358,
-0.17599166929721832,
-0.3143031895160675,
0.0758323147892952,
-0.2537304162979126,
-0.0026381947100162506,
0.09610005468130112,
-0.15397951006889343,
-0.16122809052467346,
-0.2966946065425873,
-0.14777562022209167,
0.009419329464435577,
-0.3810679614543915,
0.2848321795463562,
0.013831395655870438,
-0.3497597575187683,
0.09506042301654816,
0.295960009098053,
0.008583109825849533,
0.13585805892944336,
0.0891544371843338,
0.047630250453948975,
-0.13265930116176605,
0.058900658041238785,
0.08614540845155716,
-0.06193459406495094,
0.3294554054737091,
0.051007285714149475,
0.004528537392616272,
-0.18941152095794678,
-0.13122326135635376,
-0.2643543779850006,
-0.0374651700258255,
-0.05630527436733246,
0.2421530783176422,
-0.5696209669113159,
-0.19001984596252441,
-0.3812994956970215,
-0.0039100125432014465,
-0.34275007247924805,
0.1526920646429062,
-0.17513839900493622,
-0.05307789519429207,
0.2031038999557495,
0.30554696917533875,
-0.26841554045677185,
-0.04243692383170128,
0.18814027309417725,
0.05714346840977669,
0.39136645197868347,
0.6465758085250854,
0.04811116307973862,
-0.14451177418231964,
-0.22108803689479828,
0.45865973830223083,
0.23517607152462006,
-0.17416076362133026,
0.42817237973213196,
-0.06490343809127808,
-0.11688082665205002,
-0.2332300841808319,
0.3037765324115753,
0.1465037763118744,
0.23987480998039246,
-0.14669324457645416,
-0.5512107014656067,
-0.3743366599082947,
0.1250789761543274,
-0.2704543173313141,
0.26334571838378906,
-0.0958937257528305,
0.22987684607505798,
-0.21024394035339355,
-0.28278848528862,
-0.30248066782951355,
-0.03096078708767891,
-0.3829779624938965,
0.008635472506284714,
0.07074972987174988,
-0.07782304286956787,
0.1367991417646408,
-0.020015325397253036,
0.19661326706409454,
0.05963638424873352,
0.07618372142314911,
-0.1388770043849945,
-0.3564700484275818,
0.11404237151145935,
0.06688567996025085,
-0.025582747533917427,
0.09069858491420746,
0.008889518678188324,
-0.20834389328956604,
-0.1838398277759552,
-0.17914381623268127,
0.1881968230009079,
-0.15711748600006104,
0.2855696976184845,
0.1482059508562088,
-0.20188647508621216,
0.08214448392391205,
0.03408261761069298,
-0.27517837285995483,
0.10572610050439835,
0.19629380106925964,
0.14169660210609436,
0.02249346300959587,
-0.0360037237405777,
0.0669335424900055,
-0.019093435257673264,
0.08257686346769333,
0.05229825899004936,
0.3752169609069824,
-0.44669991731643677,
-0.008215799927711487,
0.2009214609861374,
0.5091618895530701,
0.25937724113464355,
-0.40407395362854004,
-0.03874184936285019,
0.017479076981544495,
0.2009749710559845,
-0.2562311291694641,
-0.10656120628118515,
0.30808699131011963,
-0.12022332847118378,
0.014809757471084595,
0.36294445395469666,
-0.31953832507133484,
0.03273396193981171,
-0.23854924738407135,
0.050281282514333725,
0.495045006275177,
0.09179385006427765,
0.05864984169602394,
0.2602331042289734,
-0.17212797701358795,
-0.09718704968690872,
0.2525652050971985,
0.03744083642959595,
0.13324910402297974,
0.42005348205566406,
-0.16543909907341003,
0.19971230626106262,
0.10993623733520508,
-0.06947061419487,
0.29207730293273926,
-0.1330127865076065,
0.09468568861484528,
0.19273854792118073,
-0.13999298214912415,
-0.017047256231307983,
-0.019042909145355225,
0.11872851848602295,
-0.3305736184120178,
-0.15843147039413452,
-0.030804738402366638,
0.08332625776529312,
-0.2047230303287506,
0.01235010102391243,
-0.5230586528778076,
-0.10604169964790344,
-0.21159371733665466,
-0.2621004581451416,
-0.07630196213722229,
-0.08213629573583603,
0.1726495772600174,
0.2082708775997162,
0.047270968556404114,
-0.224640354514122,
-0.24332968890666962,
0.06350281089544296,
0.3196655213832855,
-0.47177839279174805,
0.37650755047798157,
0.30544963479042053,
-0.04836894944310188,
0.21287910640239716,
0.1498156189918518,
0.643300473690033,
0.5598905086517334,
-0.07815711200237274,
-0.19649285078048706,
-0.20630137622356415,
-0.14024558663368225,
0.014567159116268158,
0.21368102729320526,
-0.0017418153584003448,
0.26225510239601135,
0.2587113380432129,
0.11945263296365738,
-0.1817447990179062,
0.05656944587826729,
0.12582889199256897,
0.05075643211603165,
-0.16138850152492523,
0.5155683159828186,
0.07670952379703522,
-0.11430440843105316,
-0.04066004604101181,
-0.09815439581871033,
-0.4315042197704315,
-0.18069297075271606,
0.3463585376739502,
0.047724660485982895,
0.24332505464553833,
0.1734587550163269,
0.08215378224849701,
0.060972996056079865,
0.368722528219223,
0.22394976019859314,
0.02441086806356907,
-0.3766196668148041,
-0.02662099152803421,
-0.3567883372306824,
0.09105301648378372,
-0.06276684999465942,
-0.4428914785385132,
0.0700845792889595,
-0.13275538384914398,
0.026513073593378067,
0.13223113119602203,
0.284187376499176,
0.33268001675605774,
-0.06667830049991608,
0.06981213390827179,
-0.30757156014442444,
-0.16343143582344055,
0.12226013839244843,
0.09219951927661896,
-0.032087139785289764,
-0.405447781085968,
0.10952312499284744,
0.010858181864023209,
0.10727585852146149,
0.0695352703332901,
-0.15590964257717133,
-0.19947728514671326,
-0.21705980598926544,
0.12449359148740768,
0.21569475531578064,
0.49318361282348633,
-0.1367795765399933,
-0.0412311926484108,
0.21740218997001648,
-0.4033986032009125,
-0.1189931184053421,
0.288048654794693,
-0.09200591593980789,
0.6007328033447266,
0.037216588854789734,
-0.1707531213760376,
-0.5542503595352173,
0.1519303023815155,
-0.04507693275809288,
-0.2768142521381378,
-0.33280280232429504,
0.31495529413223267,
-0.15418945252895355,
-0.07935252785682678,
-0.026163268834352493,
0.09795035421848297,
0.05328137427568436,
0.11506541818380356,
-0.1689833700656891,
-0.8320198059082031,
0.5784415602684021,
-0.5032221078872681,
-0.30252647399902344,
-0.0026175379753112793,
-0.06033274531364441,
-0.04169526696205139,
0.1650238186120987,
-0.5943441987037659,
-0.022433310747146606,
0.3838600218296051,
-0.05773859843611717,
-0.21738240122795105,
0.08587044477462769,
0.1489030122756958,
0.2657690644264221,
0.029644079506397247,
0.3110945522785187,
-0.14460276067256927,
-0.10509282350540161,
0.10545352101325989,
-0.22207331657409668
] |
https://github.com/huggingface/datasets/issues/6285 | As explained in my previous comment, you need to define metadata files to load the labels or update the paths to be in the format `train/label/image` (`train- image /n -labels` is not supported by the loader). | TypeError: expected str, bytes or os.PathLike object, not dict | ### Describe the bug
my dataset is in form : train- image /n -labels
and tried the code:
```
from datasets import load_dataset
data_files = {
"train": "/content/datasets/PotholeDetectionYOLOv8-1/train/",
"validation": "/content/datasets/PotholeDetectionYOLOv8-1/valid/",
"test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
}
dataset = load_dataset("imagefolder", data_dir=data_files)
dataset
```
got error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-29-2ef1926f73d9>](https://localhost:8080/#) in <cell line: 8>()
6 "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
7 }
----> 8 dataset = load_dataset("imagefolder", data_dir=data_files)
9 dataset
6 frames
[/usr/lib/python3.10/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args)
576 parts += a._parts
577 else:
--> 578 a = os.fspath(a)
579 if isinstance(a, str):
580 # Force-cast str subclasses to str (issue #21127)
TypeError: expected str, bytes or os.PathLike object, not dict
```
### Steps to reproduce the bug
as share above
### Expected behavior
load images and labels , but my dataset only uploads images
- https://huggingface.co/datasets/Andyrasika/potholes-dataset
### Environment info
colab pro | 36 | TypeError: expected str, bytes or os.PathLike object, not dict
### Describe the bug
my dataset is in form : train- image /n -labels
and tried the code:
```
from datasets import load_dataset
data_files = {
"train": "/content/datasets/PotholeDetectionYOLOv8-1/train/",
"validation": "/content/datasets/PotholeDetectionYOLOv8-1/valid/",
"test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
}
dataset = load_dataset("imagefolder", data_dir=data_files)
dataset
```
got error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-29-2ef1926f73d9>](https://localhost:8080/#) in <cell line: 8>()
6 "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
7 }
----> 8 dataset = load_dataset("imagefolder", data_dir=data_files)
9 dataset
6 frames
[/usr/lib/python3.10/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args)
576 parts += a._parts
577 else:
--> 578 a = os.fspath(a)
579 if isinstance(a, str):
580 # Force-cast str subclasses to str (issue #21127)
TypeError: expected str, bytes or os.PathLike object, not dict
```
### Steps to reproduce the bug
as share above
### Expected behavior
load images and labels , but my dataset only uploads images
- https://huggingface.co/datasets/Andyrasika/potholes-dataset
### Environment info
colab pro
As explained in my previous comment, you need to define metadata files to load the labels or update the paths to be in the format `train/label/image` (`train- image /n -labels` is not supported by the loader). | [
-0.08925832808017731,
-0.10927513986825943,
0.024575650691986084,
0.3565120995044708,
0.614642858505249,
0.05151888728141785,
0.21652670204639435,
0.32387787103652954,
0.1509816199541092,
0.20537492632865906,
0.06611413508653641,
0.478313148021698,
-0.4957769513130188,
0.12190347909927368,
-0.13280463218688965,
-0.4285096526145935,
0.020260699093341827,
0.03538119047880173,
-0.43395861983299255,
-0.047198086977005005,
-0.3027794361114502,
0.2233598828315735,
-0.06913009285926819,
0.15214212238788605,
-0.237575501203537,
-0.10790266841650009,
-0.05413350462913513,
0.24454477429389954,
-0.3525506556034088,
-0.33117973804473877,
0.3368203043937683,
-0.15419244766235352,
0.5073310136795044,
0.49825456738471985,
-0.00011383779929019511,
0.29892632365226746,
0.09997918456792831,
0.059462159872055054,
-0.2963932752609253,
-0.5588001012802124,
-0.5509284734725952,
0.1397949755191803,
0.1921442300081253,
-0.3203241229057312,
0.1148788332939148,
-0.17419147491455078,
0.11200947314500809,
-0.3624354898929596,
0.391472190618515,
0.5828685760498047,
0.18368647992610931,
0.14754758775234222,
-0.004095248878002167,
0.04348631575703621,
0.27999088168144226,
0.5245286226272583,
-0.12256596982479095,
0.08698142319917679,
-0.24650660157203674,
0.08320488780736923,
0.0180314090102911,
0.18997375667095184,
-0.09567274898290634,
-0.00904889963567257,
0.2812351584434509,
0.20907631516456604,
0.06294120103120804,
-0.2919441759586334,
-0.4249308109283447,
0.12835486233234406,
0.09079745411872864,
-0.27703386545181274,
-0.25207963585853577,
-0.08177991211414337,
-0.2763961851596832,
-0.27584224939346313,
0.17276549339294434,
0.22997108101844788,
-0.00932062417268753,
0.33487194776535034,
-0.20279163122177124,
0.4185909032821655,
-0.23466777801513672,
0.2072625607252121,
-0.08881234377622604,
0.19087335467338562,
0.06885823607444763,
0.026344429701566696,
0.008156793192029,
0.03889499977231026,
0.010014139115810394,
-0.14882196485996246,
0.0381542406976223,
0.022865545004606247,
-0.030147574841976166,
-0.0014227554202079773,
0.05273891240358353,
-0.12361281365156174,
-0.09245892614126205,
-0.07006318867206573,
0.3294808566570282,
-0.021923266351222992,
-0.10315951704978943,
0.2701849341392517,
0.2036682814359665,
0.06959769129753113,
-0.09458985924720764,
0.5558082461357117,
0.13050930202007294,
0.33419886231422424,
-0.37167149782180786,
-0.076581671833992,
-0.2711661458015442,
0.03696635738015175,
0.2180117815732956,
0.10747383534908295,
0.4971633851528168,
-0.05865594744682312,
-0.488050639629364,
0.0984347015619278,
-0.3220740556716919,
-0.06110953912138939,
0.18804311752319336,
0.22044208645820618,
0.015549443662166595,
0.3216906785964966,
0.2159859538078308,
0.021382607519626617,
0.04302512854337692,
0.017791979014873505,
-0.17847059667110443,
0.3061414957046509,
-0.11229158937931061,
-0.2413177788257599,
-0.11934612691402435,
0.14955885708332062,
0.03175558149814606,
0.04872910678386688,
-0.13431128859519958,
-0.25706690549850464,
0.06111907958984375,
-0.27172136306762695,
0.07028843462467194,
0.19236555695533752,
-0.2957468032836914,
0.07660083472728729,
0.2530460059642792,
-0.0887984186410904,
-0.11142047494649887,
0.3032885491847992,
-0.3173966109752655,
-0.29003652930259705,
-0.25248485803604126,
0.2699914276599884,
0.00001204758882522583,
-0.11569686233997345,
-0.3271111249923706,
-0.1838880479335785,
0.06994907557964325,
-0.06905285269021988,
0.00038908421993255615,
-0.5530564188957214,
-0.22994917631149292,
-0.14835487306118011,
0.2479299008846283,
0.1517229527235031,
-0.1627437025308609,
-0.18335352838039398,
-0.09922415763139725,
-0.0011463779956102371,
0.719136118888855,
0.24417968094348907,
-0.03732078894972801,
0.37544670701026917,
-0.3040310740470886,
0.21806636452674866,
0.46670934557914734,
-0.3581663966178894,
-0.1487460732460022,
0.17641375958919525,
0.048179030418395996,
0.08435419201850891,
0.2895805537700653,
0.11102582514286041,
0.22483424842357635,
0.08529314398765564,
-0.027403946965932846,
0.42044299840927124,
-0.012897126376628876,
0.13198110461235046,
-0.2633868157863617,
-0.01739293336868286,
0.2603665888309479,
0.3205587863922119,
0.11431759595870972,
0.09871084988117218,
0.013035237789154053,
0.06940026581287384,
0.3013345003128052,
-0.26748883724212646,
-0.07145695388317108,
0.1143651083111763,
0.41156482696533203,
-0.04643816500902176,
-0.006206054240465164,
-0.562056303024292,
-0.10170504450798035,
-0.016790486872196198,
-0.050138600170612335,
0.19732725620269775,
-0.2444288730621338,
-0.11320634186267853,
-0.3061619699001312,
0.03914502263069153,
-0.4672463536262512,
0.04412374645471573,
0.14074930548667908,
0.09695130586624146,
-0.07639657706022263,
-0.14382487535476685,
-0.1407034546136856,
0.15626579523086548,
-0.3757579028606415,
0.29831331968307495,
0.1002165824174881,
0.4361574649810791,
-0.22959750890731812,
-0.11816760152578354,
-0.19543185830116272,
0.17774684727191925,
0.14283213019371033,
-0.13037759065628052,
-0.18382036685943604,
0.26006022095680237,
0.3931797444820404,
-0.14772021770477295,
-0.2556595206260681,
0.041414521634578705,
0.013508344069123268,
-0.04125908017158508,
-0.2599005699157715,
0.24102629721164703,
0.17162838578224182,
0.08481081575155258,
-0.09369632601737976,
0.2500615119934082,
0.0077548157423734665,
0.262398898601532,
0.04141758382320404,
0.18381014466285706,
0.13097533583641052,
-0.12101040780544281,
-0.033601947128772736,
-0.20607444643974304,
0.17902424931526184,
-0.08402824401855469,
0.04752751439809799,
0.11300326138734818,
-0.2546992301940918,
-0.14029669761657715,
0.48253360390663147,
0.035050928592681885,
0.22449210286140442,
0.3179815411567688,
0.024528328329324722,
0.18668502569198608,
-0.037844620645046234,
0.4247395694255829,
0.2725066542625427,
0.11337000876665115,
-0.0718129500746727,
-0.019718032330274582,
-0.00704755075275898,
0.0970296710729599,
0.3163343071937561,
0.16617168486118317,
0.08381374925374985,
0.0014252150431275368,
0.19605976343154907,
0.22209708392620087,
-0.2462211549282074,
-0.28704842925071716,
-0.12354525923728943,
0.2592170238494873,
-0.4398540258407593,
0.2105807363986969,
-0.4228529930114746,
-0.11886651813983917,
-0.4256539046764374,
-0.0844888985157013,
0.1573902666568756,
-0.26844027638435364,
-0.2010023593902588,
0.005276167765259743,
-0.21109922230243683,
0.29737523198127747,
-0.1598811000585556,
-0.04141668975353241,
0.163543701171875,
-0.2949609160423279,
-0.014328010380268097,
0.17732703685760498,
-0.21609875559806824,
0.047653928399086,
0.3168341815471649,
-0.051443085074424744,
0.11987045407295227,
-0.33688485622406006,
-0.0321706160902977,
-0.18986566364765167,
-0.2844069004058838,
0.08420640230178833,
-0.15884491801261902,
0.15282709896564484,
0.3641224801540375,
0.18852494657039642,
-0.015877418220043182,
-0.3853820860385895,
0.37287622690200806,
-0.0447632260620594,
-0.3096177279949188,
0.29492026567459106,
0.11730986833572388,
0.09992658346891403,
-0.1945081651210785,
-0.31963786482810974,
-0.4377686083316803,
-0.31482622027397156,
0.03948957473039627,
0.2991688847541809,
0.3116409182548523,
0.27967900037765503,
0.2188480645418167,
-0.008930008858442307,
-0.013877706602215767,
0.2197534739971161,
0.06790947169065475,
-0.184524267911911,
0.3070013225078583,
0.0769772082567215,
-0.1540580689907074,
-0.3288120627403259,
-0.13576489686965942,
0.0641971156001091,
0.164696604013443,
-0.5805144309997559,
-0.2679210305213928,
-0.4046953618526459,
0.2601160407066345,
-0.12116394937038422,
0.011230971664190292,
0.40931951999664307,
0.32183554768562317,
-0.09031027555465698,
-0.10949664562940598,
0.0379706546664238,
0.10136997699737549,
0.1689983308315277,
0.09364552050828934,
0.07424087822437286,
0.6535634398460388,
0.011114947497844696,
0.2366318702697754,
0.01839432865381241,
-0.2685944437980652,
0.4938046932220459,
-0.2665194869041443,
0.12654836475849152,
-0.16744662821292877,
-0.4117526412010193,
0.21298585832118988,
-0.15071992576122284,
-0.27210140228271484,
-0.0136830173432827,
-0.12720949947834015,
-0.04690024256706238,
-0.029273509979248047,
0.1018684059381485,
-0.07547652721405029,
-0.13986319303512573,
0.18352828919887543,
-0.02571021020412445,
0.12111777812242508,
-0.14834867417812347,
-0.06315415352582932,
-0.0677386149764061,
0.06377571821212769,
0.25828999280929565,
0.25376051664352417,
0.18581780791282654,
-0.09174363315105438,
-0.17888617515563965,
0.05334063619375229,
-0.10886776447296143,
0.10709699988365173,
0.1848156601190567,
0.2710379660129547,
-0.1382952332496643,
-0.17497113347053528,
-0.025859743356704712,
0.11599276959896088,
0.5174344778060913,
0.11181008815765381,
0.32132118940353394,
0.07609079778194427,
-0.055213507264852524,
-0.3256898820400238,
-0.2104935348033905,
-0.46427369117736816,
0.06080472841858864,
0.25770893692970276,
0.35933542251586914,
-0.20144252479076385,
-0.02851896546781063,
0.47791701555252075,
0.14366267621517181,
-0.08299031853675842,
-0.04460877552628517,
-0.28740769624710083,
-0.3573649525642395,
-0.1868976354598999,
-0.09402522444725037,
0.3395174443721771,
0.4082048535346985,
0.05115541070699692,
-0.20189642906188965,
-0.29050007462501526,
-0.19120949506759644,
0.24202236533164978,
-0.04877958446741104,
0.2629353702068329,
-0.11595617234706879,
0.15802313387393951,
-0.2172607183456421,
0.30305585265159607,
0.3543366491794586,
0.5800001621246338,
-0.21955305337905884,
-0.44162824749946594,
0.06637942790985107,
0.09432506561279297,
0.18061941862106323,
-0.03294479846954346,
-0.21000578999519348,
-0.0016558170318603516,
0.1179429143667221,
0.19115030765533447,
-0.3949137032032013,
0.4615153670310974,
0.5076972246170044,
0.22551250457763672,
-0.33602020144462585,
-0.4731598496437073,
0.22552621364593506,
0.36030083894729614,
-0.09042543917894363,
0.22475674748420715,
-0.10619384050369263,
-0.4967966079711914,
0.4115881323814392,
0.2122790664434433,
0.8405228853225708,
0.13034307956695557,
0.3029680848121643,
0.3676663339138031,
-0.13159942626953125,
0.19007614254951477,
0.29340988397598267,
0.01445707306265831,
-0.33607181906700134,
-0.18134480714797974,
-0.2903408706188202,
-0.2062983512878418,
0.12539894878864288,
0.0694408193230629,
-0.33351677656173706,
0.08965093642473221,
-0.22688959538936615,
0.43782317638397217,
0.07065598666667938,
0.08756698668003082,
-0.04241947829723358,
-0.17599166929721832,
-0.3143031895160675,
0.0758323147892952,
-0.2537304162979126,
-0.0026381947100162506,
0.09610005468130112,
-0.15397951006889343,
-0.16122809052467346,
-0.2966946065425873,
-0.14777562022209167,
0.009419329464435577,
-0.3810679614543915,
0.2848321795463562,
0.013831395655870438,
-0.3497597575187683,
0.09506042301654816,
0.295960009098053,
0.008583109825849533,
0.13585805892944336,
0.0891544371843338,
0.047630250453948975,
-0.13265930116176605,
0.058900658041238785,
0.08614540845155716,
-0.06193459406495094,
0.3294554054737091,
0.051007285714149475,
0.004528537392616272,
-0.18941152095794678,
-0.13122326135635376,
-0.2643543779850006,
-0.0374651700258255,
-0.05630527436733246,
0.2421530783176422,
-0.5696209669113159,
-0.19001984596252441,
-0.3812994956970215,
-0.0039100125432014465,
-0.34275007247924805,
0.1526920646429062,
-0.17513839900493622,
-0.05307789519429207,
0.2031038999557495,
0.30554696917533875,
-0.26841554045677185,
-0.04243692383170128,
0.18814027309417725,
0.05714346840977669,
0.39136645197868347,
0.6465758085250854,
0.04811116307973862,
-0.14451177418231964,
-0.22108803689479828,
0.45865973830223083,
0.23517607152462006,
-0.17416076362133026,
0.42817237973213196,
-0.06490343809127808,
-0.11688082665205002,
-0.2332300841808319,
0.3037765324115753,
0.1465037763118744,
0.23987480998039246,
-0.14669324457645416,
-0.5512107014656067,
-0.3743366599082947,
0.1250789761543274,
-0.2704543173313141,
0.26334571838378906,
-0.0958937257528305,
0.22987684607505798,
-0.21024394035339355,
-0.28278848528862,
-0.30248066782951355,
-0.03096078708767891,
-0.3829779624938965,
0.008635472506284714,
0.07074972987174988,
-0.07782304286956787,
0.1367991417646408,
-0.020015325397253036,
0.19661326706409454,
0.05963638424873352,
0.07618372142314911,
-0.1388770043849945,
-0.3564700484275818,
0.11404237151145935,
0.06688567996025085,
-0.025582747533917427,
0.09069858491420746,
0.008889518678188324,
-0.20834389328956604,
-0.1838398277759552,
-0.17914381623268127,
0.1881968230009079,
-0.15711748600006104,
0.2855696976184845,
0.1482059508562088,
-0.20188647508621216,
0.08214448392391205,
0.03408261761069298,
-0.27517837285995483,
0.10572610050439835,
0.19629380106925964,
0.14169660210609436,
0.02249346300959587,
-0.0360037237405777,
0.0669335424900055,
-0.019093435257673264,
0.08257686346769333,
0.05229825899004936,
0.3752169609069824,
-0.44669991731643677,
-0.008215799927711487,
0.2009214609861374,
0.5091618895530701,
0.25937724113464355,
-0.40407395362854004,
-0.03874184936285019,
0.017479076981544495,
0.2009749710559845,
-0.2562311291694641,
-0.10656120628118515,
0.30808699131011963,
-0.12022332847118378,
0.014809757471084595,
0.36294445395469666,
-0.31953832507133484,
0.03273396193981171,
-0.23854924738407135,
0.050281282514333725,
0.495045006275177,
0.09179385006427765,
0.05864984169602394,
0.2602331042289734,
-0.17212797701358795,
-0.09718704968690872,
0.2525652050971985,
0.03744083642959595,
0.13324910402297974,
0.42005348205566406,
-0.16543909907341003,
0.19971230626106262,
0.10993623733520508,
-0.06947061419487,
0.29207730293273926,
-0.1330127865076065,
0.09468568861484528,
0.19273854792118073,
-0.13999298214912415,
-0.017047256231307983,
-0.019042909145355225,
0.11872851848602295,
-0.3305736184120178,
-0.15843147039413452,
-0.030804738402366638,
0.08332625776529312,
-0.2047230303287506,
0.01235010102391243,
-0.5230586528778076,
-0.10604169964790344,
-0.21159371733665466,
-0.2621004581451416,
-0.07630196213722229,
-0.08213629573583603,
0.1726495772600174,
0.2082708775997162,
0.047270968556404114,
-0.224640354514122,
-0.24332968890666962,
0.06350281089544296,
0.3196655213832855,
-0.47177839279174805,
0.37650755047798157,
0.30544963479042053,
-0.04836894944310188,
0.21287910640239716,
0.1498156189918518,
0.643300473690033,
0.5598905086517334,
-0.07815711200237274,
-0.19649285078048706,
-0.20630137622356415,
-0.14024558663368225,
0.014567159116268158,
0.21368102729320526,
-0.0017418153584003448,
0.26225510239601135,
0.2587113380432129,
0.11945263296365738,
-0.1817447990179062,
0.05656944587826729,
0.12582889199256897,
0.05075643211603165,
-0.16138850152492523,
0.5155683159828186,
0.07670952379703522,
-0.11430440843105316,
-0.04066004604101181,
-0.09815439581871033,
-0.4315042197704315,
-0.18069297075271606,
0.3463585376739502,
0.047724660485982895,
0.24332505464553833,
0.1734587550163269,
0.08215378224849701,
0.060972996056079865,
0.368722528219223,
0.22394976019859314,
0.02441086806356907,
-0.3766196668148041,
-0.02662099152803421,
-0.3567883372306824,
0.09105301648378372,
-0.06276684999465942,
-0.4428914785385132,
0.0700845792889595,
-0.13275538384914398,
0.026513073593378067,
0.13223113119602203,
0.284187376499176,
0.33268001675605774,
-0.06667830049991608,
0.06981213390827179,
-0.30757156014442444,
-0.16343143582344055,
0.12226013839244843,
0.09219951927661896,
-0.032087139785289764,
-0.405447781085968,
0.10952312499284744,
0.010858181864023209,
0.10727585852146149,
0.0695352703332901,
-0.15590964257717133,
-0.19947728514671326,
-0.21705980598926544,
0.12449359148740768,
0.21569475531578064,
0.49318361282348633,
-0.1367795765399933,
-0.0412311926484108,
0.21740218997001648,
-0.4033986032009125,
-0.1189931184053421,
0.288048654794693,
-0.09200591593980789,
0.6007328033447266,
0.037216588854789734,
-0.1707531213760376,
-0.5542503595352173,
0.1519303023815155,
-0.04507693275809288,
-0.2768142521381378,
-0.33280280232429504,
0.31495529413223267,
-0.15418945252895355,
-0.07935252785682678,
-0.026163268834352493,
0.09795035421848297,
0.05328137427568436,
0.11506541818380356,
-0.1689833700656891,
-0.8320198059082031,
0.5784415602684021,
-0.5032221078872681,
-0.30252647399902344,
-0.0026175379753112793,
-0.06033274531364441,
-0.04169526696205139,
0.1650238186120987,
-0.5943441987037659,
-0.022433310747146606,
0.3838600218296051,
-0.05773859843611717,
-0.21738240122795105,
0.08587044477462769,
0.1489030122756958,
0.2657690644264221,
0.029644079506397247,
0.3110945522785187,
-0.14460276067256927,
-0.10509282350540161,
0.10545352101325989,
-0.22207331657409668
] |
https://github.com/huggingface/datasets/issues/6285 | I downloaded my file after annotating using roboflow . It gives train-
images, labels , test- images, labels , valid- images, labels . I hope it
gives you an idea of the dataset . Please advise on this dataset
On Tue, Oct 10, 2023 at 18:12 Mario Ε aΕ‘ko ***@***.***> wrote:
> As explained in my previous comment, you need to define metadata files to
> load the labels or update the paths to be in the format train/label/image
> (train- image /n -labels is not supported by the loader).
>
> β
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/6285#issuecomment-1755335215>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AE4LJNN56FWWTSBYTSTUWHLX6U7CVAVCNFSM6AAAAAA5YHCSTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJVGMZTKMRRGU>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
| TypeError: expected str, bytes or os.PathLike object, not dict | ### Describe the bug
my dataset is in form : train- image /n -labels
and tried the code:
```
from datasets import load_dataset
data_files = {
"train": "/content/datasets/PotholeDetectionYOLOv8-1/train/",
"validation": "/content/datasets/PotholeDetectionYOLOv8-1/valid/",
"test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
}
dataset = load_dataset("imagefolder", data_dir=data_files)
dataset
```
got error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-29-2ef1926f73d9>](https://localhost:8080/#) in <cell line: 8>()
6 "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
7 }
----> 8 dataset = load_dataset("imagefolder", data_dir=data_files)
9 dataset
6 frames
[/usr/lib/python3.10/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args)
576 parts += a._parts
577 else:
--> 578 a = os.fspath(a)
579 if isinstance(a, str):
580 # Force-cast str subclasses to str (issue #21127)
TypeError: expected str, bytes or os.PathLike object, not dict
```
### Steps to reproduce the bug
as share above
### Expected behavior
load images and labels , but my dataset only uploads images
- https://huggingface.co/datasets/Andyrasika/potholes-dataset
### Environment info
colab pro | 125 | TypeError: expected str, bytes or os.PathLike object, not dict
### Describe the bug
my dataset is in form : train- image /n -labels
and tried the code:
```
from datasets import load_dataset
data_files = {
"train": "/content/datasets/PotholeDetectionYOLOv8-1/train/",
"validation": "/content/datasets/PotholeDetectionYOLOv8-1/valid/",
"test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
}
dataset = load_dataset("imagefolder", data_dir=data_files)
dataset
```
got error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-29-2ef1926f73d9>](https://localhost:8080/#) in <cell line: 8>()
6 "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
7 }
----> 8 dataset = load_dataset("imagefolder", data_dir=data_files)
9 dataset
6 frames
[/usr/lib/python3.10/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args)
576 parts += a._parts
577 else:
--> 578 a = os.fspath(a)
579 if isinstance(a, str):
580 # Force-cast str subclasses to str (issue #21127)
TypeError: expected str, bytes or os.PathLike object, not dict
```
### Steps to reproduce the bug
as share above
### Expected behavior
load images and labels , but my dataset only uploads images
- https://huggingface.co/datasets/Andyrasika/potholes-dataset
### Environment info
colab pro
I downloaded my file after annotating using roboflow . It gives train-
images, labels , test- images, labels , valid- images, labels . I hope it
gives you an idea of the dataset . Please advise on this dataset
On Tue, Oct 10, 2023 at 18:12 Mario Ε aΕ‘ko ***@***.***> wrote:
> As explained in my previous comment, you need to define metadata files to
> load the labels or update the paths to be in the format train/label/image
> (train- image /n -labels is not supported by the loader).
>
> β
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/6285#issuecomment-1755335215>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AE4LJNN56FWWTSBYTSTUWHLX6U7CVAVCNFSM6AAAAAA5YHCSTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJVGMZTKMRRGU>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
| [
-0.08925832808017731,
-0.10927513986825943,
0.024575650691986084,
0.3565120995044708,
0.614642858505249,
0.05151888728141785,
0.21652670204639435,
0.32387787103652954,
0.1509816199541092,
0.20537492632865906,
0.06611413508653641,
0.478313148021698,
-0.4957769513130188,
0.12190347909927368,
-0.13280463218688965,
-0.4285096526145935,
0.020260699093341827,
0.03538119047880173,
-0.43395861983299255,
-0.047198086977005005,
-0.3027794361114502,
0.2233598828315735,
-0.06913009285926819,
0.15214212238788605,
-0.237575501203537,
-0.10790266841650009,
-0.05413350462913513,
0.24454477429389954,
-0.3525506556034088,
-0.33117973804473877,
0.3368203043937683,
-0.15419244766235352,
0.5073310136795044,
0.49825456738471985,
-0.00011383779929019511,
0.29892632365226746,
0.09997918456792831,
0.059462159872055054,
-0.2963932752609253,
-0.5588001012802124,
-0.5509284734725952,
0.1397949755191803,
0.1921442300081253,
-0.3203241229057312,
0.1148788332939148,
-0.17419147491455078,
0.11200947314500809,
-0.3624354898929596,
0.391472190618515,
0.5828685760498047,
0.18368647992610931,
0.14754758775234222,
-0.004095248878002167,
0.04348631575703621,
0.27999088168144226,
0.5245286226272583,
-0.12256596982479095,
0.08698142319917679,
-0.24650660157203674,
0.08320488780736923,
0.0180314090102911,
0.18997375667095184,
-0.09567274898290634,
-0.00904889963567257,
0.2812351584434509,
0.20907631516456604,
0.06294120103120804,
-0.2919441759586334,
-0.4249308109283447,
0.12835486233234406,
0.09079745411872864,
-0.27703386545181274,
-0.25207963585853577,
-0.08177991211414337,
-0.2763961851596832,
-0.27584224939346313,
0.17276549339294434,
0.22997108101844788,
-0.00932062417268753,
0.33487194776535034,
-0.20279163122177124,
0.4185909032821655,
-0.23466777801513672,
0.2072625607252121,
-0.08881234377622604,
0.19087335467338562,
0.06885823607444763,
0.026344429701566696,
0.008156793192029,
0.03889499977231026,
0.010014139115810394,
-0.14882196485996246,
0.0381542406976223,
0.022865545004606247,
-0.030147574841976166,
-0.0014227554202079773,
0.05273891240358353,
-0.12361281365156174,
-0.09245892614126205,
-0.07006318867206573,
0.3294808566570282,
-0.021923266351222992,
-0.10315951704978943,
0.2701849341392517,
0.2036682814359665,
0.06959769129753113,
-0.09458985924720764,
0.5558082461357117,
0.13050930202007294,
0.33419886231422424,
-0.37167149782180786,
-0.076581671833992,
-0.2711661458015442,
0.03696635738015175,
0.2180117815732956,
0.10747383534908295,
0.4971633851528168,
-0.05865594744682312,
-0.488050639629364,
0.0984347015619278,
-0.3220740556716919,
-0.06110953912138939,
0.18804311752319336,
0.22044208645820618,
0.015549443662166595,
0.3216906785964966,
0.2159859538078308,
0.021382607519626617,
0.04302512854337692,
0.017791979014873505,
-0.17847059667110443,
0.3061414957046509,
-0.11229158937931061,
-0.2413177788257599,
-0.11934612691402435,
0.14955885708332062,
0.03175558149814606,
0.04872910678386688,
-0.13431128859519958,
-0.25706690549850464,
0.06111907958984375,
-0.27172136306762695,
0.07028843462467194,
0.19236555695533752,
-0.2957468032836914,
0.07660083472728729,
0.2530460059642792,
-0.0887984186410904,
-0.11142047494649887,
0.3032885491847992,
-0.3173966109752655,
-0.29003652930259705,
-0.25248485803604126,
0.2699914276599884,
0.00001204758882522583,
-0.11569686233997345,
-0.3271111249923706,
-0.1838880479335785,
0.06994907557964325,
-0.06905285269021988,
0.00038908421993255615,
-0.5530564188957214,
-0.22994917631149292,
-0.14835487306118011,
0.2479299008846283,
0.1517229527235031,
-0.1627437025308609,
-0.18335352838039398,
-0.09922415763139725,
-0.0011463779956102371,
0.719136118888855,
0.24417968094348907,
-0.03732078894972801,
0.37544670701026917,
-0.3040310740470886,
0.21806636452674866,
0.46670934557914734,
-0.3581663966178894,
-0.1487460732460022,
0.17641375958919525,
0.048179030418395996,
0.08435419201850891,
0.2895805537700653,
0.11102582514286041,
0.22483424842357635,
0.08529314398765564,
-0.027403946965932846,
0.42044299840927124,
-0.012897126376628876,
0.13198110461235046,
-0.2633868157863617,
-0.01739293336868286,
0.2603665888309479,
0.3205587863922119,
0.11431759595870972,
0.09871084988117218,
0.013035237789154053,
0.06940026581287384,
0.3013345003128052,
-0.26748883724212646,
-0.07145695388317108,
0.1143651083111763,
0.41156482696533203,
-0.04643816500902176,
-0.006206054240465164,
-0.562056303024292,
-0.10170504450798035,
-0.016790486872196198,
-0.050138600170612335,
0.19732725620269775,
-0.2444288730621338,
-0.11320634186267853,
-0.3061619699001312,
0.03914502263069153,
-0.4672463536262512,
0.04412374645471573,
0.14074930548667908,
0.09695130586624146,
-0.07639657706022263,
-0.14382487535476685,
-0.1407034546136856,
0.15626579523086548,
-0.3757579028606415,
0.29831331968307495,
0.1002165824174881,
0.4361574649810791,
-0.22959750890731812,
-0.11816760152578354,
-0.19543185830116272,
0.17774684727191925,
0.14283213019371033,
-0.13037759065628052,
-0.18382036685943604,
0.26006022095680237,
0.3931797444820404,
-0.14772021770477295,
-0.2556595206260681,
0.041414521634578705,
0.013508344069123268,
-0.04125908017158508,
-0.2599005699157715,
0.24102629721164703,
0.17162838578224182,
0.08481081575155258,
-0.09369632601737976,
0.2500615119934082,
0.0077548157423734665,
0.262398898601532,
0.04141758382320404,
0.18381014466285706,
0.13097533583641052,
-0.12101040780544281,
-0.033601947128772736,
-0.20607444643974304,
0.17902424931526184,
-0.08402824401855469,
0.04752751439809799,
0.11300326138734818,
-0.2546992301940918,
-0.14029669761657715,
0.48253360390663147,
0.035050928592681885,
0.22449210286140442,
0.3179815411567688,
0.024528328329324722,
0.18668502569198608,
-0.037844620645046234,
0.4247395694255829,
0.2725066542625427,
0.11337000876665115,
-0.0718129500746727,
-0.019718032330274582,
-0.00704755075275898,
0.0970296710729599,
0.3163343071937561,
0.16617168486118317,
0.08381374925374985,
0.0014252150431275368,
0.19605976343154907,
0.22209708392620087,
-0.2462211549282074,
-0.28704842925071716,
-0.12354525923728943,
0.2592170238494873,
-0.4398540258407593,
0.2105807363986969,
-0.4228529930114746,
-0.11886651813983917,
-0.4256539046764374,
-0.0844888985157013,
0.1573902666568756,
-0.26844027638435364,
-0.2010023593902588,
0.005276167765259743,
-0.21109922230243683,
0.29737523198127747,
-0.1598811000585556,
-0.04141668975353241,
0.163543701171875,
-0.2949609160423279,
-0.014328010380268097,
0.17732703685760498,
-0.21609875559806824,
0.047653928399086,
0.3168341815471649,
-0.051443085074424744,
0.11987045407295227,
-0.33688485622406006,
-0.0321706160902977,
-0.18986566364765167,
-0.2844069004058838,
0.08420640230178833,
-0.15884491801261902,
0.15282709896564484,
0.3641224801540375,
0.18852494657039642,
-0.015877418220043182,
-0.3853820860385895,
0.37287622690200806,
-0.0447632260620594,
-0.3096177279949188,
0.29492026567459106,
0.11730986833572388,
0.09992658346891403,
-0.1945081651210785,
-0.31963786482810974,
-0.4377686083316803,
-0.31482622027397156,
0.03948957473039627,
0.2991688847541809,
0.3116409182548523,
0.27967900037765503,
0.2188480645418167,
-0.008930008858442307,
-0.013877706602215767,
0.2197534739971161,
0.06790947169065475,
-0.184524267911911,
0.3070013225078583,
0.0769772082567215,
-0.1540580689907074,
-0.3288120627403259,
-0.13576489686965942,
0.0641971156001091,
0.164696604013443,
-0.5805144309997559,
-0.2679210305213928,
-0.4046953618526459,
0.2601160407066345,
-0.12116394937038422,
0.011230971664190292,
0.40931951999664307,
0.32183554768562317,
-0.09031027555465698,
-0.10949664562940598,
0.0379706546664238,
0.10136997699737549,
0.1689983308315277,
0.09364552050828934,
0.07424087822437286,
0.6535634398460388,
0.011114947497844696,
0.2366318702697754,
0.01839432865381241,
-0.2685944437980652,
0.4938046932220459,
-0.2665194869041443,
0.12654836475849152,
-0.16744662821292877,
-0.4117526412010193,
0.21298585832118988,
-0.15071992576122284,
-0.27210140228271484,
-0.0136830173432827,
-0.12720949947834015,
-0.04690024256706238,
-0.029273509979248047,
0.1018684059381485,
-0.07547652721405029,
-0.13986319303512573,
0.18352828919887543,
-0.02571021020412445,
0.12111777812242508,
-0.14834867417812347,
-0.06315415352582932,
-0.0677386149764061,
0.06377571821212769,
0.25828999280929565,
0.25376051664352417,
0.18581780791282654,
-0.09174363315105438,
-0.17888617515563965,
0.05334063619375229,
-0.10886776447296143,
0.10709699988365173,
0.1848156601190567,
0.2710379660129547,
-0.1382952332496643,
-0.17497113347053528,
-0.025859743356704712,
0.11599276959896088,
0.5174344778060913,
0.11181008815765381,
0.32132118940353394,
0.07609079778194427,
-0.055213507264852524,
-0.3256898820400238,
-0.2104935348033905,
-0.46427369117736816,
0.06080472841858864,
0.25770893692970276,
0.35933542251586914,
-0.20144252479076385,
-0.02851896546781063,
0.47791701555252075,
0.14366267621517181,
-0.08299031853675842,
-0.04460877552628517,
-0.28740769624710083,
-0.3573649525642395,
-0.1868976354598999,
-0.09402522444725037,
0.3395174443721771,
0.4082048535346985,
0.05115541070699692,
-0.20189642906188965,
-0.29050007462501526,
-0.19120949506759644,
0.24202236533164978,
-0.04877958446741104,
0.2629353702068329,
-0.11595617234706879,
0.15802313387393951,
-0.2172607183456421,
0.30305585265159607,
0.3543366491794586,
0.5800001621246338,
-0.21955305337905884,
-0.44162824749946594,
0.06637942790985107,
0.09432506561279297,
0.18061941862106323,
-0.03294479846954346,
-0.21000578999519348,
-0.0016558170318603516,
0.1179429143667221,
0.19115030765533447,
-0.3949137032032013,
0.4615153670310974,
0.5076972246170044,
0.22551250457763672,
-0.33602020144462585,
-0.4731598496437073,
0.22552621364593506,
0.36030083894729614,
-0.09042543917894363,
0.22475674748420715,
-0.10619384050369263,
-0.4967966079711914,
0.4115881323814392,
0.2122790664434433,
0.8405228853225708,
0.13034307956695557,
0.3029680848121643,
0.3676663339138031,
-0.13159942626953125,
0.19007614254951477,
0.29340988397598267,
0.01445707306265831,
-0.33607181906700134,
-0.18134480714797974,
-0.2903408706188202,
-0.2062983512878418,
0.12539894878864288,
0.0694408193230629,
-0.33351677656173706,
0.08965093642473221,
-0.22688959538936615,
0.43782317638397217,
0.07065598666667938,
0.08756698668003082,
-0.04241947829723358,
-0.17599166929721832,
-0.3143031895160675,
0.0758323147892952,
-0.2537304162979126,
-0.0026381947100162506,
0.09610005468130112,
-0.15397951006889343,
-0.16122809052467346,
-0.2966946065425873,
-0.14777562022209167,
0.009419329464435577,
-0.3810679614543915,
0.2848321795463562,
0.013831395655870438,
-0.3497597575187683,
0.09506042301654816,
0.295960009098053,
0.008583109825849533,
0.13585805892944336,
0.0891544371843338,
0.047630250453948975,
-0.13265930116176605,
0.058900658041238785,
0.08614540845155716,
-0.06193459406495094,
0.3294554054737091,
0.051007285714149475,
0.004528537392616272,
-0.18941152095794678,
-0.13122326135635376,
-0.2643543779850006,
-0.0374651700258255,
-0.05630527436733246,
0.2421530783176422,
-0.5696209669113159,
-0.19001984596252441,
-0.3812994956970215,
-0.0039100125432014465,
-0.34275007247924805,
0.1526920646429062,
-0.17513839900493622,
-0.05307789519429207,
0.2031038999557495,
0.30554696917533875,
-0.26841554045677185,
-0.04243692383170128,
0.18814027309417725,
0.05714346840977669,
0.39136645197868347,
0.6465758085250854,
0.04811116307973862,
-0.14451177418231964,
-0.22108803689479828,
0.45865973830223083,
0.23517607152462006,
-0.17416076362133026,
0.42817237973213196,
-0.06490343809127808,
-0.11688082665205002,
-0.2332300841808319,
0.3037765324115753,
0.1465037763118744,
0.23987480998039246,
-0.14669324457645416,
-0.5512107014656067,
-0.3743366599082947,
0.1250789761543274,
-0.2704543173313141,
0.26334571838378906,
-0.0958937257528305,
0.22987684607505798,
-0.21024394035339355,
-0.28278848528862,
-0.30248066782951355,
-0.03096078708767891,
-0.3829779624938965,
0.008635472506284714,
0.07074972987174988,
-0.07782304286956787,
0.1367991417646408,
-0.020015325397253036,
0.19661326706409454,
0.05963638424873352,
0.07618372142314911,
-0.1388770043849945,
-0.3564700484275818,
0.11404237151145935,
0.06688567996025085,
-0.025582747533917427,
0.09069858491420746,
0.008889518678188324,
-0.20834389328956604,
-0.1838398277759552,
-0.17914381623268127,
0.1881968230009079,
-0.15711748600006104,
0.2855696976184845,
0.1482059508562088,
-0.20188647508621216,
0.08214448392391205,
0.03408261761069298,
-0.27517837285995483,
0.10572610050439835,
0.19629380106925964,
0.14169660210609436,
0.02249346300959587,
-0.0360037237405777,
0.0669335424900055,
-0.019093435257673264,
0.08257686346769333,
0.05229825899004936,
0.3752169609069824,
-0.44669991731643677,
-0.008215799927711487,
0.2009214609861374,
0.5091618895530701,
0.25937724113464355,
-0.40407395362854004,
-0.03874184936285019,
0.017479076981544495,
0.2009749710559845,
-0.2562311291694641,
-0.10656120628118515,
0.30808699131011963,
-0.12022332847118378,
0.014809757471084595,
0.36294445395469666,
-0.31953832507133484,
0.03273396193981171,
-0.23854924738407135,
0.050281282514333725,
0.495045006275177,
0.09179385006427765,
0.05864984169602394,
0.2602331042289734,
-0.17212797701358795,
-0.09718704968690872,
0.2525652050971985,
0.03744083642959595,
0.13324910402297974,
0.42005348205566406,
-0.16543909907341003,
0.19971230626106262,
0.10993623733520508,
-0.06947061419487,
0.29207730293273926,
-0.1330127865076065,
0.09468568861484528,
0.19273854792118073,
-0.13999298214912415,
-0.017047256231307983,
-0.019042909145355225,
0.11872851848602295,
-0.3305736184120178,
-0.15843147039413452,
-0.030804738402366638,
0.08332625776529312,
-0.2047230303287506,
0.01235010102391243,
-0.5230586528778076,
-0.10604169964790344,
-0.21159371733665466,
-0.2621004581451416,
-0.07630196213722229,
-0.08213629573583603,
0.1726495772600174,
0.2082708775997162,
0.047270968556404114,
-0.224640354514122,
-0.24332968890666962,
0.06350281089544296,
0.3196655213832855,
-0.47177839279174805,
0.37650755047798157,
0.30544963479042053,
-0.04836894944310188,
0.21287910640239716,
0.1498156189918518,
0.643300473690033,
0.5598905086517334,
-0.07815711200237274,
-0.19649285078048706,
-0.20630137622356415,
-0.14024558663368225,
0.014567159116268158,
0.21368102729320526,
-0.0017418153584003448,
0.26225510239601135,
0.2587113380432129,
0.11945263296365738,
-0.1817447990179062,
0.05656944587826729,
0.12582889199256897,
0.05075643211603165,
-0.16138850152492523,
0.5155683159828186,
0.07670952379703522,
-0.11430440843105316,
-0.04066004604101181,
-0.09815439581871033,
-0.4315042197704315,
-0.18069297075271606,
0.3463585376739502,
0.047724660485982895,
0.24332505464553833,
0.1734587550163269,
0.08215378224849701,
0.060972996056079865,
0.368722528219223,
0.22394976019859314,
0.02441086806356907,
-0.3766196668148041,
-0.02662099152803421,
-0.3567883372306824,
0.09105301648378372,
-0.06276684999465942,
-0.4428914785385132,
0.0700845792889595,
-0.13275538384914398,
0.026513073593378067,
0.13223113119602203,
0.284187376499176,
0.33268001675605774,
-0.06667830049991608,
0.06981213390827179,
-0.30757156014442444,
-0.16343143582344055,
0.12226013839244843,
0.09219951927661896,
-0.032087139785289764,
-0.405447781085968,
0.10952312499284744,
0.010858181864023209,
0.10727585852146149,
0.0695352703332901,
-0.15590964257717133,
-0.19947728514671326,
-0.21705980598926544,
0.12449359148740768,
0.21569475531578064,
0.49318361282348633,
-0.1367795765399933,
-0.0412311926484108,
0.21740218997001648,
-0.4033986032009125,
-0.1189931184053421,
0.288048654794693,
-0.09200591593980789,
0.6007328033447266,
0.037216588854789734,
-0.1707531213760376,
-0.5542503595352173,
0.1519303023815155,
-0.04507693275809288,
-0.2768142521381378,
-0.33280280232429504,
0.31495529413223267,
-0.15418945252895355,
-0.07935252785682678,
-0.026163268834352493,
0.09795035421848297,
0.05328137427568436,
0.11506541818380356,
-0.1689833700656891,
-0.8320198059082031,
0.5784415602684021,
-0.5032221078872681,
-0.30252647399902344,
-0.0026175379753112793,
-0.06033274531364441,
-0.04169526696205139,
0.1650238186120987,
-0.5943441987037659,
-0.022433310747146606,
0.3838600218296051,
-0.05773859843611717,
-0.21738240122795105,
0.08587044477462769,
0.1489030122756958,
0.2657690644264221,
0.029644079506397247,
0.3110945522785187,
-0.14460276067256927,
-0.10509282350540161,
0.10545352101325989,
-0.22207331657409668
] |
https://github.com/huggingface/datasets/issues/6280 | Thanks for the quick response @mariosasko! I just installed your branch via `poetry add 'git+https://github.com/huggingface/datasets#fix-array_values'` and I can confirm it works on the example provided.
Follow up question for you, should `None`s be supported in these types of features as they are in others?
For example, the following script:
```
from datasets import Features, Value, Sequence, ClassLabel, Dataset
dataset_features = Features({
'text': Value('string'),
'embedding': Sequence(Value('double'), length=2),
'categories': Sequence(ClassLabel(names=sorted([
'one',
'two',
'three'
]))),
})
dataset = Dataset.from_dict(
{
'text': ['A'] * 10000,
"embedding": [None] * 10000, # THIS LINE CHANGED
'categories': [[0]] * 10000,
},
features=dataset_features
)
def test_mapper(r):
r['text'] = list(map(lambda t: t + ' b', r['text']))
return r
dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)
```
fails with
```
Traceback (most recent call last):
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1354, in _write_generator_to_queue
for i, result in enumerate(func(**kwargs)):
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3493, in _map_single
writer.write_batch(batch)
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_writer.py", line 549, in write_batch
array = cast_array_to_feature(col_values, col_type) if col_type is not None else col_values
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 2160, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
fixed_size_list<item: double>[2]
to
Sequence(feature=Value(dtype='float64', id=None), length=2, id=None)
```
Ideally we can have empty embedding columns as well! | Couldn't cast array of type fixed_size_list to Sequence(Value(float64)) | ### Describe the bug
I have a dataset with an embedding column, when I try to map that dataset I get the following exception:
```
Traceback (most recent call last):
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map
for rank, done, content in iflatmap_unordered(
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get
raise self._value
TypeError: Couldn't cast array of type
fixed_size_list<item: float>[2]
to
Sequence(feature=Value(dtype='float32', id=None), length=2, id=None)
```
### Steps to reproduce the bug
Here's a simple repro script:
```
from datasets import Features, Value, Sequence, ClassLabel, Dataset
dataset_features = Features({
'text': Value('string'),
'embedding': Sequence(Value('double'), length=2),
'categories': Sequence(ClassLabel(names=sorted([
'one',
'two',
'three'
]))),
})
dataset = Dataset.from_dict(
{
'text': ['A'] * 10000,
'embedding': [[0.0, 0.1]] * 10000,
'categories': [[0]] * 10000,
},
features=dataset_features
)
def test_mapper(r):
r['text'] = list(map(lambda t: t + ' b', r['text']))
return r
dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)
```
Removing the embedding column fixes the issue!
### Expected behavior
The mapping completes successfully.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.17.1
- PyArrow version: 13.0.0
- Pandas version: 2.0.3 | 234 | Couldn't cast array of type fixed_size_list to Sequence(Value(float64))
### Describe the bug
I have a dataset with an embedding column, when I try to map that dataset I get the following exception:
```
Traceback (most recent call last):
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map
for rank, done, content in iflatmap_unordered(
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get
raise self._value
TypeError: Couldn't cast array of type
fixed_size_list<item: float>[2]
to
Sequence(feature=Value(dtype='float32', id=None), length=2, id=None)
```
### Steps to reproduce the bug
Here's a simple repro script:
```
from datasets import Features, Value, Sequence, ClassLabel, Dataset
dataset_features = Features({
'text': Value('string'),
'embedding': Sequence(Value('double'), length=2),
'categories': Sequence(ClassLabel(names=sorted([
'one',
'two',
'three'
]))),
})
dataset = Dataset.from_dict(
{
'text': ['A'] * 10000,
'embedding': [[0.0, 0.1]] * 10000,
'categories': [[0]] * 10000,
},
features=dataset_features
)
def test_mapper(r):
r['text'] = list(map(lambda t: t + ' b', r['text']))
return r
dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)
```
Removing the embedding column fixes the issue!
### Expected behavior
The mapping completes successfully.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.17.1
- PyArrow version: 13.0.0
- Pandas version: 2.0.3
Thanks for the quick response @mariosasko! I just installed your branch via `poetry add 'git+https://github.com/huggingface/datasets#fix-array_values'` and I can confirm it works on the example provided.
Follow up question for you, should `None`s be supported in these types of features as they are in others?
For example, the following script:
```
from datasets import Features, Value, Sequence, ClassLabel, Dataset
dataset_features = Features({
'text': Value('string'),
'embedding': Sequence(Value('double'), length=2),
'categories': Sequence(ClassLabel(names=sorted([
'one',
'two',
'three'
]))),
})
dataset = Dataset.from_dict(
{
'text': ['A'] * 10000,
"embedding": [None] * 10000, # THIS LINE CHANGED
'categories': [[0]] * 10000,
},
features=dataset_features
)
def test_mapper(r):
r['text'] = list(map(lambda t: t + ' b', r['text']))
return r
dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)
```
fails with
```
Traceback (most recent call last):
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1354, in _write_generator_to_queue
for i, result in enumerate(func(**kwargs)):
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3493, in _map_single
writer.write_batch(batch)
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_writer.py", line 549, in write_batch
array = cast_array_to_feature(col_values, col_type) if col_type is not None else col_values
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 2160, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
fixed_size_list<item: double>[2]
to
Sequence(feature=Value(dtype='float64', id=None), length=2, id=None)
```
Ideally we can have empty embedding columns as well! | [
-0.014731407165527344,
-0.6136932373046875,
0.010602809488773346,
0.0606437511742115,
0.691925585269928,
0.2248997539281845,
0.3206327557563782,
0.5348027944564819,
0.3054993152618408,
0.07003742456436157,
0.2205769568681717,
0.42197325825691223,
-0.24774007499217987,
-0.15707050263881683,
0.04050465300679207,
-0.23436950147151947,
0.07567296177148819,
0.010080832988023758,
0.033999595791101456,
-0.039406247437000275,
-0.3502662181854248,
0.08186830580234528,
-0.2914665937423706,
-0.22344446182250977,
0.3141709566116333,
-0.036635398864746094,
-0.043738316744565964,
-0.387708455324173,
0.06725618243217468,
-0.4161922037601471,
0.08449304848909378,
-0.43734344840049744,
0.167301744222641,
0.004733044654130936,
-0.00011924299906240776,
0.08766727149486542,
0.1676965057849884,
-0.09879788756370544,
0.02603975683450699,
-0.1415690779685974,
-0.44053733348846436,
-0.2952093482017517,
0.04407931864261627,
-0.27701133489608765,
-0.2440282702445984,
-0.14675737917423248,
-0.019602810963988304,
-0.8098945021629333,
0.16758669912815094,
0.23712632060050964,
0.17189840972423553,
0.26110807061195374,
-0.002238132059574127,
-0.24377432465553284,
0.06861956417560577,
-0.14582855999469757,
-0.30661797523498535,
0.16370859742164612,
0.3364611268043518,
0.12783800065517426,
0.027302315458655357,
0.2367696613073349,
-0.182655930519104,
0.07607272267341614,
0.33680009841918945,
-0.031576141715049744,
0.05908780172467232,
-0.31823426485061646,
-0.08692532032728195,
0.1545332372188568,
0.27571219205856323,
-0.12381984293460846,
-0.022917278110980988,
-0.1624114215373993,
0.1246025562286377,
-0.14329127967357635,
0.12495435029268265,
0.01087181270122528,
0.21864867210388184,
0.1018034815788269,
-0.3464144468307495,
0.22441770136356354,
-0.014149166643619537,
0.2016615867614746,
-0.13139958679676056,
0.10976435244083405,
-0.0636732280254364,
0.16458916664123535,
-0.001836468931287527,
-0.3481568694114685,
-0.13462917506694794,
-0.02398580126464367,
0.10293424129486084,
0.29691529273986816,
-0.11079524457454681,
-0.22814951837062836,
0.1559053659439087,
-0.07476067543029785,
-0.026740245521068573,
-0.08730240166187286,
0.20437732338905334,
0.12169872224330902,
0.22203920781612396,
0.06769665330648422,
0.07590395212173462,
0.4233965277671814,
-0.23275913298130035,
0.4559178650379181,
0.03148274123668671,
0.3156639337539673,
-0.07851390540599823,
0.06594842672348022,
0.175690695643425,
-0.09294231235980988,
0.056804805994033813,
0.25875693559646606,
0.1035202294588089,
-0.15227943658828735,
-0.37731772661209106,
0.3860526382923126,
-0.5588682293891907,
0.29801568388938904,
0.23258069157600403,
0.345366507768631,
-0.07503615319728851,
0.22007659077644348,
0.2516765296459198,
0.3283335566520691,
-0.006437819451093674,
0.060886967927217484,
-0.10444429516792297,
0.025494109839200974,
-0.12618567049503326,
-0.22725574672222137,
0.16442328691482544,
0.21453358232975006,
0.05206294357776642,
0.03575975447893143,
0.011562994681298733,
-0.19041070342063904,
-0.19717621803283691,
-0.13874371349811554,
0.436504602432251,
0.2039535790681839,
-0.1931496262550354,
0.11611482501029968,
0.37695807218551636,
0.25478053092956543,
-0.14981137216091156,
0.2050434947013855,
-0.24341991543769836,
-0.004279054701328278,
-0.02105843834578991,
0.1922427862882614,
-0.06360703706741333,
0.12725676596164703,
0.02363857999444008,
0.038367338478565216,
0.5173706412315369,
-0.19225691258907318,
0.08188387006521225,
-0.45706871151924133,
-0.2138233780860901,
-0.28974494338035583,
0.03862978518009186,
-0.023143067955970764,
-0.334125816822052,
0.12389501929283142,
-0.16948427259922028,
0.2823229134082794,
0.1559028923511505,
0.1929406225681305,
-0.019073128700256348,
-0.001011289656162262,
-0.2737191915512085,
0.4172259569168091,
0.257110059261322,
0.07342885434627533,
-0.33514532446861267,
0.08937691152095795,
-0.030404649674892426,
0.028137996792793274,
-0.1609465777873993,
0.17232289910316467,
0.5117567777633667,
-0.20068763196468353,
0.012177824974060059,
0.15608146786689758,
-0.12181691080331802,
0.170464426279068,
-0.2511324882507324,
-0.12890274822711945,
0.09742176532745361,
-0.056382253766059875,
-0.06688988208770752,
0.2145344316959381,
0.081064373254776,
0.3329788148403168,
0.06835490465164185,
-0.18985310196876526,
0.20308521389961243,
0.4013610780239105,
0.2455708235502243,
-0.1466464102268219,
0.09062954783439636,
-0.323358416557312,
-0.4021492898464203,
0.09285596013069153,
0.12403189390897751,
-0.12915396690368652,
-0.32107195258140564,
-0.029538650065660477,
-0.2911264896392822,
0.1485082507133484,
-0.1402675211429596,
0.3615153729915619,
0.051555342972278595,
-0.05767068266868591,
0.02866557240486145,
-0.08010196685791016,
-0.08805245906114578,
-0.21238155663013458,
0.0044502392411231995,
-0.07399352639913559,
-0.45723462104797363,
0.3407262861728668,
-0.07629835605621338,
-0.24156437814235687,
-0.000879824161529541,
0.2977244555950165,
0.3089466094970703,
-0.2554756700992584,
-0.18545329570770264,
0.06781269609928131,
-0.041490595787763596,
0.0090583935379982,
-0.6232644319534302,
0.08500450849533081,
0.3012889325618744,
-0.609376072883606,
0.0168143417686224,
0.34024256467819214,
0.06993895769119263,
-0.09983507543802261,
-0.2596209645271301,
0.5482124090194702,
-0.061926089227199554,
0.40625590085983276,
-0.25437575578689575,
0.1835137903690338,
0.05256066471338272,
-0.07758843153715134,
-0.03234098479151726,
-0.5320141911506653,
0.17091216146945953,
0.32359129190444946,
-0.02632255107164383,
-0.20230379700660706,
-0.20841136574745178,
0.23279035091400146,
0.48595988750457764,
0.08558829128742218,
0.06190440431237221,
0.04999994486570358,
0.03772636130452156,
0.1752065271139145,
0.08930473774671555,
-0.1362791210412979,
0.3572753965854645,
-0.020419100299477577,
0.03788904845714569,
0.04460349678993225,
-0.21189184486865997,
-0.10992154479026794,
0.13665130734443665,
-0.005046539008617401,
0.30017518997192383,
0.25180450081825256,
0.3552767336368561,
0.037704043090343475,
-0.024452075362205505,
0.020741216838359833,
0.013129182159900665,
0.2762441635131836,
-0.3450794816017151,
0.053591057658195496,
-0.5258969068527222,
0.24876537919044495,
-0.12870879471302032,
0.1165490448474884,
0.007004039362072945,
-0.6322692036628723,
-0.11840616166591644,
0.14199481904506683,
-0.257108598947525,
0.2757343649864197,
-0.16970214247703552,
-0.21960431337356567,
0.3820171356201172,
-0.054502956569194794,
-0.13876524567604065,
-0.03586283698678017,
0.013406937941908836,
0.017696719616651535,
0.0925588607788086,
-0.19849228858947754,
0.3217742145061493,
0.278743177652359,
-0.27120548486709595,
-0.19101257622241974,
-0.3983072340488434,
0.060028303414583206,
-0.20032057166099548,
0.03405997157096863,
0.41080766916275024,
0.36805886030197144,
-0.14732247591018677,
-0.04006434977054596,
0.36776039004325867,
0.01731695979833603,
-0.13774260878562927,
0.16080865263938904,
0.04575474560260773,
0.017598852515220642,
-0.28233009576797485,
-0.21304085850715637,
-0.1292920857667923,
-0.33388566970825195,
0.03561502322554588,
-0.06704635173082352,
0.07861733436584473,
-0.1859043687582016,
0.31298860907554626,
0.11443743109703064,
0.28482162952423096,
-0.2604098618030548,
-0.088406503200531,
0.5659745335578918,
0.3640984892845154,
-0.17837165296077728,
-0.27980947494506836,
-0.11245761066675186,
-0.25646185874938965,
-0.0836997851729393,
0.11429792642593384,
-0.37483274936676025,
-0.10828276723623276,
-0.23243793845176697,
-0.02200094610452652,
-0.13607138395309448,
-0.15307512879371643,
0.1347891092300415,
0.018365997821092606,
-0.00463147833943367,
-0.21979422867298126,
-0.038447365164756775,
0.08611491322517395,
0.24986951053142548,
0.11057326942682266,
0.16714105010032654,
0.7291289567947388,
0.2036714106798172,
0.1518416702747345,
0.4298146963119507,
-0.2774936854839325,
0.4726235270500183,
-0.13884826004505157,
-0.061101317405700684,
-0.2715485990047455,
-0.2826998829841614,
0.005534965544939041,
0.06626863777637482,
-0.06784863770008087,
0.018075551837682724,
-0.28966811299324036,
-0.3529788851737976,
0.25518158078193665,
0.24507036805152893,
0.39755386114120483,
-0.17491395771503448,
0.3507847189903259,
-0.16409996151924133,
0.1255677044391632,
0.07956571877002716,
0.08357103914022446,
-0.18910907208919525,
-0.30087071657180786,
-0.08740648627281189,
-0.2721712589263916,
-0.016251467168331146,
-0.12653008103370667,
-0.1295861005783081,
-0.43570610880851746,
-0.16920089721679688,
0.4490423798561096,
0.3664797842502594,
0.4590907692909241,
-0.1614532172679901,
-0.11302125453948975,
0.1483467072248459,
0.025317441672086716,
0.48168131709098816,
-0.44076645374298096,
0.14161507785320282,
0.14679089188575745,
0.3611714839935303,
-0.34385040402412415,
0.024837709963321686,
-0.18431462347507477,
0.1914575845003128,
0.08627617359161377,
0.5145982503890991,
-0.3198578357696533,
0.14650948345661163,
0.35203731060028076,
0.1926763951778412,
-0.010515660047531128,
-0.04954076185822487,
-0.18655391037464142,
-0.23416034877300262,
-0.2160029113292694,
0.16593454778194427,
0.3185356557369232,
0.38874271512031555,
0.14403139054775238,
-0.13777005672454834,
-0.09857737272977829,
-0.30513978004455566,
-0.042576659470796585,
-0.027940213680267334,
0.21182280778884888,
0.13058514893054962,
0.27704179286956787,
-0.038301389664411545,
0.19252881407737732,
0.1166856661438942,
0.302940309047699,
-0.1584852933883667,
0.0730135440826416,
0.258468896150589,
0.06777670979499817,
0.1999226212501526,
0.3109983503818512,
0.025076791644096375,
0.008409522473812103,
0.09602674841880798,
0.23341241478919983,
-0.008836120367050171,
-0.33192455768585205,
0.17782354354858398,
-0.0005199462175369263,
-0.32832071185112,
-0.3775207996368408,
0.22168922424316406,
-0.07062619179487228,
0.0008000582456588745,
0.0771985575556755,
-0.14458483457565308,
-0.32025572657585144,
0.45683205127716064,
0.3248545229434967,
0.9603632688522339,
-0.2047732174396515,
0.02288060449063778,
0.5515077114105225,
0.3343576490879059,
0.17022976279258728,
0.2516012489795685,
0.3475590944290161,
-0.471874475479126,
-0.09217851608991623,
-0.14088451862335205,
-0.2296956479549408,
0.20192132890224457,
-0.026845350861549377,
-0.4110291004180908,
0.11839844286441803,
-0.14434459805488586,
0.31459563970565796,
-0.2338852733373642,
-0.3149000108242035,
-0.12918241322040558,
-0.25882789492607117,
-0.4706277549266815,
0.1039162129163742,
-0.12018071115016937,
-0.007411440368741751,
0.16514253616333008,
-0.24972519278526306,
-0.08119508624076843,
-0.2637501358985901,
-0.27734047174453735,
0.20639656484127045,
-0.4026607275009155,
0.21071328222751617,
-0.030321158468723297,
-0.11380774527788162,
0.23171354830265045,
0.25259730219841003,
-0.03134164959192276,
0.13201726973056793,
-0.17394684255123138,
0.02721370756626129,
0.15941429138183594,
0.029142461717128754,
0.14455145597457886,
0.015007074922323227,
0.2039279192686081,
0.09721529483795166,
0.006433635950088501,
0.021572604775428772,
-0.02257348597049713,
-0.15433017909526825,
-0.0015655755996704102,
0.32169628143310547,
0.22442206740379333,
-0.43133971095085144,
-0.4707599878311157,
-0.12498647719621658,
0.0014198645949363708,
-0.198863685131073,
0.07521715760231018,
-0.1875709593296051,
-0.06013389304280281,
0.3216326832771301,
0.14607667922973633,
-0.14516563713550568,
0.06301233172416687,
0.6949044466018677,
0.1430273801088333,
0.161018505692482,
0.5357392430305481,
0.21658694744110107,
-0.35652947425842285,
-0.21636995673179626,
0.2627693712711334,
0.3033808171749115,
-0.39714983105659485,
0.2343822568655014,
-0.3357691764831543,
-0.2018863558769226,
0.10831080377101898,
0.28115347027778625,
0.12000590562820435,
0.09035751223564148,
-0.1564120352268219,
-0.41220250725746155,
-0.4198310971260071,
0.17138642072677612,
0.14339685440063477,
0.09554918110370636,
-0.3767409324645996,
0.2148456871509552,
-0.2926470637321472,
-0.206017404794693,
-0.2392905354499817,
0.02186916023492813,
-0.2835589349269867,
0.2669895589351654,
-0.17166757583618164,
-0.09454295784235,
0.1288231611251831,
0.07541866600513458,
0.1603911817073822,
0.4157889485359192,
-0.41204074025154114,
-0.1206350103020668,
-0.15010184049606323,
0.10505138337612152,
0.005675887688994408,
-0.1913338452577591,
-0.2977760136127472,
-0.45429307222366333,
-0.023036133497953415,
-0.3262808322906494,
-0.11756132543087006,
0.020911328494548798,
0.1565629541873932,
-0.2932959198951721,
0.2651994526386261,
-0.20178453624248505,
0.35277533531188965,
0.024639062583446503,
-0.2498716115951538,
0.06711988151073456,
-0.06850183010101318,
0.09569419175386429,
-0.0035631246864795685,
0.09637059271335602,
-0.1570790857076645,
0.0555291473865509,
0.05979365110397339,
-0.09794677793979645,
0.583473265171051,
-0.08335378766059875,
-0.0437530092895031,
0.2619874179363251,
0.3545260429382324,
0.07417086511850357,
-0.48074913024902344,
-0.0893208235502243,
-0.1372917890548706,
0.11806211620569229,
-0.23007048666477203,
0.06830661743879318,
0.5966585278511047,
0.2387935072183609,
0.0316929966211319,
0.4573734402656555,
0.241622194647789,
-0.08906017243862152,
0.30242928862571716,
-0.034774526953697205,
0.6359615325927734,
-0.48130446672439575,
0.023947615176439285,
0.40539640188217163,
0.06419096887111664,
0.07527190446853638,
0.09152358770370483,
-0.07397009432315826,
0.5663990378379822,
0.26661795377731323,
-0.2606790065765381,
0.09365128725767136,
0.2743183672428131,
-0.07124264538288116,
0.2012554556131363,
-0.30610984563827515,
0.1677270382642746,
0.46194571256637573,
-0.09581658244132996,
0.40159860253334045,
0.17039449512958527,
-0.15409640967845917,
-0.35849934816360474,
-0.2967623770236969,
-0.11757589876651764,
0.31423240900039673,
-0.34046924114227295,
0.04077767953276634,
0.09888478368520737,
-0.020929619669914246,
-0.39980196952819824,
-0.10252975672483444,
-0.13894221186637878,
0.14168795943260193,
0.40236896276474,
0.12681417167186737,
0.15464016795158386,
-0.23003196716308594,
-0.07246871292591095,
-0.05564228817820549,
0.3041187822818756,
-0.32778942584991455,
0.3997332751750946,
0.032093264162540436,
0.07267196476459503,
0.08473103493452072,
0.11954376846551895,
0.2645041346549988,
0.44326716661453247,
-0.054269351065158844,
0.011966932564973831,
0.17946526408195496,
-0.15628035366535187,
-0.11826885491609573,
0.03782311826944351,
-0.08878089487552643,
0.23354856669902802,
0.16323918104171753,
0.06324820965528488,
-0.07908520102500916,
0.1657140552997589,
0.11084437370300293,
0.32701611518859863,
0.08240363001823425,
0.190421462059021,
-0.2574006915092468,
-0.2632776200771332,
-0.06235690042376518,
-0.16974009573459625,
-0.3203371465206146,
0.28411856293678284,
0.1229376420378685,
-0.1455649584531784,
0.30209994316101074,
0.22919584810733795,
0.06562316417694092,
-0.042208679020404816,
0.17463135719299316,
0.227949857711792,
-0.5005799531936646,
-0.3009428381919861,
-0.04509389400482178,
-0.33657562732696533,
0.36805832386016846,
-0.07075794041156769,
-0.09375681728124619,
0.34669166803359985,
0.23154309391975403,
0.10995149612426758,
-0.15934985876083374,
0.15326181054115295,
-0.3929290175437927,
0.09611640125513077,
0.4355100989341736,
-0.07813660800457001,
-0.3405894637107849,
0.28941357135772705,
0.030585313215851784,
0.04144022613763809,
-0.4165697991847992,
0.19930587708950043,
-0.07922010123729706,
0.06133478134870529,
-0.2836090624332428,
-0.014647692441940308,
-0.3741557002067566,
-0.0065858019515872,
0.2115599662065506,
0.10779260843992233,
0.09681627154350281,
-0.15026770532131195,
-0.21088987588882446,
-0.18099984526634216,
-0.3304256200790405,
0.021901357918977737,
0.5457656979560852,
-0.049527958035469055,
0.5184241533279419,
-0.1682012975215912,
-0.01793818548321724,
-0.1954338252544403,
-0.22923611104488373,
-0.060610558837652206,
0.1554713249206543,
-0.2987598180770874,
0.3159107267856598,
-0.5019170641899109,
0.2975316345691681,
-0.07939588278532028,
0.11476007103919983,
0.22290551662445068,
0.3448914885520935,
-0.09962716698646545,
-0.567557692527771,
0.5995520353317261,
-0.5153391361236572,
-0.4363291263580322,
0.4475153088569641,
-0.05775578320026398,
-0.18304875493049622,
-0.04715024679899216,
-0.5951933860778809,
-0.20688867568969727,
0.32950010895729065,
-0.21770143508911133,
-0.1468384712934494,
-0.03748313710093498,
0.1716468781232834,
-0.15810923278331757,
-0.20178847014904022,
0.17938943207263947,
0.0818760097026825,
-0.20784558355808258,
0.10925760865211487,
-0.24823933839797974
] |
https://github.com/huggingface/datasets/issues/6280 | This part of PyArrow is buggy and inconsistent regarding features implemented across the types, so the only option is to operate on the Arrow buffer level to fix issues such as the above one. | Couldn't cast array of type fixed_size_list to Sequence(Value(float64)) | ### Describe the bug
I have a dataset with an embedding column, when I try to map that dataset I get the following exception:
```
Traceback (most recent call last):
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map
for rank, done, content in iflatmap_unordered(
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get
raise self._value
TypeError: Couldn't cast array of type
fixed_size_list<item: float>[2]
to
Sequence(feature=Value(dtype='float32', id=None), length=2, id=None)
```
### Steps to reproduce the bug
Here's a simple repro script:
```
from datasets import Features, Value, Sequence, ClassLabel, Dataset
dataset_features = Features({
'text': Value('string'),
'embedding': Sequence(Value('double'), length=2),
'categories': Sequence(ClassLabel(names=sorted([
'one',
'two',
'three'
]))),
})
dataset = Dataset.from_dict(
{
'text': ['A'] * 10000,
'embedding': [[0.0, 0.1]] * 10000,
'categories': [[0]] * 10000,
},
features=dataset_features
)
def test_mapper(r):
r['text'] = list(map(lambda t: t + ' b', r['text']))
return r
dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)
```
Removing the embedding column fixes the issue!
### Expected behavior
The mapping completes successfully.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.17.1
- PyArrow version: 13.0.0
- Pandas version: 2.0.3 | 34 | Couldn't cast array of type fixed_size_list to Sequence(Value(float64))
### Describe the bug
I have a dataset with an embedding column, when I try to map that dataset I get the following exception:
```
Traceback (most recent call last):
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map
for rank, done, content in iflatmap_unordered(
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get
raise self._value
TypeError: Couldn't cast array of type
fixed_size_list<item: float>[2]
to
Sequence(feature=Value(dtype='float32', id=None), length=2, id=None)
```
### Steps to reproduce the bug
Here's a simple repro script:
```
from datasets import Features, Value, Sequence, ClassLabel, Dataset
dataset_features = Features({
'text': Value('string'),
'embedding': Sequence(Value('double'), length=2),
'categories': Sequence(ClassLabel(names=sorted([
'one',
'two',
'three'
]))),
})
dataset = Dataset.from_dict(
{
'text': ['A'] * 10000,
'embedding': [[0.0, 0.1]] * 10000,
'categories': [[0]] * 10000,
},
features=dataset_features
)
def test_mapper(r):
r['text'] = list(map(lambda t: t + ' b', r['text']))
return r
dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)
```
Removing the embedding column fixes the issue!
### Expected behavior
The mapping completes successfully.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.17.1
- PyArrow version: 13.0.0
- Pandas version: 2.0.3
This part of PyArrow is buggy and inconsistent regarding features implemented across the types, so the only option is to operate on the Arrow buffer level to fix issues such as the above one. | [
-0.014731407165527344,
-0.6136932373046875,
0.010602809488773346,
0.0606437511742115,
0.691925585269928,
0.2248997539281845,
0.3206327557563782,
0.5348027944564819,
0.3054993152618408,
0.07003742456436157,
0.2205769568681717,
0.42197325825691223,
-0.24774007499217987,
-0.15707050263881683,
0.04050465300679207,
-0.23436950147151947,
0.07567296177148819,
0.010080832988023758,
0.033999595791101456,
-0.039406247437000275,
-0.3502662181854248,
0.08186830580234528,
-0.2914665937423706,
-0.22344446182250977,
0.3141709566116333,
-0.036635398864746094,
-0.043738316744565964,
-0.387708455324173,
0.06725618243217468,
-0.4161922037601471,
0.08449304848909378,
-0.43734344840049744,
0.167301744222641,
0.004733044654130936,
-0.00011924299906240776,
0.08766727149486542,
0.1676965057849884,
-0.09879788756370544,
0.02603975683450699,
-0.1415690779685974,
-0.44053733348846436,
-0.2952093482017517,
0.04407931864261627,
-0.27701133489608765,
-0.2440282702445984,
-0.14675737917423248,
-0.019602810963988304,
-0.8098945021629333,
0.16758669912815094,
0.23712632060050964,
0.17189840972423553,
0.26110807061195374,
-0.002238132059574127,
-0.24377432465553284,
0.06861956417560577,
-0.14582855999469757,
-0.30661797523498535,
0.16370859742164612,
0.3364611268043518,
0.12783800065517426,
0.027302315458655357,
0.2367696613073349,
-0.182655930519104,
0.07607272267341614,
0.33680009841918945,
-0.031576141715049744,
0.05908780172467232,
-0.31823426485061646,
-0.08692532032728195,
0.1545332372188568,
0.27571219205856323,
-0.12381984293460846,
-0.022917278110980988,
-0.1624114215373993,
0.1246025562286377,
-0.14329127967357635,
0.12495435029268265,
0.01087181270122528,
0.21864867210388184,
0.1018034815788269,
-0.3464144468307495,
0.22441770136356354,
-0.014149166643619537,
0.2016615867614746,
-0.13139958679676056,
0.10976435244083405,
-0.0636732280254364,
0.16458916664123535,
-0.001836468931287527,
-0.3481568694114685,
-0.13462917506694794,
-0.02398580126464367,
0.10293424129486084,
0.29691529273986816,
-0.11079524457454681,
-0.22814951837062836,
0.1559053659439087,
-0.07476067543029785,
-0.026740245521068573,
-0.08730240166187286,
0.20437732338905334,
0.12169872224330902,
0.22203920781612396,
0.06769665330648422,
0.07590395212173462,
0.4233965277671814,
-0.23275913298130035,
0.4559178650379181,
0.03148274123668671,
0.3156639337539673,
-0.07851390540599823,
0.06594842672348022,
0.175690695643425,
-0.09294231235980988,
0.056804805994033813,
0.25875693559646606,
0.1035202294588089,
-0.15227943658828735,
-0.37731772661209106,
0.3860526382923126,
-0.5588682293891907,
0.29801568388938904,
0.23258069157600403,
0.345366507768631,
-0.07503615319728851,
0.22007659077644348,
0.2516765296459198,
0.3283335566520691,
-0.006437819451093674,
0.060886967927217484,
-0.10444429516792297,
0.025494109839200974,
-0.12618567049503326,
-0.22725574672222137,
0.16442328691482544,
0.21453358232975006,
0.05206294357776642,
0.03575975447893143,
0.011562994681298733,
-0.19041070342063904,
-0.19717621803283691,
-0.13874371349811554,
0.436504602432251,
0.2039535790681839,
-0.1931496262550354,
0.11611482501029968,
0.37695807218551636,
0.25478053092956543,
-0.14981137216091156,
0.2050434947013855,
-0.24341991543769836,
-0.004279054701328278,
-0.02105843834578991,
0.1922427862882614,
-0.06360703706741333,
0.12725676596164703,
0.02363857999444008,
0.038367338478565216,
0.5173706412315369,
-0.19225691258907318,
0.08188387006521225,
-0.45706871151924133,
-0.2138233780860901,
-0.28974494338035583,
0.03862978518009186,
-0.023143067955970764,
-0.334125816822052,
0.12389501929283142,
-0.16948427259922028,
0.2823229134082794,
0.1559028923511505,
0.1929406225681305,
-0.019073128700256348,
-0.001011289656162262,
-0.2737191915512085,
0.4172259569168091,
0.257110059261322,
0.07342885434627533,
-0.33514532446861267,
0.08937691152095795,
-0.030404649674892426,
0.028137996792793274,
-0.1609465777873993,
0.17232289910316467,
0.5117567777633667,
-0.20068763196468353,
0.012177824974060059,
0.15608146786689758,
-0.12181691080331802,
0.170464426279068,
-0.2511324882507324,
-0.12890274822711945,
0.09742176532745361,
-0.056382253766059875,
-0.06688988208770752,
0.2145344316959381,
0.081064373254776,
0.3329788148403168,
0.06835490465164185,
-0.18985310196876526,
0.20308521389961243,
0.4013610780239105,
0.2455708235502243,
-0.1466464102268219,
0.09062954783439636,
-0.323358416557312,
-0.4021492898464203,
0.09285596013069153,
0.12403189390897751,
-0.12915396690368652,
-0.32107195258140564,
-0.029538650065660477,
-0.2911264896392822,
0.1485082507133484,
-0.1402675211429596,
0.3615153729915619,
0.051555342972278595,
-0.05767068266868591,
0.02866557240486145,
-0.08010196685791016,
-0.08805245906114578,
-0.21238155663013458,
0.0044502392411231995,
-0.07399352639913559,
-0.45723462104797363,
0.3407262861728668,
-0.07629835605621338,
-0.24156437814235687,
-0.000879824161529541,
0.2977244555950165,
0.3089466094970703,
-0.2554756700992584,
-0.18545329570770264,
0.06781269609928131,
-0.041490595787763596,
0.0090583935379982,
-0.6232644319534302,
0.08500450849533081,
0.3012889325618744,
-0.609376072883606,
0.0168143417686224,
0.34024256467819214,
0.06993895769119263,
-0.09983507543802261,
-0.2596209645271301,
0.5482124090194702,
-0.061926089227199554,
0.40625590085983276,
-0.25437575578689575,
0.1835137903690338,
0.05256066471338272,
-0.07758843153715134,
-0.03234098479151726,
-0.5320141911506653,
0.17091216146945953,
0.32359129190444946,
-0.02632255107164383,
-0.20230379700660706,
-0.20841136574745178,
0.23279035091400146,
0.48595988750457764,
0.08558829128742218,
0.06190440431237221,
0.04999994486570358,
0.03772636130452156,
0.1752065271139145,
0.08930473774671555,
-0.1362791210412979,
0.3572753965854645,
-0.020419100299477577,
0.03788904845714569,
0.04460349678993225,
-0.21189184486865997,
-0.10992154479026794,
0.13665130734443665,
-0.005046539008617401,
0.30017518997192383,
0.25180450081825256,
0.3552767336368561,
0.037704043090343475,
-0.024452075362205505,
0.020741216838359833,
0.013129182159900665,
0.2762441635131836,
-0.3450794816017151,
0.053591057658195496,
-0.5258969068527222,
0.24876537919044495,
-0.12870879471302032,
0.1165490448474884,
0.007004039362072945,
-0.6322692036628723,
-0.11840616166591644,
0.14199481904506683,
-0.257108598947525,
0.2757343649864197,
-0.16970214247703552,
-0.21960431337356567,
0.3820171356201172,
-0.054502956569194794,
-0.13876524567604065,
-0.03586283698678017,
0.013406937941908836,
0.017696719616651535,
0.0925588607788086,
-0.19849228858947754,
0.3217742145061493,
0.278743177652359,
-0.27120548486709595,
-0.19101257622241974,
-0.3983072340488434,
0.060028303414583206,
-0.20032057166099548,
0.03405997157096863,
0.41080766916275024,
0.36805886030197144,
-0.14732247591018677,
-0.04006434977054596,
0.36776039004325867,
0.01731695979833603,
-0.13774260878562927,
0.16080865263938904,
0.04575474560260773,
0.017598852515220642,
-0.28233009576797485,
-0.21304085850715637,
-0.1292920857667923,
-0.33388566970825195,
0.03561502322554588,
-0.06704635173082352,
0.07861733436584473,
-0.1859043687582016,
0.31298860907554626,
0.11443743109703064,
0.28482162952423096,
-0.2604098618030548,
-0.088406503200531,
0.5659745335578918,
0.3640984892845154,
-0.17837165296077728,
-0.27980947494506836,
-0.11245761066675186,
-0.25646185874938965,
-0.0836997851729393,
0.11429792642593384,
-0.37483274936676025,
-0.10828276723623276,
-0.23243793845176697,
-0.02200094610452652,
-0.13607138395309448,
-0.15307512879371643,
0.1347891092300415,
0.018365997821092606,
-0.00463147833943367,
-0.21979422867298126,
-0.038447365164756775,
0.08611491322517395,
0.24986951053142548,
0.11057326942682266,
0.16714105010032654,
0.7291289567947388,
0.2036714106798172,
0.1518416702747345,
0.4298146963119507,
-0.2774936854839325,
0.4726235270500183,
-0.13884826004505157,
-0.061101317405700684,
-0.2715485990047455,
-0.2826998829841614,
0.005534965544939041,
0.06626863777637482,
-0.06784863770008087,
0.018075551837682724,
-0.28966811299324036,
-0.3529788851737976,
0.25518158078193665,
0.24507036805152893,
0.39755386114120483,
-0.17491395771503448,
0.3507847189903259,
-0.16409996151924133,
0.1255677044391632,
0.07956571877002716,
0.08357103914022446,
-0.18910907208919525,
-0.30087071657180786,
-0.08740648627281189,
-0.2721712589263916,
-0.016251467168331146,
-0.12653008103370667,
-0.1295861005783081,
-0.43570610880851746,
-0.16920089721679688,
0.4490423798561096,
0.3664797842502594,
0.4590907692909241,
-0.1614532172679901,
-0.11302125453948975,
0.1483467072248459,
0.025317441672086716,
0.48168131709098816,
-0.44076645374298096,
0.14161507785320282,
0.14679089188575745,
0.3611714839935303,
-0.34385040402412415,
0.024837709963321686,
-0.18431462347507477,
0.1914575845003128,
0.08627617359161377,
0.5145982503890991,
-0.3198578357696533,
0.14650948345661163,
0.35203731060028076,
0.1926763951778412,
-0.010515660047531128,
-0.04954076185822487,
-0.18655391037464142,
-0.23416034877300262,
-0.2160029113292694,
0.16593454778194427,
0.3185356557369232,
0.38874271512031555,
0.14403139054775238,
-0.13777005672454834,
-0.09857737272977829,
-0.30513978004455566,
-0.042576659470796585,
-0.027940213680267334,
0.21182280778884888,
0.13058514893054962,
0.27704179286956787,
-0.038301389664411545,
0.19252881407737732,
0.1166856661438942,
0.302940309047699,
-0.1584852933883667,
0.0730135440826416,
0.258468896150589,
0.06777670979499817,
0.1999226212501526,
0.3109983503818512,
0.025076791644096375,
0.008409522473812103,
0.09602674841880798,
0.23341241478919983,
-0.008836120367050171,
-0.33192455768585205,
0.17782354354858398,
-0.0005199462175369263,
-0.32832071185112,
-0.3775207996368408,
0.22168922424316406,
-0.07062619179487228,
0.0008000582456588745,
0.0771985575556755,
-0.14458483457565308,
-0.32025572657585144,
0.45683205127716064,
0.3248545229434967,
0.9603632688522339,
-0.2047732174396515,
0.02288060449063778,
0.5515077114105225,
0.3343576490879059,
0.17022976279258728,
0.2516012489795685,
0.3475590944290161,
-0.471874475479126,
-0.09217851608991623,
-0.14088451862335205,
-0.2296956479549408,
0.20192132890224457,
-0.026845350861549377,
-0.4110291004180908,
0.11839844286441803,
-0.14434459805488586,
0.31459563970565796,
-0.2338852733373642,
-0.3149000108242035,
-0.12918241322040558,
-0.25882789492607117,
-0.4706277549266815,
0.1039162129163742,
-0.12018071115016937,
-0.007411440368741751,
0.16514253616333008,
-0.24972519278526306,
-0.08119508624076843,
-0.2637501358985901,
-0.27734047174453735,
0.20639656484127045,
-0.4026607275009155,
0.21071328222751617,
-0.030321158468723297,
-0.11380774527788162,
0.23171354830265045,
0.25259730219841003,
-0.03134164959192276,
0.13201726973056793,
-0.17394684255123138,
0.02721370756626129,
0.15941429138183594,
0.029142461717128754,
0.14455145597457886,
0.015007074922323227,
0.2039279192686081,
0.09721529483795166,
0.006433635950088501,
0.021572604775428772,
-0.02257348597049713,
-0.15433017909526825,
-0.0015655755996704102,
0.32169628143310547,
0.22442206740379333,
-0.43133971095085144,
-0.4707599878311157,
-0.12498647719621658,
0.0014198645949363708,
-0.198863685131073,
0.07521715760231018,
-0.1875709593296051,
-0.06013389304280281,
0.3216326832771301,
0.14607667922973633,
-0.14516563713550568,
0.06301233172416687,
0.6949044466018677,
0.1430273801088333,
0.161018505692482,
0.5357392430305481,
0.21658694744110107,
-0.35652947425842285,
-0.21636995673179626,
0.2627693712711334,
0.3033808171749115,
-0.39714983105659485,
0.2343822568655014,
-0.3357691764831543,
-0.2018863558769226,
0.10831080377101898,
0.28115347027778625,
0.12000590562820435,
0.09035751223564148,
-0.1564120352268219,
-0.41220250725746155,
-0.4198310971260071,
0.17138642072677612,
0.14339685440063477,
0.09554918110370636,
-0.3767409324645996,
0.2148456871509552,
-0.2926470637321472,
-0.206017404794693,
-0.2392905354499817,
0.02186916023492813,
-0.2835589349269867,
0.2669895589351654,
-0.17166757583618164,
-0.09454295784235,
0.1288231611251831,
0.07541866600513458,
0.1603911817073822,
0.4157889485359192,
-0.41204074025154114,
-0.1206350103020668,
-0.15010184049606323,
0.10505138337612152,
0.005675887688994408,
-0.1913338452577591,
-0.2977760136127472,
-0.45429307222366333,
-0.023036133497953415,
-0.3262808322906494,
-0.11756132543087006,
0.020911328494548798,
0.1565629541873932,
-0.2932959198951721,
0.2651994526386261,
-0.20178453624248505,
0.35277533531188965,
0.024639062583446503,
-0.2498716115951538,
0.06711988151073456,
-0.06850183010101318,
0.09569419175386429,
-0.0035631246864795685,
0.09637059271335602,
-0.1570790857076645,
0.0555291473865509,
0.05979365110397339,
-0.09794677793979645,
0.583473265171051,
-0.08335378766059875,
-0.0437530092895031,
0.2619874179363251,
0.3545260429382324,
0.07417086511850357,
-0.48074913024902344,
-0.0893208235502243,
-0.1372917890548706,
0.11806211620569229,
-0.23007048666477203,
0.06830661743879318,
0.5966585278511047,
0.2387935072183609,
0.0316929966211319,
0.4573734402656555,
0.241622194647789,
-0.08906017243862152,
0.30242928862571716,
-0.034774526953697205,
0.6359615325927734,
-0.48130446672439575,
0.023947615176439285,
0.40539640188217163,
0.06419096887111664,
0.07527190446853638,
0.09152358770370483,
-0.07397009432315826,
0.5663990378379822,
0.26661795377731323,
-0.2606790065765381,
0.09365128725767136,
0.2743183672428131,
-0.07124264538288116,
0.2012554556131363,
-0.30610984563827515,
0.1677270382642746,
0.46194571256637573,
-0.09581658244132996,
0.40159860253334045,
0.17039449512958527,
-0.15409640967845917,
-0.35849934816360474,
-0.2967623770236969,
-0.11757589876651764,
0.31423240900039673,
-0.34046924114227295,
0.04077767953276634,
0.09888478368520737,
-0.020929619669914246,
-0.39980196952819824,
-0.10252975672483444,
-0.13894221186637878,
0.14168795943260193,
0.40236896276474,
0.12681417167186737,
0.15464016795158386,
-0.23003196716308594,
-0.07246871292591095,
-0.05564228817820549,
0.3041187822818756,
-0.32778942584991455,
0.3997332751750946,
0.032093264162540436,
0.07267196476459503,
0.08473103493452072,
0.11954376846551895,
0.2645041346549988,
0.44326716661453247,
-0.054269351065158844,
0.011966932564973831,
0.17946526408195496,
-0.15628035366535187,
-0.11826885491609573,
0.03782311826944351,
-0.08878089487552643,
0.23354856669902802,
0.16323918104171753,
0.06324820965528488,
-0.07908520102500916,
0.1657140552997589,
0.11084437370300293,
0.32701611518859863,
0.08240363001823425,
0.190421462059021,
-0.2574006915092468,
-0.2632776200771332,
-0.06235690042376518,
-0.16974009573459625,
-0.3203371465206146,
0.28411856293678284,
0.1229376420378685,
-0.1455649584531784,
0.30209994316101074,
0.22919584810733795,
0.06562316417694092,
-0.042208679020404816,
0.17463135719299316,
0.227949857711792,
-0.5005799531936646,
-0.3009428381919861,
-0.04509389400482178,
-0.33657562732696533,
0.36805832386016846,
-0.07075794041156769,
-0.09375681728124619,
0.34669166803359985,
0.23154309391975403,
0.10995149612426758,
-0.15934985876083374,
0.15326181054115295,
-0.3929290175437927,
0.09611640125513077,
0.4355100989341736,
-0.07813660800457001,
-0.3405894637107849,
0.28941357135772705,
0.030585313215851784,
0.04144022613763809,
-0.4165697991847992,
0.19930587708950043,
-0.07922010123729706,
0.06133478134870529,
-0.2836090624332428,
-0.014647692441940308,
-0.3741557002067566,
-0.0065858019515872,
0.2115599662065506,
0.10779260843992233,
0.09681627154350281,
-0.15026770532131195,
-0.21088987588882446,
-0.18099984526634216,
-0.3304256200790405,
0.021901357918977737,
0.5457656979560852,
-0.049527958035469055,
0.5184241533279419,
-0.1682012975215912,
-0.01793818548321724,
-0.1954338252544403,
-0.22923611104488373,
-0.060610558837652206,
0.1554713249206543,
-0.2987598180770874,
0.3159107267856598,
-0.5019170641899109,
0.2975316345691681,
-0.07939588278532028,
0.11476007103919983,
0.22290551662445068,
0.3448914885520935,
-0.09962716698646545,
-0.567557692527771,
0.5995520353317261,
-0.5153391361236572,
-0.4363291263580322,
0.4475153088569641,
-0.05775578320026398,
-0.18304875493049622,
-0.04715024679899216,
-0.5951933860778809,
-0.20688867568969727,
0.32950010895729065,
-0.21770143508911133,
-0.1468384712934494,
-0.03748313710093498,
0.1716468781232834,
-0.15810923278331757,
-0.20178847014904022,
0.17938943207263947,
0.0818760097026825,
-0.20784558355808258,
0.10925760865211487,
-0.24823933839797974
] |
https://github.com/huggingface/datasets/issues/6280 | Ok - can you take the POC I did [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e)? Happy to turn this into an actual PR but would appreciate feedback on the implementation before I take another pass! | Couldn't cast array of type fixed_size_list to Sequence(Value(float64)) | ### Describe the bug
I have a dataset with an embedding column, when I try to map that dataset I get the following exception:
```
Traceback (most recent call last):
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map
for rank, done, content in iflatmap_unordered(
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get
raise self._value
TypeError: Couldn't cast array of type
fixed_size_list<item: float>[2]
to
Sequence(feature=Value(dtype='float32', id=None), length=2, id=None)
```
### Steps to reproduce the bug
Here's a simple repro script:
```
from datasets import Features, Value, Sequence, ClassLabel, Dataset
dataset_features = Features({
'text': Value('string'),
'embedding': Sequence(Value('double'), length=2),
'categories': Sequence(ClassLabel(names=sorted([
'one',
'two',
'three'
]))),
})
dataset = Dataset.from_dict(
{
'text': ['A'] * 10000,
'embedding': [[0.0, 0.1]] * 10000,
'categories': [[0]] * 10000,
},
features=dataset_features
)
def test_mapper(r):
r['text'] = list(map(lambda t: t + ' b', r['text']))
return r
dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)
```
Removing the embedding column fixes the issue!
### Expected behavior
The mapping completes successfully.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.17.1
- PyArrow version: 13.0.0
- Pandas version: 2.0.3 | 30 | Couldn't cast array of type fixed_size_list to Sequence(Value(float64))
### Describe the bug
I have a dataset with an embedding column, when I try to map that dataset I get the following exception:
```
Traceback (most recent call last):
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map
for rank, done, content in iflatmap_unordered(
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get
raise self._value
TypeError: Couldn't cast array of type
fixed_size_list<item: float>[2]
to
Sequence(feature=Value(dtype='float32', id=None), length=2, id=None)
```
### Steps to reproduce the bug
Here's a simple repro script:
```
from datasets import Features, Value, Sequence, ClassLabel, Dataset
dataset_features = Features({
'text': Value('string'),
'embedding': Sequence(Value('double'), length=2),
'categories': Sequence(ClassLabel(names=sorted([
'one',
'two',
'three'
]))),
})
dataset = Dataset.from_dict(
{
'text': ['A'] * 10000,
'embedding': [[0.0, 0.1]] * 10000,
'categories': [[0]] * 10000,
},
features=dataset_features
)
def test_mapper(r):
r['text'] = list(map(lambda t: t + ' b', r['text']))
return r
dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)
```
Removing the embedding column fixes the issue!
### Expected behavior
The mapping completes successfully.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.17.1
- PyArrow version: 13.0.0
- Pandas version: 2.0.3
Ok - can you take the POC I did [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e)? Happy to turn this into an actual PR but would appreciate feedback on the implementation before I take another pass! | [
-0.014731407165527344,
-0.6136932373046875,
0.010602809488773346,
0.0606437511742115,
0.691925585269928,
0.2248997539281845,
0.3206327557563782,
0.5348027944564819,
0.3054993152618408,
0.07003742456436157,
0.2205769568681717,
0.42197325825691223,
-0.24774007499217987,
-0.15707050263881683,
0.04050465300679207,
-0.23436950147151947,
0.07567296177148819,
0.010080832988023758,
0.033999595791101456,
-0.039406247437000275,
-0.3502662181854248,
0.08186830580234528,
-0.2914665937423706,
-0.22344446182250977,
0.3141709566116333,
-0.036635398864746094,
-0.043738316744565964,
-0.387708455324173,
0.06725618243217468,
-0.4161922037601471,
0.08449304848909378,
-0.43734344840049744,
0.167301744222641,
0.004733044654130936,
-0.00011924299906240776,
0.08766727149486542,
0.1676965057849884,
-0.09879788756370544,
0.02603975683450699,
-0.1415690779685974,
-0.44053733348846436,
-0.2952093482017517,
0.04407931864261627,
-0.27701133489608765,
-0.2440282702445984,
-0.14675737917423248,
-0.019602810963988304,
-0.8098945021629333,
0.16758669912815094,
0.23712632060050964,
0.17189840972423553,
0.26110807061195374,
-0.002238132059574127,
-0.24377432465553284,
0.06861956417560577,
-0.14582855999469757,
-0.30661797523498535,
0.16370859742164612,
0.3364611268043518,
0.12783800065517426,
0.027302315458655357,
0.2367696613073349,
-0.182655930519104,
0.07607272267341614,
0.33680009841918945,
-0.031576141715049744,
0.05908780172467232,
-0.31823426485061646,
-0.08692532032728195,
0.1545332372188568,
0.27571219205856323,
-0.12381984293460846,
-0.022917278110980988,
-0.1624114215373993,
0.1246025562286377,
-0.14329127967357635,
0.12495435029268265,
0.01087181270122528,
0.21864867210388184,
0.1018034815788269,
-0.3464144468307495,
0.22441770136356354,
-0.014149166643619537,
0.2016615867614746,
-0.13139958679676056,
0.10976435244083405,
-0.0636732280254364,
0.16458916664123535,
-0.001836468931287527,
-0.3481568694114685,
-0.13462917506694794,
-0.02398580126464367,
0.10293424129486084,
0.29691529273986816,
-0.11079524457454681,
-0.22814951837062836,
0.1559053659439087,
-0.07476067543029785,
-0.026740245521068573,
-0.08730240166187286,
0.20437732338905334,
0.12169872224330902,
0.22203920781612396,
0.06769665330648422,
0.07590395212173462,
0.4233965277671814,
-0.23275913298130035,
0.4559178650379181,
0.03148274123668671,
0.3156639337539673,
-0.07851390540599823,
0.06594842672348022,
0.175690695643425,
-0.09294231235980988,
0.056804805994033813,
0.25875693559646606,
0.1035202294588089,
-0.15227943658828735,
-0.37731772661209106,
0.3860526382923126,
-0.5588682293891907,
0.29801568388938904,
0.23258069157600403,
0.345366507768631,
-0.07503615319728851,
0.22007659077644348,
0.2516765296459198,
0.3283335566520691,
-0.006437819451093674,
0.060886967927217484,
-0.10444429516792297,
0.025494109839200974,
-0.12618567049503326,
-0.22725574672222137,
0.16442328691482544,
0.21453358232975006,
0.05206294357776642,
0.03575975447893143,
0.011562994681298733,
-0.19041070342063904,
-0.19717621803283691,
-0.13874371349811554,
0.436504602432251,
0.2039535790681839,
-0.1931496262550354,
0.11611482501029968,
0.37695807218551636,
0.25478053092956543,
-0.14981137216091156,
0.2050434947013855,
-0.24341991543769836,
-0.004279054701328278,
-0.02105843834578991,
0.1922427862882614,
-0.06360703706741333,
0.12725676596164703,
0.02363857999444008,
0.038367338478565216,
0.5173706412315369,
-0.19225691258907318,
0.08188387006521225,
-0.45706871151924133,
-0.2138233780860901,
-0.28974494338035583,
0.03862978518009186,
-0.023143067955970764,
-0.334125816822052,
0.12389501929283142,
-0.16948427259922028,
0.2823229134082794,
0.1559028923511505,
0.1929406225681305,
-0.019073128700256348,
-0.001011289656162262,
-0.2737191915512085,
0.4172259569168091,
0.257110059261322,
0.07342885434627533,
-0.33514532446861267,
0.08937691152095795,
-0.030404649674892426,
0.028137996792793274,
-0.1609465777873993,
0.17232289910316467,
0.5117567777633667,
-0.20068763196468353,
0.012177824974060059,
0.15608146786689758,
-0.12181691080331802,
0.170464426279068,
-0.2511324882507324,
-0.12890274822711945,
0.09742176532745361,
-0.056382253766059875,
-0.06688988208770752,
0.2145344316959381,
0.081064373254776,
0.3329788148403168,
0.06835490465164185,
-0.18985310196876526,
0.20308521389961243,
0.4013610780239105,
0.2455708235502243,
-0.1466464102268219,
0.09062954783439636,
-0.323358416557312,
-0.4021492898464203,
0.09285596013069153,
0.12403189390897751,
-0.12915396690368652,
-0.32107195258140564,
-0.029538650065660477,
-0.2911264896392822,
0.1485082507133484,
-0.1402675211429596,
0.3615153729915619,
0.051555342972278595,
-0.05767068266868591,
0.02866557240486145,
-0.08010196685791016,
-0.08805245906114578,
-0.21238155663013458,
0.0044502392411231995,
-0.07399352639913559,
-0.45723462104797363,
0.3407262861728668,
-0.07629835605621338,
-0.24156437814235687,
-0.000879824161529541,
0.2977244555950165,
0.3089466094970703,
-0.2554756700992584,
-0.18545329570770264,
0.06781269609928131,
-0.041490595787763596,
0.0090583935379982,
-0.6232644319534302,
0.08500450849533081,
0.3012889325618744,
-0.609376072883606,
0.0168143417686224,
0.34024256467819214,
0.06993895769119263,
-0.09983507543802261,
-0.2596209645271301,
0.5482124090194702,
-0.061926089227199554,
0.40625590085983276,
-0.25437575578689575,
0.1835137903690338,
0.05256066471338272,
-0.07758843153715134,
-0.03234098479151726,
-0.5320141911506653,
0.17091216146945953,
0.32359129190444946,
-0.02632255107164383,
-0.20230379700660706,
-0.20841136574745178,
0.23279035091400146,
0.48595988750457764,
0.08558829128742218,
0.06190440431237221,
0.04999994486570358,
0.03772636130452156,
0.1752065271139145,
0.08930473774671555,
-0.1362791210412979,
0.3572753965854645,
-0.020419100299477577,
0.03788904845714569,
0.04460349678993225,
-0.21189184486865997,
-0.10992154479026794,
0.13665130734443665,
-0.005046539008617401,
0.30017518997192383,
0.25180450081825256,
0.3552767336368561,
0.037704043090343475,
-0.024452075362205505,
0.020741216838359833,
0.013129182159900665,
0.2762441635131836,
-0.3450794816017151,
0.053591057658195496,
-0.5258969068527222,
0.24876537919044495,
-0.12870879471302032,
0.1165490448474884,
0.007004039362072945,
-0.6322692036628723,
-0.11840616166591644,
0.14199481904506683,
-0.257108598947525,
0.2757343649864197,
-0.16970214247703552,
-0.21960431337356567,
0.3820171356201172,
-0.054502956569194794,
-0.13876524567604065,
-0.03586283698678017,
0.013406937941908836,
0.017696719616651535,
0.0925588607788086,
-0.19849228858947754,
0.3217742145061493,
0.278743177652359,
-0.27120548486709595,
-0.19101257622241974,
-0.3983072340488434,
0.060028303414583206,
-0.20032057166099548,
0.03405997157096863,
0.41080766916275024,
0.36805886030197144,
-0.14732247591018677,
-0.04006434977054596,
0.36776039004325867,
0.01731695979833603,
-0.13774260878562927,
0.16080865263938904,
0.04575474560260773,
0.017598852515220642,
-0.28233009576797485,
-0.21304085850715637,
-0.1292920857667923,
-0.33388566970825195,
0.03561502322554588,
-0.06704635173082352,
0.07861733436584473,
-0.1859043687582016,
0.31298860907554626,
0.11443743109703064,
0.28482162952423096,
-0.2604098618030548,
-0.088406503200531,
0.5659745335578918,
0.3640984892845154,
-0.17837165296077728,
-0.27980947494506836,
-0.11245761066675186,
-0.25646185874938965,
-0.0836997851729393,
0.11429792642593384,
-0.37483274936676025,
-0.10828276723623276,
-0.23243793845176697,
-0.02200094610452652,
-0.13607138395309448,
-0.15307512879371643,
0.1347891092300415,
0.018365997821092606,
-0.00463147833943367,
-0.21979422867298126,
-0.038447365164756775,
0.08611491322517395,
0.24986951053142548,
0.11057326942682266,
0.16714105010032654,
0.7291289567947388,
0.2036714106798172,
0.1518416702747345,
0.4298146963119507,
-0.2774936854839325,
0.4726235270500183,
-0.13884826004505157,
-0.061101317405700684,
-0.2715485990047455,
-0.2826998829841614,
0.005534965544939041,
0.06626863777637482,
-0.06784863770008087,
0.018075551837682724,
-0.28966811299324036,
-0.3529788851737976,
0.25518158078193665,
0.24507036805152893,
0.39755386114120483,
-0.17491395771503448,
0.3507847189903259,
-0.16409996151924133,
0.1255677044391632,
0.07956571877002716,
0.08357103914022446,
-0.18910907208919525,
-0.30087071657180786,
-0.08740648627281189,
-0.2721712589263916,
-0.016251467168331146,
-0.12653008103370667,
-0.1295861005783081,
-0.43570610880851746,
-0.16920089721679688,
0.4490423798561096,
0.3664797842502594,
0.4590907692909241,
-0.1614532172679901,
-0.11302125453948975,
0.1483467072248459,
0.025317441672086716,
0.48168131709098816,
-0.44076645374298096,
0.14161507785320282,
0.14679089188575745,
0.3611714839935303,
-0.34385040402412415,
0.024837709963321686,
-0.18431462347507477,
0.1914575845003128,
0.08627617359161377,
0.5145982503890991,
-0.3198578357696533,
0.14650948345661163,
0.35203731060028076,
0.1926763951778412,
-0.010515660047531128,
-0.04954076185822487,
-0.18655391037464142,
-0.23416034877300262,
-0.2160029113292694,
0.16593454778194427,
0.3185356557369232,
0.38874271512031555,
0.14403139054775238,
-0.13777005672454834,
-0.09857737272977829,
-0.30513978004455566,
-0.042576659470796585,
-0.027940213680267334,
0.21182280778884888,
0.13058514893054962,
0.27704179286956787,
-0.038301389664411545,
0.19252881407737732,
0.1166856661438942,
0.302940309047699,
-0.1584852933883667,
0.0730135440826416,
0.258468896150589,
0.06777670979499817,
0.1999226212501526,
0.3109983503818512,
0.025076791644096375,
0.008409522473812103,
0.09602674841880798,
0.23341241478919983,
-0.008836120367050171,
-0.33192455768585205,
0.17782354354858398,
-0.0005199462175369263,
-0.32832071185112,
-0.3775207996368408,
0.22168922424316406,
-0.07062619179487228,
0.0008000582456588745,
0.0771985575556755,
-0.14458483457565308,
-0.32025572657585144,
0.45683205127716064,
0.3248545229434967,
0.9603632688522339,
-0.2047732174396515,
0.02288060449063778,
0.5515077114105225,
0.3343576490879059,
0.17022976279258728,
0.2516012489795685,
0.3475590944290161,
-0.471874475479126,
-0.09217851608991623,
-0.14088451862335205,
-0.2296956479549408,
0.20192132890224457,
-0.026845350861549377,
-0.4110291004180908,
0.11839844286441803,
-0.14434459805488586,
0.31459563970565796,
-0.2338852733373642,
-0.3149000108242035,
-0.12918241322040558,
-0.25882789492607117,
-0.4706277549266815,
0.1039162129163742,
-0.12018071115016937,
-0.007411440368741751,
0.16514253616333008,
-0.24972519278526306,
-0.08119508624076843,
-0.2637501358985901,
-0.27734047174453735,
0.20639656484127045,
-0.4026607275009155,
0.21071328222751617,
-0.030321158468723297,
-0.11380774527788162,
0.23171354830265045,
0.25259730219841003,
-0.03134164959192276,
0.13201726973056793,
-0.17394684255123138,
0.02721370756626129,
0.15941429138183594,
0.029142461717128754,
0.14455145597457886,
0.015007074922323227,
0.2039279192686081,
0.09721529483795166,
0.006433635950088501,
0.021572604775428772,
-0.02257348597049713,
-0.15433017909526825,
-0.0015655755996704102,
0.32169628143310547,
0.22442206740379333,
-0.43133971095085144,
-0.4707599878311157,
-0.12498647719621658,
0.0014198645949363708,
-0.198863685131073,
0.07521715760231018,
-0.1875709593296051,
-0.06013389304280281,
0.3216326832771301,
0.14607667922973633,
-0.14516563713550568,
0.06301233172416687,
0.6949044466018677,
0.1430273801088333,
0.161018505692482,
0.5357392430305481,
0.21658694744110107,
-0.35652947425842285,
-0.21636995673179626,
0.2627693712711334,
0.3033808171749115,
-0.39714983105659485,
0.2343822568655014,
-0.3357691764831543,
-0.2018863558769226,
0.10831080377101898,
0.28115347027778625,
0.12000590562820435,
0.09035751223564148,
-0.1564120352268219,
-0.41220250725746155,
-0.4198310971260071,
0.17138642072677612,
0.14339685440063477,
0.09554918110370636,
-0.3767409324645996,
0.2148456871509552,
-0.2926470637321472,
-0.206017404794693,
-0.2392905354499817,
0.02186916023492813,
-0.2835589349269867,
0.2669895589351654,
-0.17166757583618164,
-0.09454295784235,
0.1288231611251831,
0.07541866600513458,
0.1603911817073822,
0.4157889485359192,
-0.41204074025154114,
-0.1206350103020668,
-0.15010184049606323,
0.10505138337612152,
0.005675887688994408,
-0.1913338452577591,
-0.2977760136127472,
-0.45429307222366333,
-0.023036133497953415,
-0.3262808322906494,
-0.11756132543087006,
0.020911328494548798,
0.1565629541873932,
-0.2932959198951721,
0.2651994526386261,
-0.20178453624248505,
0.35277533531188965,
0.024639062583446503,
-0.2498716115951538,
0.06711988151073456,
-0.06850183010101318,
0.09569419175386429,
-0.0035631246864795685,
0.09637059271335602,
-0.1570790857076645,
0.0555291473865509,
0.05979365110397339,
-0.09794677793979645,
0.583473265171051,
-0.08335378766059875,
-0.0437530092895031,
0.2619874179363251,
0.3545260429382324,
0.07417086511850357,
-0.48074913024902344,
-0.0893208235502243,
-0.1372917890548706,
0.11806211620569229,
-0.23007048666477203,
0.06830661743879318,
0.5966585278511047,
0.2387935072183609,
0.0316929966211319,
0.4573734402656555,
0.241622194647789,
-0.08906017243862152,
0.30242928862571716,
-0.034774526953697205,
0.6359615325927734,
-0.48130446672439575,
0.023947615176439285,
0.40539640188217163,
0.06419096887111664,
0.07527190446853638,
0.09152358770370483,
-0.07397009432315826,
0.5663990378379822,
0.26661795377731323,
-0.2606790065765381,
0.09365128725767136,
0.2743183672428131,
-0.07124264538288116,
0.2012554556131363,
-0.30610984563827515,
0.1677270382642746,
0.46194571256637573,
-0.09581658244132996,
0.40159860253334045,
0.17039449512958527,
-0.15409640967845917,
-0.35849934816360474,
-0.2967623770236969,
-0.11757589876651764,
0.31423240900039673,
-0.34046924114227295,
0.04077767953276634,
0.09888478368520737,
-0.020929619669914246,
-0.39980196952819824,
-0.10252975672483444,
-0.13894221186637878,
0.14168795943260193,
0.40236896276474,
0.12681417167186737,
0.15464016795158386,
-0.23003196716308594,
-0.07246871292591095,
-0.05564228817820549,
0.3041187822818756,
-0.32778942584991455,
0.3997332751750946,
0.032093264162540436,
0.07267196476459503,
0.08473103493452072,
0.11954376846551895,
0.2645041346549988,
0.44326716661453247,
-0.054269351065158844,
0.011966932564973831,
0.17946526408195496,
-0.15628035366535187,
-0.11826885491609573,
0.03782311826944351,
-0.08878089487552643,
0.23354856669902802,
0.16323918104171753,
0.06324820965528488,
-0.07908520102500916,
0.1657140552997589,
0.11084437370300293,
0.32701611518859863,
0.08240363001823425,
0.190421462059021,
-0.2574006915092468,
-0.2632776200771332,
-0.06235690042376518,
-0.16974009573459625,
-0.3203371465206146,
0.28411856293678284,
0.1229376420378685,
-0.1455649584531784,
0.30209994316101074,
0.22919584810733795,
0.06562316417694092,
-0.042208679020404816,
0.17463135719299316,
0.227949857711792,
-0.5005799531936646,
-0.3009428381919861,
-0.04509389400482178,
-0.33657562732696533,
0.36805832386016846,
-0.07075794041156769,
-0.09375681728124619,
0.34669166803359985,
0.23154309391975403,
0.10995149612426758,
-0.15934985876083374,
0.15326181054115295,
-0.3929290175437927,
0.09611640125513077,
0.4355100989341736,
-0.07813660800457001,
-0.3405894637107849,
0.28941357135772705,
0.030585313215851784,
0.04144022613763809,
-0.4165697991847992,
0.19930587708950043,
-0.07922010123729706,
0.06133478134870529,
-0.2836090624332428,
-0.014647692441940308,
-0.3741557002067566,
-0.0065858019515872,
0.2115599662065506,
0.10779260843992233,
0.09681627154350281,
-0.15026770532131195,
-0.21088987588882446,
-0.18099984526634216,
-0.3304256200790405,
0.021901357918977737,
0.5457656979560852,
-0.049527958035469055,
0.5184241533279419,
-0.1682012975215912,
-0.01793818548321724,
-0.1954338252544403,
-0.22923611104488373,
-0.060610558837652206,
0.1554713249206543,
-0.2987598180770874,
0.3159107267856598,
-0.5019170641899109,
0.2975316345691681,
-0.07939588278532028,
0.11476007103919983,
0.22290551662445068,
0.3448914885520935,
-0.09962716698646545,
-0.567557692527771,
0.5995520353317261,
-0.5153391361236572,
-0.4363291263580322,
0.4475153088569641,
-0.05775578320026398,
-0.18304875493049622,
-0.04715024679899216,
-0.5951933860778809,
-0.20688867568969727,
0.32950010895729065,
-0.21770143508911133,
-0.1468384712934494,
-0.03748313710093498,
0.1716468781232834,
-0.15810923278331757,
-0.20178847014904022,
0.17938943207263947,
0.0818760097026825,
-0.20784558355808258,
0.10925760865211487,
-0.24823933839797974
] |
https://github.com/huggingface/datasets/issues/6279 | This is exactly what I was looking for. It would also be very useful for me :-) | Batched IterableDataset | ### Feature request
Hi,
could you add an implementation of a batched `IterableDataset`. It already support an option to do batch iteration via `.iter(batch_size=...)` but this cannot be used in combination with a torch `DataLoader` since it just returns an iterator.
### Motivation
The current implementation loads each element of a batch individually which can be very slow in cases of a big batch_size. I did some experiments [here](https://discuss.huggingface.co/t/slow-dataloader-with-big-batch-size/57224) and using a batched iteration would speed up data loading significantly.
### Your contribution
N/A | 17 | Batched IterableDataset
### Feature request
Hi,
could you add an implementation of a batched `IterableDataset`. It already support an option to do batch iteration via `.iter(batch_size=...)` but this cannot be used in combination with a torch `DataLoader` since it just returns an iterator.
### Motivation
The current implementation loads each element of a batch individually which can be very slow in cases of a big batch_size. I did some experiments [here](https://discuss.huggingface.co/t/slow-dataloader-with-big-batch-size/57224) and using a batched iteration would speed up data loading significantly.
### Your contribution
N/A
This is exactly what I was looking for. It would also be very useful for me :-) | [
-0.5131292939186096,
-0.40810608863830566,
-0.14537018537521362,
-0.032330356538295746,
-0.21823614835739136,
0.07741610705852509,
0.5759497284889221,
0.15358030796051025,
0.10522644221782684,
0.2235681116580963,
-0.09468673169612885,
0.2362188696861267,
-0.41731125116348267,
0.1028560921549797,
0.1062650978565216,
-0.036261823028326035,
0.032443515956401825,
0.14595137536525726,
-0.07823605835437775,
0.2217402160167694,
-0.02130953222513199,
0.13774314522743225,
-0.09421734511852264,
-0.3845921754837036,
0.08171579241752625,
0.12042354792356491,
-0.21657639741897583,
-0.0013393890112638474,
0.025080299004912376,
-0.4899531602859497,
0.32743343710899353,
0.2797330319881439,
0.3720654249191284,
0.6666460633277893,
-0.00010651788034010679,
-0.17137031257152557,
0.10324736684560776,
-0.18687134981155396,
-0.38718390464782715,
0.24419182538986206,
0.19723492860794067,
-0.26305657625198364,
-0.03523902967572212,
-0.0930328220129013,
-0.0036163777112960815,
-0.2828977704048157,
0.18601730465888977,
-0.2817625403404236,
0.02873774990439415,
-0.26368948817253113,
0.20213420689105988,
0.12120290845632553,
-0.3400599956512451,
-0.12010961025953293,
0.08926451951265335,
0.2966045141220093,
-0.23300716280937195,
0.3178102970123291,
1.0205001831054688,
0.08523689955472946,
-0.4168267846107483,
0.13229712843894958,
-0.0065329596400260925,
0.09768235683441162,
0.15806441009044647,
-0.1755865216255188,
-0.38411757349967957,
-0.1586494743824005,
-0.05352077633142471,
0.16184866428375244,
0.6472152471542358,
-0.18012815713882446,
-0.2798834443092346,
-0.47106418013572693,
-0.005882665514945984,
-0.2938971221446991,
-0.06389687955379486,
-0.05313250422477722,
-0.18328037858009338,
-0.1331324428319931,
-0.19827476143836975,
-0.0068880170583724976,
-0.308632493019104,
-0.06498023122549057,
0.07249407470226288,
0.2602003514766693,
-0.13360711932182312,
-0.052167654037475586,
0.18824775516986847,
-0.10926641523838043,
0.47675013542175293,
0.17937880754470825,
-0.1093006581068039,
0.3600827753543854,
-0.35599371790885925,
-0.308262437582016,
-0.04398497939109802,
-0.01263604685664177,
0.2973049581050873,
0.15125803649425507,
0.2477850764989853,
-0.00283247884362936,
-0.0396125353872776,
-0.06018872931599617,
0.15608397126197815,
0.11453405022621155,
0.09922191500663757,
-0.11014392971992493,
0.10471649467945099,
0.06033448874950409,
0.2767893075942993,
0.060950443148612976,
-0.10488565266132355,
-0.12232635915279388,
0.3714619278907776,
0.019595012068748474,
-0.2871975302696228,
0.10128670930862427,
-0.13731233775615692,
-0.32468387484550476,
0.1533043384552002,
-0.2573390603065491,
-0.06911349296569824,
0.14988291263580322,
0.02393408864736557,
-0.03416075557470322,
-0.11025714129209518,
-0.15676230192184448,
0.1572725772857666,
-0.26764777302742004,
0.04142000153660774,
-0.11259038746356964,
-0.08592285215854645,
0.22736385464668274,
0.2701358497142792,
-0.38377314805984497,
0.15431928634643555,
-0.027203448116779327,
0.031934954226017,
0.47369444370269775,
0.06053414195775986,
-0.12920701503753662,
0.26329827308654785,
-0.23964270949363708,
0.022699058055877686,
0.029842369258403778,
-0.1931157112121582,
0.3565228581428528,
-0.2438330352306366,
0.2562420070171356,
-0.2573893666267395,
-0.35536861419677734,
-0.2142316699028015,
0.16346107423305511,
-0.11798954010009766,
-0.20974509418010712,
-0.43562692403793335,
0.31394511461257935,
0.020535670220851898,
-0.04282153770327568,
0.14009998738765717,
-0.05548496171832085,
-0.06085292249917984,
-0.17849335074424744,
0.07179705053567886,
0.3294411301612854,
-0.4040733873844147,
-0.1291932314634323,
-0.008592251688241959,
-0.05601273849606514,
0.101608045399189,
0.10992288589477539,
-0.12615327537059784,
0.44166645407676697,
-0.5329509973526001,
0.008591845631599426,
0.01195140928030014,
-0.10681462287902832,
-0.2457328736782074,
0.4960118234157562,
0.05758528411388397,
0.3771522343158722,
0.2455664575099945,
0.2818155586719513,
0.377567321062088,
-0.2554865777492523,
0.2186923623085022,
0.3541575074195862,
-0.30459392070770264,
0.042227551341056824,
0.05831925570964813,
-0.11279943585395813,
0.24235299229621887,
0.3968749940395355,
0.029792262241244316,
0.09157362580299377,
-0.017289508134126663,
-0.2721863389015198,
0.4468938410282135,
-0.26585468649864197,
0.10467979311943054,
0.16425970196723938,
-0.04325590282678604,
-0.030040424317121506,
0.24489682912826538,
-0.18249675631523132,
-0.5408234596252441,
0.23505818843841553,
-0.17894360423088074,
-0.16303759813308716,
0.17999306321144104,
-0.05739235877990723,
-0.037050772458314896,
0.14581966400146484,
-0.24151572585105896,
-0.3633238971233368,
0.050335027277469635,
0.24082395434379578,
-0.007215291261672974,
-0.457312673330307,
-0.410818874835968,
0.12369393557310104,
-0.07928850501775742,
-0.2692316770553589,
-0.28645455837249756,
-0.21453511714935303,
0.2755012810230255,
-0.13643167912960052,
0.04633903503417969,
0.011104265227913857,
-0.2292366921901703,
-0.3621354103088379,
0.09462572634220123,
0.3568776845932007,
-0.07942566275596619,
0.12946772575378418,
0.24367143213748932,
0.23756945133209229,
0.11072299629449844,
0.2626340985298157,
0.06172867864370346,
-0.014767326414585114,
0.02242966741323471,
-0.2710803151130676,
-0.09337904304265976,
0.4746665358543396,
-0.3169819414615631,
0.31326860189437866,
-0.0779624804854393,
-0.19502268731594086,
0.15081486105918884,
0.23430335521697998,
-0.1860702782869339,
0.24607989192008972,
0.11842332780361176,
0.03100692108273506,
0.157332643866539,
-0.22224938869476318,
-0.16422182321548462,
0.05271654948592186,
-0.04885413870215416,
0.11705422401428223,
-0.08271336555480957,
0.3271563947200775,
-0.17783312499523163,
0.09949386119842529,
0.07692426443099976,
-0.2606654167175293,
0.47465890645980835,
0.16975566744804382,
0.029359860345721245,
-0.2739383280277252,
0.6311641931533813,
0.05343139171600342,
0.15854158997535706,
-0.04261953756213188,
0.1382148265838623,
0.2270979881286621,
0.13312414288520813,
-0.1480366289615631,
-0.1478840708732605,
-0.49270641803741455,
-0.13753671944141388,
0.04937785118818283,
0.05608934164047241,
0.03031255304813385,
0.21288010478019714,
-0.08085039258003235,
-0.15431876480579376,
-0.3124033808708191,
-0.11308534443378448,
-0.07892754673957825,
0.059167906641960144,
0.5585832595825195,
0.08493709564208984,
0.07206668704748154,
0.009336307644844055,
0.6042416095733643,
0.15109828114509583,
-0.110438272356987,
-0.21438518166542053,
0.08226238936185837,
-0.0681399330496788,
0.15868431329727173,
0.07021717727184296,
-0.7184579968452454,
0.5152055025100708,
0.11826786398887634,
0.20169687271118164,
-0.48768559098243713,
0.04073098301887512,
0.11728246510028839,
-0.04486406221985817,
-0.07343024760484695,
0.3626568019390106,
0.08303530514240265,
0.18322370946407318,
-0.2505350708961487,
-0.09654247760772705,
-0.19317491352558136,
-0.09414839744567871,
-0.29024022817611694,
-0.2193664014339447,
0.10840638726949692,
0.11209136247634888,
-0.0019151903688907623,
-0.17135359346866608,
-0.26072657108306885,
0.3765922784805298,
0.15724293887615204,
0.29862529039382935,
0.06662103533744812,
-0.007933977991342545,
0.06476935744285583,
0.3183191120624542,
-0.2819026708602905,
0.044152263551950455,
-0.6033467054367065,
0.3918006420135498,
-0.4066390097141266,
-0.17978914082050323,
-0.1906258463859558,
-0.03219588100910187,
0.12408491969108582,
0.17047035694122314,
-0.32915154099464417,
0.003428630530834198,
0.007524959743022919,
0.27589714527130127,
-0.19013917446136475,
0.05423055589199066,
0.09665682166814804,
-0.0162627175450325,
-0.06726846098899841,
-0.06469489634037018,
-0.0715818852186203,
0.050267308950424194,
-0.2645367980003357,
0.35826772451400757,
0.37419453263282776,
0.13912908732891083,
0.2157006561756134,
0.8286227583885193,
-0.05650932714343071,
-0.11849610507488251,
0.2542779743671417,
-0.0859403908252716,
-0.011771000921726227,
-0.2003166526556015,
-0.5253721475601196,
0.08992026746273041,
-0.22175787389278412,
-0.14577716588974,
0.27466127276420593,
-0.15740826725959778,
-0.290367990732193,
-0.08430922776460648,
-0.2558441162109375,
0.2257155030965805,
0.06087338924407959,
0.4074189066886902,
-0.3645502030849457,
0.24865323305130005,
-0.400474488735199,
-0.08931829035282135,
-0.4350181519985199,
-0.18560487031936646,
0.27486467361450195,
-0.22786776721477509,
0.5101089477539062,
-0.20212535560131073,
-0.026886150240898132,
0.12448258697986603,
-0.5203246474266052,
0.16143830120563507,
0.2680441439151764,
0.24964217841625214,
0.09289850294589996,
-0.17820307612419128,
-0.06642754375934601,
-0.039445046335458755,
0.9014075398445129,
0.19223584234714508,
-0.10863135755062103,
-0.017362046986818314,
-0.2324340045452118,
-0.13673265278339386,
-0.20747298002243042,
-0.04018409550189972,
0.6298454999923706,
0.27483659982681274,
0.33929935097694397,
-0.11531484127044678,
-0.09909787774085999,
0.2842377722263336,
0.10051145404577255,
-0.20356842875480652,
-0.42487627267837524,
-0.0760822668671608,
0.02669209986925125,
-0.03542838245630264,
0.1169624999165535,
0.14644551277160645,
0.11605784296989441,
0.13638049364089966,
-0.12759599089622498,
-0.23412780463695526,
-0.06348879635334015,
0.013732466846704483,
0.011147700250148773,
-0.05126779526472092,
0.0913991779088974,
0.30465513467788696,
0.11107215285301208,
0.2137943059206009,
0.19609075784683228,
0.15242810547351837,
-0.14900536835193634,
-0.16685788333415985,
0.2792442739009857,
-0.33138829469680786,
0.3359123468399048,
0.1778278350830078,
0.06623316556215286,
0.17165237665176392,
-0.18515121936798096,
-0.02132738009095192,
-0.3980425000190735,
-0.3326466977596283,
0.035728566348552704,
0.028358720242977142,
-0.5424138307571411,
-0.4042041599750519,
0.39357757568359375,
0.041554614901542664,
0.02734154462814331,
0.6752319931983948,
-0.30101481080055237,
-0.09220859408378601,
0.26974809169769287,
0.1896907091140747,
0.6713260412216187,
0.026957061141729355,
0.006822618655860424,
0.046802278608083725,
0.2837945222854614,
-0.25397634506225586,
-0.2656621038913727,
0.2842828631401062,
-0.3482729196548462,
-0.4051208198070526,
-0.05124606937170029,
-0.06733247637748718,
-0.05308236926794052,
0.18821150064468384,
0.03435194492340088,
0.11609286069869995,
0.059539079666137695,
0.18017394840717316,
-0.19565322995185852,
0.17684398591518402,
-0.2975088953971863,
-0.44394564628601074,
0.03627077862620354,
0.15457502007484436,
0.08780515193939209,
0.16930115222930908,
-0.1679604947566986,
-0.11732897162437439,
0.3384939432144165,
0.2198820561170578,
-0.37376874685287476,
-0.11632322520017624,
-0.16663624346256256,
0.0988282710313797,
0.10395923256874084,
-0.34680140018463135,
0.07441025972366333,
0.22950434684753418,
0.1476844698190689,
-0.29163503646850586,
-0.12360396981239319,
0.1323467493057251,
0.09026503562927246,
0.1791217029094696,
-0.17724400758743286,
-0.1322394609451294,
0.23696252703666687,
-0.16249462962150574,
0.15151295065879822,
0.23505666851997375,
0.13988320529460907,
-0.6718791723251343,
-0.08037800341844559,
0.21140441298484802,
0.4359007477760315,
-0.3943102955818176,
-0.047648876905441284,
0.031275615096092224,
0.17472247779369354,
-0.15804710984230042,
0.09446144104003906,
0.2601134181022644,
-0.10092571377754211,
0.30433982610702515,
-0.21200747787952423,
0.0018031150102615356,
-0.05042615532875061,
0.4019975960254669,
0.21175728738307953,
-0.46682125329971313,
0.4934776723384857,
0.2796958386898041,
-0.10333636403083801,
-0.18346357345581055,
0.10195793211460114,
0.33003509044647217,
-0.3506188690662384,
0.185766339302063,
-0.19533854722976685,
0.1874769628047943,
0.06392577290534973,
0.36544814705848694,
0.09429287910461426,
-0.00905371829867363,
-0.18747326731681824,
-0.15764778852462769,
-0.3985198438167572,
-0.2189643532037735,
-0.04884928837418556,
0.38325703144073486,
0.0548785924911499,
-0.3288833498954773,
0.0865195095539093,
0.07038275897502899,
-0.34836545586586,
-0.20532134175300598,
0.1149560958147049,
0.05484245717525482,
0.21204325556755066,
0.2461235374212265,
0.10283970087766647,
0.36339110136032104,
0.06476885080337524,
0.16870459914207458,
0.015810787677764893,
-0.22713764011859894,
-0.014641646295785904,
0.10252123326063156,
-0.20062780380249023,
0.12276673316955566,
-0.06446482241153717,
-0.036141544580459595,
-0.20333275198936462,
-0.33842843770980835,
0.25238317251205444,
-0.07227742671966553,
-0.11805929988622665,
0.048549797385931015,
0.3952227532863617,
-0.12498661130666733,
-0.006855301558971405,
0.12179860472679138,
0.35121819376945496,
0.0552862286567688,
0.16043926775455475,
0.2682223320007324,
-0.1288168728351593,
-0.2430824339389801,
0.13340315222740173,
0.3456811308860779,
0.5485470294952393,
0.18977272510528564,
0.1190505400300026,
-0.1683502048254013,
0.02778002619743347,
0.09313248097896576,
0.25489553809165955,
0.20555244386196136,
-0.0965452641248703,
-0.07571952044963837,
0.15204301476478577,
0.20287039875984192,
-0.13032284379005432,
-0.1578405499458313,
-0.13383008539676666,
-0.11632959544658661,
-0.017076246440410614,
0.1953217089176178,
0.1915513277053833,
0.08968561887741089,
0.32614201307296753,
0.008479632437229156,
0.22252580523490906,
-0.4046883285045624,
-0.1285816729068756,
0.0910467654466629,
0.08031965047121048,
-0.1438589096069336,
0.3092561662197113,
0.08308842778205872,
0.18648263812065125,
0.4006738066673279,
-0.1388094127178192,
0.4780650734901428,
0.39588695764541626,
-0.11216266453266144,
0.19639074802398682,
-0.4817791283130646,
-0.0874730795621872,
-0.18383657932281494,
0.27959924936294556,
0.26813986897468567,
0.3194258511066437,
0.33793795108795166,
0.033792559057474136,
-0.11164439469575882,
-0.12560242414474487,
0.007661980576813221,
0.01782367192208767,
-0.017222337424755096,
0.05560445785522461,
-0.2980422079563141,
-0.04337380826473236,
0.015363968908786774,
-0.0008229287341237068,
-0.23994384706020355,
0.12486474215984344,
0.08785450458526611,
0.11392375081777573,
-0.34787318110466003,
0.14159467816352844,
0.20966900885105133,
0.40637636184692383,
-0.29279109835624695,
-0.14446724951267242,
0.05057242885231972,
0.052585288882255554,
0.07083484530448914,
0.4075988233089447,
0.1589544117450714,
0.3750762939453125,
0.06972017139196396,
0.26529496908187866,
-0.4902450442314148,
-0.03105168044567108,
-0.22789974510669708,
0.03505497798323631,
-0.4276285469532013,
-0.23200733959674835,
0.2897661328315735,
0.13031375408172607,
-0.08981198072433472,
0.15885762870311737,
0.25511330366134644,
-0.1634564995765686,
-0.13472402095794678,
-0.15567785501480103,
0.198419988155365,
-0.2287137806415558,
-0.33453530073165894,
-0.047042518854141235,
-0.08018916845321655,
-0.3343436121940613,
0.1708972454071045,
-0.2817547619342804,
-0.02378840744495392,
0.0689430832862854,
0.11894464492797852,
-0.1858290135860443,
0.34070149064064026,
0.3536209762096405,
0.0791335254907608,
-0.08274118602275848,
-0.15167051553726196,
-0.009212009608745575,
-0.09747132658958435,
0.16861149668693542,
0.009962163865566254,
-0.08594302088022232,
0.3354465365409851,
0.013104768469929695,
0.04214971140027046,
0.18794909119606018,
-0.030804410576820374,
0.25291380286216736,
0.6883659958839417,
-0.3257305324077606,
-0.17221587896347046,
0.11180072277784348,
0.43775537610054016,
0.04886271059513092,
-0.18588586151599884,
0.003193361684679985,
-0.07782010734081268,
0.10521729290485382,
-0.1447242796421051,
-0.39448216557502747,
0.2655893564224243,
-0.047855082899332047,
0.4943751096725464,
-0.15606838464736938,
-0.05496243014931679,
-0.15950274467468262,
0.024746738374233246,
-0.3445852994918823,
-0.007136505097150803,
-0.056520767509937286,
0.08460856229066849,
0.3759223222732544,
-0.06704884767532349,
-0.14127002656459808,
-0.12865912914276123,
-0.38478344678878784,
0.4209023714065552,
-0.06802915781736374,
0.17964881658554077,
-0.3230355978012085,
0.15841379761695862,
-0.16576871275901794,
0.16274061799049377,
-0.12604165077209473,
0.22140084207057953,
-0.00887203961610794,
0.08640201389789581,
-0.4817843437194824,
0.012805730104446411,
0.16612614691257477,
-0.4995819926261902,
-0.3489319086074829,
0.008878730237483978,
0.023424554616212845,
0.16892720758914948,
0.12346448004245758,
-0.3501662015914917,
0.04060722887516022,
0.33694595098495483,
0.038484666496515274,
0.2209569811820984,
0.3135713040828705,
0.10115058720111847,
0.21546846628189087,
-0.2069881558418274,
0.3058747947216034,
0.20443081855773926,
-0.04808180034160614,
-0.1708630919456482,
-0.31400805711746216
] |
https://github.com/huggingface/datasets/issues/6277 | `evaluate.load("paws-x", "es")` throws the error because there is no such metric in the `evaluate` lib.
So, this is unrelated to our lib. | FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either. | ### Describe the bug
I'm encountering a "FileNotFoundError" while attempting to use the "paws-x" dataset to retrain the DistilRoBERTa-base model. The error message is as follows:
FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either.
### Steps to reproduce the bug
https://colab.research.google.com/drive/11xUUFxloClpmqLvDy_Xxfmo3oUzjY5nx#scrollTo=kUn74FigzhHm
### Expected behavior
The the trained model
### Environment info
colab, "paws-x" dataset , DistilRoBERTa-base model | 22 | FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either.
### Describe the bug
I'm encountering a "FileNotFoundError" while attempting to use the "paws-x" dataset to retrain the DistilRoBERTa-base model. The error message is as follows:
FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either.
### Steps to reproduce the bug
https://colab.research.google.com/drive/11xUUFxloClpmqLvDy_Xxfmo3oUzjY5nx#scrollTo=kUn74FigzhHm
### Expected behavior
The the trained model
### Environment info
colab, "paws-x" dataset , DistilRoBERTa-base model
`evaluate.load("paws-x", "es")` throws the error because there is no such metric in the `evaluate` lib.
So, this is unrelated to our lib. | [
-0.1807367503643036,
-0.12753786146640778,
0.0636192262172699,
0.07010315358638763,
0.42050763964653015,
0.13324666023254395,
0.19292773306369781,
0.4627460837364197,
0.15083913505077362,
0.37824612855911255,
-0.01954597793519497,
0.1366032361984253,
-0.07175462692975998,
0.09107092767953873,
0.12902595102787018,
0.1412259042263031,
0.15355250239372253,
0.3041866719722748,
0.053896475583314896,
-0.1420011669397354,
-0.17122909426689148,
0.2913322150707245,
-0.28167790174484253,
0.04713582992553711,
-0.6001800298690796,
0.1247909814119339,
-0.16273543238639832,
0.4340668022632599,
-0.23443077504634857,
-0.2879672050476074,
0.29473191499710083,
-0.1746368259191513,
0.19942381978034973,
0.34564703702926636,
-0.00012282704119570553,
0.04042433947324753,
0.07868865132331848,
-0.11602704972028732,
-0.11920875310897827,
-0.3907235264778137,
0.27048301696777344,
-0.26755669713020325,
0.09029238671064377,
-0.2968127727508545,
-0.023443304002285004,
-0.12744292616844177,
0.3532225489616394,
0.2600744962692261,
0.3588050603866577,
0.40542539954185486,
0.10007204860448837,
0.22084209322929382,
-0.032333508133888245,
-0.23815414309501648,
0.12093199789524078,
0.18398816883563995,
-0.17894338071346283,
0.4202116131782532,
0.1371176540851593,
-0.25857222080230713,
-0.022761911153793335,
0.21100027859210968,
0.03711332380771637,
-0.36027976870536804,
0.2937702238559723,
0.2474776804447174,
0.7883008122444153,
-0.30462348461151123,
-0.0463845320045948,
0.37679851055145264,
0.12115374207496643,
-0.3256624639034271,
-0.27310580015182495,
-0.1811044067144394,
0.11628717184066772,
-0.2511168122291565,
0.14871083199977875,
0.010489050298929214,
0.06716512143611908,
0.23294506967067719,
0.2584301233291626,
-0.12447665631771088,
-0.060725729912519455,
0.06723128259181976,
0.1221526488661766,
0.4177241325378418,
0.008297473192214966,
0.04069940000772476,
0.015188081189990044,
0.1318555623292923,
0.21173027157783508,
0.16155973076820374,
-0.07805757224559784,
0.1978273093700409,
-0.17134691774845123,
-0.13733837008476257,
0.11061380803585052,
0.32334408164024353,
0.037878453731536865,
0.27928221225738525,
0.2398098111152649,
-0.19810751080513,
-0.19250625371932983,
0.11434710025787354,
0.06092117726802826,
0.48670196533203125,
-0.010231498628854752,
0.18082109093666077,
0.31084856390953064,
0.5776768326759338,
-0.17633947730064392,
-0.12248539924621582,
-0.026612289249897003,
-0.21572928130626678,
-0.3244815766811371,
0.2002277374267578,
0.366366982460022,
-0.04821591079235077,
-0.6423627138137817,
0.002289440482854843,
-0.14562299847602844,
-0.004511423408985138,
0.36332032084465027,
0.43326276540756226,
-0.16876572370529175,
0.4016057252883911,
0.305579274892807,
0.05019411817193031,
-0.30821341276168823,
-0.05536479130387306,
-0.28890863060951233,
0.6403994560241699,
-0.6384946703910828,
-0.004761636257171631,
-0.1601526439189911,
-0.1301584392786026,
0.36871692538261414,
-0.26508110761642456,
0.5571194887161255,
-0.13761717081069946,
-0.1721256673336029,
-0.06188393011689186,
0.005409058183431625,
0.2697022259235382,
-0.07618504017591476,
-0.31317853927612305,
0.13538287580013275,
-0.3752768039703369,
-0.21493205428123474,
0.14832369983196259,
-0.4676594138145447,
0.03509392589330673,
0.07083828002214432,
0.03804013133049011,
-0.5614885091781616,
0.09306973218917847,
0.09841018915176392,
0.03275581821799278,
-0.22610141336917877,
-0.31001847982406616,
0.28970667719841003,
-0.1271054595708847,
-0.23317337036132812,
-0.2531241476535797,
0.276687353849411,
0.7350577712059021,
-0.16292878985404968,
-0.09526126086711884,
-0.09748460352420807,
-0.06530086696147919,
0.03892374783754349,
-0.11752571165561676,
0.10396010428667068,
0.48457714915275574,
-0.4055863320827484,
0.21269971132278442,
0.6006084680557251,
-0.6484627723693848,
-0.27502956986427307,
-0.15159869194030762,
-0.201188862323761,
-0.05464784801006317,
0.1690158247947693,
0.20217514038085938,
-0.19714339077472687,
-0.13838115334510803,
0.05278912931680679,
-0.05880782753229141,
0.033331066370010376,
-0.1901814043521881,
-0.24133004248142242,
-0.33668583631515503,
0.1326965093612671,
0.16298645734786987,
0.3456992208957672,
-0.014185566455125809,
0.16181759536266327,
0.37867528200149536,
0.3234196603298187,
-0.21644695103168488,
-0.19534386694431305,
0.1597764790058136,
0.5169245600700378,
0.02193099446594715,
0.033286355435848236,
-0.35804444551467896,
0.18789643049240112,
0.2560473084449768,
-0.17679136991500854,
-0.005913064815104008,
0.29733309149742126,
-0.06322995573282242,
-0.26318976283073425,
0.04896517097949982,
-0.1994243562221527,
-0.2492569237947464,
0.0528397262096405,
-0.05153675377368927,
0.02123323082923889,
0.3281940221786499,
-0.45346295833587646,
0.549599289894104,
-0.19736534357070923,
0.2749035358428955,
-0.3684270679950714,
0.32097434997558594,
-0.019823290407657623,
-0.33231502771377563,
-0.11275577545166016,
0.5085690021514893,
0.05733183026313782,
-0.06945126503705978,
0.08441133052110672,
0.34735924005508423,
-0.0309598445892334,
-0.08389949798583984,
0.3885423541069031,
-0.087932288646698,
0.10070166736841202,
-0.06807452440261841,
0.030941778793931007,
0.0841975286602974,
0.22627831995487213,
0.03809231519699097,
0.2875908613204956,
0.3632093667984009,
-0.027508726343512535,
-0.05667440965771675,
0.06028720736503601,
0.07670194655656815,
-0.1452600061893463,
-0.24302858114242554,
-0.20638328790664673,
-0.26883769035339355,
0.4121687710285187,
0.3069058656692505,
0.1839718222618103,
-0.2740247845649719,
-0.007198512554168701,
-0.1785132884979248,
0.5084850788116455,
-0.052235670387744904,
0.15989793837070465,
0.12804125249385834,
-0.016661502420902252,
0.052810072898864746,
-0.2178698480129242,
0.08269525319337845,
0.6177169680595398,
0.14300189912319183,
-0.2536584138870239,
0.4054497480392456,
-0.2549646198749542,
-0.20232176780700684,
-0.02487041801214218,
0.16658619046211243,
-0.32849666476249695,
0.2441161572933197,
-0.039463967084884644,
-0.09061098098754883,
-0.255043089389801,
-0.2858830690383911,
-0.1912088692188263,
0.12946046888828278,
-0.38747233152389526,
0.05327259749174118,
-0.23567387461662292,
0.14516830444335938,
-0.047212060540914536,
-0.011529561132192612,
-0.1988813877105713,
-0.19792282581329346,
0.1574162244796753,
-0.007973724976181984,
0.09396602213382721,
0.16525112092494965,
-0.35348546504974365,
0.17934072017669678,
-0.21636642515659332,
0.036707088351249695,
-0.026053011417388916,
-0.18492096662521362,
-0.27936822175979614,
-0.1147134006023407,
0.2694956958293915,
0.1212039589881897,
0.013300308957695961,
-0.5862400531768799,
0.16312170028686523,
-0.09617961943149567,
-0.4585484564304352,
0.09390655159950256,
-0.010212044231593609,
0.41432443261146545,
0.26148906350135803,
-0.014718037098646164,
-0.25542008876800537,
-0.0009683854877948761,
0.14328373968601227,
-0.19424933195114136,
-0.16925418376922607,
-0.04023469612002373,
0.09701232612133026,
0.0020841285586357117,
-0.1829824447631836,
-0.32641059160232544,
0.04858905076980591,
-0.23644542694091797,
-0.041822683066129684,
-0.049033913761377335,
-0.008632726967334747,
0.35053926706314087,
0.13621433079242706,
0.2786351442337036,
-0.290252149105072,
-0.0008045285940170288,
-0.0002697594463825226,
-0.3794669210910797,
0.4556756019592285,
0.14155244827270508,
-0.2353251427412033,
0.3984299898147583,
-0.19862432777881622,
-0.027056025341153145,
-0.08262916654348373,
-0.24843162298202515,
-0.7524425983428955,
0.3185085654258728,
-0.14690767228603363,
-0.18358030915260315,
0.2107146680355072,
0.3079228103160858,
-0.19252897799015045,
0.0910145491361618,
-0.247371107339859,
-0.07993720471858978,
0.12903964519500732,
0.37446320056915283,
0.48987677693367004,
-0.36032718420028687,
0.1004500687122345,
-0.21800771355628967,
0.20644834637641907,
-0.044738661497831345,
0.06633105874061584,
0.507411003112793,
-0.09206058084964752,
0.63899827003479,
0.022480785846710205,
-0.10889305174350739,
-0.131730854511261,
0.2055373340845108,
-0.11756369471549988,
0.3534635305404663,
0.10499648749828339,
0.2827329635620117,
-0.38583728671073914,
-0.34286123514175415,
-0.3020748198032379,
-0.2868589758872986,
-0.06682031601667404,
-0.062025249004364014,
-0.14010737836360931,
0.014223866164684296,
0.2337978482246399,
-0.06128925830125809,
0.045484211295843124,
0.25833627581596375,
0.6264762878417969,
-0.0851694792509079,
0.055618319660425186,
0.10756856948137283,
-0.4615688920021057,
-0.08767540752887726,
0.23060104250907898,
0.007331762462854385,
-0.14365795254707336,
-0.103143110871315,
-0.24094440042972565,
0.10545626282691956,
-0.20346499979496002,
0.6065689921379089,
-0.18006640672683716,
-0.1124567985534668,
0.10358405858278275,
-0.09319716691970825,
-0.08797874301671982,
-0.22018225491046906,
-0.07613884657621384,
0.0115225650370121,
-0.06814250349998474,
0.27981722354888916,
-0.15202242136001587,
0.011870302259922028,
0.29354870319366455,
0.08328375965356827,
-0.16321709752082825,
0.07476092875003815,
-0.4843355119228363,
-0.5535672903060913,
0.028481043875217438,
-0.16327127814292908,
-0.04387149214744568,
0.11435899883508682,
0.4521583020687103,
0.2516550123691559,
-0.07188929617404938,
-0.2630111277103424,
0.39948639273643494,
0.19298136234283447,
0.28909796476364136,
-0.1340866982936859,
0.141034334897995,
0.1027650535106659,
0.15944911539554596,
0.13185662031173706,
0.28382235765457153,
-0.23786285519599915,
-0.3344044089317322,
-0.12928500771522522,
0.014772679656744003,
0.2318192422389984,
0.5163400173187256,
-0.21286770701408386,
-0.07646353542804718,
-0.09601923823356628,
0.11620789766311646,
0.08119857311248779,
0.216595858335495,
0.23865273594856262,
0.05828589200973511,
-0.06709277629852295,
-0.22707965970039368,
0.26953431963920593,
0.14315380156040192,
0.13834987580776215,
0.13799379765987396,
0.21421518921852112,
-0.12663741409778595,
0.06134684383869171,
0.02125382237136364,
1.2185654640197754,
0.15010155737400055,
0.20519034564495087,
0.42798441648483276,
-0.043443985283374786,
0.4600398540496826,
-0.30653446912765503,
0.2361157238483429,
-0.389362633228302,
-0.3261054754257202,
-0.12848161160945892,
-0.11507302522659302,
0.3472934365272522,
-0.2733152508735657,
-0.12194497883319855,
0.582046389579773,
0.003122106194496155,
-0.04143059253692627,
0.014351103454828262,
-0.24189913272857666,
-0.3233431875705719,
0.1242792159318924,
-0.34030961990356445,
-0.06104212999343872,
0.03140132129192352,
0.3645332157611847,
-0.3055987060070038,
-0.3268568217754364,
-0.5066156387329102,
-0.23115874826908112,
-0.10859820246696472,
0.1518581211566925,
-0.20221108198165894,
-0.0928083211183548,
0.22162756323814392,
-0.2794753313064575,
-0.027693837881088257,
0.31706365942955017,
0.4258697032928467,
-0.14898839592933655,
-0.23995468020439148,
0.31735023856163025,
-0.3331027626991272,
-0.13204771280288696,
-0.10198546200990677,
-0.005219578742980957,
0.4225923717021942,
-0.14520086348056793,
-0.29084092378616333,
-0.11944758892059326,
0.0739789754152298,
0.08152376115322113,
0.07133342325687408,
0.2274923026561737,
0.07901793718338013,
-0.06671217828989029,
-0.24048739671707153,
0.10079573094844818,
0.08678315579891205,
-0.08233161270618439,
0.027523145079612732,
0.09877493977546692,
-0.31723177433013916,
0.12234450876712799,
-0.024038469418883324,
-0.31262221932411194,
-0.011513619683682919,
0.2644287943840027,
0.006122685968875885,
0.04465538263320923,
0.319934219121933,
-0.24048630893230438,
-0.07066293805837631,
-0.0668552964925766,
-0.09333856403827667,
0.2296915203332901,
-0.54720538854599,
0.269532173871994,
0.016174476593732834,
0.013380840420722961,
-0.04708050936460495,
0.06851857900619507,
0.14149494469165802,
-0.22600530087947845,
-0.20642532408237457,
-0.38588961958885193,
-0.16686446964740753,
0.3405483067035675,
0.18992869555950165,
0.053079769015312195,
-0.16881674528121948,
0.42858248949050903,
0.04784058779478073,
-0.5475866794586182,
-0.17189878225326538,
0.11721227318048477,
-0.26475968956947327,
-0.03008108027279377,
-0.15157124400138855,
-0.07242163270711899,
0.3874449133872986,
0.03311226889491081,
-0.01435239240527153,
0.17606759071350098,
-0.19943395256996155,
-0.04851260408759117,
-0.0642855241894722,
0.18799905478954315,
-0.0461823008954525,
0.14164552092552185,
0.26200711727142334,
0.08210646361112595,
-0.1361536681652069,
-0.15560874342918396,
-0.05975664407014847,
0.33312803506851196,
0.007078394293785095,
0.07220496237277985,
0.1457783430814743,
0.2028227001428604,
0.04298761487007141,
0.060098446905612946,
0.11323972791433334,
0.27545827627182007,
0.090237095952034,
0.10965016484260559,
-0.2639358341693878,
0.07732269167900085,
0.05372198298573494,
0.19185340404510498,
-0.15746691823005676,
-0.04630385339260101,
0.16486778855323792,
0.10928402841091156,
-0.10045798122882843,
0.11344832181930542,
0.08932402729988098,
0.4632965922355652,
-0.11421670019626617,
0.062350623309612274,
0.2743322551250458,
-0.040062204003334045,
-0.5051223039627075,
0.25604620575904846,
0.44813042879104614,
0.03316458314657211,
0.0528789758682251,
0.4104696214199066,
-0.07319097965955734,
0.10564309358596802,
-0.0664953738451004,
0.1522405594587326,
0.41497448086738586,
0.1337319016456604,
0.14740315079689026,
0.5252830386161804,
-0.0009675249457359314,
0.4239071011543274,
0.10518662631511688,
-0.06114383414387703,
0.252951979637146,
0.39351993799209595,
-0.26295334100723267,
0.4797525107860565,
-0.25035449862480164,
0.07805509865283966,
-0.21266648173332214,
-0.16584992408752441,
0.038146521896123886,
0.1509009599685669,
0.3978419303894043,
-0.07891558110713959,
-0.2730334997177124,
0.6054705381393433,
-0.11194320768117905,
0.31566065549850464,
-0.22891485691070557,
0.17023088037967682,
-0.14124533534049988,
0.10891899466514587,
0.0808212012052536,
-0.1844947636127472,
-0.3620288372039795,
-0.11702346801757812,
0.32091668248176575,
0.06508952379226685,
-0.13406381011009216,
0.00350966677069664,
-0.3407280445098877,
0.4124894142150879,
-0.20543570816516876,
0.2919887900352478,
0.26047950983047485,
-0.25149619579315186,
-0.03496570512652397,
0.2662065625190735,
-0.039964593946933746,
0.20223499834537506,
0.2741195559501648,
0.3929591774940491,
0.1806238293647766,
-0.18548975884914398,
-0.20148159563541412,
0.03972204029560089,
0.051695048809051514,
0.07761611044406891,
0.11492542922496796,
0.0594070702791214,
0.6536505222320557,
0.06231538951396942,
0.04352487623691559,
-0.12432778626680374,
0.3570936918258667,
-0.2189347743988037,
0.3137546181678772,
-0.333094984292984,
0.45206692814826965,
-0.19033411145210266,
0.07144729793071747,
-0.5183548927307129,
0.009102128446102142,
-0.4999699592590332,
-0.007180400192737579,
0.0388924777507782,
0.16129590570926666,
-0.050827864557504654,
-0.1303517371416092,
-0.006937531754374504,
-0.19865494966506958,
0.09129443764686584,
0.49208003282546997,
-0.3472128212451935,
-0.17180708050727844,
0.11321176588535309,
-0.6473730206489563,
0.14779573678970337,
-0.13329175114631653,
-0.19517526030540466,
-0.20670266449451447,
-0.16311335563659668,
-0.29264581203460693,
-0.18945452570915222,
0.5793602466583252,
0.20917415618896484,
-0.025700516998767853,
-0.05438200756907463,
-0.13020406663417816,
-0.38635092973709106,
-0.3768633008003235,
-0.2177511304616928,
0.12082118541002274,
-0.23698385059833527,
-0.18833954632282257,
-0.04093498736619949,
-0.17524860799312592,
0.2216966450214386,
-0.3372865319252014,
-0.20177581906318665,
-0.12862806022167206,
0.42317700386047363,
-0.14619889855384827,
0.3495866656303406,
-0.01740499585866928,
0.05341693013906479,
-0.19360221922397614,
-0.18924757838249207,
0.0419512614607811,
-0.0046577975153923035,
0.15360383689403534,
0.3237243592739105,
-0.49820423126220703,
-0.0767994076013565,
-0.19203980267047882,
0.30159792304039,
0.21705085039138794,
-0.33281993865966797,
-0.32082194089889526,
0.09587233513593674,
-0.014643155038356781,
-0.012966692447662354,
0.09090213477611542,
0.14233212172985077,
-0.250355988740921,
0.031103327870368958,
-0.1894293576478958,
-0.2205309271812439,
0.6417365074157715,
-0.17743651568889618,
-0.1800370216369629,
-0.20736637711524963,
0.35048773884773254,
0.07378499209880829,
-0.1915852278470993,
-0.6018123626708984,
0.09755514562129974,
0.08370218425989151,
0.3384217619895935,
-0.33410388231277466,
0.3262268602848053,
-0.3750479519367218,
-0.11670170724391937,
0.21832236647605896,
-0.5230613350868225,
-0.034190833568573,
0.04100966453552246,
0.34043049812316895,
-0.13527560234069824
] |
https://github.com/huggingface/datasets/issues/6276 | Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue:
```python
if __name__ == "__main__":
common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
```
Otherwise, the only solution is to set `num_proc=1`. | I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error | ### Describe the bug
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
I tried google collab and it works but because I'm on the free version the training doesn't complete
the error comes in jupyter notebook when i run this line
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
here is the error message
```
Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s]
The above exception was the direct cause of the following exception:
NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value
NameError: name 'feature_extractor' is not defined
```
### Steps to reproduce the bug
1. follow the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
2. run this line of code
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
3. I'm using jupyter notebook from anaconda
### Expected behavior
No error message
### Environment info
datasets version: 2.8.0
Python version: 3.11
Windows 10 | 38 | I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error
### Describe the bug
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
I tried google collab and it works but because I'm on the free version the training doesn't complete
the error comes in jupyter notebook when i run this line
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
here is the error message
```
Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s]
The above exception was the direct cause of the following exception:
NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value
NameError: name 'feature_extractor' is not defined
```
### Steps to reproduce the bug
1. follow the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
2. run this line of code
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
3. I'm using jupyter notebook from anaconda
### Expected behavior
No error message
### Environment info
datasets version: 2.8.0
Python version: 3.11
Windows 10
Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue:
```python
if __name__ == "__main__":
common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
```
Otherwise, the only solution is to set `num_proc=1`. | [
-0.05113082751631737,
-0.24175772070884705,
0.10620424896478653,
0.22932514548301697,
0.37092652916908264,
0.1690148264169693,
0.1730194091796875,
0.33574602007865906,
0.06762866675853729,
0.22165171802043915,
-0.4041449725627899,
0.15247999131679535,
-0.10573357343673706,
0.2656456232070923,
-0.2897327244281769,
-0.41690778732299805,
-0.002166029065847397,
0.08255691826343536,
0.06501761078834534,
0.13238275051116943,
-0.29485347867012024,
0.16707322001457214,
-0.4330970048904419,
0.43750154972076416,
-0.005591865628957748,
-0.436674028635025,
0.03192722052335739,
-0.09617246687412262,
-0.33123382925987244,
-0.16033285856246948,
0.052873820066452026,
-0.13992610573768616,
0.06624716520309448,
0.5462722778320312,
-0.00012111190153518692,
0.0539436936378479,
0.31844931840896606,
-0.1722903549671173,
0.04955660551786423,
-0.30146345496177673,
0.3061146140098572,
0.25042983889579773,
-0.09668859839439392,
-0.15007787942886353,
-0.16167208552360535,
0.09519585967063904,
-0.09089130908250809,
-0.2667808532714844,
0.45836836099624634,
0.41465646028518677,
0.09644036740064621,
0.4229179620742798,
0.6261513829231262,
-0.04217882454395294,
-0.013494279235601425,
-0.3095824122428894,
-0.2559332847595215,
0.43736687302589417,
-0.09002220630645752,
-0.3680974841117859,
0.12284240126609802,
0.44915151596069336,
-0.12700189650058746,
0.11685223877429962,
0.19262661039829254,
0.1501515656709671,
0.19793960452079773,
-0.5410189628601074,
-0.007953237742185593,
0.3797045648097992,
-0.043974198400974274,
-0.1858237087726593,
-0.26984289288520813,
-0.14821037650108337,
0.10640023648738861,
-0.24192136526107788,
0.009630659595131874,
0.04255838692188263,
-0.175584077835083,
0.11002388596534729,
0.040818266570568085,
-0.04746551439166069,
-0.040848247706890106,
0.027915731072425842,
0.12017755210399628,
0.21676260232925415,
-0.08889569342136383,
0.23710143566131592,
0.36575812101364136,
-0.28334933519363403,
-0.14175847172737122,
0.03499222174286842,
0.026518935337662697,
0.31777524948120117,
-0.6121677756309509,
-0.0523734986782074,
0.005793849006295204,
-0.13743774592876434,
0.16335603594779968,
-0.2697126567363739,
0.43674764037132263,
-0.17850251495838165,
0.12113611400127411,
0.1987532526254654,
0.10312703251838684,
0.13188737630844116,
0.22482746839523315,
0.2376132607460022,
0.3819817304611206,
0.5106891989707947,
0.2819632291793823,
-0.08697640150785446,
-0.007815070450305939,
-0.1374230831861496,
-0.45894256234169006,
-0.09096826612949371,
0.29894107580184937,
-0.13472440838813782,
-0.5112472772598267,
0.23295287787914276,
-0.030948497354984283,
-0.044568903744220734,
0.19276174902915955,
0.13294899463653564,
-0.08867865800857544,
-0.13495948910713196,
0.2964177131652832,
0.23056434094905853,
-0.0503634512424469,
-0.21375878155231476,
-0.04697117209434509,
0.19015191495418549,
-0.15778696537017822,
0.12915262579917908,
-0.07596786320209503,
0.13496696949005127,
0.42981165647506714,
-0.32332614064216614,
0.42038825154304504,
-0.07696820795536041,
-0.07220372557640076,
-0.13352122902870178,
-0.20947398245334625,
0.24027606844902039,
-0.1846199631690979,
-0.17718684673309326,
0.302196204662323,
-0.5056790709495544,
-0.16763119399547577,
-0.21551117300987244,
-0.33342668414115906,
-0.3298189640045166,
0.09261082112789154,
0.006914346478879452,
-0.013073958456516266,
0.41235363483428955,
-0.1886478066444397,
-0.09936767816543579,
0.24332161247730255,
0.013317711651325226,
0.01954006403684616,
-0.04263583570718765,
-0.30844414234161377,
-0.09384457021951675,
0.4028947353363037,
0.31477439403533936,
-0.10397578030824661,
-0.28108975291252136,
0.13590097427368164,
0.0777510479092598,
0.2755469083786011,
0.496725469827652,
0.11556065827608109,
-0.0428575836122036,
-0.04962329566478729,
0.23273272812366486,
0.0812511071562767,
-0.4104408025741577,
-0.32728108763694763,
-0.05533377081155777,
-0.3384273946285248,
-0.04218382015824318,
0.17412102222442627,
-0.1824379861354828,
-0.06632561981678009,
0.0733848363161087,
0.5861657857894897,
0.0949072390794754,
-0.19657397270202637,
-0.25364363193511963,
-0.2357710301876068,
0.08214683085680008,
0.17252476513385773,
0.2378072291612625,
-0.28232330083847046,
-0.018839430063962936,
-0.13284426927566528,
-0.0960044264793396,
0.27483949065208435,
-0.05470442771911621,
-0.0923035517334938,
-0.015719667077064514,
0.15292438864707947,
-0.15804257988929749,
0.034825071692466736,
0.2369241714477539,
-0.04972283914685249,
0.16222544014453888,
-0.07403037697076797,
0.37641429901123047,
-0.0970885157585144,
0.1517517864704132,
-0.01994910091161728,
0.06809858232736588,
-0.1609753966331482,
-0.365443617105484,
-0.004146315157413483,
-0.12600111961364746,
0.17789769172668457,
-0.1657482385635376,
-0.20779086649417877,
0.2291184961795807,
-0.5212485790252686,
0.24230140447616577,
-0.6958329081535339,
0.17721962928771973,
-0.27779093384742737,
-0.21611447632312775,
0.23268729448318481,
0.25558069348335266,
0.0018195044249296188,
0.05421222746372223,
-0.027854163199663162,
0.5456068515777588,
-0.09776453673839569,
-0.3795401155948639,
-0.22116732597351074,
0.08659382164478302,
-0.012102961540222168,
-0.10347624123096466,
-0.1466168463230133,
0.01336415484547615,
-0.017941584810614586,
-0.03644704073667526,
0.22412659227848053,
0.5109313130378723,
0.31747666001319885,
0.20634008944034576,
-0.12605082988739014,
0.22942686080932617,
-0.02416204661130905,
-0.04759782925248146,
-0.19694478809833527,
-0.14422282576560974,
0.4851683974266052,
-0.4792439341545105,
0.2292570322751999,
-0.25143319368362427,
-0.10088446736335754,
-0.5365926623344421,
0.17083799839019775,
-0.06563059240579605,
0.25382593274116516,
-0.013330777175724506,
-0.11124436557292938,
0.15561509132385254,
-0.22508184611797333,
0.05881849676370621,
0.34173375368118286,
-0.02627069503068924,
-0.29104775190353394,
0.22184333205223083,
0.14502042531967163,
0.009110022336244583,
0.052366942167282104,
0.22620363533496857,
0.498625785112381,
0.166290283203125,
-0.058564692735672,
0.1408158242702484,
-0.09529227018356323,
-0.3056313097476959,
-0.23190543055534363,
0.3865694999694824,
-0.2727612853050232,
-0.2720333933830261,
0.07310962677001953,
0.1918105185031891,
0.10142259299755096,
0.31268057227134705,
-0.379988431930542,
-0.03611588850617409,
-0.08811180293560028,
-0.004535691812634468,
-0.032972078770399094,
0.305891215801239,
0.1662798523902893,
0.37627866864204407,
0.2178090512752533,
0.32354414463043213,
-0.06855198740959167,
-0.15491712093353271,
-0.06220794469118118,
-0.06706250458955765,
0.12729158997535706,
-0.44672122597694397,
-0.1118822917342186,
-0.14942488074302673,
-0.10122689604759216,
0.06368771940469742,
-0.1898731142282486,
0.061816971749067307,
-0.28894612193107605,
0.43151792883872986,
0.34886425733566284,
0.35225600004196167,
-0.02007938176393509,
-0.3190135359764099,
0.3510107398033142,
-0.1807297021150589,
-0.3512139320373535,
0.07935132831335068,
0.07303600013256073,
-0.12372047454118729,
-0.032618649303913116,
-0.031055837869644165,
-0.40634647011756897,
-0.3318440914154053,
0.6025372743606567,
-0.2276742309331894,
0.03623851016163826,
0.0541427917778492,
-0.15379369258880615,
0.21800482273101807,
-0.3155480623245239,
0.2593466639518738,
-0.1095348596572876,
-0.38581934571266174,
0.40893471240997314,
-0.11530991643667221,
-0.19381651282310486,
-0.19884829223155975,
0.20120103657245636,
0.3636370301246643,
-0.4676476716995239,
-0.3136027753353119,
-0.10237779468297958,
-0.09024372696876526,
0.11697480082511902,
-0.14949597418308258,
-0.04006628692150116,
0.14855307340621948,
-0.030493687838315964,
0.05094897747039795,
-0.1867942363023758,
-0.42131978273391724,
0.24406738579273224,
0.09518201649188995,
0.4098585546016693,
0.2252516746520996,
0.604364275932312,
-0.1073540598154068,
0.03831315413117409,
0.2754436731338501,
-0.00804990716278553,
0.2437146157026291,
0.12448599934577942,
-0.01834438368678093,
-0.012772221118211746,
-0.20380789041519165,
0.33008214831352234,
0.10970664024353027,
-0.09808717668056488,
0.13277025520801544,
-0.07223603129386902,
-0.060865141451358795,
-0.5553121566772461,
-0.2923474907875061,
-0.05765524506568909,
-0.12253785133361816,
-0.21829038858413696,
0.08105572313070297,
0.19803465902805328,
-0.19552087783813477,
0.0756407231092453,
0.08358453214168549,
0.04621780663728714,
0.35897648334503174,
0.01606554165482521,
0.11576180160045624,
-0.1439080685377121,
-0.31170976161956787,
-0.36081746220588684,
-0.5071966052055359,
0.406601220369339,
-0.13000623881816864,
0.4522325396537781,
-0.01632235199213028,
0.0018658339977264404,
-0.21563610434532166,
0.17040325701236725,
0.7178691625595093,
-0.007806604728102684,
-0.021000118926167488,
-0.09736520797014236,
0.22667841613292694,
-0.14307935535907745,
-0.09847225993871689,
-0.019475556910037994,
0.007628999650478363,
0.30795958638191223,
0.48453837633132935,
-0.31191739439964294,
0.15737450122833252,
0.4501084089279175,
-0.11397029459476471,
0.03388132154941559,
0.05490223690867424,
-0.41208499670028687,
-0.132290780544281,
-0.1261347085237503,
0.04579174891114235,
-0.007569245994091034,
0.3372730612754822,
0.23936322331428528,
0.4687528908252716,
0.3213670253753662,
-0.2136530727148056,
0.17868253588676453,
0.20716705918312073,
0.2854421138763428,
0.19556039571762085,
0.1786351352930069,
0.34606295824050903,
0.19155362248420715,
0.43223822116851807,
0.28512558341026306,
-0.17636437714099884,
-0.4160130023956299,
0.21115802228450775,
0.12654174864292145,
0.35902640223503113,
0.128103107213974,
-0.013191845268011093,
0.16230252385139465,
0.1631460189819336,
0.5982354283332825,
0.0665835291147232,
-0.05922272428870201,
0.45575737953186035,
0.11522196233272552,
-0.40409794449806213,
-0.04436448961496353,
0.36786845326423645,
0.15563392639160156,
0.05580654740333557,
0.08012120425701141,
0.15140843391418457,
-0.07185676693916321,
0.41555023193359375,
0.20205608010292053,
0.9475736618041992,
0.053213391453027725,
-0.04255644232034683,
0.0885927826166153,
-0.13639569282531738,
0.31552931666374207,
-0.19161057472229004,
0.08139263093471527,
0.013081520795822144,
-0.3036961257457733,
0.029069125652313232,
-0.05959731712937355,
0.2840188443660736,
-0.0580950528383255,
-0.144923597574234,
0.23109593987464905,
0.03621856868267059,
-0.1864262968301773,
0.03902534395456314,
-0.09001566469669342,
0.08126085996627808,
-0.08801020681858063,
-0.0005303993821144104,
-0.09006339311599731,
-0.2256496250629425,
0.22578753530979156,
0.20407134294509888,
-0.040111228823661804,
-0.25184544920921326,
-0.28143709897994995,
-0.21666783094406128,
-0.03584054112434387,
-0.5318975448608398,
-0.0055070556700229645,
0.48244479298591614,
-0.15242962539196014,
0.17854014039039612,
0.28177741169929504,
0.4356308579444885,
0.3400086462497711,
-0.2811509072780609,
0.19214007258415222,
0.4501974880695343,
-0.2404615581035614,
0.10981731861829758,
0.039815228432416916,
0.19135445356369019,
-0.07983489334583282,
0.03546331822872162,
0.023134004324674606,
-0.17328289151191711,
-0.0825025737285614,
-0.3889470398426056,
-0.1166863963007927,
0.4380970597267151,
-0.06932424753904343,
0.1237885132431984,
-0.1997487097978592,
0.07072925567626953,
-0.31763601303100586,
0.0713326707482338,
0.20604877173900604,
-0.4383786916732788,
-0.2039000391960144,
-0.1318921148777008,
-0.36646121740341187,
-0.04276414215564728,
0.27462804317474365,
0.014677805826067924,
0.02054072916507721,
0.48319944739341736,
0.10798589885234833,
-0.07259170711040497,
0.008172549307346344,
0.08968833088874817,
0.5692204236984253,
-0.22703832387924194,
0.22446182370185852,
0.2003893107175827,
-0.0519668310880661,
-0.3092474937438965,
0.27614396810531616,
0.42185452580451965,
-0.014380697160959244,
0.25138887763023376,
-0.3341831862926483,
-0.652658998966217,
0.2950972020626068,
-0.1557500958442688,
0.07152241468429565,
-0.13178330659866333,
0.35162919759750366,
-0.11263741552829742,
0.11191095411777496,
-0.17199289798736572,
-0.18585675954818726,
-0.4535270631313324,
0.05169788748025894,
0.6117978692054749,
0.005677399225533009,
0.049841951578855515,
-0.07264697551727295,
0.06944938749074936,
0.11732742190361023,
-0.08274848759174347,
-0.03410301357507706,
-0.1453595757484436,
0.15357033908367157,
-0.06344030052423477,
-0.18492189049720764,
0.208842471241951,
0.0043021515011787415,
-0.2639632821083069,
-0.08173973858356476,
-0.1082150936126709,
0.10540683567523956,
0.17891785502433777,
-0.019247714430093765,
0.11884172260761261,
0.02046104148030281,
0.13739845156669617,
-0.008648987859487534,
-0.18674905598163605,
0.1267780065536499,
0.1766340285539627,
-0.009986747056245804,
-0.2692561745643616,
-0.1519445776939392,
0.11498740315437317,
-0.029199305921792984,
-0.412619948387146,
-0.06649541109800339,
0.16334328055381775,
-0.4580017626285553,
-0.30800914764404297,
-0.009285837411880493,
0.4242590665817261,
0.15613505244255066,
-0.2061694711446762,
-0.05955274775624275,
0.36507928371429443,
0.005549885332584381,
-0.30935364961624146,
-0.16358830034732819,
0.14967665076255798,
-0.014666438102722168,
-0.012069612741470337,
0.2686302065849304,
-0.24325206875801086,
0.12736481428146362,
-0.46382713317871094,
-0.020513378083705902,
-0.08817269653081894,
0.053695496171712875,
0.18671660125255585,
0.41884684562683105,
0.11715541034936905,
0.0029188329353928566,
0.28508710861206055,
-0.10704751312732697,
0.15411469340324402,
0.12707114219665527,
-0.2615261971950531,
0.2316354513168335,
-0.013053828850388527,
0.10919761657714844,
0.02669360861182213,
-0.39376378059387207,
-0.09838660061359406,
0.06133013218641281,
-0.23068121075630188,
0.2599998712539673,
-0.3410632908344269,
0.4878441095352173,
-0.11580342054367065,
-0.2529909014701843,
0.13550889492034912,
0.2182617485523224,
-0.2094363570213318,
-0.30452847480773926,
-0.2605341970920563,
-0.26317864656448364,
-0.29103851318359375,
0.14484167098999023,
0.1198466420173645,
0.14194148778915405,
0.33904218673706055,
-0.015640921890735626,
-0.2616039514541626,
0.0639721155166626,
-0.5474544167518616,
0.42250481247901917,
0.27595406770706177,
-0.45271429419517517,
0.12678122520446777,
0.08666782081127167,
-0.21715140342712402,
-0.07895352691411972,
0.3603076636791229,
0.48327791690826416,
0.15224607288837433,
-0.16785269975662231,
-0.05445355176925659,
0.15132957696914673,
-0.15691356360912323,
0.266107976436615,
0.19834856688976288,
0.5461708903312683,
-0.01160820946097374,
0.27721408009529114,
-0.034456510096788406,
-0.1021818220615387,
0.12582927942276,
-0.09534533321857452,
0.3726423978805542,
-0.1534411758184433,
0.027727041393518448,
-0.29387181997299194,
-0.3235826790332794,
-0.24252597987651825,
0.07156233489513397,
-0.4745609164237976,
0.2222234606742859,
0.02082449197769165,
-0.04109911620616913,
-0.09610548615455627,
-0.19681920111179352,
0.017879322171211243,
-0.06595897674560547,
0.6050193905830383,
0.3957439064979553,
0.19243845343589783,
-0.5417633652687073,
-0.3322758972644806,
-0.2320963591337204,
0.03479091450572014,
-0.08931878209114075,
-0.06550958752632141,
-0.1251090168952942,
-0.19320380687713623,
0.2847817838191986,
0.023161236196756363,
0.0680619552731514,
-0.36598503589630127,
-0.39965999126434326,
0.13607528805732727,
-0.3842676281929016,
-0.15934553742408752,
-0.10734543949365616,
0.1410558670759201,
0.3953360319137573,
-0.08614614605903625,
0.15852387249469757,
0.04806377738714218,
-0.1391519159078598,
0.02288515493273735,
0.1317005157470703,
-0.11028772592544556,
0.11560709774494171,
0.25015050172805786,
0.18847331404685974,
0.1602557748556137,
-0.016875009983778,
-0.2344985008239746,
-0.03469577804207802,
0.016606930643320084,
-0.212650865316391,
0.09201594442129135,
0.13925977051258087,
0.4395231306552887,
0.003247808665037155,
-0.3593880534172058,
-0.441551148891449,
0.26211291551589966,
0.018809355795383453,
-0.24307478964328766,
-0.19780302047729492,
0.19374781847000122,
0.3535231351852417,
-0.010095659643411636,
0.24177128076553345,
0.01392271090298891,
0.026048794388771057,
0.0006712451577186584,
-0.4054228961467743,
-0.34629178047180176,
0.8914780020713806,
-0.20117513835430145,
0.02973969280719757,
-0.01307421550154686,
0.2509539723396301,
-0.009426556527614594,
-0.2401631623506546,
-0.690341591835022,
-0.0335092693567276,
0.15632009506225586,
0.15949758887290955,
-0.5399850606918335,
0.13395684957504272,
0.028643455356359482,
0.03278850018978119,
0.10895685851573944,
0.46238720417022705,
-0.0463266558945179,
-0.3779214918613434,
0.20957575738430023,
-0.22979354858398438
] |
https://github.com/huggingface/datasets/issues/6276 | > Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue:
>
> ```python
> if __name__ == "__main__":
> common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
> ```
>
> Otherwise, the only solution is to set `num_proc=1`.
Thank you very much for the response, i eventually tried setting `num_proc=1` and now the jupyter notebook kernel keers dying after running the command, what do you think the issue could be, could it be that my system is not capable of running the command "i'm using a Lenovo Thinkpad T440 with no GPU" | I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error | ### Describe the bug
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
I tried google collab and it works but because I'm on the free version the training doesn't complete
the error comes in jupyter notebook when i run this line
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
here is the error message
```
Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s]
The above exception was the direct cause of the following exception:
NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value
NameError: name 'feature_extractor' is not defined
```
### Steps to reproduce the bug
1. follow the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
2. run this line of code
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
3. I'm using jupyter notebook from anaconda
### Expected behavior
No error message
### Environment info
datasets version: 2.8.0
Python version: 3.11
Windows 10 | 100 | I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error
### Describe the bug
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
I tried google collab and it works but because I'm on the free version the training doesn't complete
the error comes in jupyter notebook when i run this line
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
here is the error message
```
Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s]
The above exception was the direct cause of the following exception:
NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value
NameError: name 'feature_extractor' is not defined
```
### Steps to reproduce the bug
1. follow the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
2. run this line of code
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
3. I'm using jupyter notebook from anaconda
### Expected behavior
No error message
### Environment info
datasets version: 2.8.0
Python version: 3.11
Windows 10
> Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue:
>
> ```python
> if __name__ == "__main__":
> common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
> ```
>
> Otherwise, the only solution is to set `num_proc=1`.
Thank you very much for the response, i eventually tried setting `num_proc=1` and now the jupyter notebook kernel keers dying after running the command, what do you think the issue could be, could it be that my system is not capable of running the command "i'm using a Lenovo Thinkpad T440 with no GPU" | [
-0.05113082751631737,
-0.24175772070884705,
0.10620424896478653,
0.22932514548301697,
0.37092652916908264,
0.1690148264169693,
0.1730194091796875,
0.33574602007865906,
0.06762866675853729,
0.22165171802043915,
-0.4041449725627899,
0.15247999131679535,
-0.10573357343673706,
0.2656456232070923,
-0.2897327244281769,
-0.41690778732299805,
-0.002166029065847397,
0.08255691826343536,
0.06501761078834534,
0.13238275051116943,
-0.29485347867012024,
0.16707322001457214,
-0.4330970048904419,
0.43750154972076416,
-0.005591865628957748,
-0.436674028635025,
0.03192722052335739,
-0.09617246687412262,
-0.33123382925987244,
-0.16033285856246948,
0.052873820066452026,
-0.13992610573768616,
0.06624716520309448,
0.5462722778320312,
-0.00012111190153518692,
0.0539436936378479,
0.31844931840896606,
-0.1722903549671173,
0.04955660551786423,
-0.30146345496177673,
0.3061146140098572,
0.25042983889579773,
-0.09668859839439392,
-0.15007787942886353,
-0.16167208552360535,
0.09519585967063904,
-0.09089130908250809,
-0.2667808532714844,
0.45836836099624634,
0.41465646028518677,
0.09644036740064621,
0.4229179620742798,
0.6261513829231262,
-0.04217882454395294,
-0.013494279235601425,
-0.3095824122428894,
-0.2559332847595215,
0.43736687302589417,
-0.09002220630645752,
-0.3680974841117859,
0.12284240126609802,
0.44915151596069336,
-0.12700189650058746,
0.11685223877429962,
0.19262661039829254,
0.1501515656709671,
0.19793960452079773,
-0.5410189628601074,
-0.007953237742185593,
0.3797045648097992,
-0.043974198400974274,
-0.1858237087726593,
-0.26984289288520813,
-0.14821037650108337,
0.10640023648738861,
-0.24192136526107788,
0.009630659595131874,
0.04255838692188263,
-0.175584077835083,
0.11002388596534729,
0.040818266570568085,
-0.04746551439166069,
-0.040848247706890106,
0.027915731072425842,
0.12017755210399628,
0.21676260232925415,
-0.08889569342136383,
0.23710143566131592,
0.36575812101364136,
-0.28334933519363403,
-0.14175847172737122,
0.03499222174286842,
0.026518935337662697,
0.31777524948120117,
-0.6121677756309509,
-0.0523734986782074,
0.005793849006295204,
-0.13743774592876434,
0.16335603594779968,
-0.2697126567363739,
0.43674764037132263,
-0.17850251495838165,
0.12113611400127411,
0.1987532526254654,
0.10312703251838684,
0.13188737630844116,
0.22482746839523315,
0.2376132607460022,
0.3819817304611206,
0.5106891989707947,
0.2819632291793823,
-0.08697640150785446,
-0.007815070450305939,
-0.1374230831861496,
-0.45894256234169006,
-0.09096826612949371,
0.29894107580184937,
-0.13472440838813782,
-0.5112472772598267,
0.23295287787914276,
-0.030948497354984283,
-0.044568903744220734,
0.19276174902915955,
0.13294899463653564,
-0.08867865800857544,
-0.13495948910713196,
0.2964177131652832,
0.23056434094905853,
-0.0503634512424469,
-0.21375878155231476,
-0.04697117209434509,
0.19015191495418549,
-0.15778696537017822,
0.12915262579917908,
-0.07596786320209503,
0.13496696949005127,
0.42981165647506714,
-0.32332614064216614,
0.42038825154304504,
-0.07696820795536041,
-0.07220372557640076,
-0.13352122902870178,
-0.20947398245334625,
0.24027606844902039,
-0.1846199631690979,
-0.17718684673309326,
0.302196204662323,
-0.5056790709495544,
-0.16763119399547577,
-0.21551117300987244,
-0.33342668414115906,
-0.3298189640045166,
0.09261082112789154,
0.006914346478879452,
-0.013073958456516266,
0.41235363483428955,
-0.1886478066444397,
-0.09936767816543579,
0.24332161247730255,
0.013317711651325226,
0.01954006403684616,
-0.04263583570718765,
-0.30844414234161377,
-0.09384457021951675,
0.4028947353363037,
0.31477439403533936,
-0.10397578030824661,
-0.28108975291252136,
0.13590097427368164,
0.0777510479092598,
0.2755469083786011,
0.496725469827652,
0.11556065827608109,
-0.0428575836122036,
-0.04962329566478729,
0.23273272812366486,
0.0812511071562767,
-0.4104408025741577,
-0.32728108763694763,
-0.05533377081155777,
-0.3384273946285248,
-0.04218382015824318,
0.17412102222442627,
-0.1824379861354828,
-0.06632561981678009,
0.0733848363161087,
0.5861657857894897,
0.0949072390794754,
-0.19657397270202637,
-0.25364363193511963,
-0.2357710301876068,
0.08214683085680008,
0.17252476513385773,
0.2378072291612625,
-0.28232330083847046,
-0.018839430063962936,
-0.13284426927566528,
-0.0960044264793396,
0.27483949065208435,
-0.05470442771911621,
-0.0923035517334938,
-0.015719667077064514,
0.15292438864707947,
-0.15804257988929749,
0.034825071692466736,
0.2369241714477539,
-0.04972283914685249,
0.16222544014453888,
-0.07403037697076797,
0.37641429901123047,
-0.0970885157585144,
0.1517517864704132,
-0.01994910091161728,
0.06809858232736588,
-0.1609753966331482,
-0.365443617105484,
-0.004146315157413483,
-0.12600111961364746,
0.17789769172668457,
-0.1657482385635376,
-0.20779086649417877,
0.2291184961795807,
-0.5212485790252686,
0.24230140447616577,
-0.6958329081535339,
0.17721962928771973,
-0.27779093384742737,
-0.21611447632312775,
0.23268729448318481,
0.25558069348335266,
0.0018195044249296188,
0.05421222746372223,
-0.027854163199663162,
0.5456068515777588,
-0.09776453673839569,
-0.3795401155948639,
-0.22116732597351074,
0.08659382164478302,
-0.012102961540222168,
-0.10347624123096466,
-0.1466168463230133,
0.01336415484547615,
-0.017941584810614586,
-0.03644704073667526,
0.22412659227848053,
0.5109313130378723,
0.31747666001319885,
0.20634008944034576,
-0.12605082988739014,
0.22942686080932617,
-0.02416204661130905,
-0.04759782925248146,
-0.19694478809833527,
-0.14422282576560974,
0.4851683974266052,
-0.4792439341545105,
0.2292570322751999,
-0.25143319368362427,
-0.10088446736335754,
-0.5365926623344421,
0.17083799839019775,
-0.06563059240579605,
0.25382593274116516,
-0.013330777175724506,
-0.11124436557292938,
0.15561509132385254,
-0.22508184611797333,
0.05881849676370621,
0.34173375368118286,
-0.02627069503068924,
-0.29104775190353394,
0.22184333205223083,
0.14502042531967163,
0.009110022336244583,
0.052366942167282104,
0.22620363533496857,
0.498625785112381,
0.166290283203125,
-0.058564692735672,
0.1408158242702484,
-0.09529227018356323,
-0.3056313097476959,
-0.23190543055534363,
0.3865694999694824,
-0.2727612853050232,
-0.2720333933830261,
0.07310962677001953,
0.1918105185031891,
0.10142259299755096,
0.31268057227134705,
-0.379988431930542,
-0.03611588850617409,
-0.08811180293560028,
-0.004535691812634468,
-0.032972078770399094,
0.305891215801239,
0.1662798523902893,
0.37627866864204407,
0.2178090512752533,
0.32354414463043213,
-0.06855198740959167,
-0.15491712093353271,
-0.06220794469118118,
-0.06706250458955765,
0.12729158997535706,
-0.44672122597694397,
-0.1118822917342186,
-0.14942488074302673,
-0.10122689604759216,
0.06368771940469742,
-0.1898731142282486,
0.061816971749067307,
-0.28894612193107605,
0.43151792883872986,
0.34886425733566284,
0.35225600004196167,
-0.02007938176393509,
-0.3190135359764099,
0.3510107398033142,
-0.1807297021150589,
-0.3512139320373535,
0.07935132831335068,
0.07303600013256073,
-0.12372047454118729,
-0.032618649303913116,
-0.031055837869644165,
-0.40634647011756897,
-0.3318440914154053,
0.6025372743606567,
-0.2276742309331894,
0.03623851016163826,
0.0541427917778492,
-0.15379369258880615,
0.21800482273101807,
-0.3155480623245239,
0.2593466639518738,
-0.1095348596572876,
-0.38581934571266174,
0.40893471240997314,
-0.11530991643667221,
-0.19381651282310486,
-0.19884829223155975,
0.20120103657245636,
0.3636370301246643,
-0.4676476716995239,
-0.3136027753353119,
-0.10237779468297958,
-0.09024372696876526,
0.11697480082511902,
-0.14949597418308258,
-0.04006628692150116,
0.14855307340621948,
-0.030493687838315964,
0.05094897747039795,
-0.1867942363023758,
-0.42131978273391724,
0.24406738579273224,
0.09518201649188995,
0.4098585546016693,
0.2252516746520996,
0.604364275932312,
-0.1073540598154068,
0.03831315413117409,
0.2754436731338501,
-0.00804990716278553,
0.2437146157026291,
0.12448599934577942,
-0.01834438368678093,
-0.012772221118211746,
-0.20380789041519165,
0.33008214831352234,
0.10970664024353027,
-0.09808717668056488,
0.13277025520801544,
-0.07223603129386902,
-0.060865141451358795,
-0.5553121566772461,
-0.2923474907875061,
-0.05765524506568909,
-0.12253785133361816,
-0.21829038858413696,
0.08105572313070297,
0.19803465902805328,
-0.19552087783813477,
0.0756407231092453,
0.08358453214168549,
0.04621780663728714,
0.35897648334503174,
0.01606554165482521,
0.11576180160045624,
-0.1439080685377121,
-0.31170976161956787,
-0.36081746220588684,
-0.5071966052055359,
0.406601220369339,
-0.13000623881816864,
0.4522325396537781,
-0.01632235199213028,
0.0018658339977264404,
-0.21563610434532166,
0.17040325701236725,
0.7178691625595093,
-0.007806604728102684,
-0.021000118926167488,
-0.09736520797014236,
0.22667841613292694,
-0.14307935535907745,
-0.09847225993871689,
-0.019475556910037994,
0.007628999650478363,
0.30795958638191223,
0.48453837633132935,
-0.31191739439964294,
0.15737450122833252,
0.4501084089279175,
-0.11397029459476471,
0.03388132154941559,
0.05490223690867424,
-0.41208499670028687,
-0.132290780544281,
-0.1261347085237503,
0.04579174891114235,
-0.007569245994091034,
0.3372730612754822,
0.23936322331428528,
0.4687528908252716,
0.3213670253753662,
-0.2136530727148056,
0.17868253588676453,
0.20716705918312073,
0.2854421138763428,
0.19556039571762085,
0.1786351352930069,
0.34606295824050903,
0.19155362248420715,
0.43223822116851807,
0.28512558341026306,
-0.17636437714099884,
-0.4160130023956299,
0.21115802228450775,
0.12654174864292145,
0.35902640223503113,
0.128103107213974,
-0.013191845268011093,
0.16230252385139465,
0.1631460189819336,
0.5982354283332825,
0.0665835291147232,
-0.05922272428870201,
0.45575737953186035,
0.11522196233272552,
-0.40409794449806213,
-0.04436448961496353,
0.36786845326423645,
0.15563392639160156,
0.05580654740333557,
0.08012120425701141,
0.15140843391418457,
-0.07185676693916321,
0.41555023193359375,
0.20205608010292053,
0.9475736618041992,
0.053213391453027725,
-0.04255644232034683,
0.0885927826166153,
-0.13639569282531738,
0.31552931666374207,
-0.19161057472229004,
0.08139263093471527,
0.013081520795822144,
-0.3036961257457733,
0.029069125652313232,
-0.05959731712937355,
0.2840188443660736,
-0.0580950528383255,
-0.144923597574234,
0.23109593987464905,
0.03621856868267059,
-0.1864262968301773,
0.03902534395456314,
-0.09001566469669342,
0.08126085996627808,
-0.08801020681858063,
-0.0005303993821144104,
-0.09006339311599731,
-0.2256496250629425,
0.22578753530979156,
0.20407134294509888,
-0.040111228823661804,
-0.25184544920921326,
-0.28143709897994995,
-0.21666783094406128,
-0.03584054112434387,
-0.5318975448608398,
-0.0055070556700229645,
0.48244479298591614,
-0.15242962539196014,
0.17854014039039612,
0.28177741169929504,
0.4356308579444885,
0.3400086462497711,
-0.2811509072780609,
0.19214007258415222,
0.4501974880695343,
-0.2404615581035614,
0.10981731861829758,
0.039815228432416916,
0.19135445356369019,
-0.07983489334583282,
0.03546331822872162,
0.023134004324674606,
-0.17328289151191711,
-0.0825025737285614,
-0.3889470398426056,
-0.1166863963007927,
0.4380970597267151,
-0.06932424753904343,
0.1237885132431984,
-0.1997487097978592,
0.07072925567626953,
-0.31763601303100586,
0.0713326707482338,
0.20604877173900604,
-0.4383786916732788,
-0.2039000391960144,
-0.1318921148777008,
-0.36646121740341187,
-0.04276414215564728,
0.27462804317474365,
0.014677805826067924,
0.02054072916507721,
0.48319944739341736,
0.10798589885234833,
-0.07259170711040497,
0.008172549307346344,
0.08968833088874817,
0.5692204236984253,
-0.22703832387924194,
0.22446182370185852,
0.2003893107175827,
-0.0519668310880661,
-0.3092474937438965,
0.27614396810531616,
0.42185452580451965,
-0.014380697160959244,
0.25138887763023376,
-0.3341831862926483,
-0.652658998966217,
0.2950972020626068,
-0.1557500958442688,
0.07152241468429565,
-0.13178330659866333,
0.35162919759750366,
-0.11263741552829742,
0.11191095411777496,
-0.17199289798736572,
-0.18585675954818726,
-0.4535270631313324,
0.05169788748025894,
0.6117978692054749,
0.005677399225533009,
0.049841951578855515,
-0.07264697551727295,
0.06944938749074936,
0.11732742190361023,
-0.08274848759174347,
-0.03410301357507706,
-0.1453595757484436,
0.15357033908367157,
-0.06344030052423477,
-0.18492189049720764,
0.208842471241951,
0.0043021515011787415,
-0.2639632821083069,
-0.08173973858356476,
-0.1082150936126709,
0.10540683567523956,
0.17891785502433777,
-0.019247714430093765,
0.11884172260761261,
0.02046104148030281,
0.13739845156669617,
-0.008648987859487534,
-0.18674905598163605,
0.1267780065536499,
0.1766340285539627,
-0.009986747056245804,
-0.2692561745643616,
-0.1519445776939392,
0.11498740315437317,
-0.029199305921792984,
-0.412619948387146,
-0.06649541109800339,
0.16334328055381775,
-0.4580017626285553,
-0.30800914764404297,
-0.009285837411880493,
0.4242590665817261,
0.15613505244255066,
-0.2061694711446762,
-0.05955274775624275,
0.36507928371429443,
0.005549885332584381,
-0.30935364961624146,
-0.16358830034732819,
0.14967665076255798,
-0.014666438102722168,
-0.012069612741470337,
0.2686302065849304,
-0.24325206875801086,
0.12736481428146362,
-0.46382713317871094,
-0.020513378083705902,
-0.08817269653081894,
0.053695496171712875,
0.18671660125255585,
0.41884684562683105,
0.11715541034936905,
0.0029188329353928566,
0.28508710861206055,
-0.10704751312732697,
0.15411469340324402,
0.12707114219665527,
-0.2615261971950531,
0.2316354513168335,
-0.013053828850388527,
0.10919761657714844,
0.02669360861182213,
-0.39376378059387207,
-0.09838660061359406,
0.06133013218641281,
-0.23068121075630188,
0.2599998712539673,
-0.3410632908344269,
0.4878441095352173,
-0.11580342054367065,
-0.2529909014701843,
0.13550889492034912,
0.2182617485523224,
-0.2094363570213318,
-0.30452847480773926,
-0.2605341970920563,
-0.26317864656448364,
-0.29103851318359375,
0.14484167098999023,
0.1198466420173645,
0.14194148778915405,
0.33904218673706055,
-0.015640921890735626,
-0.2616039514541626,
0.0639721155166626,
-0.5474544167518616,
0.42250481247901917,
0.27595406770706177,
-0.45271429419517517,
0.12678122520446777,
0.08666782081127167,
-0.21715140342712402,
-0.07895352691411972,
0.3603076636791229,
0.48327791690826416,
0.15224607288837433,
-0.16785269975662231,
-0.05445355176925659,
0.15132957696914673,
-0.15691356360912323,
0.266107976436615,
0.19834856688976288,
0.5461708903312683,
-0.01160820946097374,
0.27721408009529114,
-0.034456510096788406,
-0.1021818220615387,
0.12582927942276,
-0.09534533321857452,
0.3726423978805542,
-0.1534411758184433,
0.027727041393518448,
-0.29387181997299194,
-0.3235826790332794,
-0.24252597987651825,
0.07156233489513397,
-0.4745609164237976,
0.2222234606742859,
0.02082449197769165,
-0.04109911620616913,
-0.09610548615455627,
-0.19681920111179352,
0.017879322171211243,
-0.06595897674560547,
0.6050193905830383,
0.3957439064979553,
0.19243845343589783,
-0.5417633652687073,
-0.3322758972644806,
-0.2320963591337204,
0.03479091450572014,
-0.08931878209114075,
-0.06550958752632141,
-0.1251090168952942,
-0.19320380687713623,
0.2847817838191986,
0.023161236196756363,
0.0680619552731514,
-0.36598503589630127,
-0.39965999126434326,
0.13607528805732727,
-0.3842676281929016,
-0.15934553742408752,
-0.10734543949365616,
0.1410558670759201,
0.3953360319137573,
-0.08614614605903625,
0.15852387249469757,
0.04806377738714218,
-0.1391519159078598,
0.02288515493273735,
0.1317005157470703,
-0.11028772592544556,
0.11560709774494171,
0.25015050172805786,
0.18847331404685974,
0.1602557748556137,
-0.016875009983778,
-0.2344985008239746,
-0.03469577804207802,
0.016606930643320084,
-0.212650865316391,
0.09201594442129135,
0.13925977051258087,
0.4395231306552887,
0.003247808665037155,
-0.3593880534172058,
-0.441551148891449,
0.26211291551589966,
0.018809355795383453,
-0.24307478964328766,
-0.19780302047729492,
0.19374781847000122,
0.3535231351852417,
-0.010095659643411636,
0.24177128076553345,
0.01392271090298891,
0.026048794388771057,
0.0006712451577186584,
-0.4054228961467743,
-0.34629178047180176,
0.8914780020713806,
-0.20117513835430145,
0.02973969280719757,
-0.01307421550154686,
0.2509539723396301,
-0.009426556527614594,
-0.2401631623506546,
-0.690341591835022,
-0.0335092693567276,
0.15632009506225586,
0.15949758887290955,
-0.5399850606918335,
0.13395684957504272,
0.028643455356359482,
0.03278850018978119,
0.10895685851573944,
0.46238720417022705,
-0.0463266558945179,
-0.3779214918613434,
0.20957575738430023,
-0.22979354858398438
] |
https://github.com/huggingface/datasets/issues/6276 | Firstly, you didn't define feature_extractor variable. Secondly, it is large nlp model. Hence you should use proper gpu, otherwise your machine's cpu will be overclock and you can do nothing. | I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error | ### Describe the bug
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
I tried google collab and it works but because I'm on the free version the training doesn't complete
the error comes in jupyter notebook when i run this line
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
here is the error message
```
Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s]
The above exception was the direct cause of the following exception:
NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value
NameError: name 'feature_extractor' is not defined
```
### Steps to reproduce the bug
1. follow the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
2. run this line of code
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
3. I'm using jupyter notebook from anaconda
### Expected behavior
No error message
### Environment info
datasets version: 2.8.0
Python version: 3.11
Windows 10 | 30 | I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error
### Describe the bug
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
I tried google collab and it works but because I'm on the free version the training doesn't complete
the error comes in jupyter notebook when i run this line
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
here is the error message
```
Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s]
The above exception was the direct cause of the following exception:
NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value
NameError: name 'feature_extractor' is not defined
```
### Steps to reproduce the bug
1. follow the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
2. run this line of code
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
3. I'm using jupyter notebook from anaconda
### Expected behavior
No error message
### Environment info
datasets version: 2.8.0
Python version: 3.11
Windows 10
Firstly, you didn't define feature_extractor variable. Secondly, it is large nlp model. Hence you should use proper gpu, otherwise your machine's cpu will be overclock and you can do nothing. | [
-0.05113082751631737,
-0.24175772070884705,
0.10620424896478653,
0.22932514548301697,
0.37092652916908264,
0.1690148264169693,
0.1730194091796875,
0.33574602007865906,
0.06762866675853729,
0.22165171802043915,
-0.4041449725627899,
0.15247999131679535,
-0.10573357343673706,
0.2656456232070923,
-0.2897327244281769,
-0.41690778732299805,
-0.002166029065847397,
0.08255691826343536,
0.06501761078834534,
0.13238275051116943,
-0.29485347867012024,
0.16707322001457214,
-0.4330970048904419,
0.43750154972076416,
-0.005591865628957748,
-0.436674028635025,
0.03192722052335739,
-0.09617246687412262,
-0.33123382925987244,
-0.16033285856246948,
0.052873820066452026,
-0.13992610573768616,
0.06624716520309448,
0.5462722778320312,
-0.00012111190153518692,
0.0539436936378479,
0.31844931840896606,
-0.1722903549671173,
0.04955660551786423,
-0.30146345496177673,
0.3061146140098572,
0.25042983889579773,
-0.09668859839439392,
-0.15007787942886353,
-0.16167208552360535,
0.09519585967063904,
-0.09089130908250809,
-0.2667808532714844,
0.45836836099624634,
0.41465646028518677,
0.09644036740064621,
0.4229179620742798,
0.6261513829231262,
-0.04217882454395294,
-0.013494279235601425,
-0.3095824122428894,
-0.2559332847595215,
0.43736687302589417,
-0.09002220630645752,
-0.3680974841117859,
0.12284240126609802,
0.44915151596069336,
-0.12700189650058746,
0.11685223877429962,
0.19262661039829254,
0.1501515656709671,
0.19793960452079773,
-0.5410189628601074,
-0.007953237742185593,
0.3797045648097992,
-0.043974198400974274,
-0.1858237087726593,
-0.26984289288520813,
-0.14821037650108337,
0.10640023648738861,
-0.24192136526107788,
0.009630659595131874,
0.04255838692188263,
-0.175584077835083,
0.11002388596534729,
0.040818266570568085,
-0.04746551439166069,
-0.040848247706890106,
0.027915731072425842,
0.12017755210399628,
0.21676260232925415,
-0.08889569342136383,
0.23710143566131592,
0.36575812101364136,
-0.28334933519363403,
-0.14175847172737122,
0.03499222174286842,
0.026518935337662697,
0.31777524948120117,
-0.6121677756309509,
-0.0523734986782074,
0.005793849006295204,
-0.13743774592876434,
0.16335603594779968,
-0.2697126567363739,
0.43674764037132263,
-0.17850251495838165,
0.12113611400127411,
0.1987532526254654,
0.10312703251838684,
0.13188737630844116,
0.22482746839523315,
0.2376132607460022,
0.3819817304611206,
0.5106891989707947,
0.2819632291793823,
-0.08697640150785446,
-0.007815070450305939,
-0.1374230831861496,
-0.45894256234169006,
-0.09096826612949371,
0.29894107580184937,
-0.13472440838813782,
-0.5112472772598267,
0.23295287787914276,
-0.030948497354984283,
-0.044568903744220734,
0.19276174902915955,
0.13294899463653564,
-0.08867865800857544,
-0.13495948910713196,
0.2964177131652832,
0.23056434094905853,
-0.0503634512424469,
-0.21375878155231476,
-0.04697117209434509,
0.19015191495418549,
-0.15778696537017822,
0.12915262579917908,
-0.07596786320209503,
0.13496696949005127,
0.42981165647506714,
-0.32332614064216614,
0.42038825154304504,
-0.07696820795536041,
-0.07220372557640076,
-0.13352122902870178,
-0.20947398245334625,
0.24027606844902039,
-0.1846199631690979,
-0.17718684673309326,
0.302196204662323,
-0.5056790709495544,
-0.16763119399547577,
-0.21551117300987244,
-0.33342668414115906,
-0.3298189640045166,
0.09261082112789154,
0.006914346478879452,
-0.013073958456516266,
0.41235363483428955,
-0.1886478066444397,
-0.09936767816543579,
0.24332161247730255,
0.013317711651325226,
0.01954006403684616,
-0.04263583570718765,
-0.30844414234161377,
-0.09384457021951675,
0.4028947353363037,
0.31477439403533936,
-0.10397578030824661,
-0.28108975291252136,
0.13590097427368164,
0.0777510479092598,
0.2755469083786011,
0.496725469827652,
0.11556065827608109,
-0.0428575836122036,
-0.04962329566478729,
0.23273272812366486,
0.0812511071562767,
-0.4104408025741577,
-0.32728108763694763,
-0.05533377081155777,
-0.3384273946285248,
-0.04218382015824318,
0.17412102222442627,
-0.1824379861354828,
-0.06632561981678009,
0.0733848363161087,
0.5861657857894897,
0.0949072390794754,
-0.19657397270202637,
-0.25364363193511963,
-0.2357710301876068,
0.08214683085680008,
0.17252476513385773,
0.2378072291612625,
-0.28232330083847046,
-0.018839430063962936,
-0.13284426927566528,
-0.0960044264793396,
0.27483949065208435,
-0.05470442771911621,
-0.0923035517334938,
-0.015719667077064514,
0.15292438864707947,
-0.15804257988929749,
0.034825071692466736,
0.2369241714477539,
-0.04972283914685249,
0.16222544014453888,
-0.07403037697076797,
0.37641429901123047,
-0.0970885157585144,
0.1517517864704132,
-0.01994910091161728,
0.06809858232736588,
-0.1609753966331482,
-0.365443617105484,
-0.004146315157413483,
-0.12600111961364746,
0.17789769172668457,
-0.1657482385635376,
-0.20779086649417877,
0.2291184961795807,
-0.5212485790252686,
0.24230140447616577,
-0.6958329081535339,
0.17721962928771973,
-0.27779093384742737,
-0.21611447632312775,
0.23268729448318481,
0.25558069348335266,
0.0018195044249296188,
0.05421222746372223,
-0.027854163199663162,
0.5456068515777588,
-0.09776453673839569,
-0.3795401155948639,
-0.22116732597351074,
0.08659382164478302,
-0.012102961540222168,
-0.10347624123096466,
-0.1466168463230133,
0.01336415484547615,
-0.017941584810614586,
-0.03644704073667526,
0.22412659227848053,
0.5109313130378723,
0.31747666001319885,
0.20634008944034576,
-0.12605082988739014,
0.22942686080932617,
-0.02416204661130905,
-0.04759782925248146,
-0.19694478809833527,
-0.14422282576560974,
0.4851683974266052,
-0.4792439341545105,
0.2292570322751999,
-0.25143319368362427,
-0.10088446736335754,
-0.5365926623344421,
0.17083799839019775,
-0.06563059240579605,
0.25382593274116516,
-0.013330777175724506,
-0.11124436557292938,
0.15561509132385254,
-0.22508184611797333,
0.05881849676370621,
0.34173375368118286,
-0.02627069503068924,
-0.29104775190353394,
0.22184333205223083,
0.14502042531967163,
0.009110022336244583,
0.052366942167282104,
0.22620363533496857,
0.498625785112381,
0.166290283203125,
-0.058564692735672,
0.1408158242702484,
-0.09529227018356323,
-0.3056313097476959,
-0.23190543055534363,
0.3865694999694824,
-0.2727612853050232,
-0.2720333933830261,
0.07310962677001953,
0.1918105185031891,
0.10142259299755096,
0.31268057227134705,
-0.379988431930542,
-0.03611588850617409,
-0.08811180293560028,
-0.004535691812634468,
-0.032972078770399094,
0.305891215801239,
0.1662798523902893,
0.37627866864204407,
0.2178090512752533,
0.32354414463043213,
-0.06855198740959167,
-0.15491712093353271,
-0.06220794469118118,
-0.06706250458955765,
0.12729158997535706,
-0.44672122597694397,
-0.1118822917342186,
-0.14942488074302673,
-0.10122689604759216,
0.06368771940469742,
-0.1898731142282486,
0.061816971749067307,
-0.28894612193107605,
0.43151792883872986,
0.34886425733566284,
0.35225600004196167,
-0.02007938176393509,
-0.3190135359764099,
0.3510107398033142,
-0.1807297021150589,
-0.3512139320373535,
0.07935132831335068,
0.07303600013256073,
-0.12372047454118729,
-0.032618649303913116,
-0.031055837869644165,
-0.40634647011756897,
-0.3318440914154053,
0.6025372743606567,
-0.2276742309331894,
0.03623851016163826,
0.0541427917778492,
-0.15379369258880615,
0.21800482273101807,
-0.3155480623245239,
0.2593466639518738,
-0.1095348596572876,
-0.38581934571266174,
0.40893471240997314,
-0.11530991643667221,
-0.19381651282310486,
-0.19884829223155975,
0.20120103657245636,
0.3636370301246643,
-0.4676476716995239,
-0.3136027753353119,
-0.10237779468297958,
-0.09024372696876526,
0.11697480082511902,
-0.14949597418308258,
-0.04006628692150116,
0.14855307340621948,
-0.030493687838315964,
0.05094897747039795,
-0.1867942363023758,
-0.42131978273391724,
0.24406738579273224,
0.09518201649188995,
0.4098585546016693,
0.2252516746520996,
0.604364275932312,
-0.1073540598154068,
0.03831315413117409,
0.2754436731338501,
-0.00804990716278553,
0.2437146157026291,
0.12448599934577942,
-0.01834438368678093,
-0.012772221118211746,
-0.20380789041519165,
0.33008214831352234,
0.10970664024353027,
-0.09808717668056488,
0.13277025520801544,
-0.07223603129386902,
-0.060865141451358795,
-0.5553121566772461,
-0.2923474907875061,
-0.05765524506568909,
-0.12253785133361816,
-0.21829038858413696,
0.08105572313070297,
0.19803465902805328,
-0.19552087783813477,
0.0756407231092453,
0.08358453214168549,
0.04621780663728714,
0.35897648334503174,
0.01606554165482521,
0.11576180160045624,
-0.1439080685377121,
-0.31170976161956787,
-0.36081746220588684,
-0.5071966052055359,
0.406601220369339,
-0.13000623881816864,
0.4522325396537781,
-0.01632235199213028,
0.0018658339977264404,
-0.21563610434532166,
0.17040325701236725,
0.7178691625595093,
-0.007806604728102684,
-0.021000118926167488,
-0.09736520797014236,
0.22667841613292694,
-0.14307935535907745,
-0.09847225993871689,
-0.019475556910037994,
0.007628999650478363,
0.30795958638191223,
0.48453837633132935,
-0.31191739439964294,
0.15737450122833252,
0.4501084089279175,
-0.11397029459476471,
0.03388132154941559,
0.05490223690867424,
-0.41208499670028687,
-0.132290780544281,
-0.1261347085237503,
0.04579174891114235,
-0.007569245994091034,
0.3372730612754822,
0.23936322331428528,
0.4687528908252716,
0.3213670253753662,
-0.2136530727148056,
0.17868253588676453,
0.20716705918312073,
0.2854421138763428,
0.19556039571762085,
0.1786351352930069,
0.34606295824050903,
0.19155362248420715,
0.43223822116851807,
0.28512558341026306,
-0.17636437714099884,
-0.4160130023956299,
0.21115802228450775,
0.12654174864292145,
0.35902640223503113,
0.128103107213974,
-0.013191845268011093,
0.16230252385139465,
0.1631460189819336,
0.5982354283332825,
0.0665835291147232,
-0.05922272428870201,
0.45575737953186035,
0.11522196233272552,
-0.40409794449806213,
-0.04436448961496353,
0.36786845326423645,
0.15563392639160156,
0.05580654740333557,
0.08012120425701141,
0.15140843391418457,
-0.07185676693916321,
0.41555023193359375,
0.20205608010292053,
0.9475736618041992,
0.053213391453027725,
-0.04255644232034683,
0.0885927826166153,
-0.13639569282531738,
0.31552931666374207,
-0.19161057472229004,
0.08139263093471527,
0.013081520795822144,
-0.3036961257457733,
0.029069125652313232,
-0.05959731712937355,
0.2840188443660736,
-0.0580950528383255,
-0.144923597574234,
0.23109593987464905,
0.03621856868267059,
-0.1864262968301773,
0.03902534395456314,
-0.09001566469669342,
0.08126085996627808,
-0.08801020681858063,
-0.0005303993821144104,
-0.09006339311599731,
-0.2256496250629425,
0.22578753530979156,
0.20407134294509888,
-0.040111228823661804,
-0.25184544920921326,
-0.28143709897994995,
-0.21666783094406128,
-0.03584054112434387,
-0.5318975448608398,
-0.0055070556700229645,
0.48244479298591614,
-0.15242962539196014,
0.17854014039039612,
0.28177741169929504,
0.4356308579444885,
0.3400086462497711,
-0.2811509072780609,
0.19214007258415222,
0.4501974880695343,
-0.2404615581035614,
0.10981731861829758,
0.039815228432416916,
0.19135445356369019,
-0.07983489334583282,
0.03546331822872162,
0.023134004324674606,
-0.17328289151191711,
-0.0825025737285614,
-0.3889470398426056,
-0.1166863963007927,
0.4380970597267151,
-0.06932424753904343,
0.1237885132431984,
-0.1997487097978592,
0.07072925567626953,
-0.31763601303100586,
0.0713326707482338,
0.20604877173900604,
-0.4383786916732788,
-0.2039000391960144,
-0.1318921148777008,
-0.36646121740341187,
-0.04276414215564728,
0.27462804317474365,
0.014677805826067924,
0.02054072916507721,
0.48319944739341736,
0.10798589885234833,
-0.07259170711040497,
0.008172549307346344,
0.08968833088874817,
0.5692204236984253,
-0.22703832387924194,
0.22446182370185852,
0.2003893107175827,
-0.0519668310880661,
-0.3092474937438965,
0.27614396810531616,
0.42185452580451965,
-0.014380697160959244,
0.25138887763023376,
-0.3341831862926483,
-0.652658998966217,
0.2950972020626068,
-0.1557500958442688,
0.07152241468429565,
-0.13178330659866333,
0.35162919759750366,
-0.11263741552829742,
0.11191095411777496,
-0.17199289798736572,
-0.18585675954818726,
-0.4535270631313324,
0.05169788748025894,
0.6117978692054749,
0.005677399225533009,
0.049841951578855515,
-0.07264697551727295,
0.06944938749074936,
0.11732742190361023,
-0.08274848759174347,
-0.03410301357507706,
-0.1453595757484436,
0.15357033908367157,
-0.06344030052423477,
-0.18492189049720764,
0.208842471241951,
0.0043021515011787415,
-0.2639632821083069,
-0.08173973858356476,
-0.1082150936126709,
0.10540683567523956,
0.17891785502433777,
-0.019247714430093765,
0.11884172260761261,
0.02046104148030281,
0.13739845156669617,
-0.008648987859487534,
-0.18674905598163605,
0.1267780065536499,
0.1766340285539627,
-0.009986747056245804,
-0.2692561745643616,
-0.1519445776939392,
0.11498740315437317,
-0.029199305921792984,
-0.412619948387146,
-0.06649541109800339,
0.16334328055381775,
-0.4580017626285553,
-0.30800914764404297,
-0.009285837411880493,
0.4242590665817261,
0.15613505244255066,
-0.2061694711446762,
-0.05955274775624275,
0.36507928371429443,
0.005549885332584381,
-0.30935364961624146,
-0.16358830034732819,
0.14967665076255798,
-0.014666438102722168,
-0.012069612741470337,
0.2686302065849304,
-0.24325206875801086,
0.12736481428146362,
-0.46382713317871094,
-0.020513378083705902,
-0.08817269653081894,
0.053695496171712875,
0.18671660125255585,
0.41884684562683105,
0.11715541034936905,
0.0029188329353928566,
0.28508710861206055,
-0.10704751312732697,
0.15411469340324402,
0.12707114219665527,
-0.2615261971950531,
0.2316354513168335,
-0.013053828850388527,
0.10919761657714844,
0.02669360861182213,
-0.39376378059387207,
-0.09838660061359406,
0.06133013218641281,
-0.23068121075630188,
0.2599998712539673,
-0.3410632908344269,
0.4878441095352173,
-0.11580342054367065,
-0.2529909014701843,
0.13550889492034912,
0.2182617485523224,
-0.2094363570213318,
-0.30452847480773926,
-0.2605341970920563,
-0.26317864656448364,
-0.29103851318359375,
0.14484167098999023,
0.1198466420173645,
0.14194148778915405,
0.33904218673706055,
-0.015640921890735626,
-0.2616039514541626,
0.0639721155166626,
-0.5474544167518616,
0.42250481247901917,
0.27595406770706177,
-0.45271429419517517,
0.12678122520446777,
0.08666782081127167,
-0.21715140342712402,
-0.07895352691411972,
0.3603076636791229,
0.48327791690826416,
0.15224607288837433,
-0.16785269975662231,
-0.05445355176925659,
0.15132957696914673,
-0.15691356360912323,
0.266107976436615,
0.19834856688976288,
0.5461708903312683,
-0.01160820946097374,
0.27721408009529114,
-0.034456510096788406,
-0.1021818220615387,
0.12582927942276,
-0.09534533321857452,
0.3726423978805542,
-0.1534411758184433,
0.027727041393518448,
-0.29387181997299194,
-0.3235826790332794,
-0.24252597987651825,
0.07156233489513397,
-0.4745609164237976,
0.2222234606742859,
0.02082449197769165,
-0.04109911620616913,
-0.09610548615455627,
-0.19681920111179352,
0.017879322171211243,
-0.06595897674560547,
0.6050193905830383,
0.3957439064979553,
0.19243845343589783,
-0.5417633652687073,
-0.3322758972644806,
-0.2320963591337204,
0.03479091450572014,
-0.08931878209114075,
-0.06550958752632141,
-0.1251090168952942,
-0.19320380687713623,
0.2847817838191986,
0.023161236196756363,
0.0680619552731514,
-0.36598503589630127,
-0.39965999126434326,
0.13607528805732727,
-0.3842676281929016,
-0.15934553742408752,
-0.10734543949365616,
0.1410558670759201,
0.3953360319137573,
-0.08614614605903625,
0.15852387249469757,
0.04806377738714218,
-0.1391519159078598,
0.02288515493273735,
0.1317005157470703,
-0.11028772592544556,
0.11560709774494171,
0.25015050172805786,
0.18847331404685974,
0.1602557748556137,
-0.016875009983778,
-0.2344985008239746,
-0.03469577804207802,
0.016606930643320084,
-0.212650865316391,
0.09201594442129135,
0.13925977051258087,
0.4395231306552887,
0.003247808665037155,
-0.3593880534172058,
-0.441551148891449,
0.26211291551589966,
0.018809355795383453,
-0.24307478964328766,
-0.19780302047729492,
0.19374781847000122,
0.3535231351852417,
-0.010095659643411636,
0.24177128076553345,
0.01392271090298891,
0.026048794388771057,
0.0006712451577186584,
-0.4054228961467743,
-0.34629178047180176,
0.8914780020713806,
-0.20117513835430145,
0.02973969280719757,
-0.01307421550154686,
0.2509539723396301,
-0.009426556527614594,
-0.2401631623506546,
-0.690341591835022,
-0.0335092693567276,
0.15632009506225586,
0.15949758887290955,
-0.5399850606918335,
0.13395684957504272,
0.028643455356359482,
0.03278850018978119,
0.10895685851573944,
0.46238720417022705,
-0.0463266558945179,
-0.3779214918613434,
0.20957575738430023,
-0.22979354858398438
] |
https://github.com/huggingface/datasets/issues/6275 | Hi! The process of contributing a dataset is explained here: https://huggingface.co/docs/datasets/upload_dataset. Also, check https://huggingface.co/docs/datasets/image_dataset for a more detailed explanation of how to share an image dataset. | Would like to Contribute a dataset | I have a dataset of 2500 images that can be used for color-blind machine-learning algorithms. Since , there was no dataset available online , I made this dataset myself and would like to contribute this now to community | 26 | Would like to Contribute a dataset
I have a dataset of 2500 images that can be used for color-blind machine-learning algorithms. Since , there was no dataset available online , I made this dataset myself and would like to contribute this now to community
Hi! The process of contributing a dataset is explained here: https://huggingface.co/docs/datasets/upload_dataset. Also, check https://huggingface.co/docs/datasets/image_dataset for a more detailed explanation of how to share an image dataset. | [
-0.3468210697174072,
0.11698678135871887,
-0.24077367782592773,
0.0649142861366272,
0.0920683741569519,
0.06356502324342728,
0.23023587465286255,
-0.007038936018943787,
-0.09269674122333527,
0.067618228495121,
-0.038468942046165466,
-0.10947487503290176,
-0.24117659032344818,
0.2810865044593811,
0.1703341007232666,
-0.024012673646211624,
-0.02436031401157379,
-0.15777021646499634,
-0.34049728512763977,
-0.15831981599330902,
0.15665462613105774,
-0.1258614957332611,
0.23064696788787842,
-0.2753888964653015,
-0.45760995149612427,
-0.07457035034894943,
-0.28126105666160583,
0.10494445264339447,
-0.17260724306106567,
-0.07964202761650085,
0.02806723862886429,
0.18705448508262634,
0.015933264046907425,
0.5298300981521606,
-0.00010543181997491047,
-0.22370561957359314,
0.08873263001441956,
-0.025279898196458817,
-0.11609910428524017,
-0.38286781311035156,
-0.24085687100887299,
-0.15932804346084595,
-0.3274596035480499,
0.03802131116390228,
-0.3256033957004547,
-0.16241000592708588,
0.27651944756507874,
0.025178000330924988,
0.5380473136901855,
0.24296867847442627,
0.26200148463249207,
0.25515609979629517,
0.48878490924835205,
-0.0712403953075409,
-0.09448634088039398,
0.8061139583587646,
-0.10817338526248932,
0.3296053111553192,
0.24790970981121063,
-0.1183682382106781,
0.1441236436367035,
0.08790318667888641,
0.02654510736465454,
-0.13983507454395294,
0.3431100845336914,
-0.09154748916625977,
-0.3323821723461151,
-0.38791579008102417,
0.11875487864017487,
0.20052900910377502,
0.43438413739204407,
-0.07563050091266632,
-0.2283991277217865,
-0.22317717969417572,
0.040543895214796066,
0.0801977887749672,
-0.26931673288345337,
0.4814574718475342,
-0.11210979521274567,
0.05987351015210152,
-0.5388780832290649,
-0.26906871795654297,
-0.29193776845932007,
-0.29035282135009766,
0.0681624561548233,
0.03958737850189209,
-0.2528593838214874,
0.17276343703269958,
-0.14174573123455048,
-0.17356891930103302,
-0.16577795147895813,
-0.2156379669904709,
0.15776708722114563,
0.15825244784355164,
0.03326641023159027,
-0.20433296263217926,
-0.028516680002212524,
0.08452804386615753,
0.21865501999855042,
0.16044235229492188,
0.21136784553527832,
-0.18255075812339783,
-0.4390731453895569,
0.07564453780651093,
0.24901632964611053,
-0.27947452664375305,
-0.16636306047439575,
-0.007069047540426254,
-0.042576778680086136,
-0.059159260243177414,
0.01738833636045456,
-0.048872943967580795,
0.05576905235648155,
0.21920806169509888,
-0.08403424173593521,
-0.2881726324558258,
0.17013579607009888,
-0.1489623337984085,
-0.23311282694339752,
-0.2528785169124603,
0.3587852418422699,
-0.10174136608839035,
-0.09601384401321411,
0.07207880169153214,
-0.06250512599945068,
-0.24149909615516663,
-0.14302946627140045,
0.15285487473011017,
0.16331923007965088,
-0.510170578956604,
-0.19675487279891968,
0.029494211077690125,
-0.03910006955265999,
0.1621294617652893,
0.03450985997915268,
-0.14303097128868103,
-0.0009563267230987549,
-0.04543672874569893,
0.30173149704933167,
0.14134518802165985,
0.062210582196712494,
0.09628898650407791,
0.0021479763090610504,
0.18194681406021118,
-0.013913370668888092,
0.016060441732406616,
0.39158570766448975,
-0.10375038534402847,
-0.30407029390335083,
0.12249316275119781,
-0.25698819756507874,
0.06953112781047821,
-0.47467803955078125,
0.10238583385944366,
0.03467918187379837,
-0.16680029034614563,
-0.408064603805542,
0.2701815366744995,
-0.1137767881155014,
0.01412694901227951,
0.20096266269683838,
0.1075611561536789,
-0.24223272502422333,
-0.3008446991443634,
0.31782370805740356,
0.39124375581741333,
-0.36874061822891235,
0.08855831623077393,
0.05780824273824692,
0.05549705773591995,
0.06963618099689484,
0.22319287061691284,
-0.07667400687932968,
-0.14481696486473083,
0.042393721640110016,
0.015839844942092896,
0.17882923781871796,
-0.1272580772638321,
-0.22202041745185852,
0.023746807128190994,
-0.13151809573173523,
-0.39232563972473145,
-0.1862683892250061,
0.2700894773006439,
0.01660684496164322,
-0.18192338943481445,
-0.01587938889861107,
0.5820563435554504,
-0.26172390580177307,
-0.04208271577954292,
-0.03719491884112358,
-0.22134068608283997,
-0.07085910439491272,
0.45996588468551636,
-0.2086673378944397,
-0.11852225661277771,
0.4620313048362732,
-0.3026413023471832,
0.13061845302581787,
-0.17744897305965424,
0.26471856236457825,
0.013630442321300507,
0.4269426465034485,
0.05034899711608887,
-0.19073812663555145,
-0.11710582673549652,
0.13823086023330688,
0.09187833964824677,
0.27196410298347473,
0.013302808627486229,
-0.030297622084617615,
-0.14051975309848785,
-0.31890785694122314,
0.01702309399843216,
0.06405335664749146,
-0.12983575463294983,
0.13359640538692474,
-0.022836700081825256,
0.20738676190376282,
0.14140696823596954,
-0.299213171005249,
0.45667245984077454,
-0.3885520100593567,
0.05107859522104263,
-0.21036933362483978,
0.25473251938819885,
0.06496445089578629,
-0.1183117926120758,
0.35422682762145996,
0.025099825114011765,
-0.14940263330936432,
0.0933237373828888,
-0.0012618973851203918,
0.2571868300437927,
-0.35960179567337036,
0.3404842019081116,
0.29137420654296875,
0.2550511360168457,
0.3914792239665985,
-0.655579686164856,
0.3283873200416565,
-0.004883702844381332,
0.017332542687654495,
0.017282754182815552,
-0.41658034920692444,
0.11863267421722412,
-0.512248694896698,
0.10860690474510193,
-0.22859664261341095,
0.13458849489688873,
0.016338206827640533,
0.19911664724349976,
-0.17844463884830475,
0.21969738602638245,
0.09239442646503448,
-0.02684049680829048,
0.2950975298881531,
-0.19860176742076874,
-0.24044722318649292,
0.31912505626678467,
-0.2907390296459198,
0.025363974273204803,
0.040153756737709045,
0.10122378170490265,
-0.1447545737028122,
0.12074915319681168,
0.35575753450393677,
0.06920574605464935,
0.13569767773151398,
0.07630257308483124,
0.09465792775154114,
-0.08414270728826523,
-0.16370296478271484,
0.06469602882862091,
-0.20122286677360535,
-0.09684791415929794,
0.1360451877117157,
-0.351889967918396,
0.35028383135795593,
0.3040369749069214,
-0.12306863069534302,
-0.06014372408390045,
-0.21354152262210846,
-0.20525729656219482,
-0.021103687584400177,
0.1230316162109375,
0.17785382270812988,
-0.4168955087661743,
0.13100409507751465,
0.2633255422115326,
-0.2355937361717224,
0.19690734148025513,
-0.09509295225143433,
0.0440838597714901,
0.05461201071739197,
0.04301200807094574,
-0.11504444479942322,
0.4686588943004608,
0.0000036209821701049805,
-0.04371563717722893,
-0.10199444741010666,
0.16887184977531433,
0.1704418808221817,
0.18302908539772034,
0.25475797057151794,
-0.1359829604625702,
0.6482601165771484,
0.056576818227767944,
0.34184253215789795,
-0.40824416279792786,
-0.2609925866127014,
-0.21540114283561707,
-0.23828740417957306,
0.3174523711204529,
-0.007897377014160156,
0.4906020760536194,
-0.37757599353790283,
-0.31666135787963867,
0.21626372635364532,
-0.02852129191160202,
-0.18155956268310547,
-0.4315166473388672,
0.09982960671186447,
-0.09508296847343445,
-0.02450108528137207,
0.4077613055706024,
-0.3424319922924042,
-0.24435842037200928,
0.3785461187362671,
0.21860377490520477,
0.059834472835063934,
0.11868728697299957,
0.4587438106536865,
-0.13891245424747467,
0.06713847070932388,
-0.10703334957361221,
-0.0033451616764068604,
-0.5234638452529907,
0.26186344027519226,
-0.32445311546325684,
-0.42211461067199707,
-0.0012184903025627136,
0.24383163452148438,
0.11344984918832779,
0.0857599526643753,
-0.3044930696487427,
-0.16343450546264648,
-0.03481145203113556,
0.17108187079429626,
0.22056490182876587,
0.23724573850631714,
0.04102211445569992,
0.06996013224124908,
-0.0858113020658493,
0.053162842988967896,
-0.17694659531116486,
-0.4666737914085388,
0.2950475811958313,
0.4354470372200012,
0.11105994880199432,
0.05630919337272644,
0.03326761722564697,
0.7416218519210815,
0.23337239027023315,
-0.29852211475372314,
0.4451364576816559,
0.3021967113018036,
0.5432953238487244,
-0.09424816817045212,
-0.2741255462169647,
0.42353129386901855,
0.10756899416446686,
0.003680393099784851,
-0.03173363581299782,
0.2740628719329834,
-0.056764036417007446,
-0.05077451840043068,
-0.36472222208976746,
-0.4271191954612732,
-0.041044291108846664,
0.07825154066085815,
0.16313990950584412,
0.3510948121547699,
-0.2148425132036209,
-0.4857445955276489,
-0.3179208040237427,
-0.39934736490249634,
-0.07864458858966827,
0.32371798157691956,
0.2607402801513672,
0.0327720120549202,
-0.4467584192752838,
0.034557729959487915,
-0.5638954639434814,
0.19384169578552246,
-0.1333295851945877,
-0.1459091752767563,
-0.38908398151397705,
0.20148108899593353,
0.10516189783811569,
0.013430871069431305,
0.4747484028339386,
-0.31294330954551697,
-0.2595038115978241,
0.07087239623069763,
0.061640411615371704,
-0.17142686247825623,
0.16399754583835602,
0.09723386913537979,
0.1195015013217926,
-0.0743841901421547,
0.17745842039585114,
-0.1493220329284668,
0.18158414959907532,
0.28796902298927307,
-0.038567375391721725,
-0.0814303457736969,
-0.04615010693669319,
0.030938655138015747,
-0.30700045824050903,
-0.34195220470428467,
-0.08910319209098816,
0.10625860840082169,
0.08980600535869598,
0.24090836942195892,
0.12834258377552032,
-0.14358381927013397,
0.17080552875995636,
0.34847572445869446,
-0.2868996262550354,
-0.08435972034931183,
0.6029567122459412,
0.1578519344329834,
0.16423380374908447,
0.06889398396015167,
0.10655935853719711,
0.23807421326637268,
0.11557139456272125,
-0.15682315826416016,
0.04274590313434601,
0.1260174661874771,
0.11589406430721283,
0.29995134472846985,
0.29505643248558044,
-0.043119337409734726,
0.18980593979358673,
0.07777000963687897,
-0.43533647060394287,
0.36291661858558655,
0.02781759575009346,
-0.07630647718906403,
-0.2736664116382599,
-0.17527464032173157,
0.3190646469593048,
-0.1130388081073761,
0.015468567609786987,
0.14721223711967468,
0.4271894693374634,
0.07186080515384674,
0.144881933927536,
0.5181025862693787,
1.063413381576538,
-0.3466501832008362,
0.36475613713264465,
-0.4243868589401245,
-0.23654012382030487,
0.748550295829773,
0.06788690388202667,
-0.23199063539505005,
-0.034552425146102905,
-0.14093193411827087,
-0.051600176841020584,
-0.06414130330085754,
0.1240934357047081,
0.017579205334186554,
0.3566940426826477,
-0.08272720128297806,
0.2078922837972641,
0.0975661426782608,
-0.09597301483154297,
0.20219416916370392,
-0.0717020183801651,
-0.2746541202068329,
-0.039444319903850555,
0.25973016023635864,
0.05439674109220505,
0.05261959880590439,
-0.08684050291776657,
-0.3928145468235016,
-0.0356583297252655,
0.2292352318763733,
-0.48862382769584656,
-0.19762513041496277,
-0.14602431654930115,
-0.042316045612096786,
0.2064266800880432,
-0.42670881748199463,
0.37968742847442627,
0.4367850422859192,
0.41407257318496704,
0.06432320177555084,
-0.28479233384132385,
0.1733648180961609,
-0.35118189454078674,
-0.19421356916427612,
-0.2644731402397156,
-0.15225209295749664,
0.34247106313705444,
-0.055723197758197784,
-0.11909791827201843,
0.1647309809923172,
0.2760052978992462,
-0.2465253323316574,
-0.4912711977958679,
0.010286232456564903,
0.23360317945480347,
-0.11761032044887543,
0.021671954542398453,
0.005341567099094391,
0.005346179008483887,
0.037283144891262054,
0.15308547019958496,
0.27455002069473267,
0.38963526487350464,
0.04629599303007126,
0.3447589576244354,
0.06350062787532806,
-0.06444360315799713,
0.19692014157772064,
-0.030589507892727852,
-0.5072981119155884,
0.22806420922279358,
-0.19399335980415344,
-0.011475816369056702,
-0.026739858090877533,
0.2659238576889038,
0.17436596751213074,
-0.24014940857887268,
-0.0868336409330368,
-0.0013992786407470703,
0.25685006380081177,
-0.2146701216697693,
0.042086269706487656,
0.3566862940788269,
-0.09012080729007721,
0.21645265817642212,
-0.0050682127475738525,
-0.21112045645713806,
0.1682562381029129,
-0.0814686119556427,
0.18009337782859802,
-0.2299351841211319,
-0.10935686528682709,
0.178747296333313,
0.12904351949691772,
-0.3619360029697418,
0.22707036137580872,
-0.3239614963531494,
-0.13275420665740967,
0.3873489499092102,
0.1053800880908966,
0.0003188401460647583,
-0.16231100261211395,
0.07353521883487701,
0.11524130403995514,
-0.28332412242889404,
-0.18728139996528625,
-0.003023698925971985,
0.16054363548755646,
0.1974131464958191,
-0.34989452362060547,
-0.012007266283035278,
-0.23554229736328125,
-0.09073399007320404,
-0.031015222892165184,
-0.0645400658249855,
-0.1439901739358902,
-0.03997151181101799,
-0.41056951880455017,
0.04656951501965523,
0.1975214183330536,
-0.05908918380737305,
0.14466147124767303,
0.3166511058807373,
0.46652406454086304,
0.2566959857940674,
0.0434863418340683,
0.1439092755317688,
-0.11880042403936386,
0.07733194530010223,
0.23874646425247192,
0.3116101622581482,
-0.2907413840293884,
0.248976469039917,
-0.027539819478988647,
0.0039795562624931335,
0.009948041290044785,
0.32686859369277954,
-0.2915998697280884,
-0.5341703295707703,
0.39111247658729553,
0.18591618537902832,
0.2057579755783081,
0.009605757892131805,
0.09020166099071503,
0.002828892320394516,
0.12358251214027405,
-0.012831270694732666,
0.23367029428482056,
0.22038520872592926,
0.19798672199249268,
-0.042884066700935364,
-0.07553437352180481,
0.38457170128822327,
0.053078390657901764,
-0.237350732088089,
-0.11302841454744339,
-0.06335615366697311,
-0.07315146178007126,
0.36555221676826477,
0.540948212146759,
0.06135579198598862,
0.1432293951511383,
-0.07773596793413162,
0.33121535181999207,
-0.14602768421173096,
-0.2187260091304779,
0.2472619116306305,
-0.20446206629276276,
0.43354901671409607,
0.24304962158203125,
0.3029514253139496,
0.23128992319107056,
-0.08044302463531494,
0.16578389704227448,
0.0021866820752620697,
-0.20723499357700348,
0.05328184366226196,
0.1671115905046463,
0.09168049693107605,
-0.05319010466337204,
-0.402059942483902,
-0.26328951120376587,
-0.2370551973581314,
0.05738198757171631,
-0.03909369930624962,
-0.46144118905067444,
0.05979931354522705,
-0.09999057650566101,
-0.06182480603456497,
-0.056572191417217255,
-0.02964116260409355,
0.2900978624820709,
0.10711532086133957,
0.09233760833740234,
0.0897073820233345,
0.12557891011238098,
0.12344963103532791,
0.23700590431690216,
0.44877541065216064,
0.35181111097335815,
-0.19393755495548248,
0.12145965546369553,
0.47898897528648376,
-0.09885634481906891,
-0.1383710354566574,
0.1968253254890442,
-0.03352825716137886,
-0.011521749198436737,
-0.07985719293355942,
0.08946496248245239,
0.1579785943031311,
-0.10173404216766357,
-0.12005392462015152,
-0.18533086776733398,
0.014489606022834778,
-0.5263909697532654,
-0.38259267807006836,
-0.5582345128059387,
-0.20029670000076294,
-0.31065452098846436,
0.03234240412712097,
-0.3640519380569458,
0.13579891622066498,
0.19600191712379456,
-0.11373106390237808,
0.041132278740406036,
0.1323452889919281,
0.06076336279511452,
-0.22933954000473022,
0.18043315410614014,
0.4854457974433899,
0.32429569959640503,
-0.011451208963990211,
-0.6765055060386658,
-0.554100513458252,
0.008789028972387314,
-0.040620677173137665,
0.09055402874946594,
-0.26021626591682434,
0.24000585079193115,
0.35290825366973877,
0.05566157028079033,
0.17566150426864624,
-0.18567311763763428,
-0.13703706860542297,
0.21192201972007751,
0.06048627197742462,
-0.08484893292188644,
-0.09641967713832855,
0.20201162993907928,
-0.002460826188325882,
0.2521251440048218,
0.3630387485027313,
0.029739268124103546,
0.1265835016965866,
-0.152784526348114,
0.16116248071193695,
-0.15777277946472168,
-0.07021097838878632,
0.07854113727807999,
0.015540232881903648,
0.21263325214385986,
0.002029731869697571,
-0.2709871828556061,
-0.08832506835460663,
0.0247175395488739,
-0.08644388616085052,
0.23360878229141235,
0.1601114422082901,
0.4432734251022339,
-0.17447035014629364,
-0.28289514780044556,
0.025593265891075134,
0.31359875202178955,
0.015397772192955017,
-0.22080768644809723,
0.06644216924905777,
-0.24741187691688538,
-0.09921354055404663,
-0.21250540018081665,
0.25332576036453247,
0.029889466241002083,
-0.023141637444496155,
-0.022021044045686722,
-0.22216741740703583,
-0.35002052783966064,
0.21094712615013123,
-0.39863666892051697,
-0.18169337511062622,
-0.22341395914554596,
0.21320755779743195,
-0.009006980806589127,
0.25237953662872314,
-0.37439489364624023,
0.23059861361980438,
0.22685301303863525,
-0.20808257162570953,
0.05176302045583725,
0.1881302297115326,
0.0627119243144989,
0.06402555108070374,
-0.08081911504268646,
0.29363980889320374,
-0.3413301408290863,
0.08829642087221146,
0.14816154539585114,
-0.12448488175868988
] |
https://github.com/huggingface/datasets/issues/6274 | Please tell me if the above info is not enough for solving the problem. I will then make my dataset public temporarily so that you can really reproduce the bug. | FileNotFoundError for dataset with multiple builder config | ### Describe the bug
When there is only one config and only the dataset name is entered when using datasets.load_dataset(), it works fine. But if I create a second builder_config for my dataset and enter the config name when using datasets.load_dataset(), the following error will happen.
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow'
The "XXX.incomplete folder" in the cache folder of my dataset will disappear before "generating test split", which does not happen when config name is not entered and the config name is "default"
C:\Users\chenx\.cache\huggingface\datasets\my_dataset\0_shot_multiple_choice\1.0.0
The folder that is supposed to remain under the above directory will disappear, and the data generator will not have a place to generate data into.
### Steps to reproduce the bug
test = load_dataset('my_dataset', '0_shot_multiple_choice')
### Expected behavior
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow'
### Environment info
datasets 2.14.5
python 3.8.18 | 30 | FileNotFoundError for dataset with multiple builder config
### Describe the bug
When there is only one config and only the dataset name is entered when using datasets.load_dataset(), it works fine. But if I create a second builder_config for my dataset and enter the config name when using datasets.load_dataset(), the following error will happen.
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow'
The "XXX.incomplete folder" in the cache folder of my dataset will disappear before "generating test split", which does not happen when config name is not entered and the config name is "default"
C:\Users\chenx\.cache\huggingface\datasets\my_dataset\0_shot_multiple_choice\1.0.0
The folder that is supposed to remain under the above directory will disappear, and the data generator will not have a place to generate data into.
### Steps to reproduce the bug
test = load_dataset('my_dataset', '0_shot_multiple_choice')
### Expected behavior
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow'
### Environment info
datasets 2.14.5
python 3.8.18
Please tell me if the above info is not enough for solving the problem. I will then make my dataset public temporarily so that you can really reproduce the bug. | [
-0.4090709090232849,
0.14410144090652466,
0.056300513446331024,
0.7185941338539124,
0.18037883937358856,
0.22419948875904083,
0.27290409803390503,
0.13747864961624146,
-0.19434937834739685,
0.28827038407325745,
0.07692147046327591,
0.031066328287124634,
-0.15260234475135803,
-0.2077404260635376,
-0.13587260246276855,
-0.004572832025587559,
-0.04045748710632324,
0.07441061735153198,
0.10832615196704865,
0.10244227945804596,
-0.13630306720733643,
0.2989925146102905,
-0.12187890708446503,
0.05743086338043213,
-0.5633097887039185,
0.06796418875455856,
-0.23399484157562256,
0.5361876487731934,
0.14186429977416992,
-0.18267413973808289,
0.19140660762786865,
-0.020973024889826775,
-0.12823164463043213,
0.6086164712905884,
-0.00012423178122844547,
0.19131070375442505,
0.25928765535354614,
0.024565137922763824,
-0.5956797003746033,
-0.35737740993499756,
-0.2832236886024475,
-0.0983245000243187,
-0.06090712919831276,
-0.12017286568880081,
0.022972218692302704,
-0.19282987713813782,
0.22668248414993286,
-0.21812346577644348,
0.29867008328437805,
0.015667222440242767,
0.10972658544778824,
0.019237272441387177,
-0.012791529297828674,
-0.2133145034313202,
0.028668489307165146,
0.15292800962924957,
-0.09213589876890182,
-0.12858664989471436,
-0.21168380975723267,
-0.009098239243030548,
-0.12669852375984192,
0.394890159368515,
-0.1415490210056305,
0.13926301896572113,
0.1644696444272995,
0.25758957862854004,
-0.07486902177333832,
-0.39528051018714905,
0.13334007561206818,
0.3943616449832916,
0.6115192174911499,
-0.29475876688957214,
-0.4738587439060211,
-0.5070493817329407,
0.10969241708517075,
0.013215042650699615,
0.3257666528224945,
0.09203443676233292,
-0.22290900349617004,
0.025342725217342377,
-0.06028469279408455,
-0.4039342403411865,
-0.04499688744544983,
0.1465887576341629,
-0.1754378378391266,
0.13332761824131012,
-0.22379520535469055,
0.18241029977798462,
-0.11699512600898743,
-0.06914011389017105,
0.008194886147975922,
-0.6041001677513123,
-0.21246206760406494,
0.016912486404180527,
-0.17912748456001282,
0.10001961141824722,
0.1531151384115219,
0.23535192012786865,
0.11723840236663818,
0.20568415522575378,
-0.09125334024429321,
-0.12674933671951294,
-0.12595777213573456,
0.09871520847082138,
0.09606298804283142,
0.07466469705104828,
0.2881048917770386,
0.41647499799728394,
0.30184802412986755,
0.0076715461909770966,
-0.1759304404258728,
-0.22888264060020447,
-0.0432395339012146,
-0.456515908241272,
0.04835963994264603,
-0.08809823542833328,
0.4440576732158661,
-0.10921867936849594,
-0.40824490785598755,
0.005153153091669083,
-0.0774093046784401,
-0.11424071341753006,
0.3088705241680145,
0.47098231315612793,
-0.06322625279426575,
0.04201947897672653,
-0.034766100347042084,
0.28445565700531006,
-0.014706045389175415,
-0.26634788513183594,
-0.25888592004776,
-0.16965383291244507,
0.01915423572063446,
0.22096110880374908,
0.1315804421901703,
-0.2431442141532898,
0.42136985063552856,
0.24287903308868408,
0.19125202298164368,
-0.15796521306037903,
0.060705386102199554,
-0.17464075982570648,
0.007678035646677017,
0.3461712896823883,
0.06379280239343643,
0.17743423581123352,
0.10675498843193054,
-0.22064542770385742,
0.060721784830093384,
0.1486060917377472,
-0.2654775083065033,
-0.4012657403945923,
-0.29023054242134094,
0.02209526300430298,
-0.1967450976371765,
0.26073363423347473,
0.10702058672904968,
-0.029769038781523705,
0.4339182376861572,
-0.2370385229587555,
-0.07230310142040253,
0.012084636837244034,
-0.2045546919107437,
-0.3100140690803528,
0.18114790320396423,
0.8206714391708374,
-0.14469797909259796,
-0.11778341233730316,
-0.20956763625144958,
-0.15536907315254211,
-0.09363120794296265,
-0.004733171314001083,
-0.3194303512573242,
0.2425961196422577,
-0.5562406182289124,
0.04144588112831116,
0.6997939348220825,
-0.3194528818130493,
-0.1335660070180893,
0.4473785161972046,
-0.12191085517406464,
0.30568283796310425,
0.3591964840888977,
0.05590871348977089,
-0.48239243030548096,
-0.019554536789655685,
0.14860254526138306,
-0.045613668859004974,
-0.18265141546726227,
-0.06433996558189392,
-0.1357472836971283,
-0.08262547105550766,
0.11079917848110199,
0.06810905039310455,
0.129990816116333,
0.011459054425358772,
-0.041577257215976715,
-0.07886181771755219,
0.3507172167301178,
-0.14901471138000488,
0.1423056721687317,
0.3007647395133972,
-0.07552235573530197,
0.09160259366035461,
-0.014086782932281494,
-0.2232215404510498,
-0.8539990186691284,
0.39778587222099304,
0.022068776190280914,
-0.25979307293891907,
-0.19900459051132202,
0.031348682940006256,
0.13894890248775482,
-0.13681147992610931,
-0.5790526270866394,
-0.21202406287193298,
0.005421802401542664,
0.5731343030929565,
-0.06805504113435745,
-0.23247621953487396,
-0.3785913586616516,
0.6012855172157288,
-0.11017410457134247,
0.20206615328788757,
-0.3732696771621704,
0.3524186611175537,
0.07120423763990402,
-0.10679876059293747,
-0.34001612663269043,
0.08172356337308884,
0.09456150978803635,
-0.027722079306840897,
0.03866996616125107,
0.5293422341346741,
0.10825653374195099,
-0.022244777530431747,
0.08743295073509216,
-0.22679845988750458,
0.08740464597940445,
0.06566451489925385,
0.13963168859481812,
0.00795646384358406,
0.0333782397210598,
-0.0820867121219635,
-0.17759385704994202,
0.3132849335670471,
0.08633136004209518,
0.2584453821182251,
0.007559485733509064,
-0.1077687069773674,
-0.011188514530658722,
-0.11194588243961334,
-0.00821644812822342,
-0.4322088360786438,
0.21698682010173798,
0.025585509836673737,
0.4846424460411072,
-0.018167803063988686,
-0.3671145737171173,
-0.02131747454404831,
0.17056994140148163,
0.11807727813720703,
-0.175959050655365,
-0.23525308072566986,
-0.2779616713523865,
0.22207599878311157,
-0.1589098572731018,
0.5461755394935608,
0.6557275652885437,
0.15106281638145447,
0.028890056535601616,
0.0005844011902809143,
-0.24253523349761963,
-0.12119133770465851,
0.19627675414085388,
-0.01766357570886612,
0.34364041686058044,
0.6111544370651245,
0.00013634562492370605,
0.07923057675361633,
-0.33882972598075867,
-0.29586124420166016,
0.200089231133461,
-0.07786057144403458,
-0.341155081987381,
0.039300113916397095,
-0.22475820779800415,
-0.3336540758609772,
-0.28722649812698364,
-0.13786403834819794,
-0.4348815381526947,
-0.3195818364620209,
-0.09199182689189911,
0.12738962471485138,
-0.0923159122467041,
0.05463189631700516,
-0.21696488559246063,
-0.18661627173423767,
-0.12531064450740814,
-0.24519644677639008,
-0.06080765649676323,
0.1476975679397583,
-0.08734703063964844,
-0.1345723271369934,
0.39405736327171326,
-0.2610762417316437,
0.04934827983379364,
-0.1840122789144516,
-0.16541257500648499,
-0.4413600564002991,
-0.07188987731933594,
0.18215331435203552,
0.19062745571136475,
0.5967708230018616,
0.24147658050060272,
-0.015359755605459213,
0.3412078619003296,
-0.3636590242385864,
0.4387495517730713,
0.4046963155269623,
-0.1250762641429901,
0.12727788090705872,
0.14391712844371796,
-0.12939557433128357,
-0.14694708585739136,
-0.15101419389247894,
0.024451768025755882,
-0.15989314019680023,
-0.18462282419204712,
-0.038627028465270996,
0.11193941533565521,
0.47929173707962036,
0.0182000994682312,
0.13312478363513947,
-0.2842138111591339,
0.25567856431007385,
-0.1289711892604828,
-0.3328038454055786,
0.30105242133140564,
-0.2623555362224579,
0.029979102313518524,
0.1023218035697937,
-0.09148774296045303,
0.08665773272514343,
0.002350747585296631,
-0.43062084913253784,
0.06175467371940613,
-0.11812063306570053,
0.36192160844802856,
-0.1383896768093109,
0.07229110598564148,
0.21674150228500366,
0.22519196569919586,
-0.0011507533490657806,
-0.20975053310394287,
-0.10406536608934402,
0.13831111788749695,
-0.01760716177523136,
0.5067849159240723,
-0.22256070375442505,
0.16711768507957458,
-0.09193845093250275,
0.6141889691352844,
0.5178227424621582,
0.16304272413253784,
0.17791645228862762,
-0.09059000015258789,
0.5010258555412292,
-0.17702947556972504,
-0.3864145874977112,
0.14259882271289825,
0.2065507471561432,
-0.1300518810749054,
0.1835494041442871,
0.17941376566886902,
0.21810969710350037,
-0.24897047877311707,
-0.027958102524280548,
-0.2425365149974823,
-0.24163435399532318,
-0.07009828835725784,
-0.27386224269866943,
-0.03084704279899597,
0.11672403663396835,
-0.08910823613405228,
-0.13591116666793823,
0.11185485124588013,
-0.1345205008983612,
0.4802156984806061,
0.25975608825683594,
-0.1640588492155075,
0.0622858852148056,
-0.030902301892638206,
-0.04916912689805031,
0.22763992846012115,
0.15827451646327972,
-0.24277551472187042,
-0.006056077778339386,
-0.0032230019569396973,
-0.040925607085227966,
-0.005799751728773117,
0.7237770557403564,
-0.22830161452293396,
-0.04024823009967804,
0.18923434615135193,
0.015825971961021423,
-0.20635326206684113,
-0.14988622069358826,
0.15793320536613464,
0.5453106164932251,
0.042558614164590836,
0.46563947200775146,
-0.2578650116920471,
-0.3637561798095703,
0.25362879037857056,
0.3627920150756836,
-0.20286712050437927,
-0.32429033517837524,
-0.3339413106441498,
0.17837515473365784,
-0.07863251119852066,
-0.22557689249515533,
-0.225228950381279,
0.27715232968330383,
0.020822197198867798,
-0.0375354140996933,
-0.07721135765314102,
-0.1640905737876892,
-0.012332424521446228,
0.038477346301078796,
0.4352879524230957,
-0.20503993332386017,
0.23503024876117706,
0.26858603954315186,
0.1774817556142807,
0.3751014471054077,
0.5859091877937317,
-0.1099444031715393,
-0.3291195333003998,
0.15201780200004578,
-0.047260913997888565,
0.16652873158454895,
0.35882747173309326,
-0.1854581981897354,
-0.0025191158056259155,
0.10984338819980621,
0.28178930282592773,
0.0320221371948719,
-0.21388350427150726,
0.3790283799171448,
-0.10110534727573395,
-0.061137855052948,
-0.24641475081443787,
0.4018349051475525,
0.1010037213563919,
-0.05431922525167465,
0.6225240230560303,
0.07625727355480194,
-0.36287814378738403,
-0.08287473022937775,
-0.24965378642082214,
0.5245885848999023,
0.2703225612640381,
0.22488217055797577,
0.159059077501297,
-0.008057132363319397,
0.3738408386707306,
-0.12796325981616974,
0.2675877511501312,
-0.28747034072875977,
-0.21037408709526062,
0.06983119249343872,
-0.1698170006275177,
0.37694454193115234,
0.16640383005142212,
-0.1338132917881012,
0.3699374496936798,
-0.22597754001617432,
0.33515465259552,
-0.1830109804868698,
0.039642997086048126,
-0.38522595167160034,
-0.059257831424474716,
-0.13481608033180237,
-0.0394219234585762,
0.040197327733039856,
0.2698593735694885,
-0.1605713814496994,
-0.06550714373588562,
0.006373733282089233,
-0.09847832471132278,
-0.3796132504940033,
0.22575165331363678,
-0.5652268528938293,
0.12351742386817932,
0.24775537848472595,
-0.28870415687561035,
0.026416495442390442,
0.676696240901947,
0.3514833152294159,
-0.1537105143070221,
-0.1259748339653015,
0.2466454654932022,
-0.09912648051977158,
0.2296684980392456,
-0.36905038356781006,
-0.3129784166812897,
0.4052707254886627,
0.01985698938369751,
-0.23941588401794434,
-0.04875592142343521,
-0.38239702582359314,
-0.06067460775375366,
0.06622296571731567,
0.14607083797454834,
-0.059764206409454346,
-0.17939463257789612,
0.043457191437482834,
0.2079072743654251,
0.37884020805358887,
-0.2382652312517166,
0.03252686187624931,
0.12443611025810242,
-0.24869275093078613,
-0.13201476633548737,
-0.28169286251068115,
-0.21684932708740234,
0.05854927748441696,
0.09850476682186127,
-0.05723656713962555,
0.16504693031311035,
0.5378891229629517,
-0.1994812786579132,
-0.009047679603099823,
-0.17625409364700317,
0.2872539162635803,
0.20423972606658936,
-0.03129057586193085,
0.19590765237808228,
0.16513526439666748,
0.23820868134498596,
0.20806460082530975,
0.1092909425497055,
0.0749441459774971,
0.05191747099161148,
-0.045583996921777725,
-0.2203788161277771,
-0.10300865769386292,
0.05265771597623825,
-0.10799755901098251,
0.21264217793941498,
-0.26363128423690796,
0.03624605014920235,
0.3362075984477997,
0.09450466930866241,
-0.18970169126987457,
0.017341535538434982,
-0.16705405712127686,
0.1107659786939621,
-0.013271480798721313,
0.22866427898406982,
0.15074703097343445,
0.06467118859291077,
0.06928543746471405,
-0.2716720700263977,
-0.17981189489364624,
-0.021358855068683624,
-0.1698654592037201,
0.1777709722518921,
0.0772683322429657,
0.1070869192481041,
0.08013281226158142,
-0.1326117366552353,
0.09837804734706879,
-0.20234480500221252,
0.410576194524765,
0.17620784044265747,
0.005644751712679863,
0.1019977480173111,
0.11609483510255814,
0.09566396474838257,
-0.25963059067726135,
0.11611951142549515,
-0.15812742710113525,
0.2488495260477066,
0.19927337765693665,
0.2825915515422821,
-0.25230202078819275,
0.03442052751779556,
-0.009320024400949478,
-0.055453795939683914,
-0.3709378242492676,
-0.005675007589161396,
-0.024209093302488327,
-0.5086394548416138,
-0.08117400109767914,
0.05253332480788231,
0.41424697637557983,
0.4793892800807953,
-0.11375630646944046,
0.25203800201416016,
0.04511638730764389,
0.08814151585102081,
-0.15626594424247742,
-0.058229733258485794,
0.29719775915145874,
-0.051890965551137924,
0.06904801726341248,
0.23001575469970703,
-0.05903799086809158,
-0.12822996079921722,
0.2124449908733368,
0.10253066569566727,
0.16008014976978302,
-0.42063868045806885,
0.3774035573005676,
0.4034087061882019,
0.0749916359782219,
0.25395530462265015,
0.5859435200691223,
0.054063305258750916,
0.1587890237569809,
0.6821143627166748,
-0.2175295203924179,
0.19939211010932922,
-0.17682409286499023,
-0.034709855914115906,
0.10149082541465759,
-0.4296828508377075,
0.25720202922821045,
0.21619275212287903,
-0.15961094200611115,
-0.24095624685287476,
-0.2810010313987732,
0.22858422994613647,
-0.42828765511512756,
-0.03786982595920563,
-0.22760909795761108,
0.25874990224838257,
-0.23756714165210724,
-0.27335822582244873,
-0.20627734065055847,
-0.42483603954315186,
0.13408030569553375,
0.04586560279130936,
0.04528190195560455,
-0.14818060398101807,
0.23919494450092316,
0.0670115277171135,
-0.11644023656845093,
-0.2837594449520111,
0.2532959282398224,
0.34190577268600464,
-0.02825877070426941,
-0.5125472545623779,
0.33778807520866394,
0.38803404569625854,
-0.18147236108779907,
0.013603435829281807,
0.32944774627685547,
0.4987903833389282,
0.22505342960357666,
-0.03973696008324623,
-0.20839780569076538,
0.13544699549674988,
-0.04942360520362854,
-0.08145338296890259,
-0.014130539260804653,
-0.14632496237754822,
-0.16396817564964294,
0.38039863109588623,
0.07227591425180435,
-0.030035242438316345,
0.16401895880699158,
0.24425193667411804,
0.38160139322280884,
-0.4309529662132263,
0.10804629325866699,
-0.35639870166778564,
0.008559495210647583,
0.05770916864275932,
0.04829929396510124,
-0.39917445182800293,
-0.0677887499332428,
0.39469394087791443,
-0.04849084094166756,
0.14416195452213287,
0.14686790108680725,
0.02399655431509018,
0.14342646300792694,
0.1398637592792511,
0.31311991810798645,
-0.10438679158687592,
-0.40706121921539307,
-0.23429083824157715,
-0.6016024351119995,
0.06773792207241058,
-0.10525321960449219,
0.13251012563705444,
-0.1685550957918167,
0.38605743646621704,
-0.22291572391986847,
-0.1706933230161667,
0.2841843068599701,
-0.15721693634986877,
0.47180086374282837,
0.31606411933898926,
-0.43432337045669556,
-0.23642508685588837,
0.05247442051768303,
-0.01031523197889328,
0.10309697687625885,
-0.4062216281890869,
-0.13324090838432312,
-0.06337912380695343,
-0.08757998049259186,
0.17885607481002808,
0.07821889221668243,
0.2921315133571625,
-0.14280371367931366,
0.31926465034484863,
0.046358734369277954,
0.24045072495937347,
0.005760893225669861,
-0.22662490606307983,
-0.2756098508834839,
-0.1249389573931694,
-0.2243896722793579,
-0.005692480131983757,
0.2385576367378235,
0.48955070972442627,
-0.5001329183578491,
0.12454384565353394,
-0.2989121079444885,
-0.0630074217915535,
0.1400957703590393,
0.21640464663505554,
-0.031543828547000885,
0.1776883900165558,
-0.07956487685441971,
0.16601695120334625,
0.17743760347366333,
0.10738196223974228,
-0.15285071730613708,
0.18841683864593506,
-0.3010331392288208,
-0.14618432521820068,
0.5337024331092834,
-0.11067210137844086,
-0.27623608708381653,
-0.20775343477725983,
0.2925381660461426,
0.07810990512371063,
-0.05540309473872185,
-0.3645209074020386,
0.07769772410392761,
0.46547138690948486,
-0.02340184524655342,
-0.3250701427459717,
0.00625721737742424,
0.14183209836483002,
-0.12993472814559937,
0.14840467274188995,
0.21413274109363556,
0.11948232352733612,
-0.3339804708957672,
0.026993386447429657,
-0.10698219388723373
] |
https://github.com/huggingface/datasets/issues/6273 | @lhoestq @albertvillanova @lewtun I don't think we are allowed to host these data files on the Hub (due to DMCA), which means the only option is to use a different dataset in the course (and to re-record the video π), no? | Broken Link to PubMed Abstracts dataset . | ### Describe the bug
The link provided for the dataset is broken,
data_files =
[https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url)
The
### Steps to reproduce the bug
Steps to reproduce:
1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url)
2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link.
### Expected behavior
The link should Redirect to the "PubMed Abstracts dataset" as expected .
### Environment info
. | 41 | Broken Link to PubMed Abstracts dataset .
### Describe the bug
The link provided for the dataset is broken,
data_files =
[https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url)
The
### Steps to reproduce the bug
Steps to reproduce:
1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url)
2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link.
### Expected behavior
The link should Redirect to the "PubMed Abstracts dataset" as expected .
### Environment info
.
@lhoestq @albertvillanova @lewtun I don't think we are allowed to host these data files on the Hub (due to DMCA), which means the only option is to use a different dataset in the course (and to re-record the video π), no? | [
-0.13592590391635895,
0.2072862982749939,
0.02040146291255951,
0.06155046820640564,
-0.1800803542137146,
0.10274598002433777,
0.35781750082969666,
0.40044793486595154,
-0.03925119712948799,
-0.14947360754013062,
0.15373943746089935,
0.28599804639816284,
0.00019788742065429688,
0.12664249539375305,
0.3263750672340393,
-0.08028876036405563,
0.12096181511878967,
0.029976774007081985,
0.03511086478829384,
-0.0901719406247139,
0.14520974457263947,
0.09525489807128906,
-0.24582940340042114,
-0.06162099912762642,
0.058740392327308655,
-0.024248339235782623,
-0.18933740258216858,
0.21890808641910553,
0.0682096928358078,
-0.3402508497238159,
0.03414413332939148,
0.03330923244357109,
0.23039069771766663,
0.3473976254463196,
-0.00011050797183997929,
-0.20009496808052063,
0.3882172107696533,
0.03229675441980362,
-0.22542211413383484,
-0.13341577351093292,
-0.40641430020332336,
-0.16431188583374023,
-0.19010323286056519,
-0.18688714504241943,
0.0024054422974586487,
-0.37666812539100647,
0.11498455703258514,
0.14780491590499878,
0.2533542811870575,
0.40266671776771545,
0.16520024836063385,
0.0721549242734909,
0.20855997502803802,
-0.06070224568247795,
0.0867619663476944,
0.20559906959533691,
-0.012245558202266693,
0.4646456837654114,
0.1929931491613388,
0.24221785366535187,
-0.23463758826255798,
0.3249319791793823,
0.11043072491884232,
-0.08631259202957153,
0.14649316668510437,
-0.023267753422260284,
-0.29070934653282166,
-0.15260078012943268,
0.11420328170061111,
0.23516972362995148,
0.29012614488601685,
-0.17011024057865143,
-0.015035595744848251,
-0.19807268679141998,
-0.0033770576119422913,
0.20631369948387146,
0.10477295517921448,
0.30105671286582947,
0.1057078093290329,
0.28314208984375,
0.2604535222053528,
-0.4114144444465637,
-0.3301534652709961,
0.35414430499076843,
0.3440586030483246,
-0.12527300417423248,
-0.04071063920855522,
0.07289983332157135,
0.007400382775813341,
0.0022436529397964478,
0.30935320258140564,
0.15880084037780762,
-0.17206557095050812,
0.009872432798147202,
0.02441720850765705,
-0.4254005253314972,
0.034541673958301544,
0.05778995901346207,
0.23383301496505737,
-0.02667517587542534,
-0.13837793469429016,
0.01436159573495388,
0.0015282109379768372,
-0.04881429299712181,
0.45909416675567627,
-0.3338843584060669,
-0.2758558690547943,
0.11283288896083832,
0.40347325801849365,
0.4203777313232422,
0.13330921530723572,
0.15135368704795837,
0.03737747669219971,
0.02320147678256035,
-0.2725335955619812,
-0.10603033006191254,
0.016513332724571228,
-0.28797560930252075,
-0.24702370166778564,
0.29048407077789307,
-0.23713402450084686,
0.12062082439661026,
-0.2735997140407562,
0.2910575270652771,
-0.02415367402136326,
0.1209697276353836,
0.07324612140655518,
0.08929876238107681,
-0.06365632265806198,
-0.27445951104164124,
-0.0849226862192154,
0.15967455506324768,
-0.07761401683092117,
0.15867851674556732,
0.3439742922782898,
-0.04509233683347702,
0.28819453716278076,
0.040380991995334625,
0.10086926817893982,
-0.3501661419868469,
0.15649348497390747,
0.02907073125243187,
0.23475651443004608,
0.22333765029907227,
0.3261905312538147,
0.191927969455719,
-0.04061318561434746,
0.009178213775157928,
-0.08589217811822891,
0.11873085796833038,
-0.5151599645614624,
-0.12461351603269577,
-0.3340936005115509,
0.11101815849542618,
-0.4114362597465515,
-0.05083369091153145,
-0.38510286808013916,
0.10559219866991043,
-0.3596034049987793,
-0.2538547217845917,
-0.023777738213539124,
-0.014058629050850868,
0.17146699130535126,
-0.1343408226966858,
0.1537024825811386,
0.1425262689590454,
-0.029893089085817337,
-0.0724632740020752,
-0.17475415766239166,
0.34508025646209717,
-0.2255566269159317,
0.11316186189651489,
-0.2513984143733978,
0.2642148435115814,
-0.34410250186920166,
0.30170169472694397,
0.42344242334365845,
-0.3623187839984894,
-0.6826608777046204,
0.10671856999397278,
-0.16963467001914978,
-0.22029376029968262,
-0.12183897942304611,
0.06054510176181793,
0.3870552182197571,
-0.3305099904537201,
0.18277975916862488,
0.39542052149772644,
0.21434225142002106,
0.011163339018821716,
-0.4019466042518616,
-0.26691657304763794,
-0.2533454895019531,
0.22731928527355194,
0.0769953578710556,
-0.055426400154829025,
0.34723663330078125,
0.5795882940292358,
0.27044692635536194,
-0.012068208307027817,
0.056546010076999664,
0.35478195548057556,
0.24085119366645813,
-0.3174089193344116,
0.2721019387245178,
-0.14570491015911102,
-0.2696022093296051,
-0.14572545886039734,
-0.0010713711380958557,
0.2689368724822998,
-0.11858915537595749,
-0.17140328884124756,
-0.23491227626800537,
-0.31710749864578247,
-0.001980457454919815,
-0.23588642477989197,
0.13541850447654724,
-0.11699268221855164,
-0.19971820712089539,
0.09921067208051682,
-0.14393003284931183,
0.019762353971600533,
-0.24052006006240845,
-0.027535628527402878,
-0.47634565830230713,
0.5213222503662109,
-0.157915398478508,
-0.03498413413763046,
0.2027186006307602,
0.17137670516967773,
0.05857463553547859,
-0.12016396224498749,
0.012832175940275192,
0.27787771821022034,
-0.21220459043979645,
0.2902379631996155,
0.39648258686065674,
0.09279771149158478,
0.5120166540145874,
-0.9748710989952087,
0.1656956821680069,
0.3641365170478821,
0.013786625117063522,
0.05674871802330017,
-0.23773328959941864,
0.21292096376419067,
-0.12566086649894714,
0.08844158053398132,
0.13660544157028198,
0.19745682179927826,
0.14049668610095978,
-0.20099273324012756,
-0.3455826938152313,
-0.05649571865797043,
0.32592710852622986,
0.23268862068653107,
-0.2740210294723511,
0.08563417941331863,
-0.28678756952285767,
0.2861340343952179,
0.5097318291664124,
-0.18799519538879395,
0.1197282075881958,
0.2618677616119385,
-0.5008021593093872,
-0.25927406549453735,
0.1454724669456482,
0.3406028151512146,
0.3465929627418518,
0.14206525683403015,
-0.0389891192317009,
0.1576334834098816,
-0.16440927982330322,
-0.1966603696346283,
0.054988499730825424,
0.20802092552185059,
0.07464079558849335,
0.07474875450134277,
0.2912014424800873,
0.14928972721099854,
-0.1594553142786026,
-0.21523341536521912,
0.08305592834949493,
0.07269863784313202,
-0.4843814969062805,
0.04395217448472977,
-0.16930937767028809,
-0.09202470630407333,
-0.44896405935287476,
0.02957640215754509,
-0.0008573625236749649,
-0.18967857956886292,
-0.002284103073179722,
0.14580513536930084,
-0.15107473731040955,
0.12361126393079758,
-0.029217921197414398,
0.37538760900497437,
-0.18260395526885986,
0.2621018886566162,
-0.08746074140071869,
-0.07396877557039261,
-0.34237056970596313,
0.05974697321653366,
0.08819013833999634,
0.36740443110466003,
-0.0026307515799999237,
-0.018394790589809418,
-0.1128263771533966,
-0.5904468297958374,
-0.4169425964355469,
0.22704264521598816,
-0.16429823637008667,
0.3083006739616394,
0.01908877305686474,
0.49875983595848083,
-0.05180872976779938,
-0.11196105927228928,
0.16772596538066864,
-0.17519192397594452,
0.2964414358139038,
-0.18019525706768036,
-0.13119420409202576,
0.06449364125728607,
-0.005959361791610718,
-0.49141648411750793,
-0.19327180087566376,
-0.28774523735046387,
-0.0018413364887237549,
-0.023758307099342346,
0.0442737452685833,
-0.07440876960754395,
0.1551605761051178,
-0.03719763457775116,
0.03510848805308342,
-0.11142390221357346,
-0.23543065786361694,
-0.2548702657222748,
0.2459924817085266,
-0.31276506185531616,
-0.7323322892189026,
-0.04275260120630264,
0.12446875870227814,
0.08398659527301788,
-0.09015928208827972,
-0.5834625959396362,
-0.1408129185438156,
0.09383830428123474,
-0.2915620803833008,
-0.0659908577799797,
-0.10377947241067886,
-0.023041296750307083,
-0.19777286052703857,
-0.10775946080684662,
-0.08070563524961472,
0.017041973769664764,
0.13350945711135864,
0.24284464120864868,
0.5605983734130859,
-0.008224045857787132,
0.2763741910457611,
0.33566713333129883,
0.677087128162384,
0.26177215576171875,
-0.19407536089420319,
0.08491602540016174,
0.050839073956012726,
0.35162869095802307,
0.13521640002727509,
-0.0631711557507515,
0.2941778004169464,
-0.17762814462184906,
-0.050129830837249756,
0.23013180494308472,
0.13145990669727325,
-0.017179502174258232,
-0.1292959451675415,
-0.2971739172935486,
-0.289899080991745,
-0.3832574486732483,
0.0965004414319992,
-0.23034995794296265,
-0.050124555826187134,
0.2791738510131836,
-0.013750411570072174,
0.011655345559120178,
-0.253621369600296,
0.39460206031799316,
0.29396405816078186,
0.13399150967597961,
0.07674694061279297,
-0.1797158122062683,
-0.16828539967536926,
-0.3454548716545105,
-0.04182029515504837,
-0.18658974766731262,
0.3372059762477875,
-0.16125717759132385,
-0.01028144359588623,
0.09192182123661041,
0.024182062596082687,
0.43698394298553467,
-0.17652051150798798,
0.31082725524902344,
-0.07555030286312103,
0.5857790112495422,
-0.3947618901729584,
0.09310200065374374,
-0.27292725443840027,
-0.029985444620251656,
0.4438215494155884,
0.2537093758583069,
-0.08844238519668579,
0.06776560097932816,
0.47965916991233826,
-0.1622334122657776,
-0.05401192605495453,
-0.03207944333553314,
0.02850314974784851,
-0.4298352897167206,
-0.4567788243293762,
-0.14456775784492493,
0.44266271591186523,
-0.16436265408992767,
-0.18910838663578033,
-0.2575603127479553,
0.055885083973407745,
-0.1989670991897583,
-0.09536894410848618,
-0.029142603278160095,
0.244991272687912,
0.08311282843351364,
0.07625646889209747,
0.24391286075115204,
0.3355289697647095,
0.26619765162467957,
0.27697843313217163,
0.07500503212213516,
-0.2999606132507324,
0.3331003487110138,
-0.26784443855285645,
0.1941102147102356,
0.3503018021583557,
0.06581079959869385,
-0.06433605402708054,
0.2650958001613617,
-0.008539509028196335,
-0.2707592248916626,
0.28299984335899353,
0.29609429836273193,
0.003383427858352661,
-0.6062105894088745,
-0.2525773048400879,
0.7597081661224365,
-0.02353183552622795,
-0.0641346201300621,
0.33468276262283325,
0.36256060004234314,
-0.2777092456817627,
0.6511173248291016,
0.15315426886081696,
0.9730663299560547,
0.1921602189540863,
0.3077405095100403,
0.06787935644388199,
0.0030961185693740845,
0.6352680921554565,
-0.12713980674743652,
0.03711830452084541,
-0.09937623143196106,
-0.3317314088344574,
-0.12632513046264648,
-0.1587795466184616,
-0.051595259457826614,
0.058978449553251266,
-0.26305538415908813,
0.2583855092525482,
0.22696074843406677,
0.2079748511314392,
0.16760696470737457,
0.5045690536499023,
0.18717217445373535,
-0.09136833995580673,
-0.3472396731376648,
0.15220770239830017,
-0.05659012123942375,
0.25612345337867737,
-0.10446079820394516,
-0.2807728052139282,
-0.28983381390571594,
-0.004793398082256317,
-0.5128450393676758,
0.2830457091331482,
0.3907277584075928,
0.08637021481990814,
-0.05222390592098236,
-0.38393330574035645,
0.18680892884731293,
-0.0808153748512268,
0.1312137246131897,
0.2421671450138092,
-0.4349827468395233,
0.4450320303440094,
-0.2707766592502594,
-0.20042207837104797,
0.4163588583469391,
-0.044345151633024216,
0.43825817108154297,
-0.20792248845100403,
-0.21754617989063263,
0.21377357840538025,
0.10282579064369202,
-0.3759336769580841,
0.0059347003698349,
-0.14294204115867615,
-0.014706812798976898,
-0.037618156522512436,
-0.19500544667243958,
0.12992259860038757,
-0.1377256214618683,
-0.2007293403148651,
0.1452900767326355,
0.13937166333198547,
0.06013954058289528,
-0.1844305545091629,
0.3203031122684479,
-0.2202429473400116,
-0.07282949984073639,
0.47010138630867004,
-0.00424918532371521,
-0.2129819542169571,
0.2579442858695984,
0.30356431007385254,
-0.0003491640090942383,
-0.1776309311389923,
-0.011338263750076294,
0.09510429203510284,
-0.446355402469635,
-0.02101711556315422,
-0.3727152645587921,
0.12150903046131134,
-0.15573422610759735,
0.06738950312137604,
0.05461256578564644,
0.03608519583940506,
-0.33794254064559937,
-0.546343207359314,
-0.09864798188209534,
0.22910058498382568,
-0.3324351906776428,
-0.043625228106975555,
0.20742830634117126,
-0.0688997209072113,
0.07154220342636108,
-0.2927955985069275,
-0.31685250997543335,
0.24155405163764954,
-0.15119561553001404,
0.03763674199581146,
-0.003657873719930649,
0.1208249032497406,
0.17710749804973602,
-0.09908241033554077,
0.004559710621833801,
0.09515630453824997,
0.11665929853916168,
-0.1274510622024536,
-0.11757764220237732,
0.1235215812921524,
0.26157331466674805,
0.14958582818508148,
-0.43616920709609985,
-0.3137367069721222,
-0.1557948887348175,
0.16330879926681519,
-0.028970591723918915,
-0.2105002999305725,
0.11639648675918579,
-0.050424281507730484,
0.048696476966142654,
-0.26082631945610046,
0.05652131140232086,
0.0718441754579544,
0.1897592842578888,
0.24727961421012878,
0.0427011102437973,
0.20475098490715027,
-0.016735762357711792,
0.04922373592853546,
-0.37410134077072144,
0.2512246370315552,
0.17778155207633972,
0.18859311938285828,
0.3363320231437683,
-0.19666838645935059,
0.0669134110212326,
-0.0035597383975982666,
0.19564314186573029,
0.182475745677948,
-0.4596771001815796,
-0.13487151265144348,
0.148097425699234,
0.132360577583313,
-0.18681520223617554,
0.0838412493467331,
-0.11109549552202225,
0.11340087652206421,
-0.18672484159469604,
-0.20031362771987915,
0.29039543867111206,
-0.08568847179412842,
-0.2916841506958008,
0.24956810474395752,
0.6238601207733154,
-0.18696507811546326,
0.16910211741924286,
0.19559752941131592,
-0.007893815636634827,
0.19343441724777222,
0.06041949987411499,
0.047102224081754684,
0.3013852834701538,
0.2967360317707062,
0.09092729538679123,
0.2616785168647766,
0.42781561613082886,
0.1526888608932495,
0.0779678076505661,
0.11062884330749512,
-0.2144816666841507,
0.4357433617115021,
0.24548445641994476,
0.06213083118200302,
0.20423582196235657,
0.17029619216918945,
0.06736786663532257,
-0.2937510013580322,
-0.11958232522010803,
0.05002875626087189,
0.1432776153087616,
0.084090456366539,
-0.04668596014380455,
-0.0043004825711250305,
-0.11039197444915771,
0.04462452232837677,
-0.20829862356185913,
-0.14802229404449463,
-0.08478733897209167,
0.12044158577919006,
-0.16953548789024353,
-0.419607549905777,
-0.10917088389396667,
0.22494259476661682,
0.14807920157909393,
-0.06716381758451462,
0.1264706403017044,
-0.35600724816322327,
-0.1516755372285843,
0.21923109889030457,
0.27266639471054077,
0.2592734396457672,
-0.071083664894104,
-0.06780712306499481,
0.020427249372005463,
0.12049827724695206,
-0.015578102320432663,
0.10752546787261963,
0.08912242949008942,
0.28619930148124695,
-0.07258503884077072,
0.24538299441337585,
0.18902185559272766,
-0.21611100435256958,
0.020797790959477425,
0.09918784350156784,
0.32431888580322266,
-0.07633228600025177,
0.38219428062438965,
-0.2988107204437256,
-0.1389383226633072,
-0.20679616928100586,
-0.26340967416763306,
-0.4674779772758484,
-0.2687034010887146,
0.5238127708435059,
-0.301913857460022,
0.1426486372947693,
-0.17902101576328278,
0.07931786775588989,
-0.07943226397037506,
0.5203474760055542,
0.46634888648986816,
0.06369732320308685,
-0.07108235359191895,
-0.3530716896057129,
-0.5278023481369019,
0.3431251645088196,
0.024716949090361595,
0.1325240135192871,
0.09902967512607574,
-0.005935162305831909,
-0.1030011773109436,
0.11686045676469803,
0.00826844573020935,
0.316106379032135,
-0.1966724544763565,
-0.019132409244775772,
-0.21630379557609558,
-0.11714529991149902,
-0.22133558988571167,
0.4316665828227997,
-0.20717653632164001,
0.2239227443933487,
0.14931869506835938,
0.06276360154151917,
-0.04763198643922806,
0.012170825153589249,
-0.23922191560268402,
-0.05766630172729492,
-0.2817212641239166,
0.4078602194786072,
-0.03630994260311127,
0.11485946178436279,
-0.053002163767814636,
-0.2548523545265198,
-0.582007884979248,
-0.31841301918029785,
-0.1679682731628418,
0.21044740080833435,
-0.010321793146431446,
0.07013573497533798,
-0.0028339512646198273,
0.43162935972213745,
-0.12953682243824005,
-0.22979699075222015,
-0.08987995237112045,
0.075247623026371,
-0.622642993927002,
0.062450163066387177,
-0.13428957760334015,
0.08023553341627121,
0.15113863348960876,
0.17492598295211792,
-0.1814500093460083,
-0.03351543843746185,
-0.23533064126968384,
-0.1696052849292755,
0.40581774711608887,
-0.5389190912246704,
-0.06985559314489365,
0.10492056608200073,
0.44898882508277893,
-0.35777953267097473,
0.0455150231719017,
-0.6594854593276978,
-0.13157758116722107,
0.15545566380023956,
0.11242426186800003,
-0.31680911779403687,
-0.11258454620838165,
0.07781217247247696,
0.1671859323978424,
0.036084599792957306,
0.269089937210083,
0.19294510781764984,
-0.3327021300792694,
0.12617775797843933,
-0.08375460654497147
] |
https://github.com/huggingface/datasets/issues/6273 | Keeping the video is maybe fine, we can add a note on youtube to suggest to load a dataset with a different name. Maybe C4 ? And update the code snippets on the website ? | Broken Link to PubMed Abstracts dataset . | ### Describe the bug
The link provided for the dataset is broken,
data_files =
[https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url)
The
### Steps to reproduce the bug
Steps to reproduce:
1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url)
2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link.
### Expected behavior
The link should Redirect to the "PubMed Abstracts dataset" as expected .
### Environment info
. | 35 | Broken Link to PubMed Abstracts dataset .
### Describe the bug
The link provided for the dataset is broken,
data_files =
[https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url)
The
### Steps to reproduce the bug
Steps to reproduce:
1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url)
2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link.
### Expected behavior
The link should Redirect to the "PubMed Abstracts dataset" as expected .
### Environment info
.
Keeping the video is maybe fine, we can add a note on youtube to suggest to load a dataset with a different name. Maybe C4 ? And update the code snippets on the website ? | [
-0.04150284081697464,
0.3160797953605652,
-0.021375423297286034,
-0.03278052806854248,
-0.0857972502708435,
0.026594944298267365,
0.33419814705848694,
0.4359488785266876,
-0.18444597721099854,
-0.18531033396720886,
0.19457286596298218,
0.27567416429519653,
0.03499675542116165,
0.16506117582321167,
0.33702564239501953,
-0.18528541922569275,
0.12784433364868164,
0.06829240173101425,
0.10146812349557877,
-0.023691125214099884,
0.03150416910648346,
0.05352579057216644,
-0.19784623384475708,
-0.05087512359023094,
0.28725242614746094,
0.010587869212031364,
-0.16057898104190826,
0.20371860265731812,
0.0943426564335823,
-0.3974621593952179,
-0.11698156595230103,
-0.033282458782196045,
0.13633202016353607,
0.37680381536483765,
-0.00010527924314374104,
-0.26398801803588867,
0.47118568420410156,
0.08315800875425339,
-0.19961993396282196,
-0.21078568696975708,
-0.4134218394756317,
-0.24567142128944397,
-0.1456589251756668,
-0.17526507377624512,
0.13778367638587952,
-0.46750444173812866,
0.11060518026351929,
-0.010358765721321106,
0.20938625931739807,
0.3379818797111511,
0.22560515999794006,
0.10128829628229141,
0.26871585845947266,
0.000662386417388916,
0.10882706940174103,
0.08928333967924118,
-0.05076596140861511,
0.37082812190055847,
0.18010756373405457,
0.19499415159225464,
-0.18582463264465332,
0.37590667605400085,
0.11108648777008057,
-0.0392843559384346,
0.11534877121448517,
-0.025633975863456726,
-0.29420652985572815,
-0.20755499601364136,
0.1446341872215271,
0.2654435932636261,
0.3255542516708374,
-0.223916694521904,
-0.030562657862901688,
-0.12002374231815338,
-0.002916008234024048,
0.0852750614285469,
0.11228854954242706,
0.25406473875045776,
0.15937410295009613,
0.15234607458114624,
0.2742913067340851,
-0.3750027120113373,
-0.28007128834724426,
0.2890821695327759,
0.2855169177055359,
-0.1819850504398346,
-0.01832006871700287,
0.06050378084182739,
0.14210331439971924,
-0.16610783338546753,
0.2735782265663147,
0.1744905412197113,
-0.1771514117717743,
0.002729702740907669,
-0.007260732352733612,
-0.2803434133529663,
0.039825137704610825,
-0.03538260981440544,
0.2842738628387451,
-0.016623569652438164,
-0.16812752187252045,
0.09951053559780121,
0.08834899216890335,
-0.058313243091106415,
0.4777267277240753,
-0.39762645959854126,
-0.34544289112091064,
0.10827308893203735,
0.3581625521183014,
0.3088712990283966,
0.13000428676605225,
0.18243646621704102,
0.05427277460694313,
-0.0690743550658226,
-0.09930767118930817,
-0.22741937637329102,
0.011224552989006042,
-0.22466738522052765,
-0.23420077562332153,
0.2899499535560608,
-0.24306482076644897,
0.01566249504685402,
-0.3116205632686615,
0.31753331422805786,
-0.05511924624443054,
0.07370507717132568,
0.07352322340011597,
0.050339847803115845,
0.04013100266456604,
-0.2878718376159668,
-0.08660644292831421,
0.07999841123819351,
-0.17874571681022644,
0.13424623012542725,
0.3038432002067566,
-0.13928361237049103,
0.2612513303756714,
0.01772201433777809,
0.07318136096000671,
-0.3199390769004822,
0.11218667030334473,
0.021790534257888794,
0.10464458167552948,
0.21991530060768127,
0.3219964802265167,
0.1960545778274536,
-0.027459701523184776,
-0.05429839342832565,
-0.09636320173740387,
0.1258208304643631,
-0.4484483003616333,
-0.06039983779191971,
-0.42952215671539307,
0.19145634770393372,
-0.3538288176059723,
-0.07327000796794891,
-0.3679916560649872,
0.1411558985710144,
-0.2652057111263275,
-0.23403772711753845,
-0.07424958050251007,
-0.025836901739239693,
0.11505651473999023,
-0.23152539134025574,
0.2670517861843109,
0.16666272282600403,
-0.1233929991722107,
-0.05235794931650162,
-0.3103768527507782,
0.3209459185600281,
-0.0953839048743248,
0.14330242574214935,
-0.24094423651695251,
0.15619094669818878,
-0.3486713469028473,
0.26542964577674866,
0.4388796389102936,
-0.14902086555957794,
-0.5803890228271484,
0.2314491868019104,
-0.20050525665283203,
-0.2067641168832779,
-0.13454684615135193,
0.06100161001086235,
0.31974029541015625,
-0.2578677237033844,
0.16435939073562622,
0.35196760296821594,
0.1382439136505127,
0.054277002811431885,
-0.4281592071056366,
-0.26248493790626526,
-0.18321087956428528,
0.168655127286911,
0.1624830812215805,
-0.024419739842414856,
0.3490537703037262,
0.424211710691452,
0.2439088225364685,
0.09875811636447906,
0.00442156195640564,
0.2923741340637207,
0.3706064522266388,
-0.28455883264541626,
0.32845500111579895,
-0.1197701022028923,
-0.26712822914123535,
-0.10397835075855255,
0.015245795249938965,
0.20585256814956665,
-0.1401749551296234,
-0.08566812425851822,
-0.3394761383533478,
-0.1727633774280548,
0.02730286493897438,
-0.1694323718547821,
0.16545885801315308,
0.007416313514113426,
-0.31394416093826294,
0.11332840472459793,
-0.21513709425926208,
-0.08499784022569656,
-0.22036077082157135,
-0.007764250040054321,
-0.3845275044441223,
0.5268970131874084,
-0.21104200184345245,
-0.033415041863918304,
0.21887707710266113,
0.037462130188941956,
0.01372408214956522,
-0.11671515554189682,
-0.01258845441043377,
0.38848844170570374,
-0.23541371524333954,
0.2577492594718933,
0.31371936202049255,
0.09933947026729584,
0.43635252118110657,
-1.0027997493743896,
0.15097841620445251,
0.49595317244529724,
0.06110681593418121,
0.014433197677135468,
-0.19031040370464325,
0.13153564929962158,
-0.08960969746112823,
0.06352748721837997,
0.13988015055656433,
0.14437904953956604,
0.19479595124721527,
-0.18442364037036896,
-0.29453244805336,
-0.06874102354049683,
0.3010529577732086,
0.08913198113441467,
-0.14396418631076813,
0.06030739098787308,
-0.38718706369400024,
0.2965441346168518,
0.4877205789089203,
-0.1312883496284485,
0.06194278597831726,
0.2662692070007324,
-0.45373788475990295,
-0.24314986169338226,
0.07285621762275696,
0.44856923818588257,
0.2767307460308075,
0.19425109028816223,
-0.10666534304618835,
0.08891559392213821,
-0.03580481559038162,
-0.13997600972652435,
0.09343860298395157,
0.28046730160713196,
0.11095790565013885,
0.019756240770220757,
0.2724922001361847,
0.20621700584888458,
-0.08277841657400131,
-0.2520068287849426,
0.06703325361013412,
0.11788299679756165,
-0.4737846255302429,
0.026320666074752808,
-0.16654618084430695,
-0.11875379085540771,
-0.5324766039848328,
0.08569732308387756,
-0.008296549320220947,
-0.15802353620529175,
-0.09318269789218903,
0.08730347454547882,
-0.12836411595344543,
0.19328299164772034,
-0.18265648186206818,
0.25842902064323425,
-0.0935545340180397,
0.23329076170921326,
-0.12049639225006104,
0.039895862340927124,
-0.20077571272850037,
0.1391223967075348,
0.15275055170059204,
0.31087321043014526,
0.06030752509832382,
0.04835803061723709,
-0.10731111466884613,
-0.5478659868240356,
-0.5408676266670227,
0.22793376445770264,
-0.21063566207885742,
0.27269449830055237,
0.061553649604320526,
0.4445546269416809,
-0.03503112494945526,
-0.15474388003349304,
0.1517455279827118,
-0.16230064630508423,
0.3081783056259155,
-0.15038323402404785,
-0.0744025930762291,
-0.0057114362716674805,
0.013634912669658661,
-0.42373892664909363,
-0.10882783681154251,
-0.2622568905353546,
-0.04572794958949089,
-0.07253134250640869,
0.06352350115776062,
-0.04551270231604576,
0.15249772369861603,
-0.010652914643287659,
0.20409353077411652,
-0.12988300621509552,
-0.12413088977336884,
-0.09334702789783478,
0.22985315322875977,
-0.23080885410308838,
-0.6376470327377319,
-0.0018231719732284546,
0.10225612670183182,
-0.012703720480203629,
-0.010388780385255814,
-0.565481424331665,
0.11105532944202423,
0.10596052557229996,
-0.30411309003829956,
-0.07188662141561508,
-0.12378017604351044,
-0.047187965363264084,
-0.01712825335562229,
-0.1532045155763626,
-0.09887275844812393,
-0.12891975045204163,
0.10200934112071991,
0.1048814132809639,
0.6858530640602112,
0.07783044129610062,
0.421082079410553,
0.22527824342250824,
0.8024168014526367,
0.14780627191066742,
-0.30841854214668274,
0.0867558941245079,
-0.019535617902874947,
0.2920081913471222,
0.1570778787136078,
-0.18659362196922302,
0.23194462060928345,
-0.1324532926082611,
0.03403265029191971,
0.16531115770339966,
0.05842776596546173,
-0.0722610205411911,
-0.11424392461776733,
-0.20818479359149933,
-0.2984621524810791,
-0.2767806947231293,
0.11248968541622162,
-0.1900908648967743,
0.031560420989990234,
0.2339080274105072,
-0.10154084861278534,
0.13879884779453278,
-0.19185680150985718,
0.3152349889278412,
0.218525230884552,
0.13849346339702606,
-0.03846870735287666,
-0.1406688690185547,
-0.06657399982213974,
-0.2877923846244812,
-0.02386993169784546,
-0.18829238414764404,
0.2534981071949005,
-0.054718587547540665,
-0.11892911791801453,
0.039969637989997864,
-0.05259329453110695,
0.3762298822402954,
-0.16829562187194824,
0.2500884234905243,
-0.05273094028234482,
0.6125118136405945,
-0.34748974442481995,
0.15060923993587494,
-0.26087242364883423,
0.0105857253074646,
0.5070919990539551,
0.10002826154232025,
-0.09522468596696854,
0.0820380300283432,
0.5198596119880676,
-0.13748213648796082,
-0.0571482852101326,
-0.09775826334953308,
-0.03275555372238159,
-0.3157462477684021,
-0.3436122238636017,
-0.18577168881893158,
0.28547632694244385,
-0.17183539271354675,
-0.17385666072368622,
-0.30735909938812256,
0.0005151256918907166,
-0.2521173655986786,
-0.060179293155670166,
0.007319170981645584,
0.2748448848724365,
0.08792382478713989,
0.21063202619552612,
0.11227241903543472,
0.3700419068336487,
0.36169394850730896,
0.21176698803901672,
-0.0992528647184372,
-0.34998488426208496,
0.263980507850647,
-0.17869696021080017,
0.1613539159297943,
0.21101856231689453,
0.037666283547878265,
-0.05048703774809837,
0.30509626865386963,
0.07316385954618454,
-0.06413071602582932,
0.22073601186275482,
0.37040960788726807,
-0.001319345086812973,
-0.5822889804840088,
-0.38074609637260437,
0.787217378616333,
-0.10226880759000778,
-0.0881081372499466,
0.3677138686180115,
0.4121439456939697,
-0.1998303085565567,
0.5435848832130432,
0.07345091551542282,
0.9025512933731079,
0.1506279855966568,
0.08886060863733292,
0.102863609790802,
-0.0011858642101287842,
0.4996478855609894,
0.05998653173446655,
-0.05339338630437851,
-0.15241360664367676,
-0.2673642933368683,
-0.05102982744574547,
-0.14359815418720245,
-0.11847216635942459,
-0.005449427291750908,
-0.3304469585418701,
0.26318493485450745,
0.16754326224327087,
0.14260224997997284,
0.17061489820480347,
0.4889233112335205,
0.3094191253185272,
-0.1319558024406433,
-0.31837064027786255,
0.2005697637796402,
-0.15038089454174042,
0.15319538116455078,
-0.05438757315278053,
-0.2689015865325928,
-0.12970565259456635,
-0.030344292521476746,
-0.4343900680541992,
0.34725838899612427,
0.32015326619148254,
0.07614700496196747,
-0.005359984003007412,
-0.3512876629829407,
0.3269689083099365,
-0.154185950756073,
0.13042667508125305,
0.23642385005950928,
-0.3675498366355896,
0.5029255151748657,
-0.07373058795928955,
-0.20971834659576416,
0.3828088343143463,
-0.038862258195877075,
0.40298372507095337,
-0.17464539408683777,
-0.30381911993026733,
0.223321333527565,
0.10107677429914474,
-0.33230334520339966,
0.002325400710105896,
-0.09352734684944153,
0.050243109464645386,
-0.04334813728928566,
-0.13080476224422455,
0.23595041036605835,
-0.044496070593595505,
-0.2335054725408554,
0.1986580342054367,
0.12204276025295258,
0.16604389250278473,
-0.15763655304908752,
0.21547532081604004,
-0.16662350296974182,
-0.10880165547132492,
0.3863004148006439,
-0.03931845724582672,
-0.2128870189189911,
0.2421906441450119,
0.2647494077682495,
-0.05363062769174576,
-0.17929553985595703,
-0.049430012702941895,
-0.006707232445478439,
-0.3178337812423706,
-0.04595541954040527,
-0.4372863173484802,
0.2041100710630417,
-0.09967617690563202,
0.03439352661371231,
0.02440621890127659,
0.08684062957763672,
-0.2415512055158615,
-0.4843140244483948,
-0.09020165354013443,
0.15284623205661774,
-0.35805344581604004,
-0.1535654366016388,
0.06711605191230774,
-0.15192407369613647,
0.09166759252548218,
-0.2759460210800171,
-0.37950950860977173,
0.2241821140050888,
-0.06927254796028137,
-0.050678838044404984,
0.16957363486289978,
0.12132422626018524,
0.19358927011489868,
-0.1301494836807251,
0.09813196957111359,
0.0520116463303566,
0.10774108022451401,
-0.17101377248764038,
-0.1110774576663971,
0.10073654353618622,
0.15352505445480347,
0.04837600886821747,
-0.46402838826179504,
-0.31327974796295166,
-0.22047702968120575,
0.18312132358551025,
-0.10322463512420654,
-0.20483940839767456,
0.11563389003276825,
-0.14341118931770325,
0.016129162162542343,
-0.24152198433876038,
0.06899980455636978,
0.03935936838388443,
0.11520238220691681,
0.29085302352905273,
0.12946817278862,
0.25474292039871216,
-0.01680753380060196,
-0.006474435329437256,
-0.31253305077552795,
0.19937512278556824,
0.253191739320755,
0.220309317111969,
0.3901401460170746,
-0.24127773940563202,
-0.05118640512228012,
-0.035006333142519,
0.29653841257095337,
0.2042849212884903,
-0.4864223003387451,
-0.17141079902648926,
0.20137901604175568,
0.2215210497379303,
-0.2534458041191101,
0.20126891136169434,
-0.26953473687171936,
0.17312371730804443,
-0.19029952585697174,
-0.11456279456615448,
0.2008739858865738,
-0.12389149516820908,
-0.16076219081878662,
0.19591137766838074,
0.7116780877113342,
-0.2139923870563507,
0.09998150169849396,
0.11420651525259018,
-0.0015117451548576355,
0.1671728491783142,
0.09604460000991821,
0.19484128057956696,
0.31578442454338074,
0.22762398421764374,
0.03589232265949249,
0.22235767543315887,
0.3531267046928406,
0.18617667257785797,
0.04183279350399971,
0.16277825832366943,
-0.18290016055107117,
0.502633273601532,
0.11679480969905853,
0.090206578373909,
0.291170209646225,
0.1654793620109558,
0.17598050832748413,
-0.2524307370185852,
-0.051831021904945374,
0.07465308904647827,
0.2790297865867615,
0.07253988087177277,
-0.04907800257205963,
-0.010120660066604614,
-0.15288515388965607,
0.0036090239882469177,
-0.09654590487480164,
-0.16549843549728394,
-0.07544410973787308,
0.19755730032920837,
-0.11853603273630142,
-0.5027726292610168,
-0.1717423051595688,
0.2635006606578827,
0.18909767270088196,
-0.07110220938920975,
0.07020850479602814,
-0.22355882823467255,
-0.18214835226535797,
0.17251162230968475,
0.2581409513950348,
0.23911288380622864,
-0.04870927333831787,
0.0035550929605960846,
-0.017459111288189888,
0.13961252570152283,
-0.03888397663831711,
0.17404118180274963,
-0.002518467605113983,
0.15914197266101837,
-0.15136593580245972,
0.21784478425979614,
0.2039117068052292,
-0.25824612379074097,
0.0457562580704689,
0.16133582592010498,
0.43059074878692627,
-0.08885057270526886,
0.28860071301460266,
-0.3524433672428131,
-0.06263218075037003,
-0.3171643018722534,
-0.29723504185676575,
-0.4457051157951355,
-0.28620976209640503,
0.5679478645324707,
-0.2823726534843445,
0.035595666617155075,
-0.14482499659061432,
0.11050578951835632,
-0.035940445959568024,
0.39774981141090393,
0.4193039536476135,
0.14435294270515442,
-0.09095830470323563,
-0.4136795103549957,
-0.5682785511016846,
0.3473430275917053,
-0.006869367323815823,
0.06480985879898071,
0.07979875802993774,
0.0309012308716774,
-0.13274192810058594,
-0.016865640878677368,
0.011472158133983612,
0.35880327224731445,
-0.24508388340473175,
-0.005704110488295555,
-0.22221305966377258,
-0.1167418360710144,
-0.3210203945636749,
0.3497294783592224,
-0.1973428726196289,
0.21621105074882507,
0.07081668078899384,
-0.02098255604505539,
0.048459261655807495,
-0.1257064938545227,
-0.2600063979625702,
-0.06162486597895622,
-0.22930064797401428,
0.4916885793209076,
-0.08739404380321503,
0.04388318210840225,
-0.05896535888314247,
-0.2995741367340088,
-0.46423953771591187,
-0.34597140550613403,
-0.18147683143615723,
0.33238300681114197,
0.14189796149730682,
0.00018184632062911987,
0.08810951560735703,
0.37017661333084106,
-0.20505240559577942,
-0.1768435388803482,
-0.10059857368469238,
-0.12643663585186005,
-0.6204349994659424,
0.03305649012327194,
-0.009215280413627625,
0.11090679466724396,
0.08020630478858948,
0.11622603237628937,
-0.15507283806800842,
0.047571539878845215,
-0.2273707091808319,
-0.22265514731407166,
0.4172267019748688,
-0.4420301616191864,
-0.013328071683645248,
0.07796943187713623,
0.4545539617538452,
-0.3880317509174347,
0.11929856240749359,
-0.6662216186523438,
-0.18525893986225128,
0.1841166913509369,
0.16482357680797577,
-0.3406086266040802,
-0.21115447580814362,
0.018788043409585953,
0.1913030445575714,
0.0222480446100235,
0.17595146596431732,
0.23251576721668243,
-0.32049107551574707,
0.12314307689666748,
-0.023652292788028717
] |
https://github.com/huggingface/datasets/issues/6273 | Maybe you want to try it with the PUBMED dataset that I reproduced based on the The [PubMed Abstract GitHub Site](http://github.com/thoppe/The-Pile-PubMed) and uploaded on the HuggingFace:
```
from datasets import load_dataset
pubmed_dataset = load_dataset("hwang2006/PUBMED_title_abstracts_2020_baseline")
pubmed_dataset
#Downloading data: 100%
#7.98G/7.98G [11:47<00:00, 9.68MB/s]
#Generating train split: 17722096/0 [00:36<00:00, 505376.37 examples/s]
#DatasetDict({
# train: Dataset({
# features: ['meta', 'text'],
# num_rows: 17722096
# })
#})
``` | Broken Link to PubMed Abstracts dataset . | ### Describe the bug
The link provided for the dataset is broken,
data_files =
[https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url)
The
### Steps to reproduce the bug
Steps to reproduce:
1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url)
2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link.
### Expected behavior
The link should Redirect to the "PubMed Abstracts dataset" as expected .
### Environment info
. | 63 | Broken Link to PubMed Abstracts dataset .
### Describe the bug
The link provided for the dataset is broken,
data_files =
[https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url)
The
### Steps to reproduce the bug
Steps to reproduce:
1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url)
2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link.
### Expected behavior
The link should Redirect to the "PubMed Abstracts dataset" as expected .
### Environment info
.
Maybe you want to try it with the PUBMED dataset that I reproduced based on the The [PubMed Abstract GitHub Site](http://github.com/thoppe/The-Pile-PubMed) and uploaded on the HuggingFace:
```
from datasets import load_dataset
pubmed_dataset = load_dataset("hwang2006/PUBMED_title_abstracts_2020_baseline")
pubmed_dataset
#Downloading data: 100%
#7.98G/7.98G [11:47<00:00, 9.68MB/s]
#Generating train split: 17722096/0 [00:36<00:00, 505376.37 examples/s]
#DatasetDict({
# train: Dataset({
# features: ['meta', 'text'],
# num_rows: 17722096
# })
#})
``` | [
0.053189292550086975,
0.2400374561548233,
0.01789788529276848,
-0.11713257431983948,
0.03730643913149834,
0.05982741713523865,
0.2670304775238037,
0.4082258343696594,
-0.0903175100684166,
-0.08971862494945526,
0.06688192486763,
0.3428689241409302,
0.02864374965429306,
0.05629585683345795,
0.2932327389717102,
-0.13813868165016174,
0.08515758067369461,
-0.028821580111980438,
0.03817713260650635,
-0.02854139357805252,
-0.06393109261989594,
0.19329585134983063,
-0.20779705047607422,
-0.00688755139708519,
0.2551249563694,
0.09779603034257889,
-0.18911612033843994,
0.2259976714849472,
-0.007501071318984032,
-0.34920090436935425,
0.022997207939624786,
-0.07077495753765106,
0.019518181681632996,
0.3992520272731781,
-0.00010338566789869219,
-0.12808459997177124,
0.41117531061172485,
0.17161262035369873,
-0.17148366570472717,
-0.47061625123023987,
-0.15146242082118988,
-0.19322657585144043,
-0.12086353451013565,
-0.1960693895816803,
0.07565304636955261,
-0.3615341782569885,
0.12797187268733978,
0.11738855391740799,
0.24103954434394836,
0.44833120703697205,
0.22491857409477234,
0.2383848875761032,
0.3175094425678253,
-0.10373884439468384,
0.11715362966060638,
-0.027933664619922638,
-0.009771332144737244,
0.4516053795814514,
0.010963847860693932,
0.20936542749404907,
-0.09336292743682861,
0.39261144399642944,
0.14793166518211365,
-0.029232829809188843,
0.1090158000588417,
0.14305426180362701,
-0.18186166882514954,
-0.1195012629032135,
0.08709888160228729,
0.24824634194374084,
0.15562757849693298,
-0.3683900535106659,
-0.13257774710655212,
-0.15490847826004028,
-0.032872479408979416,
-0.008703440427780151,
0.14000454545021057,
0.19687145948410034,
0.13120591640472412,
0.25091955065727234,
0.31567099690437317,
-0.2919375002384186,
-0.188022643327713,
0.27959027886390686,
0.1921071708202362,
-0.08952777087688446,
-0.06169711798429489,
-0.014240030199289322,
0.35535138845443726,
-0.10160090029239655,
0.07360947132110596,
0.21152366697788239,
-0.15790313482284546,
0.04633050784468651,
-0.05790024623274803,
-0.2368222028017044,
0.13620641827583313,
-0.19142335653305054,
0.3405391573905945,
0.019630230963230133,
-0.23531904816627502,
0.09221751242876053,
0.061130937188863754,
-0.040394727140665054,
0.439563512802124,
-0.312940388917923,
-0.4269382357597351,
0.009944383054971695,
0.3832116723060608,
0.2897423207759857,
0.15041370689868927,
0.026828676462173462,
-0.017300963401794434,
-0.1056622862815857,
-0.1230371743440628,
-0.3037775456905365,
0.0004715248942375183,
-0.14330559968948364,
-0.1674552857875824,
0.25067371129989624,
-0.2052963823080063,
0.035850707441568375,
-0.29050564765930176,
0.39038777351379395,
-0.10238583385944366,
0.03598824888467789,
0.047154299914836884,
0.0859452411532402,
-0.05948891118168831,
-0.12460435926914215,
-0.16754257678985596,
0.07784341275691986,
-0.21521693468093872,
0.01915685459971428,
0.19295606017112732,
-0.2260671854019165,
0.2386314570903778,
0.061440564692020416,
0.13567021489143372,
-0.4035828709602356,
0.0462038591504097,
-0.11420635879039764,
0.02177431806921959,
0.28642892837524414,
0.2678162455558777,
0.2557359039783478,
0.10171034932136536,
-0.06688696146011353,
-0.11902202665805817,
0.08807015419006348,
-0.5121721625328064,
-0.2079763263463974,
-0.3676680028438568,
0.212705597281456,
-0.39505088329315186,
-0.04113179072737694,
-0.33195582032203674,
0.0501408688724041,
-0.30126893520355225,
-0.09503328055143356,
-0.08394958078861237,
-0.02777288667857647,
0.10198340564966202,
-0.203074112534523,
0.36120688915252686,
0.14181435108184814,
0.15328149497509003,
-0.12704673409461975,
-0.2627953588962555,
0.2827684283256531,
-0.06397592276334763,
0.22045300900936127,
-0.2388027161359787,
0.1875135898590088,
-0.2917911410331726,
0.33242422342300415,
0.445825457572937,
-0.0690508782863617,
-0.5595405101776123,
0.10454787313938141,
-0.2557215690612793,
-0.1337115466594696,
-0.2507694363594055,
-0.03510066121816635,
0.09770901501178741,
-0.1603623926639557,
0.1750735491514206,
0.3191555142402649,
0.2565061151981354,
0.10726581513881683,
-0.388729453086853,
-0.29801446199417114,
-0.2920045256614685,
0.11864295601844788,
0.15321160852909088,
-0.021072670817375183,
0.2939848303794861,
0.36992958188056946,
0.29869940876960754,
0.11247430741786957,
-0.0939902663230896,
0.3363957405090332,
0.29466384649276733,
-0.10030291974544525,
0.3318014144897461,
-0.14432352781295776,
-0.1207689493894577,
-0.04683151841163635,
0.020384714007377625,
0.3653573989868164,
-0.14330831170082092,
-0.08369839191436768,
-0.42632606625556946,
-0.04322697967290878,
0.020981306210160255,
-0.15431222319602966,
0.17998747527599335,
-0.10186366736888885,
-0.19632981717586517,
0.2620614767074585,
-0.26678895950317383,
-0.10281059890985489,
-0.1989893615245819,
0.1355307698249817,
-0.44995760917663574,
0.5538346767425537,
-0.24354778230190277,
-0.022873010486364365,
0.15166214108467102,
0.21057681739330292,
-0.015950016677379608,
-0.1213221400976181,
-0.017300711944699287,
0.5072835683822632,
-0.23338201642036438,
0.27252811193466187,
0.11717776954174042,
0.08942894637584686,
0.3994097113609314,
-0.8113821744918823,
0.030720939859747887,
0.42314738035202026,
0.01059025526046753,
0.04222013056278229,
-0.21598123013973236,
0.1355808973312378,
-0.07133203744888306,
0.05076904594898224,
0.1428203284740448,
0.18060660362243652,
0.17530205845832825,
-0.22813507914543152,
-0.15754839777946472,
-0.0959107056260109,
0.25880739092826843,
-0.015074837021529675,
-0.24231234192848206,
0.02837306447327137,
-0.2900191843509674,
0.16973784565925598,
0.44891878962516785,
-0.04601839929819107,
0.0902758240699768,
0.2768093943595886,
-0.520340085029602,
-0.25140905380249023,
-0.03324110433459282,
0.41675788164138794,
0.2773866057395935,
0.1797800213098526,
-0.0010896194726228714,
0.19090601801872253,
-0.1142873466014862,
-0.19362355768680573,
0.07858581840991974,
0.21872171759605408,
0.15802429616451263,
0.0523901991546154,
0.25067558884620667,
0.19974413514137268,
-0.20771245658397675,
-0.22903431951999664,
-0.04105822369456291,
0.16581955552101135,
-0.4572598934173584,
-0.012179598212242126,
-0.1674940139055252,
-0.14159759879112244,
-0.5951353907585144,
-0.009933991357684135,
-0.017843741923570633,
-0.23010297119617462,
-0.16239148378372192,
0.09799110889434814,
-0.1534300297498703,
0.12494604289531708,
-0.14363184571266174,
0.10819068551063538,
-0.10281048715114594,
0.07679194957017899,
-0.13518820703029633,
-0.021888740360736847,
-0.20032094419002533,
0.12806089222431183,
-0.012111879885196686,
0.359320729970932,
-0.03378792107105255,
0.005361735820770264,
-0.1367713361978531,
-0.33319351077079773,
-0.5267600417137146,
0.2005719542503357,
-0.1904928833246231,
0.24534901976585388,
0.15876555442810059,
0.4229038655757904,
-0.053271081298589706,
-0.17052756249904633,
0.36519187688827515,
-0.14484582841396332,
0.23257309198379517,
-0.021394427865743637,
0.024034056812524796,
0.032669056206941605,
-0.07689740508794785,
-0.5059616565704346,
-0.11000967770814896,
-0.24646040797233582,
0.04916419833898544,
-0.12989270687103271,
0.0631391853094101,
0.21124149858951569,
0.16998234391212463,
-0.00648919865489006,
0.18694013357162476,
-0.10905954986810684,
-0.1636832356452942,
-0.13261663913726807,
0.3042907416820526,
-0.25160664319992065,
-0.6151644587516785,
-0.04260643571615219,
0.07092581689357758,
-0.03598606958985329,
-0.07485528290271759,
-0.5789172053337097,
0.003257017582654953,
-0.025699611753225327,
-0.2713381052017212,
0.003700289875268936,
-0.02814795821905136,
-0.0350990928709507,
-0.02971624583005905,
-0.2207564413547516,
-0.1292361170053482,
-0.09256969392299652,
0.19398906826972961,
0.09241369366645813,
0.5571815967559814,
0.07914365082979202,
0.4576226472854614,
0.26848548650741577,
0.6269858479499817,
0.20177105069160461,
-0.19591167569160461,
0.11603187024593353,
-0.13369059562683105,
0.3296942114830017,
0.08504628390073776,
-0.24032193422317505,
0.25829049944877625,
-0.11620651185512543,
0.07941699773073196,
0.1335238218307495,
0.19766466319561005,
0.0865757018327713,
-0.11060167849063873,
-0.22688598930835724,
-0.22057895362377167,
-0.41964995861053467,
0.11487971246242523,
-0.08535158634185791,
0.02969568409025669,
0.22658702731132507,
-0.1185193806886673,
0.049110297113657,
-0.18461117148399353,
0.3809080719947815,
0.29463517665863037,
0.040038321167230606,
-0.03171258047223091,
-0.24130642414093018,
-0.022985661402344704,
-0.3801669776439667,
-0.09521140158176422,
-0.15588507056236267,
0.14674891531467438,
0.04484006017446518,
-0.15111039578914642,
0.08741317689418793,
-0.09415144473314285,
0.5227023959159851,
-0.014515025541186333,
0.230838343501091,
-0.03871062025427818,
0.5006037354469299,
-0.39655521512031555,
0.22041629254817963,
-0.1047397330403328,
-0.07288610190153122,
0.6432732343673706,
0.20466119050979614,
-0.18040814995765686,
0.02137107029557228,
0.5415540933609009,
-0.08498302102088928,
-0.036658335477113724,
-0.16772888600826263,
-0.10810977965593338,
-0.4513639211654663,
-0.23058168590068817,
-0.13417349755764008,
0.2131410837173462,
0.013889074325561523,
-0.17025509476661682,
-0.2537703514099121,
0.049069829285144806,
-0.29348307847976685,
-0.060015223920345306,
0.04161173477768898,
0.27896204590797424,
0.019752051681280136,
0.13235989212989807,
0.29008355736732483,
0.3602501451969147,
0.2993950843811035,
0.30784326791763306,
-0.19321909546852112,
-0.37428030371665955,
0.04332776740193367,
-0.19385704398155212,
-0.01719740778207779,
0.14330574870109558,
-0.002892538905143738,
0.10833406448364258,
0.23106740415096283,
0.06815018504858017,
-0.10971668362617493,
0.27469131350517273,
0.3573012948036194,
0.05940163508057594,
-0.4693683683872223,
-0.40895307064056396,
0.731765627861023,
-0.11983777582645416,
-0.015772074460983276,
0.26740190386772156,
0.4253568947315216,
-0.1963660717010498,
0.4782573878765106,
-0.011811710894107819,
0.850256621837616,
0.08920392394065857,
0.019442081451416016,
0.1702633947134018,
-0.01071012020111084,
0.6089611649513245,
-0.030191592872142792,
0.0012079402804374695,
-0.12921307981014252,
-0.18591013550758362,
-0.015150327235460281,
-0.16801202297210693,
-0.1513919085264206,
-0.053006816655397415,
-0.22113418579101562,
0.20083008706569672,
0.2336214929819107,
0.20927342772483826,
0.15033671259880066,
0.4655269682407379,
0.14105086028575897,
-0.08039075136184692,
-0.3070981502532959,
0.20140519738197327,
-0.05168558284640312,
0.2699965238571167,
0.030933111906051636,
-0.3049830198287964,
-0.2255442589521408,
-0.07313820719718933,
-0.3846967816352844,
0.3185352683067322,
0.21934233605861664,
0.15821720659732819,
0.15410062670707703,
-0.3206852078437805,
0.23936279118061066,
-0.027396798133850098,
0.22400563955307007,
0.29588937759399414,
-0.33978405594825745,
0.414050817489624,
-0.15488800406455994,
-0.20925967395305634,
0.40403270721435547,
0.01334916427731514,
0.3341059982776642,
-0.22208376228809357,
-0.3829945921897888,
0.11852183938026428,
0.026616673916578293,
-0.35239988565444946,
0.12053811550140381,
-0.09239540994167328,
0.011291252449154854,
-0.05991064012050629,
-0.08366380631923676,
0.2990439236164093,
0.01655028760433197,
-0.31048548221588135,
0.19992081820964813,
0.09504428505897522,
0.27295735478401184,
-0.1356540471315384,
0.08883289992809296,
-0.19250601530075073,
-0.0972975566983223,
0.375704824924469,
-0.1473562866449356,
-0.28340470790863037,
0.2933166027069092,
0.24642421305179596,
-0.12406739592552185,
-0.14850229024887085,
-0.10325130820274353,
0.07347778975963593,
-0.37866079807281494,
-0.0110591109842062,
-0.37956735491752625,
0.2859576940536499,
-0.04760168865323067,
0.09342916309833527,
0.07322141528129578,
0.10030777752399445,
-0.210952028632164,
-0.5249577164649963,
-0.08416174352169037,
0.16838927567005157,
-0.3104065954685211,
-0.0865626186132431,
0.11852163076400757,
0.0420864038169384,
0.1261497139930725,
-0.3482946455478668,
-0.38743510842323303,
0.30604109168052673,
-0.14439894258975983,
-0.08769446611404419,
0.13514377176761627,
0.024137232452630997,
0.36636996269226074,
-0.2545665502548218,
0.10860035568475723,
0.006531622260808945,
0.03302138298749924,
-0.18274256587028503,
-0.3085988163948059,
0.06748789548873901,
0.056133583188056946,
-0.01112256571650505,
-0.38384073972702026,
-0.22231833636760712,
-0.135040283203125,
0.081647127866745,
-0.029649071395397186,
-0.14705580472946167,
0.02871098741889,
-0.13431158661842346,
0.13026948273181915,
-0.11551903933286667,
0.024359196424484253,
-0.016933491453528404,
0.16986030340194702,
0.19501450657844543,
0.14313510060310364,
0.16120457649230957,
-0.12051229178905487,
0.007681034505367279,
-0.25607162714004517,
0.12702436745166779,
0.2507612705230713,
0.052935849875211716,
0.41919443011283875,
-0.23040324449539185,
-0.14457495510578156,
-0.06998010724782944,
0.3786378502845764,
0.22670647501945496,
-0.3844502568244934,
-0.08688732981681824,
0.23082628846168518,
0.24020038545131683,
-0.23109382390975952,
0.2653128504753113,
-0.2171984612941742,
0.17129644751548767,
-0.1230221539735794,
-0.05456977337598801,
0.22474215924739838,
-0.02640405297279358,
-0.21755316853523254,
0.16172191500663757,
0.7246332764625549,
-0.10477080196142197,
0.028779800981283188,
0.24218633770942688,
0.05061030387878418,
0.1682031899690628,
0.11458142101764679,
0.09133085608482361,
0.37056875228881836,
0.20341062545776367,
0.044131502509117126,
0.2313918024301529,
0.38161998987197876,
0.21330425143241882,
-0.04894289746880531,
0.04027619957923889,
-0.23338180780410767,
0.46755051612854004,
0.11653997004032135,
-0.013470657169818878,
0.18793785572052002,
0.31807762384414673,
0.16410396993160248,
-0.13474693894386292,
0.009434238076210022,
0.2076118141412735,
0.29863831400871277,
-0.09007623791694641,
-0.010077357292175293,
-0.04974875599145889,
-0.1953926980495453,
-0.061867162585258484,
0.036396849900484085,
-0.26373153924942017,
-0.11649349331855774,
0.1323162168264389,
-0.007835082709789276,
-0.6024025082588196,
-0.27389055490493774,
0.17287848889827728,
0.22261536121368408,
-0.10813099890947342,
0.008254153653979301,
-0.14652441442012787,
-0.1920534372329712,
0.10429549217224121,
0.23248052597045898,
0.31192561984062195,
-0.04437190294265747,
0.08471355587244034,
-0.08136440813541412,
0.08773043751716614,
-0.020301032811403275,
0.09061850607395172,
0.010426528751850128,
0.2033480405807495,
-0.0843915194272995,
0.2288484424352646,
0.2244672179222107,
-0.29962265491485596,
0.00024166156072169542,
0.08982221782207489,
0.5217714905738831,
-0.13950864970684052,
0.47632795572280884,
-0.33847713470458984,
-0.09415275603532791,
-0.27737337350845337,
-0.29762592911720276,
-0.3928733766078949,
-0.1662316471338272,
0.4709163308143616,
-0.3000563681125641,
0.010824132710695267,
-0.17382730543613434,
0.12585419416427612,
0.11315388977527618,
0.43400025367736816,
0.4698579013347626,
0.2266884595155716,
-0.018906231969594955,
-0.4538327157497406,
-0.5227749347686768,
0.2700498402118683,
-0.01384442113339901,
0.14944395422935486,
0.08056985586881638,
-0.046621937304735184,
-0.1737259030342102,
0.07069796323776245,
-0.14136910438537598,
0.29513412714004517,
-0.24235157668590546,
0.03887919709086418,
-0.14500416815280914,
-0.060405269265174866,
-0.30276134610176086,
0.19997665286064148,
-0.1294403076171875,
0.29932305216789246,
0.018823131918907166,
-0.0022221989929676056,
0.03257159888744354,
-0.16631601750850677,
-0.09229497611522675,
-0.1324692815542221,
-0.3460541069507599,
0.5020621418952942,
-0.011071591638028622,
0.019375648349523544,
-0.0257895365357399,
-0.2961657643318176,
-0.5067782998085022,
-0.4072377383708954,
-0.15678943693637848,
0.26677462458610535,
0.09742674231529236,
0.10189750790596008,
0.09752654284238815,
0.22807841002941132,
-0.21279513835906982,
-0.1346839964389801,
0.02060559391975403,
-0.2061438113451004,
-0.5160591006278992,
0.02022538334131241,
0.011402703821659088,
0.04844163358211517,
0.1009940654039383,
0.21278615295886993,
-0.08782181143760681,
0.12561246752738953,
-0.16882146894931793,
-0.28456413745880127,
0.3589170575141907,
-0.5591388940811157,
0.026094205677509308,
0.04282026365399361,
0.4252813458442688,
-0.30022427439689636,
-0.06031753867864609,
-0.7830376029014587,
-0.0975446030497551,
0.18197153508663177,
0.2913190424442291,
-0.45864492654800415,
-0.1962708681821823,
0.06688456237316132,
0.18890373408794403,
0.04026084393262863,
0.23787790536880493,
0.1788400113582611,
-0.3518046736717224,
0.15411363542079926,
-0.0751318633556366
] |
https://github.com/huggingface/datasets/issues/6272 | I think it's best to drop duplicates with a `set` (as a temporary fix) and improve the patterns when/if https://github.com/fsspec/filesystem_spec/pull/1382 gets merged. @lhoestq Do you have some other ideas? | Duplicate `data_files` when named `<split>/<split>.parquet` | e.g. with `u23429/stock_1_minute_ticker`
```ipython
In [1]: from datasets import *
In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker")
Downloading readme: 100%|ββββββββββββββββββββββββββ| 627/627 [00:00<00:00, 246kB/s]
In [3]: b.config.data_files
Out[3]:
{NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'],
NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'],
NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']}
```
This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko | 29 | Duplicate `data_files` when named `<split>/<split>.parquet`
e.g. with `u23429/stock_1_minute_ticker`
```ipython
In [1]: from datasets import *
In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker")
Downloading readme: 100%|ββββββββββββββββββββββββββ| 627/627 [00:00<00:00, 246kB/s]
In [3]: b.config.data_files
Out[3]:
{NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'],
NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'],
NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']}
```
This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
I think it's best to drop duplicates with a `set` (as a temporary fix) and improve the patterns when/if https://github.com/fsspec/filesystem_spec/pull/1382 gets merged. @lhoestq Do you have some other ideas? | [
-0.30908650159835815,
-0.11631924659013748,
-0.11791282892227173,
0.39790865778923035,
0.30234766006469727,
0.1111975759267807,
0.3349858820438385,
0.4634609818458557,
0.019552171230316162,
0.3075334429740906,
-0.10650788247585297,
0.324413001537323,
-0.08251963555812836,
0.25816643238067627,
0.016248896718025208,
0.009527147747576237,
-0.030174411833286285,
0.22384440898895264,
0.028409359976649284,
-0.033552512526512146,
0.022426076233386993,
0.09839514642953873,
0.0755636990070343,
0.11592554301023483,
-0.2304082214832306,
-0.023290473967790604,
-0.02988271787762642,
0.24672742187976837,
-0.30624833703041077,
-0.48090851306915283,
0.11290408670902252,
-0.16473078727722168,
-0.13549676537513733,
0.4876673221588135,
-0.00010876324085984379,
0.0885191261768341,
0.2490713745355606,
-0.03963345289230347,
-0.26976069808006287,
-0.08975547552108765,
-0.3295462131500244,
-0.1833774447441101,
0.19111692905426025,
-0.4548946022987366,
-0.1313847303390503,
-0.3222501277923584,
-0.0399552620947361,
-0.012054301798343658,
0.6052088737487793,
0.45798614621162415,
0.19898906350135803,
0.24281495809555054,
-0.06401003897190094,
-0.07273028790950775,
0.4250287413597107,
0.18993283808231354,
0.016399189829826355,
0.12362003326416016,
0.05834488570690155,
0.12629732489585876,
0.03128882497549057,
0.3099825978279114,
0.08301908522844315,
0.17814189195632935,
-0.15965783596038818,
0.03259650245308876,
-0.034125249832868576,
-0.09666106104850769,
0.08668388426303864,
0.19245366752147675,
-0.0002621188759803772,
-0.2389184534549713,
-0.0451190322637558,
-0.4948391318321228,
-0.11280800402164459,
-0.5054447650909424,
0.03792106360197067,
0.36668747663497925,
0.07213449478149414,
0.06790243089199066,
0.04607652500271797,
0.10920915752649307,
-0.014980442821979523,
-0.027875825762748718,
-0.06097063422203064,
0.4724966883659363,
-0.08253717422485352,
0.13710595667362213,
0.023655656725168228,
0.0074592288583517075,
0.07069669663906097,
-0.2641391456127167,
0.0002634236589074135,
-0.06898146867752075,
-0.13466468453407288,
-0.06310418248176575,
-0.13225772976875305,
-0.0679907351732254,
-0.07578959316015244,
0.13633036613464355,
-0.1939459890127182,
-0.09159719944000244,
0.3524767756462097,
0.07633096724748611,
0.1539892852306366,
-0.2197299599647522,
-0.11748814582824707,
0.5034672021865845,
0.037931062281131744,
0.35104066133499146,
-0.341068834066391,
-0.09321184456348419,
0.005437258630990982,
-0.0025818385183811188,
-0.013516850769519806,
-0.028163276612758636,
0.36392462253570557,
-0.08923953771591187,
-0.5344590544700623,
0.0480906218290329,
-0.04423839598894119,
-0.20882132649421692,
0.04411459341645241,
0.14854563772678375,
-0.06397178024053574,
0.026107165962457657,
-0.2818061411380768,
0.1878909170627594,
-0.24726548790931702,
-0.2214125096797943,
-0.3558864891529083,
0.27231210470199585,
-0.17732569575309753,
-0.02489328570663929,
0.10383401811122894,
0.020593293011188507,
0.4593062400817871,
0.3083874583244324,
0.109681636095047,
-0.2183406502008438,
0.27528640627861023,
-0.0851624459028244,
-0.21675512194633484,
0.223927304148674,
-0.024502627551555634,
0.09617883712053299,
0.1837536245584488,
-0.15333192050457,
-0.11965896189212799,
0.02744261920452118,
-0.3033311069011688,
-0.3394900858402252,
-0.17173826694488525,
0.2923870384693146,
0.04607507586479187,
0.12958993017673492,
-0.09007138758897781,
0.004639427177608013,
0.20783667266368866,
-0.10068926215171814,
-0.18230193853378296,
-0.19717618823051453,
-0.10425719618797302,
-0.14557617902755737,
0.030050240457057953,
0.3476787805557251,
-0.14823243021965027,
-0.16295073926448822,
-0.1039557158946991,
-0.02832123637199402,
0.3495420217514038,
0.3119150698184967,
-0.3696371614933014,
0.26498445868492126,
-0.2805452048778534,
0.25216174125671387,
0.6477166414260864,
-0.2672576606273651,
-0.16731375455856323,
0.09286420792341232,
-0.2249927818775177,
0.10848551243543625,
0.5010205507278442,
-0.10518021881580353,
0.4092772305011749,
-0.0011238008737564087,
-0.07370777428150177,
-0.07966708391904831,
0.019716190174221992,
-0.13920113444328308,
-0.34030598402023315,
0.03422684967517853,
0.10484182834625244,
0.11124107241630554,
-0.1482967585325241,
-0.3527791202068329,
0.13723623752593994,
0.2014131098985672,
0.2860555350780487,
-0.15952691435813904,
0.07250400632619858,
-0.02437558025121689,
0.01183840911835432,
0.34652796387672424,
-0.08550494909286499,
-0.3769909739494324,
-0.21148893237113953,
0.1158834770321846,
-0.21873381733894348,
-0.05105643719434738,
-0.2256711721420288,
-0.34895575046539307,
-0.5518126487731934,
-0.03426928073167801,
-0.4720977246761322,
-0.26476556062698364,
0.21683551371097565,
0.362338662147522,
-0.1072140634059906,
-0.17754130065441132,
-0.20018941164016724,
0.12501542270183563,
-0.15995675325393677,
0.12896324694156647,
-0.21122655272483826,
0.25302544236183167,
-0.2928012013435364,
-0.1666465550661087,
0.18420690298080444,
0.0794035792350769,
0.25712645053863525,
-0.046573273837566376,
0.07089535892009735,
0.29827436804771423,
0.3406228721141815,
0.10271558165550232,
0.135273277759552,
0.03595702350139618,
0.09788250923156738,
0.04823268949985504,
-0.04455127194523811,
-0.02711065113544464,
0.007657554000616074,
-0.09807926416397095,
-0.46031075716018677,
0.346666157245636,
0.21137672662734985,
0.041413478553295135,
0.0046343207359313965,
-0.310100793838501,
0.24220305681228638,
-0.13204829394817352,
-0.05781057849526405,
-0.18709354102611542,
0.0829005315899849,
0.19487972557544708,
-0.02947237342596054,
0.19460928440093994,
-0.4104606509208679,
0.19726017117500305,
0.5507493615150452,
-0.17835943400859833,
-0.11920270323753357,
0.017534147948026657,
-0.004908442497253418,
-0.13466323912143707,
-0.08866644650697708,
0.28791847825050354,
0.28160226345062256,
0.2714698612689972,
0.32343578338623047,
0.09122961014509201,
-0.12928448617458344,
-0.22684063017368317,
0.23285265266895294,
0.005213309079408646,
-0.053232382982969284,
0.28079915046691895,
0.09549565613269806,
-0.21883684396743774,
-0.4679564833641052,
-0.14015907049179077,
0.18631070852279663,
0.09485489875078201,
-0.253265380859375,
0.03756225109100342,
-0.478381872177124,
-0.005713500082492828,
-0.626946210861206,
0.19972342252731323,
0.046253375709056854,
-0.3058737516403198,
0.1796007603406906,
0.384112149477005,
-0.057115353643894196,
0.2114524096250534,
0.04870186746120453,
-0.022495120763778687,
0.11463023722171783,
-0.15102577209472656,
-0.1696767807006836,
-0.1304750144481659,
-0.20537316799163818,
0.19766885042190552,
0.17654450237751007,
0.22028730809688568,
0.42170530557632446,
-0.18177200853824615,
-0.019456636160612106,
-0.22618916630744934,
-0.4400518536567688,
0.05717313662171364,
-0.06451817601919174,
0.08421263843774796,
0.2018129825592041,
0.19486108422279358,
0.14703646302223206,
-0.3549288511276245,
0.26222726702690125,
0.28262534737586975,
-0.12071843445301056,
-0.2414572536945343,
-0.10246169567108154,
-0.06823710352182388,
-0.012420162558555603,
-0.6947731971740723,
-0.19420093297958374,
-0.28164517879486084,
0.1936519294977188,
0.29534462094306946,
0.0969010591506958,
-0.2590813934803009,
-0.14275234937667847,
-0.04852497950196266,
-0.2132924497127533,
0.07613282650709152,
-0.2988337576389313,
-0.28628793358802795,
0.24385008215904236,
-0.13980579376220703,
-0.08749482035636902,
-0.006639562547206879,
-0.08753608167171478,
0.19047045707702637,
-0.14693842828273773,
-0.5598123073577881,
-0.004423849284648895,
-0.21065488457679749,
0.007050134241580963,
-0.11820856481790543,
0.025672858580946922,
0.22908291220664978,
0.1722102016210556,
-0.16783905029296875,
-0.01568537950515747,
-0.08737492561340332,
0.1434869021177292,
0.10982977598905563,
0.0887177512049675,
-0.17036542296409607,
0.5233087539672852,
0.12521488964557648,
0.5978509783744812,
0.27304577827453613,
-0.005678401328623295,
0.22543834149837494,
-0.266295462846756,
0.25776833295822144,
-0.24693474173545837,
-0.2867079973220825,
0.0808255672454834,
0.007529310882091522,
-0.05261500924825668,
0.3871223032474518,
-0.11665841937065125,
0.185812309384346,
0.0837516039609909,
0.05108854919672012,
-0.1649918258190155,
-0.32635509967803955,
-0.008387058041989803,
0.025720542296767235,
0.11118236184120178,
0.11546316742897034,
-0.08852685242891312,
0.01270584762096405,
0.07772835344076157,
-0.007710874080657959,
0.05288158729672432,
0.011503346264362335,
0.06222471967339516,
-0.1783922016620636,
0.04633935168385506,
-0.25163137912750244,
0.05151405185461044,
0.15341490507125854,
0.022861246019601822,
0.010419070720672607,
-0.09445591270923615,
0.1127588227391243,
0.09837917238473892,
0.472431480884552,
0.21843238174915314,
0.2747613191604614,
0.1048775166273117,
-0.12050057202577591,
-0.18396401405334473,
-0.21845820546150208,
-0.33123382925987244,
0.07299551367759705,
0.2721790075302124,
0.7909634709358215,
-0.649622917175293,
-0.05051303282380104,
0.4538895785808563,
0.2892705202102661,
-0.15391764044761658,
0.12368139624595642,
-0.2559513449668884,
-0.1631239354610443,
-0.4025355577468872,
0.2716025412082672,
0.17295484244823456,
0.38508906960487366,
0.0483628511428833,
-0.08954571187496185,
-0.05333463102579117,
-0.09467261284589767,
0.07527107000350952,
0.1286337673664093,
0.2866211235523224,
-0.0739860087633133,
0.1098271906375885,
-0.09300802648067474,
0.21096697449684143,
0.025605106726288795,
0.7117032408714294,
-0.13229015469551086,
-0.2453993558883667,
0.04557788372039795,
-0.24667437374591827,
0.0497819259762764,
0.17436599731445312,
-0.024543728679418564,
-0.038217607885599136,
-0.08243708312511444,
0.2383478432893753,
-0.08800950646400452,
0.3615918457508087,
0.4777933359146118,
-0.12591871619224548,
-0.4248642921447754,
-0.42610421776771545,
0.22480140626430511,
0.04750389605760574,
-0.05554059147834778,
0.3285316824913025,
-0.011316467076539993,
-0.21603098511695862,
0.14226576685905457,
-0.16416844725608826,
0.8346702456474304,
-0.01440051943063736,
0.11634523421525955,
0.4014773666858673,
-0.42818278074264526,
0.25679120421409607,
-0.30012524127960205,
-0.023379959166049957,
-0.26462793350219727,
-0.07259571552276611,
0.07692789286375046,
-0.05812939628958702,
0.20267900824546814,
0.4314551055431366,
-0.1136721521615982,
0.33940330147743225,
0.18433907628059387,
0.328558087348938,
-0.14968915283679962,
0.4750936031341553,
0.1755165010690689,
0.11792406439781189,
-0.2513613998889923,
0.17275777459144592,
0.034715600311756134,
-0.13737964630126953,
0.028913188725709915,
-0.061546243727207184,
0.031183436512947083,
-0.2917725443840027,
-0.024568885564804077,
-0.033135026693344116,
-0.11291757971048355,
0.30444812774658203,
-0.25066760182380676,
-0.3719501495361328,
-0.09503266215324402,
-0.04324209317564964,
-0.29394176602363586,
0.10198251903057098,
-0.018206855282187462,
0.26496896147727966,
0.006620293483138084,
-0.03493184968829155,
-0.11574714630842209,
-0.01608641818165779,
-0.003863966092467308,
-0.1568024605512619,
-0.18086649477481842,
-0.09386911243200302,
-0.08801276981830597,
-0.2517656683921814,
-0.14019693434238434,
0.3171793520450592,
0.30948373675346375,
-0.5553622245788574,
-0.1461198478937149,
-0.14597578346729279,
-0.10740285366773605,
-0.3700966536998749,
0.17185738682746887,
-0.3264642655849457,
-0.16680029034614563,
0.03887680917978287,
-0.04388006776571274,
-0.4088277816772461,
-0.2566623091697693,
0.18160764873027802,
0.22487396001815796,
0.20259183645248413,
0.5038830041885376,
-0.08837511390447617,
-0.28042617440223694,
-0.2988913059234619,
0.09444895386695862,
0.13597442209720612,
-0.2823508381843567,
0.12303832918405533,
-0.13503603637218475,
-0.05714760720729828,
0.1998957395553589,
-0.07720538228750229,
0.2272135317325592,
0.11571705341339111,
0.06996206939220428,
-0.36584141850471497,
-0.13756555318832397,
-0.005183789879083633,
0.05973397567868233,
0.27710357308387756,
0.2990233302116394,
0.3956863284111023,
-0.10736355930566788,
-0.06809253245592117,
-0.3958466649055481,
0.3049456477165222,
0.007406309247016907,
0.4909559190273285,
0.23390613496303558,
-0.060645826160907745,
0.15057474374771118,
0.361205518245697,
0.2739097476005554,
0.05415179952979088,
-0.12156855314970016,
-0.33541837334632874,
-0.06958489865064621,
0.0909121185541153,
-0.18980485200881958,
0.21490666270256042,
-0.1761254072189331,
-0.07327387481927872,
-0.003975158557295799,
-0.1373155415058136,
0.16682025790214539,
0.017614848911762238,
0.1318364441394806,
-0.009520523250102997,
0.48243191838264465,
-0.05582619458436966,
0.015165828168392181,
-0.16702759265899658,
-0.22425477206707,
0.3012077808380127,
0.0428282655775547,
0.16097143292427063,
-0.013052280992269516,
-0.07062488794326782,
-0.1923927217721939,
-0.10691331326961517,
0.37719929218292236,
0.07983211427927017,
0.17229358851909637,
-0.19688713550567627,
-0.1866491734981537,
0.18712753057479858,
0.5465976595878601,
0.6090094447135925,
-0.168633371591568,
-0.21931999921798706,
0.056630026549100876,
0.2648698091506958,
-0.3602132201194763,
-0.08529792726039886,
0.3661343455314636,
-0.16627147793769836,
0.1840030997991562,
0.25676387548446655,
0.1529937982559204,
0.024981185793876648,
0.008823415264487267,
0.19981153309345245,
0.27892008423805237,
-0.2886826992034912,
0.41909611225128174,
0.3547709882259369,
-0.11196955293416977,
-0.2193886637687683,
0.3314710855484009,
-0.03238869085907936,
0.2431516945362091,
0.599908709526062,
-0.04146747291088104,
0.37607112526893616,
0.24629545211791992,
-0.09538418054580688,
0.11955449730157852,
-0.02047835662961006,
-0.29438939690589905,
0.24939730763435364,
-0.012081462889909744,
-0.047124914824962616,
0.27441802620887756,
0.13440361618995667,
-0.0650959312915802,
-0.11917168647050858,
-0.24045994877815247,
0.34556639194488525,
-0.1452760547399521,
0.0018345937132835388,
0.17666172981262207,
-0.1349259465932846,
-0.36419379711151123,
0.15693676471710205,
-0.0037333182990550995,
0.21297259628772736,
0.0035355165600776672,
0.004608524963259697,
-0.019000917673110962,
-0.32100215554237366,
-0.03179421275854111,
0.011844049207866192,
0.10385853052139282,
-0.418509840965271,
0.2356724590063095,
0.428875207901001,
-0.17986968159675598,
0.11270562559366226,
0.22627590596675873,
0.4462118148803711,
0.06666672229766846,
-0.019607463851571083,
-0.1420183926820755,
-0.1052108108997345,
-0.20303109288215637,
-0.14765916764736176,
0.0289255753159523,
-0.1393536627292633,
0.21071673929691315,
0.4406188130378723,
0.25475597381591797,
-0.29201552271842957,
-0.1870744824409485,
0.18673503398895264,
-0.4614831507205963,
-0.4731268286705017,
0.3161681294441223,
-0.05330529063940048,
-0.03720530867576599,
-0.12929698824882507,
0.03757909685373306,
-0.4924267530441284,
-0.3314661979675293,
0.11546880006790161,
0.15686173737049103,
0.2732029855251312,
-0.07768326997756958,
0.11253656446933746,
0.002480311319231987,
0.4407373368740082,
-0.05403897538781166,
-0.3344731628894806,
-0.33654484152793884,
-0.3361363410949707,
-0.6100761890411377,
0.12419895827770233,
-0.41227689385414124,
-0.2720104455947876,
0.08144848793745041,
0.28278830647468567,
-0.2362753450870514,
0.05695892497897148,
0.05324020981788635,
-0.04683954641222954,
0.047190628945827484,
0.09211200475692749,
-0.24151967465877533,
-0.07538963854312897,
0.20634211599826813,
-0.09706483036279678,
0.14295831322669983,
-0.24837720394134521,
0.4040428400039673,
-0.09845435619354248,
0.14364750683307648,
-0.0415184386074543,
-0.17581957578659058,
0.17178642749786377,
-0.005960982292890549,
0.2899016737937927,
0.23704759776592255,
0.34011268615722656,
-0.26866793632507324,
-0.1610575020313263,
-0.0666171982884407,
-0.05464472621679306,
-0.18432249128818512,
0.6407705545425415,
0.10433304309844971,
0.32872843742370605,
-0.11637386679649353,
-0.0005659149028360844,
-0.3491601049900055,
0.22799113392829895,
0.02474275976419449,
-0.17110112309455872,
0.03726762533187866,
-0.0337248370051384,
-0.0344015508890152,
0.3026396930217743,
-0.07424690574407578,
0.2767486274242401,
0.033142201602458954,
0.034437015652656555,
-0.0023770183324813843,
-0.6050345301628113,
0.5183269381523132,
-0.30721303820610046,
-0.5018857717514038,
-0.11568183451890945,
0.180986225605011,
0.20159803330898285,
0.3526686429977417,
-0.5205014944076538,
0.19413234293460846,
0.4587147533893585,
-0.05027499794960022,
-0.12158769369125366,
0.22748513519763947,
0.07665365934371948,
-0.03499516844749451,
0.10871738195419312,
0.2233411967754364,
0.28327834606170654,
-0.33326858282089233,
0.13019385933876038,
-0.22924146056175232
] |
https://github.com/huggingface/datasets/issues/6272 | Alternatively we could just use this no ?
```python
if config.FSSPEC_VERSION < version.parse("2023.9.0"):
KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [
"{keyword}[{sep}/]**",
"**[{sep}]{keyword}[{sep}/]**",
"**/{keyword}[{sep}/]**",
]
else:
KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [
"{keyword}[{sep}/]**",
"**/*[{sep}]{keyword}[{sep}/]**",
"**/*/{keyword}[{sep}/]**",
]
```
This way no need to implement sets, which would require a bit of work since we've always considered a list of pattern to be resolved as the concatenated list of resolved files for each pattern (including duplicates)
| Duplicate `data_files` when named `<split>/<split>.parquet` | e.g. with `u23429/stock_1_minute_ticker`
```ipython
In [1]: from datasets import *
In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker")
Downloading readme: 100%|ββββββββββββββββββββββββββ| 627/627 [00:00<00:00, 246kB/s]
In [3]: b.config.data_files
Out[3]:
{NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'],
NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'],
NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']}
```
This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko | 66 | Duplicate `data_files` when named `<split>/<split>.parquet`
e.g. with `u23429/stock_1_minute_ticker`
```ipython
In [1]: from datasets import *
In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker")
Downloading readme: 100%|ββββββββββββββββββββββββββ| 627/627 [00:00<00:00, 246kB/s]
In [3]: b.config.data_files
Out[3]:
{NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'],
NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'],
NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']}
```
This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
Alternatively we could just use this no ?
```python
if config.FSSPEC_VERSION < version.parse("2023.9.0"):
KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [
"{keyword}[{sep}/]**",
"**[{sep}]{keyword}[{sep}/]**",
"**/{keyword}[{sep}/]**",
]
else:
KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [
"{keyword}[{sep}/]**",
"**/*[{sep}]{keyword}[{sep}/]**",
"**/*/{keyword}[{sep}/]**",
]
```
This way no need to implement sets, which would require a bit of work since we've always considered a list of pattern to be resolved as the concatenated list of resolved files for each pattern (including duplicates)
| [
-0.30908650159835815,
-0.11631924659013748,
-0.11791282892227173,
0.39790865778923035,
0.30234766006469727,
0.1111975759267807,
0.3349858820438385,
0.4634609818458557,
0.019552171230316162,
0.3075334429740906,
-0.10650788247585297,
0.324413001537323,
-0.08251963555812836,
0.25816643238067627,
0.016248896718025208,
0.009527147747576237,
-0.030174411833286285,
0.22384440898895264,
0.028409359976649284,
-0.033552512526512146,
0.022426076233386993,
0.09839514642953873,
0.0755636990070343,
0.11592554301023483,
-0.2304082214832306,
-0.023290473967790604,
-0.02988271787762642,
0.24672742187976837,
-0.30624833703041077,
-0.48090851306915283,
0.11290408670902252,
-0.16473078727722168,
-0.13549676537513733,
0.4876673221588135,
-0.00010876324085984379,
0.0885191261768341,
0.2490713745355606,
-0.03963345289230347,
-0.26976069808006287,
-0.08975547552108765,
-0.3295462131500244,
-0.1833774447441101,
0.19111692905426025,
-0.4548946022987366,
-0.1313847303390503,
-0.3222501277923584,
-0.0399552620947361,
-0.012054301798343658,
0.6052088737487793,
0.45798614621162415,
0.19898906350135803,
0.24281495809555054,
-0.06401003897190094,
-0.07273028790950775,
0.4250287413597107,
0.18993283808231354,
0.016399189829826355,
0.12362003326416016,
0.05834488570690155,
0.12629732489585876,
0.03128882497549057,
0.3099825978279114,
0.08301908522844315,
0.17814189195632935,
-0.15965783596038818,
0.03259650245308876,
-0.034125249832868576,
-0.09666106104850769,
0.08668388426303864,
0.19245366752147675,
-0.0002621188759803772,
-0.2389184534549713,
-0.0451190322637558,
-0.4948391318321228,
-0.11280800402164459,
-0.5054447650909424,
0.03792106360197067,
0.36668747663497925,
0.07213449478149414,
0.06790243089199066,
0.04607652500271797,
0.10920915752649307,
-0.014980442821979523,
-0.027875825762748718,
-0.06097063422203064,
0.4724966883659363,
-0.08253717422485352,
0.13710595667362213,
0.023655656725168228,
0.0074592288583517075,
0.07069669663906097,
-0.2641391456127167,
0.0002634236589074135,
-0.06898146867752075,
-0.13466468453407288,
-0.06310418248176575,
-0.13225772976875305,
-0.0679907351732254,
-0.07578959316015244,
0.13633036613464355,
-0.1939459890127182,
-0.09159719944000244,
0.3524767756462097,
0.07633096724748611,
0.1539892852306366,
-0.2197299599647522,
-0.11748814582824707,
0.5034672021865845,
0.037931062281131744,
0.35104066133499146,
-0.341068834066391,
-0.09321184456348419,
0.005437258630990982,
-0.0025818385183811188,
-0.013516850769519806,
-0.028163276612758636,
0.36392462253570557,
-0.08923953771591187,
-0.5344590544700623,
0.0480906218290329,
-0.04423839598894119,
-0.20882132649421692,
0.04411459341645241,
0.14854563772678375,
-0.06397178024053574,
0.026107165962457657,
-0.2818061411380768,
0.1878909170627594,
-0.24726548790931702,
-0.2214125096797943,
-0.3558864891529083,
0.27231210470199585,
-0.17732569575309753,
-0.02489328570663929,
0.10383401811122894,
0.020593293011188507,
0.4593062400817871,
0.3083874583244324,
0.109681636095047,
-0.2183406502008438,
0.27528640627861023,
-0.0851624459028244,
-0.21675512194633484,
0.223927304148674,
-0.024502627551555634,
0.09617883712053299,
0.1837536245584488,
-0.15333192050457,
-0.11965896189212799,
0.02744261920452118,
-0.3033311069011688,
-0.3394900858402252,
-0.17173826694488525,
0.2923870384693146,
0.04607507586479187,
0.12958993017673492,
-0.09007138758897781,
0.004639427177608013,
0.20783667266368866,
-0.10068926215171814,
-0.18230193853378296,
-0.19717618823051453,
-0.10425719618797302,
-0.14557617902755737,
0.030050240457057953,
0.3476787805557251,
-0.14823243021965027,
-0.16295073926448822,
-0.1039557158946991,
-0.02832123637199402,
0.3495420217514038,
0.3119150698184967,
-0.3696371614933014,
0.26498445868492126,
-0.2805452048778534,
0.25216174125671387,
0.6477166414260864,
-0.2672576606273651,
-0.16731375455856323,
0.09286420792341232,
-0.2249927818775177,
0.10848551243543625,
0.5010205507278442,
-0.10518021881580353,
0.4092772305011749,
-0.0011238008737564087,
-0.07370777428150177,
-0.07966708391904831,
0.019716190174221992,
-0.13920113444328308,
-0.34030598402023315,
0.03422684967517853,
0.10484182834625244,
0.11124107241630554,
-0.1482967585325241,
-0.3527791202068329,
0.13723623752593994,
0.2014131098985672,
0.2860555350780487,
-0.15952691435813904,
0.07250400632619858,
-0.02437558025121689,
0.01183840911835432,
0.34652796387672424,
-0.08550494909286499,
-0.3769909739494324,
-0.21148893237113953,
0.1158834770321846,
-0.21873381733894348,
-0.05105643719434738,
-0.2256711721420288,
-0.34895575046539307,
-0.5518126487731934,
-0.03426928073167801,
-0.4720977246761322,
-0.26476556062698364,
0.21683551371097565,
0.362338662147522,
-0.1072140634059906,
-0.17754130065441132,
-0.20018941164016724,
0.12501542270183563,
-0.15995675325393677,
0.12896324694156647,
-0.21122655272483826,
0.25302544236183167,
-0.2928012013435364,
-0.1666465550661087,
0.18420690298080444,
0.0794035792350769,
0.25712645053863525,
-0.046573273837566376,
0.07089535892009735,
0.29827436804771423,
0.3406228721141815,
0.10271558165550232,
0.135273277759552,
0.03595702350139618,
0.09788250923156738,
0.04823268949985504,
-0.04455127194523811,
-0.02711065113544464,
0.007657554000616074,
-0.09807926416397095,
-0.46031075716018677,
0.346666157245636,
0.21137672662734985,
0.041413478553295135,
0.0046343207359313965,
-0.310100793838501,
0.24220305681228638,
-0.13204829394817352,
-0.05781057849526405,
-0.18709354102611542,
0.0829005315899849,
0.19487972557544708,
-0.02947237342596054,
0.19460928440093994,
-0.4104606509208679,
0.19726017117500305,
0.5507493615150452,
-0.17835943400859833,
-0.11920270323753357,
0.017534147948026657,
-0.004908442497253418,
-0.13466323912143707,
-0.08866644650697708,
0.28791847825050354,
0.28160226345062256,
0.2714698612689972,
0.32343578338623047,
0.09122961014509201,
-0.12928448617458344,
-0.22684063017368317,
0.23285265266895294,
0.005213309079408646,
-0.053232382982969284,
0.28079915046691895,
0.09549565613269806,
-0.21883684396743774,
-0.4679564833641052,
-0.14015907049179077,
0.18631070852279663,
0.09485489875078201,
-0.253265380859375,
0.03756225109100342,
-0.478381872177124,
-0.005713500082492828,
-0.626946210861206,
0.19972342252731323,
0.046253375709056854,
-0.3058737516403198,
0.1796007603406906,
0.384112149477005,
-0.057115353643894196,
0.2114524096250534,
0.04870186746120453,
-0.022495120763778687,
0.11463023722171783,
-0.15102577209472656,
-0.1696767807006836,
-0.1304750144481659,
-0.20537316799163818,
0.19766885042190552,
0.17654450237751007,
0.22028730809688568,
0.42170530557632446,
-0.18177200853824615,
-0.019456636160612106,
-0.22618916630744934,
-0.4400518536567688,
0.05717313662171364,
-0.06451817601919174,
0.08421263843774796,
0.2018129825592041,
0.19486108422279358,
0.14703646302223206,
-0.3549288511276245,
0.26222726702690125,
0.28262534737586975,
-0.12071843445301056,
-0.2414572536945343,
-0.10246169567108154,
-0.06823710352182388,
-0.012420162558555603,
-0.6947731971740723,
-0.19420093297958374,
-0.28164517879486084,
0.1936519294977188,
0.29534462094306946,
0.0969010591506958,
-0.2590813934803009,
-0.14275234937667847,
-0.04852497950196266,
-0.2132924497127533,
0.07613282650709152,
-0.2988337576389313,
-0.28628793358802795,
0.24385008215904236,
-0.13980579376220703,
-0.08749482035636902,
-0.006639562547206879,
-0.08753608167171478,
0.19047045707702637,
-0.14693842828273773,
-0.5598123073577881,
-0.004423849284648895,
-0.21065488457679749,
0.007050134241580963,
-0.11820856481790543,
0.025672858580946922,
0.22908291220664978,
0.1722102016210556,
-0.16783905029296875,
-0.01568537950515747,
-0.08737492561340332,
0.1434869021177292,
0.10982977598905563,
0.0887177512049675,
-0.17036542296409607,
0.5233087539672852,
0.12521488964557648,
0.5978509783744812,
0.27304577827453613,
-0.005678401328623295,
0.22543834149837494,
-0.266295462846756,
0.25776833295822144,
-0.24693474173545837,
-0.2867079973220825,
0.0808255672454834,
0.007529310882091522,
-0.05261500924825668,
0.3871223032474518,
-0.11665841937065125,
0.185812309384346,
0.0837516039609909,
0.05108854919672012,
-0.1649918258190155,
-0.32635509967803955,
-0.008387058041989803,
0.025720542296767235,
0.11118236184120178,
0.11546316742897034,
-0.08852685242891312,
0.01270584762096405,
0.07772835344076157,
-0.007710874080657959,
0.05288158729672432,
0.011503346264362335,
0.06222471967339516,
-0.1783922016620636,
0.04633935168385506,
-0.25163137912750244,
0.05151405185461044,
0.15341490507125854,
0.022861246019601822,
0.010419070720672607,
-0.09445591270923615,
0.1127588227391243,
0.09837917238473892,
0.472431480884552,
0.21843238174915314,
0.2747613191604614,
0.1048775166273117,
-0.12050057202577591,
-0.18396401405334473,
-0.21845820546150208,
-0.33123382925987244,
0.07299551367759705,
0.2721790075302124,
0.7909634709358215,
-0.649622917175293,
-0.05051303282380104,
0.4538895785808563,
0.2892705202102661,
-0.15391764044761658,
0.12368139624595642,
-0.2559513449668884,
-0.1631239354610443,
-0.4025355577468872,
0.2716025412082672,
0.17295484244823456,
0.38508906960487366,
0.0483628511428833,
-0.08954571187496185,
-0.05333463102579117,
-0.09467261284589767,
0.07527107000350952,
0.1286337673664093,
0.2866211235523224,
-0.0739860087633133,
0.1098271906375885,
-0.09300802648067474,
0.21096697449684143,
0.025605106726288795,
0.7117032408714294,
-0.13229015469551086,
-0.2453993558883667,
0.04557788372039795,
-0.24667437374591827,
0.0497819259762764,
0.17436599731445312,
-0.024543728679418564,
-0.038217607885599136,
-0.08243708312511444,
0.2383478432893753,
-0.08800950646400452,
0.3615918457508087,
0.4777933359146118,
-0.12591871619224548,
-0.4248642921447754,
-0.42610421776771545,
0.22480140626430511,
0.04750389605760574,
-0.05554059147834778,
0.3285316824913025,
-0.011316467076539993,
-0.21603098511695862,
0.14226576685905457,
-0.16416844725608826,
0.8346702456474304,
-0.01440051943063736,
0.11634523421525955,
0.4014773666858673,
-0.42818278074264526,
0.25679120421409607,
-0.30012524127960205,
-0.023379959166049957,
-0.26462793350219727,
-0.07259571552276611,
0.07692789286375046,
-0.05812939628958702,
0.20267900824546814,
0.4314551055431366,
-0.1136721521615982,
0.33940330147743225,
0.18433907628059387,
0.328558087348938,
-0.14968915283679962,
0.4750936031341553,
0.1755165010690689,
0.11792406439781189,
-0.2513613998889923,
0.17275777459144592,
0.034715600311756134,
-0.13737964630126953,
0.028913188725709915,
-0.061546243727207184,
0.031183436512947083,
-0.2917725443840027,
-0.024568885564804077,
-0.033135026693344116,
-0.11291757971048355,
0.30444812774658203,
-0.25066760182380676,
-0.3719501495361328,
-0.09503266215324402,
-0.04324209317564964,
-0.29394176602363586,
0.10198251903057098,
-0.018206855282187462,
0.26496896147727966,
0.006620293483138084,
-0.03493184968829155,
-0.11574714630842209,
-0.01608641818165779,
-0.003863966092467308,
-0.1568024605512619,
-0.18086649477481842,
-0.09386911243200302,
-0.08801276981830597,
-0.2517656683921814,
-0.14019693434238434,
0.3171793520450592,
0.30948373675346375,
-0.5553622245788574,
-0.1461198478937149,
-0.14597578346729279,
-0.10740285366773605,
-0.3700966536998749,
0.17185738682746887,
-0.3264642655849457,
-0.16680029034614563,
0.03887680917978287,
-0.04388006776571274,
-0.4088277816772461,
-0.2566623091697693,
0.18160764873027802,
0.22487396001815796,
0.20259183645248413,
0.5038830041885376,
-0.08837511390447617,
-0.28042617440223694,
-0.2988913059234619,
0.09444895386695862,
0.13597442209720612,
-0.2823508381843567,
0.12303832918405533,
-0.13503603637218475,
-0.05714760720729828,
0.1998957395553589,
-0.07720538228750229,
0.2272135317325592,
0.11571705341339111,
0.06996206939220428,
-0.36584141850471497,
-0.13756555318832397,
-0.005183789879083633,
0.05973397567868233,
0.27710357308387756,
0.2990233302116394,
0.3956863284111023,
-0.10736355930566788,
-0.06809253245592117,
-0.3958466649055481,
0.3049456477165222,
0.007406309247016907,
0.4909559190273285,
0.23390613496303558,
-0.060645826160907745,
0.15057474374771118,
0.361205518245697,
0.2739097476005554,
0.05415179952979088,
-0.12156855314970016,
-0.33541837334632874,
-0.06958489865064621,
0.0909121185541153,
-0.18980485200881958,
0.21490666270256042,
-0.1761254072189331,
-0.07327387481927872,
-0.003975158557295799,
-0.1373155415058136,
0.16682025790214539,
0.017614848911762238,
0.1318364441394806,
-0.009520523250102997,
0.48243191838264465,
-0.05582619458436966,
0.015165828168392181,
-0.16702759265899658,
-0.22425477206707,
0.3012077808380127,
0.0428282655775547,
0.16097143292427063,
-0.013052280992269516,
-0.07062488794326782,
-0.1923927217721939,
-0.10691331326961517,
0.37719929218292236,
0.07983211427927017,
0.17229358851909637,
-0.19688713550567627,
-0.1866491734981537,
0.18712753057479858,
0.5465976595878601,
0.6090094447135925,
-0.168633371591568,
-0.21931999921798706,
0.056630026549100876,
0.2648698091506958,
-0.3602132201194763,
-0.08529792726039886,
0.3661343455314636,
-0.16627147793769836,
0.1840030997991562,
0.25676387548446655,
0.1529937982559204,
0.024981185793876648,
0.008823415264487267,
0.19981153309345245,
0.27892008423805237,
-0.2886826992034912,
0.41909611225128174,
0.3547709882259369,
-0.11196955293416977,
-0.2193886637687683,
0.3314710855484009,
-0.03238869085907936,
0.2431516945362091,
0.599908709526062,
-0.04146747291088104,
0.37607112526893616,
0.24629545211791992,
-0.09538418054580688,
0.11955449730157852,
-0.02047835662961006,
-0.29438939690589905,
0.24939730763435364,
-0.012081462889909744,
-0.047124914824962616,
0.27441802620887756,
0.13440361618995667,
-0.0650959312915802,
-0.11917168647050858,
-0.24045994877815247,
0.34556639194488525,
-0.1452760547399521,
0.0018345937132835388,
0.17666172981262207,
-0.1349259465932846,
-0.36419379711151123,
0.15693676471710205,
-0.0037333182990550995,
0.21297259628772736,
0.0035355165600776672,
0.004608524963259697,
-0.019000917673110962,
-0.32100215554237366,
-0.03179421275854111,
0.011844049207866192,
0.10385853052139282,
-0.418509840965271,
0.2356724590063095,
0.428875207901001,
-0.17986968159675598,
0.11270562559366226,
0.22627590596675873,
0.4462118148803711,
0.06666672229766846,
-0.019607463851571083,
-0.1420183926820755,
-0.1052108108997345,
-0.20303109288215637,
-0.14765916764736176,
0.0289255753159523,
-0.1393536627292633,
0.21071673929691315,
0.4406188130378723,
0.25475597381591797,
-0.29201552271842957,
-0.1870744824409485,
0.18673503398895264,
-0.4614831507205963,
-0.4731268286705017,
0.3161681294441223,
-0.05330529063940048,
-0.03720530867576599,
-0.12929698824882507,
0.03757909685373306,
-0.4924267530441284,
-0.3314661979675293,
0.11546880006790161,
0.15686173737049103,
0.2732029855251312,
-0.07768326997756958,
0.11253656446933746,
0.002480311319231987,
0.4407373368740082,
-0.05403897538781166,
-0.3344731628894806,
-0.33654484152793884,
-0.3361363410949707,
-0.6100761890411377,
0.12419895827770233,
-0.41227689385414124,
-0.2720104455947876,
0.08144848793745041,
0.28278830647468567,
-0.2362753450870514,
0.05695892497897148,
0.05324020981788635,
-0.04683954641222954,
0.047190628945827484,
0.09211200475692749,
-0.24151967465877533,
-0.07538963854312897,
0.20634211599826813,
-0.09706483036279678,
0.14295831322669983,
-0.24837720394134521,
0.4040428400039673,
-0.09845435619354248,
0.14364750683307648,
-0.0415184386074543,
-0.17581957578659058,
0.17178642749786377,
-0.005960982292890549,
0.2899016737937927,
0.23704759776592255,
0.34011268615722656,
-0.26866793632507324,
-0.1610575020313263,
-0.0666171982884407,
-0.05464472621679306,
-0.18432249128818512,
0.6407705545425415,
0.10433304309844971,
0.32872843742370605,
-0.11637386679649353,
-0.0005659149028360844,
-0.3491601049900055,
0.22799113392829895,
0.02474275976419449,
-0.17110112309455872,
0.03726762533187866,
-0.0337248370051384,
-0.0344015508890152,
0.3026396930217743,
-0.07424690574407578,
0.2767486274242401,
0.033142201602458954,
0.034437015652656555,
-0.0023770183324813843,
-0.6050345301628113,
0.5183269381523132,
-0.30721303820610046,
-0.5018857717514038,
-0.11568183451890945,
0.180986225605011,
0.20159803330898285,
0.3526686429977417,
-0.5205014944076538,
0.19413234293460846,
0.4587147533893585,
-0.05027499794960022,
-0.12158769369125366,
0.22748513519763947,
0.07665365934371948,
-0.03499516844749451,
0.10871738195419312,
0.2233411967754364,
0.28327834606170654,
-0.33326858282089233,
0.13019385933876038,
-0.22924146056175232
] |
https://github.com/huggingface/datasets/issues/6272 | Arf `"**/*/{keyword}[{sep}/]**"` does return `data/keyword.txt` in latest `fsspec` but not in `glob.glob`
EDIT: actually forgot to set `recursive=True` | Duplicate `data_files` when named `<split>/<split>.parquet` | e.g. with `u23429/stock_1_minute_ticker`
```ipython
In [1]: from datasets import *
In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker")
Downloading readme: 100%|ββββββββββββββββββββββββββ| 627/627 [00:00<00:00, 246kB/s]
In [3]: b.config.data_files
Out[3]:
{NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'],
NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'],
NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']}
```
This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko | 18 | Duplicate `data_files` when named `<split>/<split>.parquet`
e.g. with `u23429/stock_1_minute_ticker`
```ipython
In [1]: from datasets import *
In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker")
Downloading readme: 100%|ββββββββββββββββββββββββββ| 627/627 [00:00<00:00, 246kB/s]
In [3]: b.config.data_files
Out[3]:
{NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'],
NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'],
NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']}
```
This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
Arf `"**/*/{keyword}[{sep}/]**"` does return `data/keyword.txt` in latest `fsspec` but not in `glob.glob`
EDIT: actually forgot to set `recursive=True` | [
-0.30908650159835815,
-0.11631924659013748,
-0.11791282892227173,
0.39790865778923035,
0.30234766006469727,
0.1111975759267807,
0.3349858820438385,
0.4634609818458557,
0.019552171230316162,
0.3075334429740906,
-0.10650788247585297,
0.324413001537323,
-0.08251963555812836,
0.25816643238067627,
0.016248896718025208,
0.009527147747576237,
-0.030174411833286285,
0.22384440898895264,
0.028409359976649284,
-0.033552512526512146,
0.022426076233386993,
0.09839514642953873,
0.0755636990070343,
0.11592554301023483,
-0.2304082214832306,
-0.023290473967790604,
-0.02988271787762642,
0.24672742187976837,
-0.30624833703041077,
-0.48090851306915283,
0.11290408670902252,
-0.16473078727722168,
-0.13549676537513733,
0.4876673221588135,
-0.00010876324085984379,
0.0885191261768341,
0.2490713745355606,
-0.03963345289230347,
-0.26976069808006287,
-0.08975547552108765,
-0.3295462131500244,
-0.1833774447441101,
0.19111692905426025,
-0.4548946022987366,
-0.1313847303390503,
-0.3222501277923584,
-0.0399552620947361,
-0.012054301798343658,
0.6052088737487793,
0.45798614621162415,
0.19898906350135803,
0.24281495809555054,
-0.06401003897190094,
-0.07273028790950775,
0.4250287413597107,
0.18993283808231354,
0.016399189829826355,
0.12362003326416016,
0.05834488570690155,
0.12629732489585876,
0.03128882497549057,
0.3099825978279114,
0.08301908522844315,
0.17814189195632935,
-0.15965783596038818,
0.03259650245308876,
-0.034125249832868576,
-0.09666106104850769,
0.08668388426303864,
0.19245366752147675,
-0.0002621188759803772,
-0.2389184534549713,
-0.0451190322637558,
-0.4948391318321228,
-0.11280800402164459,
-0.5054447650909424,
0.03792106360197067,
0.36668747663497925,
0.07213449478149414,
0.06790243089199066,
0.04607652500271797,
0.10920915752649307,
-0.014980442821979523,
-0.027875825762748718,
-0.06097063422203064,
0.4724966883659363,
-0.08253717422485352,
0.13710595667362213,
0.023655656725168228,
0.0074592288583517075,
0.07069669663906097,
-0.2641391456127167,
0.0002634236589074135,
-0.06898146867752075,
-0.13466468453407288,
-0.06310418248176575,
-0.13225772976875305,
-0.0679907351732254,
-0.07578959316015244,
0.13633036613464355,
-0.1939459890127182,
-0.09159719944000244,
0.3524767756462097,
0.07633096724748611,
0.1539892852306366,
-0.2197299599647522,
-0.11748814582824707,
0.5034672021865845,
0.037931062281131744,
0.35104066133499146,
-0.341068834066391,
-0.09321184456348419,
0.005437258630990982,
-0.0025818385183811188,
-0.013516850769519806,
-0.028163276612758636,
0.36392462253570557,
-0.08923953771591187,
-0.5344590544700623,
0.0480906218290329,
-0.04423839598894119,
-0.20882132649421692,
0.04411459341645241,
0.14854563772678375,
-0.06397178024053574,
0.026107165962457657,
-0.2818061411380768,
0.1878909170627594,
-0.24726548790931702,
-0.2214125096797943,
-0.3558864891529083,
0.27231210470199585,
-0.17732569575309753,
-0.02489328570663929,
0.10383401811122894,
0.020593293011188507,
0.4593062400817871,
0.3083874583244324,
0.109681636095047,
-0.2183406502008438,
0.27528640627861023,
-0.0851624459028244,
-0.21675512194633484,
0.223927304148674,
-0.024502627551555634,
0.09617883712053299,
0.1837536245584488,
-0.15333192050457,
-0.11965896189212799,
0.02744261920452118,
-0.3033311069011688,
-0.3394900858402252,
-0.17173826694488525,
0.2923870384693146,
0.04607507586479187,
0.12958993017673492,
-0.09007138758897781,
0.004639427177608013,
0.20783667266368866,
-0.10068926215171814,
-0.18230193853378296,
-0.19717618823051453,
-0.10425719618797302,
-0.14557617902755737,
0.030050240457057953,
0.3476787805557251,
-0.14823243021965027,
-0.16295073926448822,
-0.1039557158946991,
-0.02832123637199402,
0.3495420217514038,
0.3119150698184967,
-0.3696371614933014,
0.26498445868492126,
-0.2805452048778534,
0.25216174125671387,
0.6477166414260864,
-0.2672576606273651,
-0.16731375455856323,
0.09286420792341232,
-0.2249927818775177,
0.10848551243543625,
0.5010205507278442,
-0.10518021881580353,
0.4092772305011749,
-0.0011238008737564087,
-0.07370777428150177,
-0.07966708391904831,
0.019716190174221992,
-0.13920113444328308,
-0.34030598402023315,
0.03422684967517853,
0.10484182834625244,
0.11124107241630554,
-0.1482967585325241,
-0.3527791202068329,
0.13723623752593994,
0.2014131098985672,
0.2860555350780487,
-0.15952691435813904,
0.07250400632619858,
-0.02437558025121689,
0.01183840911835432,
0.34652796387672424,
-0.08550494909286499,
-0.3769909739494324,
-0.21148893237113953,
0.1158834770321846,
-0.21873381733894348,
-0.05105643719434738,
-0.2256711721420288,
-0.34895575046539307,
-0.5518126487731934,
-0.03426928073167801,
-0.4720977246761322,
-0.26476556062698364,
0.21683551371097565,
0.362338662147522,
-0.1072140634059906,
-0.17754130065441132,
-0.20018941164016724,
0.12501542270183563,
-0.15995675325393677,
0.12896324694156647,
-0.21122655272483826,
0.25302544236183167,
-0.2928012013435364,
-0.1666465550661087,
0.18420690298080444,
0.0794035792350769,
0.25712645053863525,
-0.046573273837566376,
0.07089535892009735,
0.29827436804771423,
0.3406228721141815,
0.10271558165550232,
0.135273277759552,
0.03595702350139618,
0.09788250923156738,
0.04823268949985504,
-0.04455127194523811,
-0.02711065113544464,
0.007657554000616074,
-0.09807926416397095,
-0.46031075716018677,
0.346666157245636,
0.21137672662734985,
0.041413478553295135,
0.0046343207359313965,
-0.310100793838501,
0.24220305681228638,
-0.13204829394817352,
-0.05781057849526405,
-0.18709354102611542,
0.0829005315899849,
0.19487972557544708,
-0.02947237342596054,
0.19460928440093994,
-0.4104606509208679,
0.19726017117500305,
0.5507493615150452,
-0.17835943400859833,
-0.11920270323753357,
0.017534147948026657,
-0.004908442497253418,
-0.13466323912143707,
-0.08866644650697708,
0.28791847825050354,
0.28160226345062256,
0.2714698612689972,
0.32343578338623047,
0.09122961014509201,
-0.12928448617458344,
-0.22684063017368317,
0.23285265266895294,
0.005213309079408646,
-0.053232382982969284,
0.28079915046691895,
0.09549565613269806,
-0.21883684396743774,
-0.4679564833641052,
-0.14015907049179077,
0.18631070852279663,
0.09485489875078201,
-0.253265380859375,
0.03756225109100342,
-0.478381872177124,
-0.005713500082492828,
-0.626946210861206,
0.19972342252731323,
0.046253375709056854,
-0.3058737516403198,
0.1796007603406906,
0.384112149477005,
-0.057115353643894196,
0.2114524096250534,
0.04870186746120453,
-0.022495120763778687,
0.11463023722171783,
-0.15102577209472656,
-0.1696767807006836,
-0.1304750144481659,
-0.20537316799163818,
0.19766885042190552,
0.17654450237751007,
0.22028730809688568,
0.42170530557632446,
-0.18177200853824615,
-0.019456636160612106,
-0.22618916630744934,
-0.4400518536567688,
0.05717313662171364,
-0.06451817601919174,
0.08421263843774796,
0.2018129825592041,
0.19486108422279358,
0.14703646302223206,
-0.3549288511276245,
0.26222726702690125,
0.28262534737586975,
-0.12071843445301056,
-0.2414572536945343,
-0.10246169567108154,
-0.06823710352182388,
-0.012420162558555603,
-0.6947731971740723,
-0.19420093297958374,
-0.28164517879486084,
0.1936519294977188,
0.29534462094306946,
0.0969010591506958,
-0.2590813934803009,
-0.14275234937667847,
-0.04852497950196266,
-0.2132924497127533,
0.07613282650709152,
-0.2988337576389313,
-0.28628793358802795,
0.24385008215904236,
-0.13980579376220703,
-0.08749482035636902,
-0.006639562547206879,
-0.08753608167171478,
0.19047045707702637,
-0.14693842828273773,
-0.5598123073577881,
-0.004423849284648895,
-0.21065488457679749,
0.007050134241580963,
-0.11820856481790543,
0.025672858580946922,
0.22908291220664978,
0.1722102016210556,
-0.16783905029296875,
-0.01568537950515747,
-0.08737492561340332,
0.1434869021177292,
0.10982977598905563,
0.0887177512049675,
-0.17036542296409607,
0.5233087539672852,
0.12521488964557648,
0.5978509783744812,
0.27304577827453613,
-0.005678401328623295,
0.22543834149837494,
-0.266295462846756,
0.25776833295822144,
-0.24693474173545837,
-0.2867079973220825,
0.0808255672454834,
0.007529310882091522,
-0.05261500924825668,
0.3871223032474518,
-0.11665841937065125,
0.185812309384346,
0.0837516039609909,
0.05108854919672012,
-0.1649918258190155,
-0.32635509967803955,
-0.008387058041989803,
0.025720542296767235,
0.11118236184120178,
0.11546316742897034,
-0.08852685242891312,
0.01270584762096405,
0.07772835344076157,
-0.007710874080657959,
0.05288158729672432,
0.011503346264362335,
0.06222471967339516,
-0.1783922016620636,
0.04633935168385506,
-0.25163137912750244,
0.05151405185461044,
0.15341490507125854,
0.022861246019601822,
0.010419070720672607,
-0.09445591270923615,
0.1127588227391243,
0.09837917238473892,
0.472431480884552,
0.21843238174915314,
0.2747613191604614,
0.1048775166273117,
-0.12050057202577591,
-0.18396401405334473,
-0.21845820546150208,
-0.33123382925987244,
0.07299551367759705,
0.2721790075302124,
0.7909634709358215,
-0.649622917175293,
-0.05051303282380104,
0.4538895785808563,
0.2892705202102661,
-0.15391764044761658,
0.12368139624595642,
-0.2559513449668884,
-0.1631239354610443,
-0.4025355577468872,
0.2716025412082672,
0.17295484244823456,
0.38508906960487366,
0.0483628511428833,
-0.08954571187496185,
-0.05333463102579117,
-0.09467261284589767,
0.07527107000350952,
0.1286337673664093,
0.2866211235523224,
-0.0739860087633133,
0.1098271906375885,
-0.09300802648067474,
0.21096697449684143,
0.025605106726288795,
0.7117032408714294,
-0.13229015469551086,
-0.2453993558883667,
0.04557788372039795,
-0.24667437374591827,
0.0497819259762764,
0.17436599731445312,
-0.024543728679418564,
-0.038217607885599136,
-0.08243708312511444,
0.2383478432893753,
-0.08800950646400452,
0.3615918457508087,
0.4777933359146118,
-0.12591871619224548,
-0.4248642921447754,
-0.42610421776771545,
0.22480140626430511,
0.04750389605760574,
-0.05554059147834778,
0.3285316824913025,
-0.011316467076539993,
-0.21603098511695862,
0.14226576685905457,
-0.16416844725608826,
0.8346702456474304,
-0.01440051943063736,
0.11634523421525955,
0.4014773666858673,
-0.42818278074264526,
0.25679120421409607,
-0.30012524127960205,
-0.023379959166049957,
-0.26462793350219727,
-0.07259571552276611,
0.07692789286375046,
-0.05812939628958702,
0.20267900824546814,
0.4314551055431366,
-0.1136721521615982,
0.33940330147743225,
0.18433907628059387,
0.328558087348938,
-0.14968915283679962,
0.4750936031341553,
0.1755165010690689,
0.11792406439781189,
-0.2513613998889923,
0.17275777459144592,
0.034715600311756134,
-0.13737964630126953,
0.028913188725709915,
-0.061546243727207184,
0.031183436512947083,
-0.2917725443840027,
-0.024568885564804077,
-0.033135026693344116,
-0.11291757971048355,
0.30444812774658203,
-0.25066760182380676,
-0.3719501495361328,
-0.09503266215324402,
-0.04324209317564964,
-0.29394176602363586,
0.10198251903057098,
-0.018206855282187462,
0.26496896147727966,
0.006620293483138084,
-0.03493184968829155,
-0.11574714630842209,
-0.01608641818165779,
-0.003863966092467308,
-0.1568024605512619,
-0.18086649477481842,
-0.09386911243200302,
-0.08801276981830597,
-0.2517656683921814,
-0.14019693434238434,
0.3171793520450592,
0.30948373675346375,
-0.5553622245788574,
-0.1461198478937149,
-0.14597578346729279,
-0.10740285366773605,
-0.3700966536998749,
0.17185738682746887,
-0.3264642655849457,
-0.16680029034614563,
0.03887680917978287,
-0.04388006776571274,
-0.4088277816772461,
-0.2566623091697693,
0.18160764873027802,
0.22487396001815796,
0.20259183645248413,
0.5038830041885376,
-0.08837511390447617,
-0.28042617440223694,
-0.2988913059234619,
0.09444895386695862,
0.13597442209720612,
-0.2823508381843567,
0.12303832918405533,
-0.13503603637218475,
-0.05714760720729828,
0.1998957395553589,
-0.07720538228750229,
0.2272135317325592,
0.11571705341339111,
0.06996206939220428,
-0.36584141850471497,
-0.13756555318832397,
-0.005183789879083633,
0.05973397567868233,
0.27710357308387756,
0.2990233302116394,
0.3956863284111023,
-0.10736355930566788,
-0.06809253245592117,
-0.3958466649055481,
0.3049456477165222,
0.007406309247016907,
0.4909559190273285,
0.23390613496303558,
-0.060645826160907745,
0.15057474374771118,
0.361205518245697,
0.2739097476005554,
0.05415179952979088,
-0.12156855314970016,
-0.33541837334632874,
-0.06958489865064621,
0.0909121185541153,
-0.18980485200881958,
0.21490666270256042,
-0.1761254072189331,
-0.07327387481927872,
-0.003975158557295799,
-0.1373155415058136,
0.16682025790214539,
0.017614848911762238,
0.1318364441394806,
-0.009520523250102997,
0.48243191838264465,
-0.05582619458436966,
0.015165828168392181,
-0.16702759265899658,
-0.22425477206707,
0.3012077808380127,
0.0428282655775547,
0.16097143292427063,
-0.013052280992269516,
-0.07062488794326782,
-0.1923927217721939,
-0.10691331326961517,
0.37719929218292236,
0.07983211427927017,
0.17229358851909637,
-0.19688713550567627,
-0.1866491734981537,
0.18712753057479858,
0.5465976595878601,
0.6090094447135925,
-0.168633371591568,
-0.21931999921798706,
0.056630026549100876,
0.2648698091506958,
-0.3602132201194763,
-0.08529792726039886,
0.3661343455314636,
-0.16627147793769836,
0.1840030997991562,
0.25676387548446655,
0.1529937982559204,
0.024981185793876648,
0.008823415264487267,
0.19981153309345245,
0.27892008423805237,
-0.2886826992034912,
0.41909611225128174,
0.3547709882259369,
-0.11196955293416977,
-0.2193886637687683,
0.3314710855484009,
-0.03238869085907936,
0.2431516945362091,
0.599908709526062,
-0.04146747291088104,
0.37607112526893616,
0.24629545211791992,
-0.09538418054580688,
0.11955449730157852,
-0.02047835662961006,
-0.29438939690589905,
0.24939730763435364,
-0.012081462889909744,
-0.047124914824962616,
0.27441802620887756,
0.13440361618995667,
-0.0650959312915802,
-0.11917168647050858,
-0.24045994877815247,
0.34556639194488525,
-0.1452760547399521,
0.0018345937132835388,
0.17666172981262207,
-0.1349259465932846,
-0.36419379711151123,
0.15693676471710205,
-0.0037333182990550995,
0.21297259628772736,
0.0035355165600776672,
0.004608524963259697,
-0.019000917673110962,
-0.32100215554237366,
-0.03179421275854111,
0.011844049207866192,
0.10385853052139282,
-0.418509840965271,
0.2356724590063095,
0.428875207901001,
-0.17986968159675598,
0.11270562559366226,
0.22627590596675873,
0.4462118148803711,
0.06666672229766846,
-0.019607463851571083,
-0.1420183926820755,
-0.1052108108997345,
-0.20303109288215637,
-0.14765916764736176,
0.0289255753159523,
-0.1393536627292633,
0.21071673929691315,
0.4406188130378723,
0.25475597381591797,
-0.29201552271842957,
-0.1870744824409485,
0.18673503398895264,
-0.4614831507205963,
-0.4731268286705017,
0.3161681294441223,
-0.05330529063940048,
-0.03720530867576599,
-0.12929698824882507,
0.03757909685373306,
-0.4924267530441284,
-0.3314661979675293,
0.11546880006790161,
0.15686173737049103,
0.2732029855251312,
-0.07768326997756958,
0.11253656446933746,
0.002480311319231987,
0.4407373368740082,
-0.05403897538781166,
-0.3344731628894806,
-0.33654484152793884,
-0.3361363410949707,
-0.6100761890411377,
0.12419895827770233,
-0.41227689385414124,
-0.2720104455947876,
0.08144848793745041,
0.28278830647468567,
-0.2362753450870514,
0.05695892497897148,
0.05324020981788635,
-0.04683954641222954,
0.047190628945827484,
0.09211200475692749,
-0.24151967465877533,
-0.07538963854312897,
0.20634211599826813,
-0.09706483036279678,
0.14295831322669983,
-0.24837720394134521,
0.4040428400039673,
-0.09845435619354248,
0.14364750683307648,
-0.0415184386074543,
-0.17581957578659058,
0.17178642749786377,
-0.005960982292890549,
0.2899016737937927,
0.23704759776592255,
0.34011268615722656,
-0.26866793632507324,
-0.1610575020313263,
-0.0666171982884407,
-0.05464472621679306,
-0.18432249128818512,
0.6407705545425415,
0.10433304309844971,
0.32872843742370605,
-0.11637386679649353,
-0.0005659149028360844,
-0.3491601049900055,
0.22799113392829895,
0.02474275976419449,
-0.17110112309455872,
0.03726762533187866,
-0.0337248370051384,
-0.0344015508890152,
0.3026396930217743,
-0.07424690574407578,
0.2767486274242401,
0.033142201602458954,
0.034437015652656555,
-0.0023770183324813843,
-0.6050345301628113,
0.5183269381523132,
-0.30721303820610046,
-0.5018857717514038,
-0.11568183451890945,
0.180986225605011,
0.20159803330898285,
0.3526686429977417,
-0.5205014944076538,
0.19413234293460846,
0.4587147533893585,
-0.05027499794960022,
-0.12158769369125366,
0.22748513519763947,
0.07665365934371948,
-0.03499516844749451,
0.10871738195419312,
0.2233411967754364,
0.28327834606170654,
-0.33326858282089233,
0.13019385933876038,
-0.22924146056175232
] |
https://github.com/huggingface/datasets/issues/6272 | > I think it's best to drop duplicates with a set (as a temporary fix)
I started https://github.com/huggingface/datasets/pull/6278 to use DataFilesSet objects instead of DataFilesList | Duplicate `data_files` when named `<split>/<split>.parquet` | e.g. with `u23429/stock_1_minute_ticker`
```ipython
In [1]: from datasets import *
In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker")
Downloading readme: 100%|ββββββββββββββββββββββββββ| 627/627 [00:00<00:00, 246kB/s]
In [3]: b.config.data_files
Out[3]:
{NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'],
NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'],
NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']}
```
This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko | 25 | Duplicate `data_files` when named `<split>/<split>.parquet`
e.g. with `u23429/stock_1_minute_ticker`
```ipython
In [1]: from datasets import *
In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker")
Downloading readme: 100%|ββββββββββββββββββββββββββ| 627/627 [00:00<00:00, 246kB/s]
In [3]: b.config.data_files
Out[3]:
{NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'],
NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'],
NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']}
```
This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
> I think it's best to drop duplicates with a set (as a temporary fix)
I started https://github.com/huggingface/datasets/pull/6278 to use DataFilesSet objects instead of DataFilesList | [
-0.30908650159835815,
-0.11631924659013748,
-0.11791282892227173,
0.39790865778923035,
0.30234766006469727,
0.1111975759267807,
0.3349858820438385,
0.4634609818458557,
0.019552171230316162,
0.3075334429740906,
-0.10650788247585297,
0.324413001537323,
-0.08251963555812836,
0.25816643238067627,
0.016248896718025208,
0.009527147747576237,
-0.030174411833286285,
0.22384440898895264,
0.028409359976649284,
-0.033552512526512146,
0.022426076233386993,
0.09839514642953873,
0.0755636990070343,
0.11592554301023483,
-0.2304082214832306,
-0.023290473967790604,
-0.02988271787762642,
0.24672742187976837,
-0.30624833703041077,
-0.48090851306915283,
0.11290408670902252,
-0.16473078727722168,
-0.13549676537513733,
0.4876673221588135,
-0.00010876324085984379,
0.0885191261768341,
0.2490713745355606,
-0.03963345289230347,
-0.26976069808006287,
-0.08975547552108765,
-0.3295462131500244,
-0.1833774447441101,
0.19111692905426025,
-0.4548946022987366,
-0.1313847303390503,
-0.3222501277923584,
-0.0399552620947361,
-0.012054301798343658,
0.6052088737487793,
0.45798614621162415,
0.19898906350135803,
0.24281495809555054,
-0.06401003897190094,
-0.07273028790950775,
0.4250287413597107,
0.18993283808231354,
0.016399189829826355,
0.12362003326416016,
0.05834488570690155,
0.12629732489585876,
0.03128882497549057,
0.3099825978279114,
0.08301908522844315,
0.17814189195632935,
-0.15965783596038818,
0.03259650245308876,
-0.034125249832868576,
-0.09666106104850769,
0.08668388426303864,
0.19245366752147675,
-0.0002621188759803772,
-0.2389184534549713,
-0.0451190322637558,
-0.4948391318321228,
-0.11280800402164459,
-0.5054447650909424,
0.03792106360197067,
0.36668747663497925,
0.07213449478149414,
0.06790243089199066,
0.04607652500271797,
0.10920915752649307,
-0.014980442821979523,
-0.027875825762748718,
-0.06097063422203064,
0.4724966883659363,
-0.08253717422485352,
0.13710595667362213,
0.023655656725168228,
0.0074592288583517075,
0.07069669663906097,
-0.2641391456127167,
0.0002634236589074135,
-0.06898146867752075,
-0.13466468453407288,
-0.06310418248176575,
-0.13225772976875305,
-0.0679907351732254,
-0.07578959316015244,
0.13633036613464355,
-0.1939459890127182,
-0.09159719944000244,
0.3524767756462097,
0.07633096724748611,
0.1539892852306366,
-0.2197299599647522,
-0.11748814582824707,
0.5034672021865845,
0.037931062281131744,
0.35104066133499146,
-0.341068834066391,
-0.09321184456348419,
0.005437258630990982,
-0.0025818385183811188,
-0.013516850769519806,
-0.028163276612758636,
0.36392462253570557,
-0.08923953771591187,
-0.5344590544700623,
0.0480906218290329,
-0.04423839598894119,
-0.20882132649421692,
0.04411459341645241,
0.14854563772678375,
-0.06397178024053574,
0.026107165962457657,
-0.2818061411380768,
0.1878909170627594,
-0.24726548790931702,
-0.2214125096797943,
-0.3558864891529083,
0.27231210470199585,
-0.17732569575309753,
-0.02489328570663929,
0.10383401811122894,
0.020593293011188507,
0.4593062400817871,
0.3083874583244324,
0.109681636095047,
-0.2183406502008438,
0.27528640627861023,
-0.0851624459028244,
-0.21675512194633484,
0.223927304148674,
-0.024502627551555634,
0.09617883712053299,
0.1837536245584488,
-0.15333192050457,
-0.11965896189212799,
0.02744261920452118,
-0.3033311069011688,
-0.3394900858402252,
-0.17173826694488525,
0.2923870384693146,
0.04607507586479187,
0.12958993017673492,
-0.09007138758897781,
0.004639427177608013,
0.20783667266368866,
-0.10068926215171814,
-0.18230193853378296,
-0.19717618823051453,
-0.10425719618797302,
-0.14557617902755737,
0.030050240457057953,
0.3476787805557251,
-0.14823243021965027,
-0.16295073926448822,
-0.1039557158946991,
-0.02832123637199402,
0.3495420217514038,
0.3119150698184967,
-0.3696371614933014,
0.26498445868492126,
-0.2805452048778534,
0.25216174125671387,
0.6477166414260864,
-0.2672576606273651,
-0.16731375455856323,
0.09286420792341232,
-0.2249927818775177,
0.10848551243543625,
0.5010205507278442,
-0.10518021881580353,
0.4092772305011749,
-0.0011238008737564087,
-0.07370777428150177,
-0.07966708391904831,
0.019716190174221992,
-0.13920113444328308,
-0.34030598402023315,
0.03422684967517853,
0.10484182834625244,
0.11124107241630554,
-0.1482967585325241,
-0.3527791202068329,
0.13723623752593994,
0.2014131098985672,
0.2860555350780487,
-0.15952691435813904,
0.07250400632619858,
-0.02437558025121689,
0.01183840911835432,
0.34652796387672424,
-0.08550494909286499,
-0.3769909739494324,
-0.21148893237113953,
0.1158834770321846,
-0.21873381733894348,
-0.05105643719434738,
-0.2256711721420288,
-0.34895575046539307,
-0.5518126487731934,
-0.03426928073167801,
-0.4720977246761322,
-0.26476556062698364,
0.21683551371097565,
0.362338662147522,
-0.1072140634059906,
-0.17754130065441132,
-0.20018941164016724,
0.12501542270183563,
-0.15995675325393677,
0.12896324694156647,
-0.21122655272483826,
0.25302544236183167,
-0.2928012013435364,
-0.1666465550661087,
0.18420690298080444,
0.0794035792350769,
0.25712645053863525,
-0.046573273837566376,
0.07089535892009735,
0.29827436804771423,
0.3406228721141815,
0.10271558165550232,
0.135273277759552,
0.03595702350139618,
0.09788250923156738,
0.04823268949985504,
-0.04455127194523811,
-0.02711065113544464,
0.007657554000616074,
-0.09807926416397095,
-0.46031075716018677,
0.346666157245636,
0.21137672662734985,
0.041413478553295135,
0.0046343207359313965,
-0.310100793838501,
0.24220305681228638,
-0.13204829394817352,
-0.05781057849526405,
-0.18709354102611542,
0.0829005315899849,
0.19487972557544708,
-0.02947237342596054,
0.19460928440093994,
-0.4104606509208679,
0.19726017117500305,
0.5507493615150452,
-0.17835943400859833,
-0.11920270323753357,
0.017534147948026657,
-0.004908442497253418,
-0.13466323912143707,
-0.08866644650697708,
0.28791847825050354,
0.28160226345062256,
0.2714698612689972,
0.32343578338623047,
0.09122961014509201,
-0.12928448617458344,
-0.22684063017368317,
0.23285265266895294,
0.005213309079408646,
-0.053232382982969284,
0.28079915046691895,
0.09549565613269806,
-0.21883684396743774,
-0.4679564833641052,
-0.14015907049179077,
0.18631070852279663,
0.09485489875078201,
-0.253265380859375,
0.03756225109100342,
-0.478381872177124,
-0.005713500082492828,
-0.626946210861206,
0.19972342252731323,
0.046253375709056854,
-0.3058737516403198,
0.1796007603406906,
0.384112149477005,
-0.057115353643894196,
0.2114524096250534,
0.04870186746120453,
-0.022495120763778687,
0.11463023722171783,
-0.15102577209472656,
-0.1696767807006836,
-0.1304750144481659,
-0.20537316799163818,
0.19766885042190552,
0.17654450237751007,
0.22028730809688568,
0.42170530557632446,
-0.18177200853824615,
-0.019456636160612106,
-0.22618916630744934,
-0.4400518536567688,
0.05717313662171364,
-0.06451817601919174,
0.08421263843774796,
0.2018129825592041,
0.19486108422279358,
0.14703646302223206,
-0.3549288511276245,
0.26222726702690125,
0.28262534737586975,
-0.12071843445301056,
-0.2414572536945343,
-0.10246169567108154,
-0.06823710352182388,
-0.012420162558555603,
-0.6947731971740723,
-0.19420093297958374,
-0.28164517879486084,
0.1936519294977188,
0.29534462094306946,
0.0969010591506958,
-0.2590813934803009,
-0.14275234937667847,
-0.04852497950196266,
-0.2132924497127533,
0.07613282650709152,
-0.2988337576389313,
-0.28628793358802795,
0.24385008215904236,
-0.13980579376220703,
-0.08749482035636902,
-0.006639562547206879,
-0.08753608167171478,
0.19047045707702637,
-0.14693842828273773,
-0.5598123073577881,
-0.004423849284648895,
-0.21065488457679749,
0.007050134241580963,
-0.11820856481790543,
0.025672858580946922,
0.22908291220664978,
0.1722102016210556,
-0.16783905029296875,
-0.01568537950515747,
-0.08737492561340332,
0.1434869021177292,
0.10982977598905563,
0.0887177512049675,
-0.17036542296409607,
0.5233087539672852,
0.12521488964557648,
0.5978509783744812,
0.27304577827453613,
-0.005678401328623295,
0.22543834149837494,
-0.266295462846756,
0.25776833295822144,
-0.24693474173545837,
-0.2867079973220825,
0.0808255672454834,
0.007529310882091522,
-0.05261500924825668,
0.3871223032474518,
-0.11665841937065125,
0.185812309384346,
0.0837516039609909,
0.05108854919672012,
-0.1649918258190155,
-0.32635509967803955,
-0.008387058041989803,
0.025720542296767235,
0.11118236184120178,
0.11546316742897034,
-0.08852685242891312,
0.01270584762096405,
0.07772835344076157,
-0.007710874080657959,
0.05288158729672432,
0.011503346264362335,
0.06222471967339516,
-0.1783922016620636,
0.04633935168385506,
-0.25163137912750244,
0.05151405185461044,
0.15341490507125854,
0.022861246019601822,
0.010419070720672607,
-0.09445591270923615,
0.1127588227391243,
0.09837917238473892,
0.472431480884552,
0.21843238174915314,
0.2747613191604614,
0.1048775166273117,
-0.12050057202577591,
-0.18396401405334473,
-0.21845820546150208,
-0.33123382925987244,
0.07299551367759705,
0.2721790075302124,
0.7909634709358215,
-0.649622917175293,
-0.05051303282380104,
0.4538895785808563,
0.2892705202102661,
-0.15391764044761658,
0.12368139624595642,
-0.2559513449668884,
-0.1631239354610443,
-0.4025355577468872,
0.2716025412082672,
0.17295484244823456,
0.38508906960487366,
0.0483628511428833,
-0.08954571187496185,
-0.05333463102579117,
-0.09467261284589767,
0.07527107000350952,
0.1286337673664093,
0.2866211235523224,
-0.0739860087633133,
0.1098271906375885,
-0.09300802648067474,
0.21096697449684143,
0.025605106726288795,
0.7117032408714294,
-0.13229015469551086,
-0.2453993558883667,
0.04557788372039795,
-0.24667437374591827,
0.0497819259762764,
0.17436599731445312,
-0.024543728679418564,
-0.038217607885599136,
-0.08243708312511444,
0.2383478432893753,
-0.08800950646400452,
0.3615918457508087,
0.4777933359146118,
-0.12591871619224548,
-0.4248642921447754,
-0.42610421776771545,
0.22480140626430511,
0.04750389605760574,
-0.05554059147834778,
0.3285316824913025,
-0.011316467076539993,
-0.21603098511695862,
0.14226576685905457,
-0.16416844725608826,
0.8346702456474304,
-0.01440051943063736,
0.11634523421525955,
0.4014773666858673,
-0.42818278074264526,
0.25679120421409607,
-0.30012524127960205,
-0.023379959166049957,
-0.26462793350219727,
-0.07259571552276611,
0.07692789286375046,
-0.05812939628958702,
0.20267900824546814,
0.4314551055431366,
-0.1136721521615982,
0.33940330147743225,
0.18433907628059387,
0.328558087348938,
-0.14968915283679962,
0.4750936031341553,
0.1755165010690689,
0.11792406439781189,
-0.2513613998889923,
0.17275777459144592,
0.034715600311756134,
-0.13737964630126953,
0.028913188725709915,
-0.061546243727207184,
0.031183436512947083,
-0.2917725443840027,
-0.024568885564804077,
-0.033135026693344116,
-0.11291757971048355,
0.30444812774658203,
-0.25066760182380676,
-0.3719501495361328,
-0.09503266215324402,
-0.04324209317564964,
-0.29394176602363586,
0.10198251903057098,
-0.018206855282187462,
0.26496896147727966,
0.006620293483138084,
-0.03493184968829155,
-0.11574714630842209,
-0.01608641818165779,
-0.003863966092467308,
-0.1568024605512619,
-0.18086649477481842,
-0.09386911243200302,
-0.08801276981830597,
-0.2517656683921814,
-0.14019693434238434,
0.3171793520450592,
0.30948373675346375,
-0.5553622245788574,
-0.1461198478937149,
-0.14597578346729279,
-0.10740285366773605,
-0.3700966536998749,
0.17185738682746887,
-0.3264642655849457,
-0.16680029034614563,
0.03887680917978287,
-0.04388006776571274,
-0.4088277816772461,
-0.2566623091697693,
0.18160764873027802,
0.22487396001815796,
0.20259183645248413,
0.5038830041885376,
-0.08837511390447617,
-0.28042617440223694,
-0.2988913059234619,
0.09444895386695862,
0.13597442209720612,
-0.2823508381843567,
0.12303832918405533,
-0.13503603637218475,
-0.05714760720729828,
0.1998957395553589,
-0.07720538228750229,
0.2272135317325592,
0.11571705341339111,
0.06996206939220428,
-0.36584141850471497,
-0.13756555318832397,
-0.005183789879083633,
0.05973397567868233,
0.27710357308387756,
0.2990233302116394,
0.3956863284111023,
-0.10736355930566788,
-0.06809253245592117,
-0.3958466649055481,
0.3049456477165222,
0.007406309247016907,
0.4909559190273285,
0.23390613496303558,
-0.060645826160907745,
0.15057474374771118,
0.361205518245697,
0.2739097476005554,
0.05415179952979088,
-0.12156855314970016,
-0.33541837334632874,
-0.06958489865064621,
0.0909121185541153,
-0.18980485200881958,
0.21490666270256042,
-0.1761254072189331,
-0.07327387481927872,
-0.003975158557295799,
-0.1373155415058136,
0.16682025790214539,
0.017614848911762238,
0.1318364441394806,
-0.009520523250102997,
0.48243191838264465,
-0.05582619458436966,
0.015165828168392181,
-0.16702759265899658,
-0.22425477206707,
0.3012077808380127,
0.0428282655775547,
0.16097143292427063,
-0.013052280992269516,
-0.07062488794326782,
-0.1923927217721939,
-0.10691331326961517,
0.37719929218292236,
0.07983211427927017,
0.17229358851909637,
-0.19688713550567627,
-0.1866491734981537,
0.18712753057479858,
0.5465976595878601,
0.6090094447135925,
-0.168633371591568,
-0.21931999921798706,
0.056630026549100876,
0.2648698091506958,
-0.3602132201194763,
-0.08529792726039886,
0.3661343455314636,
-0.16627147793769836,
0.1840030997991562,
0.25676387548446655,
0.1529937982559204,
0.024981185793876648,
0.008823415264487267,
0.19981153309345245,
0.27892008423805237,
-0.2886826992034912,
0.41909611225128174,
0.3547709882259369,
-0.11196955293416977,
-0.2193886637687683,
0.3314710855484009,
-0.03238869085907936,
0.2431516945362091,
0.599908709526062,
-0.04146747291088104,
0.37607112526893616,
0.24629545211791992,
-0.09538418054580688,
0.11955449730157852,
-0.02047835662961006,
-0.29438939690589905,
0.24939730763435364,
-0.012081462889909744,
-0.047124914824962616,
0.27441802620887756,
0.13440361618995667,
-0.0650959312915802,
-0.11917168647050858,
-0.24045994877815247,
0.34556639194488525,
-0.1452760547399521,
0.0018345937132835388,
0.17666172981262207,
-0.1349259465932846,
-0.36419379711151123,
0.15693676471710205,
-0.0037333182990550995,
0.21297259628772736,
0.0035355165600776672,
0.004608524963259697,
-0.019000917673110962,
-0.32100215554237366,
-0.03179421275854111,
0.011844049207866192,
0.10385853052139282,
-0.418509840965271,
0.2356724590063095,
0.428875207901001,
-0.17986968159675598,
0.11270562559366226,
0.22627590596675873,
0.4462118148803711,
0.06666672229766846,
-0.019607463851571083,
-0.1420183926820755,
-0.1052108108997345,
-0.20303109288215637,
-0.14765916764736176,
0.0289255753159523,
-0.1393536627292633,
0.21071673929691315,
0.4406188130378723,
0.25475597381591797,
-0.29201552271842957,
-0.1870744824409485,
0.18673503398895264,
-0.4614831507205963,
-0.4731268286705017,
0.3161681294441223,
-0.05330529063940048,
-0.03720530867576599,
-0.12929698824882507,
0.03757909685373306,
-0.4924267530441284,
-0.3314661979675293,
0.11546880006790161,
0.15686173737049103,
0.2732029855251312,
-0.07768326997756958,
0.11253656446933746,
0.002480311319231987,
0.4407373368740082,
-0.05403897538781166,
-0.3344731628894806,
-0.33654484152793884,
-0.3361363410949707,
-0.6100761890411377,
0.12419895827770233,
-0.41227689385414124,
-0.2720104455947876,
0.08144848793745041,
0.28278830647468567,
-0.2362753450870514,
0.05695892497897148,
0.05324020981788635,
-0.04683954641222954,
0.047190628945827484,
0.09211200475692749,
-0.24151967465877533,
-0.07538963854312897,
0.20634211599826813,
-0.09706483036279678,
0.14295831322669983,
-0.24837720394134521,
0.4040428400039673,
-0.09845435619354248,
0.14364750683307648,
-0.0415184386074543,
-0.17581957578659058,
0.17178642749786377,
-0.005960982292890549,
0.2899016737937927,
0.23704759776592255,
0.34011268615722656,
-0.26866793632507324,
-0.1610575020313263,
-0.0666171982884407,
-0.05464472621679306,
-0.18432249128818512,
0.6407705545425415,
0.10433304309844971,
0.32872843742370605,
-0.11637386679649353,
-0.0005659149028360844,
-0.3491601049900055,
0.22799113392829895,
0.02474275976419449,
-0.17110112309455872,
0.03726762533187866,
-0.0337248370051384,
-0.0344015508890152,
0.3026396930217743,
-0.07424690574407578,
0.2767486274242401,
0.033142201602458954,
0.034437015652656555,
-0.0023770183324813843,
-0.6050345301628113,
0.5183269381523132,
-0.30721303820610046,
-0.5018857717514038,
-0.11568183451890945,
0.180986225605011,
0.20159803330898285,
0.3526686429977417,
-0.5205014944076538,
0.19413234293460846,
0.4587147533893585,
-0.05027499794960022,
-0.12158769369125366,
0.22748513519763947,
0.07665365934371948,
-0.03499516844749451,
0.10871738195419312,
0.2233411967754364,
0.28327834606170654,
-0.33326858282089233,
0.13019385933876038,
-0.22924146056175232
] |
https://github.com/huggingface/datasets/issues/6270 | `gen_kwargs` should be a `dict`, as stated in the docstring, but you are passing a `list`.
So, to fix the error, replace the list of dicts with a dict of lists (and slightly modify the generator function):
```python
from pathlib import Path
import datasets
def process_yaml(files):
for f in files:
# process
yield dict(...)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs={'files': [f for f in dir.glob('*.yml')]})
ds.to_json('training.jsonl')
``` | Dataset.from_generator raises with sharded gen_args | ### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
| 74 | Dataset.from_generator raises with sharded gen_args
### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
`gen_kwargs` should be a `dict`, as stated in the docstring, but you are passing a `list`.
So, to fix the error, replace the list of dicts with a dict of lists (and slightly modify the generator function):
```python
from pathlib import Path
import datasets
def process_yaml(files):
for f in files:
# process
yield dict(...)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs={'files': [f for f in dir.glob('*.yml')]})
ds.to_json('training.jsonl')
``` | [
-0.15784285962581635,
-0.10980907082557678,
-0.023734301328659058,
0.26803869009017944,
0.4730006158351898,
-0.033754147589206696,
0.549604058265686,
0.1978403627872467,
-0.1852407455444336,
0.12854865193367004,
0.3643640875816345,
0.3822571337223053,
-0.16803902387619019,
0.011552132666110992,
0.09968142211437225,
-0.14850389957427979,
0.26457545161247253,
-0.0006915032863616943,
-0.2629392147064209,
-0.23543009161949158,
-0.24016904830932617,
0.22717100381851196,
-0.1817735880613327,
0.04174627363681793,
-0.1491759866476059,
-0.10244195908308029,
-0.07896298170089722,
0.24702605605125427,
0.07482917606830597,
-0.2893107235431671,
0.18971434235572815,
-0.1778041124343872,
-0.22012463212013245,
0.259885311126709,
-0.00010609811579342932,
0.06207677721977234,
0.4077569842338562,
0.049807026982307434,
-0.2411380261182785,
-0.13297505676746368,
-0.29373109340667725,
0.07795015722513199,
-0.1174921840429306,
-0.3742959201335907,
-0.1084788590669632,
-0.16993947327136993,
-0.15880033373832703,
-0.30634263157844543,
0.7054424285888672,
0.331430584192276,
0.23277464509010315,
-0.0111805759370327,
0.11429344117641449,
-0.07272511720657349,
0.42983731627464294,
0.3433683216571808,
-0.09498411417007446,
-0.1322554498910904,
-0.25734683871269226,
0.04719609022140503,
0.03659772127866745,
0.31393957138061523,
-0.16736260056495667,
0.005901111289858818,
0.15913714468479156,
0.24970027804374695,
-0.13912111520767212,
-0.25681912899017334,
-0.023533577099442482,
0.2173217535018921,
-0.055103372782468796,
-0.26205095648765564,
-0.27958542108535767,
-0.35682412981987,
-0.08268633484840393,
-0.4586637616157532,
0.11594999581575394,
0.09201992303133011,
-0.3122900724411011,
0.0677146315574646,
-0.0877026915550232,
0.006484527140855789,
-0.15010270476341248,
-0.04630066454410553,
0.1011822298169136,
0.16190913319587708,
-0.039254650473594666,
0.29482302069664,
0.24209558963775635,
0.05493514612317085,
-0.05267195403575897,
-0.0015112627297639847,
-0.0795370563864708,
-0.019040921702980995,
-0.4661932587623596,
-0.02479834109544754,
0.2009052038192749,
-0.276576429605484,
0.0862012580037117,
0.07945075631141663,
-0.02193094603717327,
-0.10098148882389069,
0.242404043674469,
0.1604568362236023,
0.27836355566978455,
-0.0456102080643177,
0.18043239414691925,
0.3785388171672821,
0.13116325438022614,
0.044349342584609985,
-0.3036634624004364,
0.0809030532836914,
0.008122533559799194,
-0.193753182888031,
0.27301284670829773,
-0.01460731215775013,
0.28890252113342285,
0.17850612103939056,
-0.3090308606624603,
0.11624543368816376,
-0.30112677812576294,
-0.08697660267353058,
0.03894142061471939,
0.32567957043647766,
-0.015029698610305786,
0.050866853445768356,
-0.1166703924536705,
0.018695807084441185,
-0.0795060247182846,
-0.3491377532482147,
-0.35638630390167236,
-0.07875393331050873,
-0.12187393754720688,
0.103138767182827,
-0.10816357284784317,
0.15306691825389862,
0.2628326416015625,
0.22616730630397797,
0.018397357314825058,
-0.21673408150672913,
0.236505925655365,
-0.0792684257030487,
0.17069011926651,
0.29507318139076233,
-0.16784079372882843,
0.17946548759937286,
0.31153082847595215,
-0.15768113732337952,
0.04069820046424866,
0.09573684632778168,
-0.20743459463119507,
-0.24198220670223236,
0.2103128433227539,
0.2611261308193207,
-0.1624443531036377,
0.2883467674255371,
-0.2608499526977539,
-0.023726588115096092,
0.5064906477928162,
0.05266067385673523,
-0.13782894611358643,
-0.2666981518268585,
-0.4021056890487671,
-0.4032999277114868,
0.2591351270675659,
0.2868085205554962,
-0.2034398913383484,
-0.08259401470422745,
-0.39772331714630127,
-0.04495704174041748,
0.3474798798561096,
0.04529901593923569,
-0.2977654039859772,
0.3502030372619629,
-0.20216187834739685,
0.19374851882457733,
0.36650002002716064,
0.048314169049263,
-0.3252546787261963,
0.3235197365283966,
-0.2271762490272522,
0.1593630015850067,
0.26789242029190063,
0.01734389364719391,
0.12171928584575653,
-0.10525019466876984,
0.07779577374458313,
0.23388715088367462,
-0.1331402063369751,
0.041271358728408813,
-0.2166253626346588,
0.1735142171382904,
-0.0811433270573616,
-0.1009964644908905,
-0.028715576976537704,
0.13521499931812286,
-0.016546592116355896,
0.043711550533771515,
0.37048688530921936,
-0.1652609407901764,
0.0911550521850586,
0.18870586156845093,
0.25282353162765503,
-0.1496049463748932,
0.13846755027770996,
-0.021027766168117523,
-0.3107548654079437,
0.21378810703754425,
-0.1389680802822113,
0.10406774282455444,
-0.40398091077804565,
-0.1228102594614029,
-0.23692521452903748,
0.30418160557746887,
-0.355906218290329,
-0.17567405104637146,
0.13329264521598816,
0.09730380773544312,
-0.10920222848653793,
-0.04176604375243187,
-0.17816254496574402,
0.09278661757707596,
-0.351763516664505,
0.0952969565987587,
-0.36988261342048645,
0.14325009286403656,
0.03660898655653,
-0.19214960932731628,
-0.08577239513397217,
0.04368959367275238,
0.14083275198936462,
-0.010060237720608711,
-0.03360937535762787,
0.2355310022830963,
0.4105110168457031,
0.0342116579413414,
-0.27520766854286194,
-0.0881127268075943,
-0.04730646312236786,
-0.0333423987030983,
-0.17359331250190735,
0.11127965897321701,
0.06077062711119652,
-0.16199812293052673,
0.038533054292201996,
0.3997645378112793,
-0.020583420991897583,
0.3240191340446472,
-0.06981866806745529,
0.2005484700202942,
0.24245473742485046,
0.021220237016677856,
0.004040353000164032,
-0.36596935987472534,
-0.09860140830278397,
0.1262367218732834,
0.031862132251262665,
0.17157992720603943,
-0.18312573432922363,
0.14698255062103271,
0.8064930438995361,
0.052492596209049225,
-0.1075921282172203,
-0.04722781479358673,
-0.2181302309036255,
-0.1424514800310135,
0.0904737189412117,
0.7266733646392822,
0.3785043954849243,
0.09051747620105743,
0.09853796660900116,
0.12512347102165222,
-0.10116367042064667,
-0.24194714426994324,
0.1314166933298111,
-0.09140820801258087,
0.26452890038490295,
0.13556770980358124,
0.06517429649829865,
-0.12995871901512146,
-0.32056236267089844,
-0.09169786423444748,
0.09210538864135742,
0.3198549449443817,
-0.28235018253326416,
0.38193175196647644,
-0.27775952219963074,
0.23330789804458618,
-0.263860285282135,
0.007037632167339325,
-0.046177756041288376,
-0.3171912133693695,
-0.02566426247358322,
0.2552991509437561,
-0.2555367350578308,
0.23317575454711914,
0.27462518215179443,
-0.06871207058429718,
0.3267672657966614,
-0.16282068192958832,
-0.16732853651046753,
-0.17645373940467834,
-0.2641761004924774,
0.08975377678871155,
0.27897346019744873,
-0.11483801156282425,
0.20433172583580017,
-0.039966970682144165,
-0.21791282296180725,
-0.15109029412269592,
-0.11985094100236893,
0.13655906915664673,
-0.3961308002471924,
0.6054110527038574,
0.3316963315010071,
0.017838548868894577,
-0.2102777510881424,
-0.22534418106079102,
0.3435792624950409,
0.03946086764335632,
-0.22080092132091522,
0.3147134780883789,
0.08072911947965622,
0.18667803704738617,
-0.2370038628578186,
-0.3330809772014618,
0.13968978822231293,
-0.15045702457427979,
0.09063811600208282,
0.14340093731880188,
0.32835716009140015,
0.18592576682567596,
0.23984166979789734,
-0.04028237611055374,
-0.15048529207706451,
0.10879357159137726,
-0.15397000312805176,
-0.32664892077445984,
0.16311410069465637,
-0.1309162974357605,
-0.3727894425392151,
0.009502731263637543,
-0.25579822063446045,
0.3095617890357971,
0.33607590198516846,
-0.35933125019073486,
-0.07952391356229782,
-0.09548017382621765,
0.09608592838048935,
0.04959162324666977,
-0.09582014381885529,
0.06153514236211777,
0.2093369960784912,
-0.11627832055091858,
-0.2525187134742737,
0.2807512879371643,
0.5255702137947083,
-0.2480117827653885,
-0.058763984590768814,
0.2321254014968872,
0.3146638870239258,
0.16989146173000336,
0.6522672176361084,
0.33269891142845154,
-0.23868818581104279,
0.026250695809721947,
-0.09359810501337051,
0.0958968847990036,
-0.12675878405570984,
-0.3676437735557556,
-0.20000439882278442,
0.11944623291492462,
-0.21220935881137848,
-0.037183962762355804,
-0.06948718428611755,
0.14362558722496033,
0.04778457432985306,
0.19904661178588867,
-0.02931852638721466,
-0.4188997745513916,
0.06207998842000961,
-0.3534839153289795,
0.23390522599220276,
-0.0018185153603553772,
0.29953569173812866,
-0.07888168096542358,
0.12136063724756241,
-0.15275900065898895,
-0.2272331416606903,
0.34357696771621704,
-0.22264662384986877,
-0.20912271738052368,
-0.20330777764320374,
-0.21964240074157715,
0.07948513329029083,
-0.002013538032770157,
0.12372930347919464,
-0.013597249984741211,
-0.31149935722351074,
0.1864255666732788,
-0.0752110406756401,
0.7218579053878784,
-0.14527854323387146,
0.0806717574596405,
0.22514064610004425,
-0.0037493929266929626,
0.08861763030290604,
0.1396578997373581,
-0.08758695423603058,
-0.10628650337457657,
0.024564165621995926,
0.19608071446418762,
-0.4938080906867981,
-0.1832541674375534,
0.022517144680023193,
0.16170810163021088,
-0.27420419454574585,
-0.004729650914669037,
-0.24293479323387146,
-0.25218188762664795,
-0.12842820584774017,
0.004679866135120392,
-0.043963316828012466,
0.320157527923584,
-0.22588929533958435,
-0.042550791054964066,
-0.22720099985599518,
-0.1451486498117447,
-0.03546355292201042,
0.25693953037261963,
0.2892206013202667,
-0.4538407623767853,
0.1847544014453888,
-0.09518636763095856,
0.0014899475499987602,
0.17531374096870422,
0.3397604525089264,
-0.051615312695503235,
-0.3519446849822998,
-0.36475303769111633,
-0.0782531127333641,
0.07314300537109375,
0.19057652354240417,
-0.3861370086669922,
0.07060487568378448,
-0.01658930629491806,
0.20212285220623016,
-0.10218991339206696,
0.06460395455360413,
0.5791630744934082,
-0.07099157571792603,
-0.04548242688179016,
-0.7101126313209534,
0.30384185910224915,
0.12906068563461304,
-0.15801063179969788,
0.3936196565628052,
0.01013290323317051,
-0.3858549892902374,
0.5526435971260071,
0.047394268214702606,
0.8315760493278503,
-0.032363276928663254,
0.08781810104846954,
0.5476921200752258,
0.481478750705719,
0.46340155601501465,
0.061275795102119446,
0.22169171273708344,
-0.436667263507843,
-0.06644263863563538,
0.006198473274707794,
-0.0649719089269638,
0.26376521587371826,
0.3466538190841675,
-0.06306405365467072,
0.0600644126534462,
-0.18439751863479614,
0.3075667917728424,
-0.020541496574878693,
0.04443950951099396,
0.05073004961013794,
-0.025608977302908897,
-0.3046756982803345,
0.13165447115898132,
0.05248681828379631,
-0.16619986295700073,
0.19981227815151215,
-0.2772303819656372,
-0.09476418048143387,
-0.45874205231666565,
-0.19773977994918823,
0.2560681402683258,
0.16485260426998138,
0.20870104432106018,
0.14699779450893402,
-0.3647993505001068,
-0.09907680004835129,
0.4680759906768799,
0.22057294845581055,
0.14880771934986115,
0.044703468680381775,
0.25167137384414673,
-0.013462714850902557,
0.2530905604362488,
-0.02477450855076313,
-0.19791486859321594,
0.40481430292129517,
-0.0469871386885643,
-0.2681368589401245,
0.09421196579933167,
-0.03376689553260803,
-0.3844759464263916,
-0.17629912495613098,
0.17863363027572632,
-0.1744941920042038,
-0.3034570813179016,
0.17454321682453156,
0.18681448698043823,
-0.11816760897636414,
-0.35960614681243896,
0.1977262794971466,
0.10988959670066833,
-0.29411888122558594,
0.3485908508300781,
-0.2193504422903061,
-0.06496137380599976,
-0.05059446394443512,
0.07009704411029816,
0.2770228981971741,
0.2781606912612915,
0.5193920135498047,
0.05686628818511963,
0.003728054463863373,
-0.38686978816986084,
-0.04071108251810074,
0.0993226170539856,
-0.32551977038383484,
0.4965094327926636,
0.14515116810798645,
0.26451054215431213,
0.07115666568279266,
0.12535758316516876,
-0.17370536923408508,
0.21235910058021545,
-0.13882337510585785,
-0.18387305736541748,
-0.08349190652370453,
0.0191964078694582,
-0.21004465222358704,
0.10635311901569366,
0.012596972286701202,
0.12514428794384003,
-0.28081876039505005,
0.27288058400154114,
-0.3642040491104126,
-0.0636899396777153,
-0.14787113666534424,
0.19674301147460938,
0.12510599195957184,
-0.12280357629060745,
0.12618182599544525,
0.04377398267388344,
0.2551786005496979,
-0.02453000470995903,
-0.20257897675037384,
-0.28495123982429504,
-0.11279991269111633,
0.08897656202316284,
0.010875297710299492,
-0.01983475312590599,
-0.06346739828586578,
0.055291056632995605,
-0.18079206347465515,
-0.19998547434806824,
0.34668898582458496,
-0.041756466031074524,
-0.05318190157413483,
0.3286387026309967,
0.22971105575561523,
0.40859198570251465,
0.02946341037750244,
-0.13359490036964417,
-0.4766758382320404,
0.14858758449554443,
-0.01601610705256462,
0.202903613448143,
0.16567710041999817,
-0.16246283054351807,
-0.1720626950263977,
0.08338387310504913,
-0.16632920503616333,
-0.17694690823554993,
0.6944023370742798,
-0.35234886407852173,
-0.35318130254745483,
-0.059244416654109955,
0.5709480047225952,
0.3852596580982208,
-0.14849452674388885,
-0.1366128921508789,
0.172578364610672,
0.2660880982875824,
-0.2827227711677551,
-0.2438805252313614,
0.16841989755630493,
0.04368026182055473,
0.152430459856987,
0.21906839311122894,
-0.006831161677837372,
-0.18577969074249268,
-0.13661006093025208,
0.02144952490925789,
0.30737942457199097,
-0.35207194089889526,
0.3450411260128021,
0.5913934111595154,
0.03600652515888214,
0.09812483191490173,
0.2469237595796585,
-0.01257352065294981,
0.2575858235359192,
0.8022925853729248,
-0.21473823487758636,
0.48949500918388367,
-0.10421648621559143,
-0.12635324895381927,
0.13281460106372833,
-0.37151122093200684,
0.2334393560886383,
0.3077058792114258,
-0.3464195728302002,
-0.11042803525924683,
-0.10757662355899811,
0.478206604719162,
0.16364721953868866,
-0.02160448022186756,
-0.28433549404144287,
0.3604546785354614,
-0.059491731226444244,
-0.15640142560005188,
-0.42755118012428284,
-0.18138667941093445,
-0.2011992335319519,
0.0033804625272750854,
0.1361466348171234,
-0.10238434374332428,
0.4187743067741394,
-0.04344240948557854,
-0.04847734421491623,
-0.15251952409744263,
0.22734910249710083,
-0.11629734188318253,
0.04332106187939644,
-0.3451710343360901,
-0.034015268087387085,
0.3565813899040222,
-0.08095864951610565,
0.05285690352320671,
-0.1462164670228958,
0.3024649918079376,
0.36468616127967834,
0.011158954352140427,
-0.07417701184749603,
-0.1680934876203537,
-0.2048870474100113,
-0.34814587235450745,
0.3729678988456726,
-0.3150898218154907,
0.09356921911239624,
0.18638193607330322,
0.13495315611362457,
-0.17654219269752502,
-0.01852545142173767,
0.18300718069076538,
0.44401127099990845,
-0.1696707308292389,
0.48180800676345825,
-0.2359336018562317,
-0.1163000762462616,
-0.14245203137397766,
0.1533540040254593,
-0.2931213974952698,
-0.10921701788902283,
0.5346869826316833,
0.13562452793121338,
0.17210228741168976,
-0.29986464977264404,
0.10618337243795395,
-0.16508769989013672,
0.3083075284957886,
-0.18725711107254028,
0.08362914621829987,
-0.22967875003814697,
-0.09506864845752716,
-0.3746106028556824,
0.1000114306807518,
-0.18890945613384247,
0.1772850602865219,
-0.06488794088363647,
0.2627214193344116,
0.019840437918901443,
0.12302009761333466,
-0.16196206212043762,
-0.18251562118530273,
-0.3567834794521332,
0.4094754457473755,
-0.23212680220603943,
-0.14471988379955292,
-0.0760062038898468,
-0.17873293161392212,
-0.0732550248503685,
-0.330486536026001,
0.2590421140193939,
-0.29810550808906555,
0.13757939636707306,
0.0018403511494398117,
-0.06966988742351532,
0.23709118366241455,
0.10657782852649689,
0.14694161713123322,
0.4893016815185547,
0.142564594745636,
-0.024495434015989304,
-0.16443750262260437,
-0.338314950466156,
-0.1415187418460846,
-0.30600613355636597,
0.12002711743116379,
-0.020306933671236038,
0.547357976436615,
-0.05868305638432503,
0.007012508809566498,
-0.38081052899360657,
0.24240729212760925,
0.0697404071688652,
-0.20524655282497406,
-0.2095746099948883,
0.24344104528427124,
-0.27421319484710693,
0.16151446104049683,
0.014361981302499771,
0.004746877588331699,
0.02521655708551407,
0.09547092765569687,
-0.23009872436523438,
-0.5110782980918884,
0.36375904083251953,
-0.5501344799995422,
-0.30043262243270874,
-0.09401419013738632,
0.20327742397785187,
-0.013635654002428055,
-0.26886773109436035,
-0.17490705847740173,
-0.07122842967510223,
0.38877516984939575,
-0.04315933585166931,
-0.036049146205186844,
0.1864093840122223,
0.2220209836959839,
-0.0035575851798057556,
-0.01628410443663597,
0.035193223506212234,
-0.04149104654788971,
-0.35925915837287903,
0.21217551827430725,
-0.27191686630249023
] |
https://github.com/huggingface/datasets/issues/6270 | That runs, and because my dataset is small, it's what I did to get past the problem.
However, it does not produce a sharded dataset. From the doc string I expect there ought to be a way to call from_generator such that num_shards in the resulting data set is equal to the number of items in the list.
The part of the doc string that your suggestion is not responsive to is:
` You can define a sharded dataset by passing the list of shards in *g
en_kwargs*.
`
What your suggestion does is calls the generator once, with the list argument, and produces a single shard dataset.
| Dataset.from_generator raises with sharded gen_args | ### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
| 108 | Dataset.from_generator raises with sharded gen_args
### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
That runs, and because my dataset is small, it's what I did to get past the problem.
However, it does not produce a sharded dataset. From the doc string I expect there ought to be a way to call from_generator such that num_shards in the resulting data set is equal to the number of items in the list.
The part of the doc string that your suggestion is not responsive to is:
` You can define a sharded dataset by passing the list of shards in *g
en_kwargs*.
`
What your suggestion does is calls the generator once, with the list argument, and produces a single shard dataset.
| [
-0.15784285962581635,
-0.10980907082557678,
-0.023734301328659058,
0.26803869009017944,
0.4730006158351898,
-0.033754147589206696,
0.549604058265686,
0.1978403627872467,
-0.1852407455444336,
0.12854865193367004,
0.3643640875816345,
0.3822571337223053,
-0.16803902387619019,
0.011552132666110992,
0.09968142211437225,
-0.14850389957427979,
0.26457545161247253,
-0.0006915032863616943,
-0.2629392147064209,
-0.23543009161949158,
-0.24016904830932617,
0.22717100381851196,
-0.1817735880613327,
0.04174627363681793,
-0.1491759866476059,
-0.10244195908308029,
-0.07896298170089722,
0.24702605605125427,
0.07482917606830597,
-0.2893107235431671,
0.18971434235572815,
-0.1778041124343872,
-0.22012463212013245,
0.259885311126709,
-0.00010609811579342932,
0.06207677721977234,
0.4077569842338562,
0.049807026982307434,
-0.2411380261182785,
-0.13297505676746368,
-0.29373109340667725,
0.07795015722513199,
-0.1174921840429306,
-0.3742959201335907,
-0.1084788590669632,
-0.16993947327136993,
-0.15880033373832703,
-0.30634263157844543,
0.7054424285888672,
0.331430584192276,
0.23277464509010315,
-0.0111805759370327,
0.11429344117641449,
-0.07272511720657349,
0.42983731627464294,
0.3433683216571808,
-0.09498411417007446,
-0.1322554498910904,
-0.25734683871269226,
0.04719609022140503,
0.03659772127866745,
0.31393957138061523,
-0.16736260056495667,
0.005901111289858818,
0.15913714468479156,
0.24970027804374695,
-0.13912111520767212,
-0.25681912899017334,
-0.023533577099442482,
0.2173217535018921,
-0.055103372782468796,
-0.26205095648765564,
-0.27958542108535767,
-0.35682412981987,
-0.08268633484840393,
-0.4586637616157532,
0.11594999581575394,
0.09201992303133011,
-0.3122900724411011,
0.0677146315574646,
-0.0877026915550232,
0.006484527140855789,
-0.15010270476341248,
-0.04630066454410553,
0.1011822298169136,
0.16190913319587708,
-0.039254650473594666,
0.29482302069664,
0.24209558963775635,
0.05493514612317085,
-0.05267195403575897,
-0.0015112627297639847,
-0.0795370563864708,
-0.019040921702980995,
-0.4661932587623596,
-0.02479834109544754,
0.2009052038192749,
-0.276576429605484,
0.0862012580037117,
0.07945075631141663,
-0.02193094603717327,
-0.10098148882389069,
0.242404043674469,
0.1604568362236023,
0.27836355566978455,
-0.0456102080643177,
0.18043239414691925,
0.3785388171672821,
0.13116325438022614,
0.044349342584609985,
-0.3036634624004364,
0.0809030532836914,
0.008122533559799194,
-0.193753182888031,
0.27301284670829773,
-0.01460731215775013,
0.28890252113342285,
0.17850612103939056,
-0.3090308606624603,
0.11624543368816376,
-0.30112677812576294,
-0.08697660267353058,
0.03894142061471939,
0.32567957043647766,
-0.015029698610305786,
0.050866853445768356,
-0.1166703924536705,
0.018695807084441185,
-0.0795060247182846,
-0.3491377532482147,
-0.35638630390167236,
-0.07875393331050873,
-0.12187393754720688,
0.103138767182827,
-0.10816357284784317,
0.15306691825389862,
0.2628326416015625,
0.22616730630397797,
0.018397357314825058,
-0.21673408150672913,
0.236505925655365,
-0.0792684257030487,
0.17069011926651,
0.29507318139076233,
-0.16784079372882843,
0.17946548759937286,
0.31153082847595215,
-0.15768113732337952,
0.04069820046424866,
0.09573684632778168,
-0.20743459463119507,
-0.24198220670223236,
0.2103128433227539,
0.2611261308193207,
-0.1624443531036377,
0.2883467674255371,
-0.2608499526977539,
-0.023726588115096092,
0.5064906477928162,
0.05266067385673523,
-0.13782894611358643,
-0.2666981518268585,
-0.4021056890487671,
-0.4032999277114868,
0.2591351270675659,
0.2868085205554962,
-0.2034398913383484,
-0.08259401470422745,
-0.39772331714630127,
-0.04495704174041748,
0.3474798798561096,
0.04529901593923569,
-0.2977654039859772,
0.3502030372619629,
-0.20216187834739685,
0.19374851882457733,
0.36650002002716064,
0.048314169049263,
-0.3252546787261963,
0.3235197365283966,
-0.2271762490272522,
0.1593630015850067,
0.26789242029190063,
0.01734389364719391,
0.12171928584575653,
-0.10525019466876984,
0.07779577374458313,
0.23388715088367462,
-0.1331402063369751,
0.041271358728408813,
-0.2166253626346588,
0.1735142171382904,
-0.0811433270573616,
-0.1009964644908905,
-0.028715576976537704,
0.13521499931812286,
-0.016546592116355896,
0.043711550533771515,
0.37048688530921936,
-0.1652609407901764,
0.0911550521850586,
0.18870586156845093,
0.25282353162765503,
-0.1496049463748932,
0.13846755027770996,
-0.021027766168117523,
-0.3107548654079437,
0.21378810703754425,
-0.1389680802822113,
0.10406774282455444,
-0.40398091077804565,
-0.1228102594614029,
-0.23692521452903748,
0.30418160557746887,
-0.355906218290329,
-0.17567405104637146,
0.13329264521598816,
0.09730380773544312,
-0.10920222848653793,
-0.04176604375243187,
-0.17816254496574402,
0.09278661757707596,
-0.351763516664505,
0.0952969565987587,
-0.36988261342048645,
0.14325009286403656,
0.03660898655653,
-0.19214960932731628,
-0.08577239513397217,
0.04368959367275238,
0.14083275198936462,
-0.010060237720608711,
-0.03360937535762787,
0.2355310022830963,
0.4105110168457031,
0.0342116579413414,
-0.27520766854286194,
-0.0881127268075943,
-0.04730646312236786,
-0.0333423987030983,
-0.17359331250190735,
0.11127965897321701,
0.06077062711119652,
-0.16199812293052673,
0.038533054292201996,
0.3997645378112793,
-0.020583420991897583,
0.3240191340446472,
-0.06981866806745529,
0.2005484700202942,
0.24245473742485046,
0.021220237016677856,
0.004040353000164032,
-0.36596935987472534,
-0.09860140830278397,
0.1262367218732834,
0.031862132251262665,
0.17157992720603943,
-0.18312573432922363,
0.14698255062103271,
0.8064930438995361,
0.052492596209049225,
-0.1075921282172203,
-0.04722781479358673,
-0.2181302309036255,
-0.1424514800310135,
0.0904737189412117,
0.7266733646392822,
0.3785043954849243,
0.09051747620105743,
0.09853796660900116,
0.12512347102165222,
-0.10116367042064667,
-0.24194714426994324,
0.1314166933298111,
-0.09140820801258087,
0.26452890038490295,
0.13556770980358124,
0.06517429649829865,
-0.12995871901512146,
-0.32056236267089844,
-0.09169786423444748,
0.09210538864135742,
0.3198549449443817,
-0.28235018253326416,
0.38193175196647644,
-0.27775952219963074,
0.23330789804458618,
-0.263860285282135,
0.007037632167339325,
-0.046177756041288376,
-0.3171912133693695,
-0.02566426247358322,
0.2552991509437561,
-0.2555367350578308,
0.23317575454711914,
0.27462518215179443,
-0.06871207058429718,
0.3267672657966614,
-0.16282068192958832,
-0.16732853651046753,
-0.17645373940467834,
-0.2641761004924774,
0.08975377678871155,
0.27897346019744873,
-0.11483801156282425,
0.20433172583580017,
-0.039966970682144165,
-0.21791282296180725,
-0.15109029412269592,
-0.11985094100236893,
0.13655906915664673,
-0.3961308002471924,
0.6054110527038574,
0.3316963315010071,
0.017838548868894577,
-0.2102777510881424,
-0.22534418106079102,
0.3435792624950409,
0.03946086764335632,
-0.22080092132091522,
0.3147134780883789,
0.08072911947965622,
0.18667803704738617,
-0.2370038628578186,
-0.3330809772014618,
0.13968978822231293,
-0.15045702457427979,
0.09063811600208282,
0.14340093731880188,
0.32835716009140015,
0.18592576682567596,
0.23984166979789734,
-0.04028237611055374,
-0.15048529207706451,
0.10879357159137726,
-0.15397000312805176,
-0.32664892077445984,
0.16311410069465637,
-0.1309162974357605,
-0.3727894425392151,
0.009502731263637543,
-0.25579822063446045,
0.3095617890357971,
0.33607590198516846,
-0.35933125019073486,
-0.07952391356229782,
-0.09548017382621765,
0.09608592838048935,
0.04959162324666977,
-0.09582014381885529,
0.06153514236211777,
0.2093369960784912,
-0.11627832055091858,
-0.2525187134742737,
0.2807512879371643,
0.5255702137947083,
-0.2480117827653885,
-0.058763984590768814,
0.2321254014968872,
0.3146638870239258,
0.16989146173000336,
0.6522672176361084,
0.33269891142845154,
-0.23868818581104279,
0.026250695809721947,
-0.09359810501337051,
0.0958968847990036,
-0.12675878405570984,
-0.3676437735557556,
-0.20000439882278442,
0.11944623291492462,
-0.21220935881137848,
-0.037183962762355804,
-0.06948718428611755,
0.14362558722496033,
0.04778457432985306,
0.19904661178588867,
-0.02931852638721466,
-0.4188997745513916,
0.06207998842000961,
-0.3534839153289795,
0.23390522599220276,
-0.0018185153603553772,
0.29953569173812866,
-0.07888168096542358,
0.12136063724756241,
-0.15275900065898895,
-0.2272331416606903,
0.34357696771621704,
-0.22264662384986877,
-0.20912271738052368,
-0.20330777764320374,
-0.21964240074157715,
0.07948513329029083,
-0.002013538032770157,
0.12372930347919464,
-0.013597249984741211,
-0.31149935722351074,
0.1864255666732788,
-0.0752110406756401,
0.7218579053878784,
-0.14527854323387146,
0.0806717574596405,
0.22514064610004425,
-0.0037493929266929626,
0.08861763030290604,
0.1396578997373581,
-0.08758695423603058,
-0.10628650337457657,
0.024564165621995926,
0.19608071446418762,
-0.4938080906867981,
-0.1832541674375534,
0.022517144680023193,
0.16170810163021088,
-0.27420419454574585,
-0.004729650914669037,
-0.24293479323387146,
-0.25218188762664795,
-0.12842820584774017,
0.004679866135120392,
-0.043963316828012466,
0.320157527923584,
-0.22588929533958435,
-0.042550791054964066,
-0.22720099985599518,
-0.1451486498117447,
-0.03546355292201042,
0.25693953037261963,
0.2892206013202667,
-0.4538407623767853,
0.1847544014453888,
-0.09518636763095856,
0.0014899475499987602,
0.17531374096870422,
0.3397604525089264,
-0.051615312695503235,
-0.3519446849822998,
-0.36475303769111633,
-0.0782531127333641,
0.07314300537109375,
0.19057652354240417,
-0.3861370086669922,
0.07060487568378448,
-0.01658930629491806,
0.20212285220623016,
-0.10218991339206696,
0.06460395455360413,
0.5791630744934082,
-0.07099157571792603,
-0.04548242688179016,
-0.7101126313209534,
0.30384185910224915,
0.12906068563461304,
-0.15801063179969788,
0.3936196565628052,
0.01013290323317051,
-0.3858549892902374,
0.5526435971260071,
0.047394268214702606,
0.8315760493278503,
-0.032363276928663254,
0.08781810104846954,
0.5476921200752258,
0.481478750705719,
0.46340155601501465,
0.061275795102119446,
0.22169171273708344,
-0.436667263507843,
-0.06644263863563538,
0.006198473274707794,
-0.0649719089269638,
0.26376521587371826,
0.3466538190841675,
-0.06306405365467072,
0.0600644126534462,
-0.18439751863479614,
0.3075667917728424,
-0.020541496574878693,
0.04443950951099396,
0.05073004961013794,
-0.025608977302908897,
-0.3046756982803345,
0.13165447115898132,
0.05248681828379631,
-0.16619986295700073,
0.19981227815151215,
-0.2772303819656372,
-0.09476418048143387,
-0.45874205231666565,
-0.19773977994918823,
0.2560681402683258,
0.16485260426998138,
0.20870104432106018,
0.14699779450893402,
-0.3647993505001068,
-0.09907680004835129,
0.4680759906768799,
0.22057294845581055,
0.14880771934986115,
0.044703468680381775,
0.25167137384414673,
-0.013462714850902557,
0.2530905604362488,
-0.02477450855076313,
-0.19791486859321594,
0.40481430292129517,
-0.0469871386885643,
-0.2681368589401245,
0.09421196579933167,
-0.03376689553260803,
-0.3844759464263916,
-0.17629912495613098,
0.17863363027572632,
-0.1744941920042038,
-0.3034570813179016,
0.17454321682453156,
0.18681448698043823,
-0.11816760897636414,
-0.35960614681243896,
0.1977262794971466,
0.10988959670066833,
-0.29411888122558594,
0.3485908508300781,
-0.2193504422903061,
-0.06496137380599976,
-0.05059446394443512,
0.07009704411029816,
0.2770228981971741,
0.2781606912612915,
0.5193920135498047,
0.05686628818511963,
0.003728054463863373,
-0.38686978816986084,
-0.04071108251810074,
0.0993226170539856,
-0.32551977038383484,
0.4965094327926636,
0.14515116810798645,
0.26451054215431213,
0.07115666568279266,
0.12535758316516876,
-0.17370536923408508,
0.21235910058021545,
-0.13882337510585785,
-0.18387305736541748,
-0.08349190652370453,
0.0191964078694582,
-0.21004465222358704,
0.10635311901569366,
0.012596972286701202,
0.12514428794384003,
-0.28081876039505005,
0.27288058400154114,
-0.3642040491104126,
-0.0636899396777153,
-0.14787113666534424,
0.19674301147460938,
0.12510599195957184,
-0.12280357629060745,
0.12618182599544525,
0.04377398267388344,
0.2551786005496979,
-0.02453000470995903,
-0.20257897675037384,
-0.28495123982429504,
-0.11279991269111633,
0.08897656202316284,
0.010875297710299492,
-0.01983475312590599,
-0.06346739828586578,
0.055291056632995605,
-0.18079206347465515,
-0.19998547434806824,
0.34668898582458496,
-0.041756466031074524,
-0.05318190157413483,
0.3286387026309967,
0.22971105575561523,
0.40859198570251465,
0.02946341037750244,
-0.13359490036964417,
-0.4766758382320404,
0.14858758449554443,
-0.01601610705256462,
0.202903613448143,
0.16567710041999817,
-0.16246283054351807,
-0.1720626950263977,
0.08338387310504913,
-0.16632920503616333,
-0.17694690823554993,
0.6944023370742798,
-0.35234886407852173,
-0.35318130254745483,
-0.059244416654109955,
0.5709480047225952,
0.3852596580982208,
-0.14849452674388885,
-0.1366128921508789,
0.172578364610672,
0.2660880982875824,
-0.2827227711677551,
-0.2438805252313614,
0.16841989755630493,
0.04368026182055473,
0.152430459856987,
0.21906839311122894,
-0.006831161677837372,
-0.18577969074249268,
-0.13661006093025208,
0.02144952490925789,
0.30737942457199097,
-0.35207194089889526,
0.3450411260128021,
0.5913934111595154,
0.03600652515888214,
0.09812483191490173,
0.2469237595796585,
-0.01257352065294981,
0.2575858235359192,
0.8022925853729248,
-0.21473823487758636,
0.48949500918388367,
-0.10421648621559143,
-0.12635324895381927,
0.13281460106372833,
-0.37151122093200684,
0.2334393560886383,
0.3077058792114258,
-0.3464195728302002,
-0.11042803525924683,
-0.10757662355899811,
0.478206604719162,
0.16364721953868866,
-0.02160448022186756,
-0.28433549404144287,
0.3604546785354614,
-0.059491731226444244,
-0.15640142560005188,
-0.42755118012428284,
-0.18138667941093445,
-0.2011992335319519,
0.0033804625272750854,
0.1361466348171234,
-0.10238434374332428,
0.4187743067741394,
-0.04344240948557854,
-0.04847734421491623,
-0.15251952409744263,
0.22734910249710083,
-0.11629734188318253,
0.04332106187939644,
-0.3451710343360901,
-0.034015268087387085,
0.3565813899040222,
-0.08095864951610565,
0.05285690352320671,
-0.1462164670228958,
0.3024649918079376,
0.36468616127967834,
0.011158954352140427,
-0.07417701184749603,
-0.1680934876203537,
-0.2048870474100113,
-0.34814587235450745,
0.3729678988456726,
-0.3150898218154907,
0.09356921911239624,
0.18638193607330322,
0.13495315611362457,
-0.17654219269752502,
-0.01852545142173767,
0.18300718069076538,
0.44401127099990845,
-0.1696707308292389,
0.48180800676345825,
-0.2359336018562317,
-0.1163000762462616,
-0.14245203137397766,
0.1533540040254593,
-0.2931213974952698,
-0.10921701788902283,
0.5346869826316833,
0.13562452793121338,
0.17210228741168976,
-0.29986464977264404,
0.10618337243795395,
-0.16508769989013672,
0.3083075284957886,
-0.18725711107254028,
0.08362914621829987,
-0.22967875003814697,
-0.09506864845752716,
-0.3746106028556824,
0.1000114306807518,
-0.18890945613384247,
0.1772850602865219,
-0.06488794088363647,
0.2627214193344116,
0.019840437918901443,
0.12302009761333466,
-0.16196206212043762,
-0.18251562118530273,
-0.3567834794521332,
0.4094754457473755,
-0.23212680220603943,
-0.14471988379955292,
-0.0760062038898468,
-0.17873293161392212,
-0.0732550248503685,
-0.330486536026001,
0.2590421140193939,
-0.29810550808906555,
0.13757939636707306,
0.0018403511494398117,
-0.06966988742351532,
0.23709118366241455,
0.10657782852649689,
0.14694161713123322,
0.4893016815185547,
0.142564594745636,
-0.024495434015989304,
-0.16443750262260437,
-0.338314950466156,
-0.1415187418460846,
-0.30600613355636597,
0.12002711743116379,
-0.020306933671236038,
0.547357976436615,
-0.05868305638432503,
0.007012508809566498,
-0.38081052899360657,
0.24240729212760925,
0.0697404071688652,
-0.20524655282497406,
-0.2095746099948883,
0.24344104528427124,
-0.27421319484710693,
0.16151446104049683,
0.014361981302499771,
0.004746877588331699,
0.02521655708551407,
0.09547092765569687,
-0.23009872436523438,
-0.5110782980918884,
0.36375904083251953,
-0.5501344799995422,
-0.30043262243270874,
-0.09401419013738632,
0.20327742397785187,
-0.013635654002428055,
-0.26886773109436035,
-0.17490705847740173,
-0.07122842967510223,
0.38877516984939575,
-0.04315933585166931,
-0.036049146205186844,
0.1864093840122223,
0.2220209836959839,
-0.0035575851798057556,
-0.01628410443663597,
0.035193223506212234,
-0.04149104654788971,
-0.35925915837287903,
0.21217551827430725,
-0.27191686630249023
] |
https://github.com/huggingface/datasets/issues/6270 | The sharding mentioned here refers to using this function with `num_proc` (multiprocessing splits the `kwargs` into shards and passes them to the generator function)
> That runs, and because my dataset is small, it's what I did to get past the problem.
`from_generator` generates a memory-mapped dataset (can be larger than RAM), so the dataset size should not be an issue unless the generator function's implementation does not properly free the memory.
| Dataset.from_generator raises with sharded gen_args | ### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
| 72 | Dataset.from_generator raises with sharded gen_args
### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
The sharding mentioned here refers to using this function with `num_proc` (multiprocessing splits the `kwargs` into shards and passes them to the generator function)
> That runs, and because my dataset is small, it's what I did to get past the problem.
`from_generator` generates a memory-mapped dataset (can be larger than RAM), so the dataset size should not be an issue unless the generator function's implementation does not properly free the memory.
| [
-0.15784285962581635,
-0.10980907082557678,
-0.023734301328659058,
0.26803869009017944,
0.4730006158351898,
-0.033754147589206696,
0.549604058265686,
0.1978403627872467,
-0.1852407455444336,
0.12854865193367004,
0.3643640875816345,
0.3822571337223053,
-0.16803902387619019,
0.011552132666110992,
0.09968142211437225,
-0.14850389957427979,
0.26457545161247253,
-0.0006915032863616943,
-0.2629392147064209,
-0.23543009161949158,
-0.24016904830932617,
0.22717100381851196,
-0.1817735880613327,
0.04174627363681793,
-0.1491759866476059,
-0.10244195908308029,
-0.07896298170089722,
0.24702605605125427,
0.07482917606830597,
-0.2893107235431671,
0.18971434235572815,
-0.1778041124343872,
-0.22012463212013245,
0.259885311126709,
-0.00010609811579342932,
0.06207677721977234,
0.4077569842338562,
0.049807026982307434,
-0.2411380261182785,
-0.13297505676746368,
-0.29373109340667725,
0.07795015722513199,
-0.1174921840429306,
-0.3742959201335907,
-0.1084788590669632,
-0.16993947327136993,
-0.15880033373832703,
-0.30634263157844543,
0.7054424285888672,
0.331430584192276,
0.23277464509010315,
-0.0111805759370327,
0.11429344117641449,
-0.07272511720657349,
0.42983731627464294,
0.3433683216571808,
-0.09498411417007446,
-0.1322554498910904,
-0.25734683871269226,
0.04719609022140503,
0.03659772127866745,
0.31393957138061523,
-0.16736260056495667,
0.005901111289858818,
0.15913714468479156,
0.24970027804374695,
-0.13912111520767212,
-0.25681912899017334,
-0.023533577099442482,
0.2173217535018921,
-0.055103372782468796,
-0.26205095648765564,
-0.27958542108535767,
-0.35682412981987,
-0.08268633484840393,
-0.4586637616157532,
0.11594999581575394,
0.09201992303133011,
-0.3122900724411011,
0.0677146315574646,
-0.0877026915550232,
0.006484527140855789,
-0.15010270476341248,
-0.04630066454410553,
0.1011822298169136,
0.16190913319587708,
-0.039254650473594666,
0.29482302069664,
0.24209558963775635,
0.05493514612317085,
-0.05267195403575897,
-0.0015112627297639847,
-0.0795370563864708,
-0.019040921702980995,
-0.4661932587623596,
-0.02479834109544754,
0.2009052038192749,
-0.276576429605484,
0.0862012580037117,
0.07945075631141663,
-0.02193094603717327,
-0.10098148882389069,
0.242404043674469,
0.1604568362236023,
0.27836355566978455,
-0.0456102080643177,
0.18043239414691925,
0.3785388171672821,
0.13116325438022614,
0.044349342584609985,
-0.3036634624004364,
0.0809030532836914,
0.008122533559799194,
-0.193753182888031,
0.27301284670829773,
-0.01460731215775013,
0.28890252113342285,
0.17850612103939056,
-0.3090308606624603,
0.11624543368816376,
-0.30112677812576294,
-0.08697660267353058,
0.03894142061471939,
0.32567957043647766,
-0.015029698610305786,
0.050866853445768356,
-0.1166703924536705,
0.018695807084441185,
-0.0795060247182846,
-0.3491377532482147,
-0.35638630390167236,
-0.07875393331050873,
-0.12187393754720688,
0.103138767182827,
-0.10816357284784317,
0.15306691825389862,
0.2628326416015625,
0.22616730630397797,
0.018397357314825058,
-0.21673408150672913,
0.236505925655365,
-0.0792684257030487,
0.17069011926651,
0.29507318139076233,
-0.16784079372882843,
0.17946548759937286,
0.31153082847595215,
-0.15768113732337952,
0.04069820046424866,
0.09573684632778168,
-0.20743459463119507,
-0.24198220670223236,
0.2103128433227539,
0.2611261308193207,
-0.1624443531036377,
0.2883467674255371,
-0.2608499526977539,
-0.023726588115096092,
0.5064906477928162,
0.05266067385673523,
-0.13782894611358643,
-0.2666981518268585,
-0.4021056890487671,
-0.4032999277114868,
0.2591351270675659,
0.2868085205554962,
-0.2034398913383484,
-0.08259401470422745,
-0.39772331714630127,
-0.04495704174041748,
0.3474798798561096,
0.04529901593923569,
-0.2977654039859772,
0.3502030372619629,
-0.20216187834739685,
0.19374851882457733,
0.36650002002716064,
0.048314169049263,
-0.3252546787261963,
0.3235197365283966,
-0.2271762490272522,
0.1593630015850067,
0.26789242029190063,
0.01734389364719391,
0.12171928584575653,
-0.10525019466876984,
0.07779577374458313,
0.23388715088367462,
-0.1331402063369751,
0.041271358728408813,
-0.2166253626346588,
0.1735142171382904,
-0.0811433270573616,
-0.1009964644908905,
-0.028715576976537704,
0.13521499931812286,
-0.016546592116355896,
0.043711550533771515,
0.37048688530921936,
-0.1652609407901764,
0.0911550521850586,
0.18870586156845093,
0.25282353162765503,
-0.1496049463748932,
0.13846755027770996,
-0.021027766168117523,
-0.3107548654079437,
0.21378810703754425,
-0.1389680802822113,
0.10406774282455444,
-0.40398091077804565,
-0.1228102594614029,
-0.23692521452903748,
0.30418160557746887,
-0.355906218290329,
-0.17567405104637146,
0.13329264521598816,
0.09730380773544312,
-0.10920222848653793,
-0.04176604375243187,
-0.17816254496574402,
0.09278661757707596,
-0.351763516664505,
0.0952969565987587,
-0.36988261342048645,
0.14325009286403656,
0.03660898655653,
-0.19214960932731628,
-0.08577239513397217,
0.04368959367275238,
0.14083275198936462,
-0.010060237720608711,
-0.03360937535762787,
0.2355310022830963,
0.4105110168457031,
0.0342116579413414,
-0.27520766854286194,
-0.0881127268075943,
-0.04730646312236786,
-0.0333423987030983,
-0.17359331250190735,
0.11127965897321701,
0.06077062711119652,
-0.16199812293052673,
0.038533054292201996,
0.3997645378112793,
-0.020583420991897583,
0.3240191340446472,
-0.06981866806745529,
0.2005484700202942,
0.24245473742485046,
0.021220237016677856,
0.004040353000164032,
-0.36596935987472534,
-0.09860140830278397,
0.1262367218732834,
0.031862132251262665,
0.17157992720603943,
-0.18312573432922363,
0.14698255062103271,
0.8064930438995361,
0.052492596209049225,
-0.1075921282172203,
-0.04722781479358673,
-0.2181302309036255,
-0.1424514800310135,
0.0904737189412117,
0.7266733646392822,
0.3785043954849243,
0.09051747620105743,
0.09853796660900116,
0.12512347102165222,
-0.10116367042064667,
-0.24194714426994324,
0.1314166933298111,
-0.09140820801258087,
0.26452890038490295,
0.13556770980358124,
0.06517429649829865,
-0.12995871901512146,
-0.32056236267089844,
-0.09169786423444748,
0.09210538864135742,
0.3198549449443817,
-0.28235018253326416,
0.38193175196647644,
-0.27775952219963074,
0.23330789804458618,
-0.263860285282135,
0.007037632167339325,
-0.046177756041288376,
-0.3171912133693695,
-0.02566426247358322,
0.2552991509437561,
-0.2555367350578308,
0.23317575454711914,
0.27462518215179443,
-0.06871207058429718,
0.3267672657966614,
-0.16282068192958832,
-0.16732853651046753,
-0.17645373940467834,
-0.2641761004924774,
0.08975377678871155,
0.27897346019744873,
-0.11483801156282425,
0.20433172583580017,
-0.039966970682144165,
-0.21791282296180725,
-0.15109029412269592,
-0.11985094100236893,
0.13655906915664673,
-0.3961308002471924,
0.6054110527038574,
0.3316963315010071,
0.017838548868894577,
-0.2102777510881424,
-0.22534418106079102,
0.3435792624950409,
0.03946086764335632,
-0.22080092132091522,
0.3147134780883789,
0.08072911947965622,
0.18667803704738617,
-0.2370038628578186,
-0.3330809772014618,
0.13968978822231293,
-0.15045702457427979,
0.09063811600208282,
0.14340093731880188,
0.32835716009140015,
0.18592576682567596,
0.23984166979789734,
-0.04028237611055374,
-0.15048529207706451,
0.10879357159137726,
-0.15397000312805176,
-0.32664892077445984,
0.16311410069465637,
-0.1309162974357605,
-0.3727894425392151,
0.009502731263637543,
-0.25579822063446045,
0.3095617890357971,
0.33607590198516846,
-0.35933125019073486,
-0.07952391356229782,
-0.09548017382621765,
0.09608592838048935,
0.04959162324666977,
-0.09582014381885529,
0.06153514236211777,
0.2093369960784912,
-0.11627832055091858,
-0.2525187134742737,
0.2807512879371643,
0.5255702137947083,
-0.2480117827653885,
-0.058763984590768814,
0.2321254014968872,
0.3146638870239258,
0.16989146173000336,
0.6522672176361084,
0.33269891142845154,
-0.23868818581104279,
0.026250695809721947,
-0.09359810501337051,
0.0958968847990036,
-0.12675878405570984,
-0.3676437735557556,
-0.20000439882278442,
0.11944623291492462,
-0.21220935881137848,
-0.037183962762355804,
-0.06948718428611755,
0.14362558722496033,
0.04778457432985306,
0.19904661178588867,
-0.02931852638721466,
-0.4188997745513916,
0.06207998842000961,
-0.3534839153289795,
0.23390522599220276,
-0.0018185153603553772,
0.29953569173812866,
-0.07888168096542358,
0.12136063724756241,
-0.15275900065898895,
-0.2272331416606903,
0.34357696771621704,
-0.22264662384986877,
-0.20912271738052368,
-0.20330777764320374,
-0.21964240074157715,
0.07948513329029083,
-0.002013538032770157,
0.12372930347919464,
-0.013597249984741211,
-0.31149935722351074,
0.1864255666732788,
-0.0752110406756401,
0.7218579053878784,
-0.14527854323387146,
0.0806717574596405,
0.22514064610004425,
-0.0037493929266929626,
0.08861763030290604,
0.1396578997373581,
-0.08758695423603058,
-0.10628650337457657,
0.024564165621995926,
0.19608071446418762,
-0.4938080906867981,
-0.1832541674375534,
0.022517144680023193,
0.16170810163021088,
-0.27420419454574585,
-0.004729650914669037,
-0.24293479323387146,
-0.25218188762664795,
-0.12842820584774017,
0.004679866135120392,
-0.043963316828012466,
0.320157527923584,
-0.22588929533958435,
-0.042550791054964066,
-0.22720099985599518,
-0.1451486498117447,
-0.03546355292201042,
0.25693953037261963,
0.2892206013202667,
-0.4538407623767853,
0.1847544014453888,
-0.09518636763095856,
0.0014899475499987602,
0.17531374096870422,
0.3397604525089264,
-0.051615312695503235,
-0.3519446849822998,
-0.36475303769111633,
-0.0782531127333641,
0.07314300537109375,
0.19057652354240417,
-0.3861370086669922,
0.07060487568378448,
-0.01658930629491806,
0.20212285220623016,
-0.10218991339206696,
0.06460395455360413,
0.5791630744934082,
-0.07099157571792603,
-0.04548242688179016,
-0.7101126313209534,
0.30384185910224915,
0.12906068563461304,
-0.15801063179969788,
0.3936196565628052,
0.01013290323317051,
-0.3858549892902374,
0.5526435971260071,
0.047394268214702606,
0.8315760493278503,
-0.032363276928663254,
0.08781810104846954,
0.5476921200752258,
0.481478750705719,
0.46340155601501465,
0.061275795102119446,
0.22169171273708344,
-0.436667263507843,
-0.06644263863563538,
0.006198473274707794,
-0.0649719089269638,
0.26376521587371826,
0.3466538190841675,
-0.06306405365467072,
0.0600644126534462,
-0.18439751863479614,
0.3075667917728424,
-0.020541496574878693,
0.04443950951099396,
0.05073004961013794,
-0.025608977302908897,
-0.3046756982803345,
0.13165447115898132,
0.05248681828379631,
-0.16619986295700073,
0.19981227815151215,
-0.2772303819656372,
-0.09476418048143387,
-0.45874205231666565,
-0.19773977994918823,
0.2560681402683258,
0.16485260426998138,
0.20870104432106018,
0.14699779450893402,
-0.3647993505001068,
-0.09907680004835129,
0.4680759906768799,
0.22057294845581055,
0.14880771934986115,
0.044703468680381775,
0.25167137384414673,
-0.013462714850902557,
0.2530905604362488,
-0.02477450855076313,
-0.19791486859321594,
0.40481430292129517,
-0.0469871386885643,
-0.2681368589401245,
0.09421196579933167,
-0.03376689553260803,
-0.3844759464263916,
-0.17629912495613098,
0.17863363027572632,
-0.1744941920042038,
-0.3034570813179016,
0.17454321682453156,
0.18681448698043823,
-0.11816760897636414,
-0.35960614681243896,
0.1977262794971466,
0.10988959670066833,
-0.29411888122558594,
0.3485908508300781,
-0.2193504422903061,
-0.06496137380599976,
-0.05059446394443512,
0.07009704411029816,
0.2770228981971741,
0.2781606912612915,
0.5193920135498047,
0.05686628818511963,
0.003728054463863373,
-0.38686978816986084,
-0.04071108251810074,
0.0993226170539856,
-0.32551977038383484,
0.4965094327926636,
0.14515116810798645,
0.26451054215431213,
0.07115666568279266,
0.12535758316516876,
-0.17370536923408508,
0.21235910058021545,
-0.13882337510585785,
-0.18387305736541748,
-0.08349190652370453,
0.0191964078694582,
-0.21004465222358704,
0.10635311901569366,
0.012596972286701202,
0.12514428794384003,
-0.28081876039505005,
0.27288058400154114,
-0.3642040491104126,
-0.0636899396777153,
-0.14787113666534424,
0.19674301147460938,
0.12510599195957184,
-0.12280357629060745,
0.12618182599544525,
0.04377398267388344,
0.2551786005496979,
-0.02453000470995903,
-0.20257897675037384,
-0.28495123982429504,
-0.11279991269111633,
0.08897656202316284,
0.010875297710299492,
-0.01983475312590599,
-0.06346739828586578,
0.055291056632995605,
-0.18079206347465515,
-0.19998547434806824,
0.34668898582458496,
-0.041756466031074524,
-0.05318190157413483,
0.3286387026309967,
0.22971105575561523,
0.40859198570251465,
0.02946341037750244,
-0.13359490036964417,
-0.4766758382320404,
0.14858758449554443,
-0.01601610705256462,
0.202903613448143,
0.16567710041999817,
-0.16246283054351807,
-0.1720626950263977,
0.08338387310504913,
-0.16632920503616333,
-0.17694690823554993,
0.6944023370742798,
-0.35234886407852173,
-0.35318130254745483,
-0.059244416654109955,
0.5709480047225952,
0.3852596580982208,
-0.14849452674388885,
-0.1366128921508789,
0.172578364610672,
0.2660880982875824,
-0.2827227711677551,
-0.2438805252313614,
0.16841989755630493,
0.04368026182055473,
0.152430459856987,
0.21906839311122894,
-0.006831161677837372,
-0.18577969074249268,
-0.13661006093025208,
0.02144952490925789,
0.30737942457199097,
-0.35207194089889526,
0.3450411260128021,
0.5913934111595154,
0.03600652515888214,
0.09812483191490173,
0.2469237595796585,
-0.01257352065294981,
0.2575858235359192,
0.8022925853729248,
-0.21473823487758636,
0.48949500918388367,
-0.10421648621559143,
-0.12635324895381927,
0.13281460106372833,
-0.37151122093200684,
0.2334393560886383,
0.3077058792114258,
-0.3464195728302002,
-0.11042803525924683,
-0.10757662355899811,
0.478206604719162,
0.16364721953868866,
-0.02160448022186756,
-0.28433549404144287,
0.3604546785354614,
-0.059491731226444244,
-0.15640142560005188,
-0.42755118012428284,
-0.18138667941093445,
-0.2011992335319519,
0.0033804625272750854,
0.1361466348171234,
-0.10238434374332428,
0.4187743067741394,
-0.04344240948557854,
-0.04847734421491623,
-0.15251952409744263,
0.22734910249710083,
-0.11629734188318253,
0.04332106187939644,
-0.3451710343360901,
-0.034015268087387085,
0.3565813899040222,
-0.08095864951610565,
0.05285690352320671,
-0.1462164670228958,
0.3024649918079376,
0.36468616127967834,
0.011158954352140427,
-0.07417701184749603,
-0.1680934876203537,
-0.2048870474100113,
-0.34814587235450745,
0.3729678988456726,
-0.3150898218154907,
0.09356921911239624,
0.18638193607330322,
0.13495315611362457,
-0.17654219269752502,
-0.01852545142173767,
0.18300718069076538,
0.44401127099990845,
-0.1696707308292389,
0.48180800676345825,
-0.2359336018562317,
-0.1163000762462616,
-0.14245203137397766,
0.1533540040254593,
-0.2931213974952698,
-0.10921701788902283,
0.5346869826316833,
0.13562452793121338,
0.17210228741168976,
-0.29986464977264404,
0.10618337243795395,
-0.16508769989013672,
0.3083075284957886,
-0.18725711107254028,
0.08362914621829987,
-0.22967875003814697,
-0.09506864845752716,
-0.3746106028556824,
0.1000114306807518,
-0.18890945613384247,
0.1772850602865219,
-0.06488794088363647,
0.2627214193344116,
0.019840437918901443,
0.12302009761333466,
-0.16196206212043762,
-0.18251562118530273,
-0.3567834794521332,
0.4094754457473755,
-0.23212680220603943,
-0.14471988379955292,
-0.0760062038898468,
-0.17873293161392212,
-0.0732550248503685,
-0.330486536026001,
0.2590421140193939,
-0.29810550808906555,
0.13757939636707306,
0.0018403511494398117,
-0.06966988742351532,
0.23709118366241455,
0.10657782852649689,
0.14694161713123322,
0.4893016815185547,
0.142564594745636,
-0.024495434015989304,
-0.16443750262260437,
-0.338314950466156,
-0.1415187418460846,
-0.30600613355636597,
0.12002711743116379,
-0.020306933671236038,
0.547357976436615,
-0.05868305638432503,
0.007012508809566498,
-0.38081052899360657,
0.24240729212760925,
0.0697404071688652,
-0.20524655282497406,
-0.2095746099948883,
0.24344104528427124,
-0.27421319484710693,
0.16151446104049683,
0.014361981302499771,
0.004746877588331699,
0.02521655708551407,
0.09547092765569687,
-0.23009872436523438,
-0.5110782980918884,
0.36375904083251953,
-0.5501344799995422,
-0.30043262243270874,
-0.09401419013738632,
0.20327742397785187,
-0.013635654002428055,
-0.26886773109436035,
-0.17490705847740173,
-0.07122842967510223,
0.38877516984939575,
-0.04315933585166931,
-0.036049146205186844,
0.1864093840122223,
0.2220209836959839,
-0.0035575851798057556,
-0.01628410443663597,
0.035193223506212234,
-0.04149104654788971,
-0.35925915837287903,
0.21217551827430725,
-0.27191686630249023
] |
https://github.com/huggingface/datasets/issues/6270 | It sounds like you are saying that num_proc affects the form of gen_kwargs.
Are you saying that for non-zero num_proc gen_kwargs should be a list whose length is the same as num_proc?
Or are you saying that for non-zero num_proc, gen_kwargs should be a dict whose elements are lists the length of num_proc?
| Dataset.from_generator raises with sharded gen_args | ### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
| 53 | Dataset.from_generator raises with sharded gen_args
### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
It sounds like you are saying that num_proc affects the form of gen_kwargs.
Are you saying that for non-zero num_proc gen_kwargs should be a list whose length is the same as num_proc?
Or are you saying that for non-zero num_proc, gen_kwargs should be a dict whose elements are lists the length of num_proc?
| [
-0.15784285962581635,
-0.10980907082557678,
-0.023734301328659058,
0.26803869009017944,
0.4730006158351898,
-0.033754147589206696,
0.549604058265686,
0.1978403627872467,
-0.1852407455444336,
0.12854865193367004,
0.3643640875816345,
0.3822571337223053,
-0.16803902387619019,
0.011552132666110992,
0.09968142211437225,
-0.14850389957427979,
0.26457545161247253,
-0.0006915032863616943,
-0.2629392147064209,
-0.23543009161949158,
-0.24016904830932617,
0.22717100381851196,
-0.1817735880613327,
0.04174627363681793,
-0.1491759866476059,
-0.10244195908308029,
-0.07896298170089722,
0.24702605605125427,
0.07482917606830597,
-0.2893107235431671,
0.18971434235572815,
-0.1778041124343872,
-0.22012463212013245,
0.259885311126709,
-0.00010609811579342932,
0.06207677721977234,
0.4077569842338562,
0.049807026982307434,
-0.2411380261182785,
-0.13297505676746368,
-0.29373109340667725,
0.07795015722513199,
-0.1174921840429306,
-0.3742959201335907,
-0.1084788590669632,
-0.16993947327136993,
-0.15880033373832703,
-0.30634263157844543,
0.7054424285888672,
0.331430584192276,
0.23277464509010315,
-0.0111805759370327,
0.11429344117641449,
-0.07272511720657349,
0.42983731627464294,
0.3433683216571808,
-0.09498411417007446,
-0.1322554498910904,
-0.25734683871269226,
0.04719609022140503,
0.03659772127866745,
0.31393957138061523,
-0.16736260056495667,
0.005901111289858818,
0.15913714468479156,
0.24970027804374695,
-0.13912111520767212,
-0.25681912899017334,
-0.023533577099442482,
0.2173217535018921,
-0.055103372782468796,
-0.26205095648765564,
-0.27958542108535767,
-0.35682412981987,
-0.08268633484840393,
-0.4586637616157532,
0.11594999581575394,
0.09201992303133011,
-0.3122900724411011,
0.0677146315574646,
-0.0877026915550232,
0.006484527140855789,
-0.15010270476341248,
-0.04630066454410553,
0.1011822298169136,
0.16190913319587708,
-0.039254650473594666,
0.29482302069664,
0.24209558963775635,
0.05493514612317085,
-0.05267195403575897,
-0.0015112627297639847,
-0.0795370563864708,
-0.019040921702980995,
-0.4661932587623596,
-0.02479834109544754,
0.2009052038192749,
-0.276576429605484,
0.0862012580037117,
0.07945075631141663,
-0.02193094603717327,
-0.10098148882389069,
0.242404043674469,
0.1604568362236023,
0.27836355566978455,
-0.0456102080643177,
0.18043239414691925,
0.3785388171672821,
0.13116325438022614,
0.044349342584609985,
-0.3036634624004364,
0.0809030532836914,
0.008122533559799194,
-0.193753182888031,
0.27301284670829773,
-0.01460731215775013,
0.28890252113342285,
0.17850612103939056,
-0.3090308606624603,
0.11624543368816376,
-0.30112677812576294,
-0.08697660267353058,
0.03894142061471939,
0.32567957043647766,
-0.015029698610305786,
0.050866853445768356,
-0.1166703924536705,
0.018695807084441185,
-0.0795060247182846,
-0.3491377532482147,
-0.35638630390167236,
-0.07875393331050873,
-0.12187393754720688,
0.103138767182827,
-0.10816357284784317,
0.15306691825389862,
0.2628326416015625,
0.22616730630397797,
0.018397357314825058,
-0.21673408150672913,
0.236505925655365,
-0.0792684257030487,
0.17069011926651,
0.29507318139076233,
-0.16784079372882843,
0.17946548759937286,
0.31153082847595215,
-0.15768113732337952,
0.04069820046424866,
0.09573684632778168,
-0.20743459463119507,
-0.24198220670223236,
0.2103128433227539,
0.2611261308193207,
-0.1624443531036377,
0.2883467674255371,
-0.2608499526977539,
-0.023726588115096092,
0.5064906477928162,
0.05266067385673523,
-0.13782894611358643,
-0.2666981518268585,
-0.4021056890487671,
-0.4032999277114868,
0.2591351270675659,
0.2868085205554962,
-0.2034398913383484,
-0.08259401470422745,
-0.39772331714630127,
-0.04495704174041748,
0.3474798798561096,
0.04529901593923569,
-0.2977654039859772,
0.3502030372619629,
-0.20216187834739685,
0.19374851882457733,
0.36650002002716064,
0.048314169049263,
-0.3252546787261963,
0.3235197365283966,
-0.2271762490272522,
0.1593630015850067,
0.26789242029190063,
0.01734389364719391,
0.12171928584575653,
-0.10525019466876984,
0.07779577374458313,
0.23388715088367462,
-0.1331402063369751,
0.041271358728408813,
-0.2166253626346588,
0.1735142171382904,
-0.0811433270573616,
-0.1009964644908905,
-0.028715576976537704,
0.13521499931812286,
-0.016546592116355896,
0.043711550533771515,
0.37048688530921936,
-0.1652609407901764,
0.0911550521850586,
0.18870586156845093,
0.25282353162765503,
-0.1496049463748932,
0.13846755027770996,
-0.021027766168117523,
-0.3107548654079437,
0.21378810703754425,
-0.1389680802822113,
0.10406774282455444,
-0.40398091077804565,
-0.1228102594614029,
-0.23692521452903748,
0.30418160557746887,
-0.355906218290329,
-0.17567405104637146,
0.13329264521598816,
0.09730380773544312,
-0.10920222848653793,
-0.04176604375243187,
-0.17816254496574402,
0.09278661757707596,
-0.351763516664505,
0.0952969565987587,
-0.36988261342048645,
0.14325009286403656,
0.03660898655653,
-0.19214960932731628,
-0.08577239513397217,
0.04368959367275238,
0.14083275198936462,
-0.010060237720608711,
-0.03360937535762787,
0.2355310022830963,
0.4105110168457031,
0.0342116579413414,
-0.27520766854286194,
-0.0881127268075943,
-0.04730646312236786,
-0.0333423987030983,
-0.17359331250190735,
0.11127965897321701,
0.06077062711119652,
-0.16199812293052673,
0.038533054292201996,
0.3997645378112793,
-0.020583420991897583,
0.3240191340446472,
-0.06981866806745529,
0.2005484700202942,
0.24245473742485046,
0.021220237016677856,
0.004040353000164032,
-0.36596935987472534,
-0.09860140830278397,
0.1262367218732834,
0.031862132251262665,
0.17157992720603943,
-0.18312573432922363,
0.14698255062103271,
0.8064930438995361,
0.052492596209049225,
-0.1075921282172203,
-0.04722781479358673,
-0.2181302309036255,
-0.1424514800310135,
0.0904737189412117,
0.7266733646392822,
0.3785043954849243,
0.09051747620105743,
0.09853796660900116,
0.12512347102165222,
-0.10116367042064667,
-0.24194714426994324,
0.1314166933298111,
-0.09140820801258087,
0.26452890038490295,
0.13556770980358124,
0.06517429649829865,
-0.12995871901512146,
-0.32056236267089844,
-0.09169786423444748,
0.09210538864135742,
0.3198549449443817,
-0.28235018253326416,
0.38193175196647644,
-0.27775952219963074,
0.23330789804458618,
-0.263860285282135,
0.007037632167339325,
-0.046177756041288376,
-0.3171912133693695,
-0.02566426247358322,
0.2552991509437561,
-0.2555367350578308,
0.23317575454711914,
0.27462518215179443,
-0.06871207058429718,
0.3267672657966614,
-0.16282068192958832,
-0.16732853651046753,
-0.17645373940467834,
-0.2641761004924774,
0.08975377678871155,
0.27897346019744873,
-0.11483801156282425,
0.20433172583580017,
-0.039966970682144165,
-0.21791282296180725,
-0.15109029412269592,
-0.11985094100236893,
0.13655906915664673,
-0.3961308002471924,
0.6054110527038574,
0.3316963315010071,
0.017838548868894577,
-0.2102777510881424,
-0.22534418106079102,
0.3435792624950409,
0.03946086764335632,
-0.22080092132091522,
0.3147134780883789,
0.08072911947965622,
0.18667803704738617,
-0.2370038628578186,
-0.3330809772014618,
0.13968978822231293,
-0.15045702457427979,
0.09063811600208282,
0.14340093731880188,
0.32835716009140015,
0.18592576682567596,
0.23984166979789734,
-0.04028237611055374,
-0.15048529207706451,
0.10879357159137726,
-0.15397000312805176,
-0.32664892077445984,
0.16311410069465637,
-0.1309162974357605,
-0.3727894425392151,
0.009502731263637543,
-0.25579822063446045,
0.3095617890357971,
0.33607590198516846,
-0.35933125019073486,
-0.07952391356229782,
-0.09548017382621765,
0.09608592838048935,
0.04959162324666977,
-0.09582014381885529,
0.06153514236211777,
0.2093369960784912,
-0.11627832055091858,
-0.2525187134742737,
0.2807512879371643,
0.5255702137947083,
-0.2480117827653885,
-0.058763984590768814,
0.2321254014968872,
0.3146638870239258,
0.16989146173000336,
0.6522672176361084,
0.33269891142845154,
-0.23868818581104279,
0.026250695809721947,
-0.09359810501337051,
0.0958968847990036,
-0.12675878405570984,
-0.3676437735557556,
-0.20000439882278442,
0.11944623291492462,
-0.21220935881137848,
-0.037183962762355804,
-0.06948718428611755,
0.14362558722496033,
0.04778457432985306,
0.19904661178588867,
-0.02931852638721466,
-0.4188997745513916,
0.06207998842000961,
-0.3534839153289795,
0.23390522599220276,
-0.0018185153603553772,
0.29953569173812866,
-0.07888168096542358,
0.12136063724756241,
-0.15275900065898895,
-0.2272331416606903,
0.34357696771621704,
-0.22264662384986877,
-0.20912271738052368,
-0.20330777764320374,
-0.21964240074157715,
0.07948513329029083,
-0.002013538032770157,
0.12372930347919464,
-0.013597249984741211,
-0.31149935722351074,
0.1864255666732788,
-0.0752110406756401,
0.7218579053878784,
-0.14527854323387146,
0.0806717574596405,
0.22514064610004425,
-0.0037493929266929626,
0.08861763030290604,
0.1396578997373581,
-0.08758695423603058,
-0.10628650337457657,
0.024564165621995926,
0.19608071446418762,
-0.4938080906867981,
-0.1832541674375534,
0.022517144680023193,
0.16170810163021088,
-0.27420419454574585,
-0.004729650914669037,
-0.24293479323387146,
-0.25218188762664795,
-0.12842820584774017,
0.004679866135120392,
-0.043963316828012466,
0.320157527923584,
-0.22588929533958435,
-0.042550791054964066,
-0.22720099985599518,
-0.1451486498117447,
-0.03546355292201042,
0.25693953037261963,
0.2892206013202667,
-0.4538407623767853,
0.1847544014453888,
-0.09518636763095856,
0.0014899475499987602,
0.17531374096870422,
0.3397604525089264,
-0.051615312695503235,
-0.3519446849822998,
-0.36475303769111633,
-0.0782531127333641,
0.07314300537109375,
0.19057652354240417,
-0.3861370086669922,
0.07060487568378448,
-0.01658930629491806,
0.20212285220623016,
-0.10218991339206696,
0.06460395455360413,
0.5791630744934082,
-0.07099157571792603,
-0.04548242688179016,
-0.7101126313209534,
0.30384185910224915,
0.12906068563461304,
-0.15801063179969788,
0.3936196565628052,
0.01013290323317051,
-0.3858549892902374,
0.5526435971260071,
0.047394268214702606,
0.8315760493278503,
-0.032363276928663254,
0.08781810104846954,
0.5476921200752258,
0.481478750705719,
0.46340155601501465,
0.061275795102119446,
0.22169171273708344,
-0.436667263507843,
-0.06644263863563538,
0.006198473274707794,
-0.0649719089269638,
0.26376521587371826,
0.3466538190841675,
-0.06306405365467072,
0.0600644126534462,
-0.18439751863479614,
0.3075667917728424,
-0.020541496574878693,
0.04443950951099396,
0.05073004961013794,
-0.025608977302908897,
-0.3046756982803345,
0.13165447115898132,
0.05248681828379631,
-0.16619986295700073,
0.19981227815151215,
-0.2772303819656372,
-0.09476418048143387,
-0.45874205231666565,
-0.19773977994918823,
0.2560681402683258,
0.16485260426998138,
0.20870104432106018,
0.14699779450893402,
-0.3647993505001068,
-0.09907680004835129,
0.4680759906768799,
0.22057294845581055,
0.14880771934986115,
0.044703468680381775,
0.25167137384414673,
-0.013462714850902557,
0.2530905604362488,
-0.02477450855076313,
-0.19791486859321594,
0.40481430292129517,
-0.0469871386885643,
-0.2681368589401245,
0.09421196579933167,
-0.03376689553260803,
-0.3844759464263916,
-0.17629912495613098,
0.17863363027572632,
-0.1744941920042038,
-0.3034570813179016,
0.17454321682453156,
0.18681448698043823,
-0.11816760897636414,
-0.35960614681243896,
0.1977262794971466,
0.10988959670066833,
-0.29411888122558594,
0.3485908508300781,
-0.2193504422903061,
-0.06496137380599976,
-0.05059446394443512,
0.07009704411029816,
0.2770228981971741,
0.2781606912612915,
0.5193920135498047,
0.05686628818511963,
0.003728054463863373,
-0.38686978816986084,
-0.04071108251810074,
0.0993226170539856,
-0.32551977038383484,
0.4965094327926636,
0.14515116810798645,
0.26451054215431213,
0.07115666568279266,
0.12535758316516876,
-0.17370536923408508,
0.21235910058021545,
-0.13882337510585785,
-0.18387305736541748,
-0.08349190652370453,
0.0191964078694582,
-0.21004465222358704,
0.10635311901569366,
0.012596972286701202,
0.12514428794384003,
-0.28081876039505005,
0.27288058400154114,
-0.3642040491104126,
-0.0636899396777153,
-0.14787113666534424,
0.19674301147460938,
0.12510599195957184,
-0.12280357629060745,
0.12618182599544525,
0.04377398267388344,
0.2551786005496979,
-0.02453000470995903,
-0.20257897675037384,
-0.28495123982429504,
-0.11279991269111633,
0.08897656202316284,
0.010875297710299492,
-0.01983475312590599,
-0.06346739828586578,
0.055291056632995605,
-0.18079206347465515,
-0.19998547434806824,
0.34668898582458496,
-0.041756466031074524,
-0.05318190157413483,
0.3286387026309967,
0.22971105575561523,
0.40859198570251465,
0.02946341037750244,
-0.13359490036964417,
-0.4766758382320404,
0.14858758449554443,
-0.01601610705256462,
0.202903613448143,
0.16567710041999817,
-0.16246283054351807,
-0.1720626950263977,
0.08338387310504913,
-0.16632920503616333,
-0.17694690823554993,
0.6944023370742798,
-0.35234886407852173,
-0.35318130254745483,
-0.059244416654109955,
0.5709480047225952,
0.3852596580982208,
-0.14849452674388885,
-0.1366128921508789,
0.172578364610672,
0.2660880982875824,
-0.2827227711677551,
-0.2438805252313614,
0.16841989755630493,
0.04368026182055473,
0.152430459856987,
0.21906839311122894,
-0.006831161677837372,
-0.18577969074249268,
-0.13661006093025208,
0.02144952490925789,
0.30737942457199097,
-0.35207194089889526,
0.3450411260128021,
0.5913934111595154,
0.03600652515888214,
0.09812483191490173,
0.2469237595796585,
-0.01257352065294981,
0.2575858235359192,
0.8022925853729248,
-0.21473823487758636,
0.48949500918388367,
-0.10421648621559143,
-0.12635324895381927,
0.13281460106372833,
-0.37151122093200684,
0.2334393560886383,
0.3077058792114258,
-0.3464195728302002,
-0.11042803525924683,
-0.10757662355899811,
0.478206604719162,
0.16364721953868866,
-0.02160448022186756,
-0.28433549404144287,
0.3604546785354614,
-0.059491731226444244,
-0.15640142560005188,
-0.42755118012428284,
-0.18138667941093445,
-0.2011992335319519,
0.0033804625272750854,
0.1361466348171234,
-0.10238434374332428,
0.4187743067741394,
-0.04344240948557854,
-0.04847734421491623,
-0.15251952409744263,
0.22734910249710083,
-0.11629734188318253,
0.04332106187939644,
-0.3451710343360901,
-0.034015268087387085,
0.3565813899040222,
-0.08095864951610565,
0.05285690352320671,
-0.1462164670228958,
0.3024649918079376,
0.36468616127967834,
0.011158954352140427,
-0.07417701184749603,
-0.1680934876203537,
-0.2048870474100113,
-0.34814587235450745,
0.3729678988456726,
-0.3150898218154907,
0.09356921911239624,
0.18638193607330322,
0.13495315611362457,
-0.17654219269752502,
-0.01852545142173767,
0.18300718069076538,
0.44401127099990845,
-0.1696707308292389,
0.48180800676345825,
-0.2359336018562317,
-0.1163000762462616,
-0.14245203137397766,
0.1533540040254593,
-0.2931213974952698,
-0.10921701788902283,
0.5346869826316833,
0.13562452793121338,
0.17210228741168976,
-0.29986464977264404,
0.10618337243795395,
-0.16508769989013672,
0.3083075284957886,
-0.18725711107254028,
0.08362914621829987,
-0.22967875003814697,
-0.09506864845752716,
-0.3746106028556824,
0.1000114306807518,
-0.18890945613384247,
0.1772850602865219,
-0.06488794088363647,
0.2627214193344116,
0.019840437918901443,
0.12302009761333466,
-0.16196206212043762,
-0.18251562118530273,
-0.3567834794521332,
0.4094754457473755,
-0.23212680220603943,
-0.14471988379955292,
-0.0760062038898468,
-0.17873293161392212,
-0.0732550248503685,
-0.330486536026001,
0.2590421140193939,
-0.29810550808906555,
0.13757939636707306,
0.0018403511494398117,
-0.06966988742351532,
0.23709118366241455,
0.10657782852649689,
0.14694161713123322,
0.4893016815185547,
0.142564594745636,
-0.024495434015989304,
-0.16443750262260437,
-0.338314950466156,
-0.1415187418460846,
-0.30600613355636597,
0.12002711743116379,
-0.020306933671236038,
0.547357976436615,
-0.05868305638432503,
0.007012508809566498,
-0.38081052899360657,
0.24240729212760925,
0.0697404071688652,
-0.20524655282497406,
-0.2095746099948883,
0.24344104528427124,
-0.27421319484710693,
0.16151446104049683,
0.014361981302499771,
0.004746877588331699,
0.02521655708551407,
0.09547092765569687,
-0.23009872436523438,
-0.5110782980918884,
0.36375904083251953,
-0.5501344799995422,
-0.30043262243270874,
-0.09401419013738632,
0.20327742397785187,
-0.013635654002428055,
-0.26886773109436035,
-0.17490705847740173,
-0.07122842967510223,
0.38877516984939575,
-0.04315933585166931,
-0.036049146205186844,
0.1864093840122223,
0.2220209836959839,
-0.0035575851798057556,
-0.01628410443663597,
0.035193223506212234,
-0.04149104654788971,
-0.35925915837287903,
0.21217551827430725,
-0.27191686630249023
] |
https://github.com/huggingface/datasets/issues/6270 | I ran some tests. So, it looks like with num_proc greater than 1, gen_kwargs is expected to be a dict of lists. It calls the generator also with a dict of lists, but the lists are split.
I.E. if my original has `gen_kwargs=dict(a=[0,1,2])`, then my generator might get called with `gen_kwalrgs=dict([0])`.
That all makes sense, but I definitely think there is room for improvement in the doc string here.
In order to suggest improvements to the doc string, I need to look at how the gen_kwargs are split, and figure out if:
* num_proc needs to exactly equal the length of the lists
* num_proc needs to evenly divide the length of the lists
* Or there's no required relationship.
I'll look into that and then propose an improved doc string if no one else gets to it first. | Dataset.from_generator raises with sharded gen_args | ### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
| 139 | Dataset.from_generator raises with sharded gen_args
### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
I ran some tests. So, it looks like with num_proc greater than 1, gen_kwargs is expected to be a dict of lists. It calls the generator also with a dict of lists, but the lists are split.
I.E. if my original has `gen_kwargs=dict(a=[0,1,2])`, then my generator might get called with `gen_kwalrgs=dict([0])`.
That all makes sense, but I definitely think there is room for improvement in the doc string here.
In order to suggest improvements to the doc string, I need to look at how the gen_kwargs are split, and figure out if:
* num_proc needs to exactly equal the length of the lists
* num_proc needs to evenly divide the length of the lists
* Or there's no required relationship.
I'll look into that and then propose an improved doc string if no one else gets to it first. | [
-0.15784285962581635,
-0.10980907082557678,
-0.023734301328659058,
0.26803869009017944,
0.4730006158351898,
-0.033754147589206696,
0.549604058265686,
0.1978403627872467,
-0.1852407455444336,
0.12854865193367004,
0.3643640875816345,
0.3822571337223053,
-0.16803902387619019,
0.011552132666110992,
0.09968142211437225,
-0.14850389957427979,
0.26457545161247253,
-0.0006915032863616943,
-0.2629392147064209,
-0.23543009161949158,
-0.24016904830932617,
0.22717100381851196,
-0.1817735880613327,
0.04174627363681793,
-0.1491759866476059,
-0.10244195908308029,
-0.07896298170089722,
0.24702605605125427,
0.07482917606830597,
-0.2893107235431671,
0.18971434235572815,
-0.1778041124343872,
-0.22012463212013245,
0.259885311126709,
-0.00010609811579342932,
0.06207677721977234,
0.4077569842338562,
0.049807026982307434,
-0.2411380261182785,
-0.13297505676746368,
-0.29373109340667725,
0.07795015722513199,
-0.1174921840429306,
-0.3742959201335907,
-0.1084788590669632,
-0.16993947327136993,
-0.15880033373832703,
-0.30634263157844543,
0.7054424285888672,
0.331430584192276,
0.23277464509010315,
-0.0111805759370327,
0.11429344117641449,
-0.07272511720657349,
0.42983731627464294,
0.3433683216571808,
-0.09498411417007446,
-0.1322554498910904,
-0.25734683871269226,
0.04719609022140503,
0.03659772127866745,
0.31393957138061523,
-0.16736260056495667,
0.005901111289858818,
0.15913714468479156,
0.24970027804374695,
-0.13912111520767212,
-0.25681912899017334,
-0.023533577099442482,
0.2173217535018921,
-0.055103372782468796,
-0.26205095648765564,
-0.27958542108535767,
-0.35682412981987,
-0.08268633484840393,
-0.4586637616157532,
0.11594999581575394,
0.09201992303133011,
-0.3122900724411011,
0.0677146315574646,
-0.0877026915550232,
0.006484527140855789,
-0.15010270476341248,
-0.04630066454410553,
0.1011822298169136,
0.16190913319587708,
-0.039254650473594666,
0.29482302069664,
0.24209558963775635,
0.05493514612317085,
-0.05267195403575897,
-0.0015112627297639847,
-0.0795370563864708,
-0.019040921702980995,
-0.4661932587623596,
-0.02479834109544754,
0.2009052038192749,
-0.276576429605484,
0.0862012580037117,
0.07945075631141663,
-0.02193094603717327,
-0.10098148882389069,
0.242404043674469,
0.1604568362236023,
0.27836355566978455,
-0.0456102080643177,
0.18043239414691925,
0.3785388171672821,
0.13116325438022614,
0.044349342584609985,
-0.3036634624004364,
0.0809030532836914,
0.008122533559799194,
-0.193753182888031,
0.27301284670829773,
-0.01460731215775013,
0.28890252113342285,
0.17850612103939056,
-0.3090308606624603,
0.11624543368816376,
-0.30112677812576294,
-0.08697660267353058,
0.03894142061471939,
0.32567957043647766,
-0.015029698610305786,
0.050866853445768356,
-0.1166703924536705,
0.018695807084441185,
-0.0795060247182846,
-0.3491377532482147,
-0.35638630390167236,
-0.07875393331050873,
-0.12187393754720688,
0.103138767182827,
-0.10816357284784317,
0.15306691825389862,
0.2628326416015625,
0.22616730630397797,
0.018397357314825058,
-0.21673408150672913,
0.236505925655365,
-0.0792684257030487,
0.17069011926651,
0.29507318139076233,
-0.16784079372882843,
0.17946548759937286,
0.31153082847595215,
-0.15768113732337952,
0.04069820046424866,
0.09573684632778168,
-0.20743459463119507,
-0.24198220670223236,
0.2103128433227539,
0.2611261308193207,
-0.1624443531036377,
0.2883467674255371,
-0.2608499526977539,
-0.023726588115096092,
0.5064906477928162,
0.05266067385673523,
-0.13782894611358643,
-0.2666981518268585,
-0.4021056890487671,
-0.4032999277114868,
0.2591351270675659,
0.2868085205554962,
-0.2034398913383484,
-0.08259401470422745,
-0.39772331714630127,
-0.04495704174041748,
0.3474798798561096,
0.04529901593923569,
-0.2977654039859772,
0.3502030372619629,
-0.20216187834739685,
0.19374851882457733,
0.36650002002716064,
0.048314169049263,
-0.3252546787261963,
0.3235197365283966,
-0.2271762490272522,
0.1593630015850067,
0.26789242029190063,
0.01734389364719391,
0.12171928584575653,
-0.10525019466876984,
0.07779577374458313,
0.23388715088367462,
-0.1331402063369751,
0.041271358728408813,
-0.2166253626346588,
0.1735142171382904,
-0.0811433270573616,
-0.1009964644908905,
-0.028715576976537704,
0.13521499931812286,
-0.016546592116355896,
0.043711550533771515,
0.37048688530921936,
-0.1652609407901764,
0.0911550521850586,
0.18870586156845093,
0.25282353162765503,
-0.1496049463748932,
0.13846755027770996,
-0.021027766168117523,
-0.3107548654079437,
0.21378810703754425,
-0.1389680802822113,
0.10406774282455444,
-0.40398091077804565,
-0.1228102594614029,
-0.23692521452903748,
0.30418160557746887,
-0.355906218290329,
-0.17567405104637146,
0.13329264521598816,
0.09730380773544312,
-0.10920222848653793,
-0.04176604375243187,
-0.17816254496574402,
0.09278661757707596,
-0.351763516664505,
0.0952969565987587,
-0.36988261342048645,
0.14325009286403656,
0.03660898655653,
-0.19214960932731628,
-0.08577239513397217,
0.04368959367275238,
0.14083275198936462,
-0.010060237720608711,
-0.03360937535762787,
0.2355310022830963,
0.4105110168457031,
0.0342116579413414,
-0.27520766854286194,
-0.0881127268075943,
-0.04730646312236786,
-0.0333423987030983,
-0.17359331250190735,
0.11127965897321701,
0.06077062711119652,
-0.16199812293052673,
0.038533054292201996,
0.3997645378112793,
-0.020583420991897583,
0.3240191340446472,
-0.06981866806745529,
0.2005484700202942,
0.24245473742485046,
0.021220237016677856,
0.004040353000164032,
-0.36596935987472534,
-0.09860140830278397,
0.1262367218732834,
0.031862132251262665,
0.17157992720603943,
-0.18312573432922363,
0.14698255062103271,
0.8064930438995361,
0.052492596209049225,
-0.1075921282172203,
-0.04722781479358673,
-0.2181302309036255,
-0.1424514800310135,
0.0904737189412117,
0.7266733646392822,
0.3785043954849243,
0.09051747620105743,
0.09853796660900116,
0.12512347102165222,
-0.10116367042064667,
-0.24194714426994324,
0.1314166933298111,
-0.09140820801258087,
0.26452890038490295,
0.13556770980358124,
0.06517429649829865,
-0.12995871901512146,
-0.32056236267089844,
-0.09169786423444748,
0.09210538864135742,
0.3198549449443817,
-0.28235018253326416,
0.38193175196647644,
-0.27775952219963074,
0.23330789804458618,
-0.263860285282135,
0.007037632167339325,
-0.046177756041288376,
-0.3171912133693695,
-0.02566426247358322,
0.2552991509437561,
-0.2555367350578308,
0.23317575454711914,
0.27462518215179443,
-0.06871207058429718,
0.3267672657966614,
-0.16282068192958832,
-0.16732853651046753,
-0.17645373940467834,
-0.2641761004924774,
0.08975377678871155,
0.27897346019744873,
-0.11483801156282425,
0.20433172583580017,
-0.039966970682144165,
-0.21791282296180725,
-0.15109029412269592,
-0.11985094100236893,
0.13655906915664673,
-0.3961308002471924,
0.6054110527038574,
0.3316963315010071,
0.017838548868894577,
-0.2102777510881424,
-0.22534418106079102,
0.3435792624950409,
0.03946086764335632,
-0.22080092132091522,
0.3147134780883789,
0.08072911947965622,
0.18667803704738617,
-0.2370038628578186,
-0.3330809772014618,
0.13968978822231293,
-0.15045702457427979,
0.09063811600208282,
0.14340093731880188,
0.32835716009140015,
0.18592576682567596,
0.23984166979789734,
-0.04028237611055374,
-0.15048529207706451,
0.10879357159137726,
-0.15397000312805176,
-0.32664892077445984,
0.16311410069465637,
-0.1309162974357605,
-0.3727894425392151,
0.009502731263637543,
-0.25579822063446045,
0.3095617890357971,
0.33607590198516846,
-0.35933125019073486,
-0.07952391356229782,
-0.09548017382621765,
0.09608592838048935,
0.04959162324666977,
-0.09582014381885529,
0.06153514236211777,
0.2093369960784912,
-0.11627832055091858,
-0.2525187134742737,
0.2807512879371643,
0.5255702137947083,
-0.2480117827653885,
-0.058763984590768814,
0.2321254014968872,
0.3146638870239258,
0.16989146173000336,
0.6522672176361084,
0.33269891142845154,
-0.23868818581104279,
0.026250695809721947,
-0.09359810501337051,
0.0958968847990036,
-0.12675878405570984,
-0.3676437735557556,
-0.20000439882278442,
0.11944623291492462,
-0.21220935881137848,
-0.037183962762355804,
-0.06948718428611755,
0.14362558722496033,
0.04778457432985306,
0.19904661178588867,
-0.02931852638721466,
-0.4188997745513916,
0.06207998842000961,
-0.3534839153289795,
0.23390522599220276,
-0.0018185153603553772,
0.29953569173812866,
-0.07888168096542358,
0.12136063724756241,
-0.15275900065898895,
-0.2272331416606903,
0.34357696771621704,
-0.22264662384986877,
-0.20912271738052368,
-0.20330777764320374,
-0.21964240074157715,
0.07948513329029083,
-0.002013538032770157,
0.12372930347919464,
-0.013597249984741211,
-0.31149935722351074,
0.1864255666732788,
-0.0752110406756401,
0.7218579053878784,
-0.14527854323387146,
0.0806717574596405,
0.22514064610004425,
-0.0037493929266929626,
0.08861763030290604,
0.1396578997373581,
-0.08758695423603058,
-0.10628650337457657,
0.024564165621995926,
0.19608071446418762,
-0.4938080906867981,
-0.1832541674375534,
0.022517144680023193,
0.16170810163021088,
-0.27420419454574585,
-0.004729650914669037,
-0.24293479323387146,
-0.25218188762664795,
-0.12842820584774017,
0.004679866135120392,
-0.043963316828012466,
0.320157527923584,
-0.22588929533958435,
-0.042550791054964066,
-0.22720099985599518,
-0.1451486498117447,
-0.03546355292201042,
0.25693953037261963,
0.2892206013202667,
-0.4538407623767853,
0.1847544014453888,
-0.09518636763095856,
0.0014899475499987602,
0.17531374096870422,
0.3397604525089264,
-0.051615312695503235,
-0.3519446849822998,
-0.36475303769111633,
-0.0782531127333641,
0.07314300537109375,
0.19057652354240417,
-0.3861370086669922,
0.07060487568378448,
-0.01658930629491806,
0.20212285220623016,
-0.10218991339206696,
0.06460395455360413,
0.5791630744934082,
-0.07099157571792603,
-0.04548242688179016,
-0.7101126313209534,
0.30384185910224915,
0.12906068563461304,
-0.15801063179969788,
0.3936196565628052,
0.01013290323317051,
-0.3858549892902374,
0.5526435971260071,
0.047394268214702606,
0.8315760493278503,
-0.032363276928663254,
0.08781810104846954,
0.5476921200752258,
0.481478750705719,
0.46340155601501465,
0.061275795102119446,
0.22169171273708344,
-0.436667263507843,
-0.06644263863563538,
0.006198473274707794,
-0.0649719089269638,
0.26376521587371826,
0.3466538190841675,
-0.06306405365467072,
0.0600644126534462,
-0.18439751863479614,
0.3075667917728424,
-0.020541496574878693,
0.04443950951099396,
0.05073004961013794,
-0.025608977302908897,
-0.3046756982803345,
0.13165447115898132,
0.05248681828379631,
-0.16619986295700073,
0.19981227815151215,
-0.2772303819656372,
-0.09476418048143387,
-0.45874205231666565,
-0.19773977994918823,
0.2560681402683258,
0.16485260426998138,
0.20870104432106018,
0.14699779450893402,
-0.3647993505001068,
-0.09907680004835129,
0.4680759906768799,
0.22057294845581055,
0.14880771934986115,
0.044703468680381775,
0.25167137384414673,
-0.013462714850902557,
0.2530905604362488,
-0.02477450855076313,
-0.19791486859321594,
0.40481430292129517,
-0.0469871386885643,
-0.2681368589401245,
0.09421196579933167,
-0.03376689553260803,
-0.3844759464263916,
-0.17629912495613098,
0.17863363027572632,
-0.1744941920042038,
-0.3034570813179016,
0.17454321682453156,
0.18681448698043823,
-0.11816760897636414,
-0.35960614681243896,
0.1977262794971466,
0.10988959670066833,
-0.29411888122558594,
0.3485908508300781,
-0.2193504422903061,
-0.06496137380599976,
-0.05059446394443512,
0.07009704411029816,
0.2770228981971741,
0.2781606912612915,
0.5193920135498047,
0.05686628818511963,
0.003728054463863373,
-0.38686978816986084,
-0.04071108251810074,
0.0993226170539856,
-0.32551977038383484,
0.4965094327926636,
0.14515116810798645,
0.26451054215431213,
0.07115666568279266,
0.12535758316516876,
-0.17370536923408508,
0.21235910058021545,
-0.13882337510585785,
-0.18387305736541748,
-0.08349190652370453,
0.0191964078694582,
-0.21004465222358704,
0.10635311901569366,
0.012596972286701202,
0.12514428794384003,
-0.28081876039505005,
0.27288058400154114,
-0.3642040491104126,
-0.0636899396777153,
-0.14787113666534424,
0.19674301147460938,
0.12510599195957184,
-0.12280357629060745,
0.12618182599544525,
0.04377398267388344,
0.2551786005496979,
-0.02453000470995903,
-0.20257897675037384,
-0.28495123982429504,
-0.11279991269111633,
0.08897656202316284,
0.010875297710299492,
-0.01983475312590599,
-0.06346739828586578,
0.055291056632995605,
-0.18079206347465515,
-0.19998547434806824,
0.34668898582458496,
-0.041756466031074524,
-0.05318190157413483,
0.3286387026309967,
0.22971105575561523,
0.40859198570251465,
0.02946341037750244,
-0.13359490036964417,
-0.4766758382320404,
0.14858758449554443,
-0.01601610705256462,
0.202903613448143,
0.16567710041999817,
-0.16246283054351807,
-0.1720626950263977,
0.08338387310504913,
-0.16632920503616333,
-0.17694690823554993,
0.6944023370742798,
-0.35234886407852173,
-0.35318130254745483,
-0.059244416654109955,
0.5709480047225952,
0.3852596580982208,
-0.14849452674388885,
-0.1366128921508789,
0.172578364610672,
0.2660880982875824,
-0.2827227711677551,
-0.2438805252313614,
0.16841989755630493,
0.04368026182055473,
0.152430459856987,
0.21906839311122894,
-0.006831161677837372,
-0.18577969074249268,
-0.13661006093025208,
0.02144952490925789,
0.30737942457199097,
-0.35207194089889526,
0.3450411260128021,
0.5913934111595154,
0.03600652515888214,
0.09812483191490173,
0.2469237595796585,
-0.01257352065294981,
0.2575858235359192,
0.8022925853729248,
-0.21473823487758636,
0.48949500918388367,
-0.10421648621559143,
-0.12635324895381927,
0.13281460106372833,
-0.37151122093200684,
0.2334393560886383,
0.3077058792114258,
-0.3464195728302002,
-0.11042803525924683,
-0.10757662355899811,
0.478206604719162,
0.16364721953868866,
-0.02160448022186756,
-0.28433549404144287,
0.3604546785354614,
-0.059491731226444244,
-0.15640142560005188,
-0.42755118012428284,
-0.18138667941093445,
-0.2011992335319519,
0.0033804625272750854,
0.1361466348171234,
-0.10238434374332428,
0.4187743067741394,
-0.04344240948557854,
-0.04847734421491623,
-0.15251952409744263,
0.22734910249710083,
-0.11629734188318253,
0.04332106187939644,
-0.3451710343360901,
-0.034015268087387085,
0.3565813899040222,
-0.08095864951610565,
0.05285690352320671,
-0.1462164670228958,
0.3024649918079376,
0.36468616127967834,
0.011158954352140427,
-0.07417701184749603,
-0.1680934876203537,
-0.2048870474100113,
-0.34814587235450745,
0.3729678988456726,
-0.3150898218154907,
0.09356921911239624,
0.18638193607330322,
0.13495315611362457,
-0.17654219269752502,
-0.01852545142173767,
0.18300718069076538,
0.44401127099990845,
-0.1696707308292389,
0.48180800676345825,
-0.2359336018562317,
-0.1163000762462616,
-0.14245203137397766,
0.1533540040254593,
-0.2931213974952698,
-0.10921701788902283,
0.5346869826316833,
0.13562452793121338,
0.17210228741168976,
-0.29986464977264404,
0.10618337243795395,
-0.16508769989013672,
0.3083075284957886,
-0.18725711107254028,
0.08362914621829987,
-0.22967875003814697,
-0.09506864845752716,
-0.3746106028556824,
0.1000114306807518,
-0.18890945613384247,
0.1772850602865219,
-0.06488794088363647,
0.2627214193344116,
0.019840437918901443,
0.12302009761333466,
-0.16196206212043762,
-0.18251562118530273,
-0.3567834794521332,
0.4094754457473755,
-0.23212680220603943,
-0.14471988379955292,
-0.0760062038898468,
-0.17873293161392212,
-0.0732550248503685,
-0.330486536026001,
0.2590421140193939,
-0.29810550808906555,
0.13757939636707306,
0.0018403511494398117,
-0.06966988742351532,
0.23709118366241455,
0.10657782852649689,
0.14694161713123322,
0.4893016815185547,
0.142564594745636,
-0.024495434015989304,
-0.16443750262260437,
-0.338314950466156,
-0.1415187418460846,
-0.30600613355636597,
0.12002711743116379,
-0.020306933671236038,
0.547357976436615,
-0.05868305638432503,
0.007012508809566498,
-0.38081052899360657,
0.24240729212760925,
0.0697404071688652,
-0.20524655282497406,
-0.2095746099948883,
0.24344104528427124,
-0.27421319484710693,
0.16151446104049683,
0.014361981302499771,
0.004746877588331699,
0.02521655708551407,
0.09547092765569687,
-0.23009872436523438,
-0.5110782980918884,
0.36375904083251953,
-0.5501344799995422,
-0.30043262243270874,
-0.09401419013738632,
0.20327742397785187,
-0.013635654002428055,
-0.26886773109436035,
-0.17490705847740173,
-0.07122842967510223,
0.38877516984939575,
-0.04315933585166931,
-0.036049146205186844,
0.1864093840122223,
0.2220209836959839,
-0.0035575851798057556,
-0.01628410443663597,
0.035193223506212234,
-0.04149104654788971,
-0.35925915837287903,
0.21217551827430725,
-0.27191686630249023
] |
https://github.com/huggingface/datasets/issues/6270 | Okay, that was fun; I took a dive through the dataset code and feel like I have a much better understanding.
Here is my understanding of the behavior:
* max_proc is an upper limit on the number of shards that `from_generator` produces
* If `max_proc` is greater than 1, then all lists in *gen_kwargs* must be the same length
* If the lists in *gen_kwargs* are shorter than *num_proc* elements, *num_proc* will be reduced and a warning produced. Put another way, `min(list_length, num_shards)` shards will be produced
* The members of the lists in *gen_kwargs* will be partitioned among the created jobs.
To validate the above, take a look at
`_number_of_shards_in_gen_kwargs` and `_distribute_shards` and `_split_gen_kwargs` in utils/sharding.py.
I've also chased down starting at *from_generator* all the way through to GeneratorBuilder and the calls to the functions in sharding.py.
Tomorrow I'll take a look at the contributing guidelines and see what's involved in putting together a PR to improve the doc string. | Dataset.from_generator raises with sharded gen_args | ### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
| 161 | Dataset.from_generator raises with sharded gen_args
### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
Okay, that was fun; I took a dive through the dataset code and feel like I have a much better understanding.
Here is my understanding of the behavior:
* max_proc is an upper limit on the number of shards that `from_generator` produces
* If `max_proc` is greater than 1, then all lists in *gen_kwargs* must be the same length
* If the lists in *gen_kwargs* are shorter than *num_proc* elements, *num_proc* will be reduced and a warning produced. Put another way, `min(list_length, num_shards)` shards will be produced
* The members of the lists in *gen_kwargs* will be partitioned among the created jobs.
To validate the above, take a look at
`_number_of_shards_in_gen_kwargs` and `_distribute_shards` and `_split_gen_kwargs` in utils/sharding.py.
I've also chased down starting at *from_generator* all the way through to GeneratorBuilder and the calls to the functions in sharding.py.
Tomorrow I'll take a look at the contributing guidelines and see what's involved in putting together a PR to improve the doc string. | [
-0.15784285962581635,
-0.10980907082557678,
-0.023734301328659058,
0.26803869009017944,
0.4730006158351898,
-0.033754147589206696,
0.549604058265686,
0.1978403627872467,
-0.1852407455444336,
0.12854865193367004,
0.3643640875816345,
0.3822571337223053,
-0.16803902387619019,
0.011552132666110992,
0.09968142211437225,
-0.14850389957427979,
0.26457545161247253,
-0.0006915032863616943,
-0.2629392147064209,
-0.23543009161949158,
-0.24016904830932617,
0.22717100381851196,
-0.1817735880613327,
0.04174627363681793,
-0.1491759866476059,
-0.10244195908308029,
-0.07896298170089722,
0.24702605605125427,
0.07482917606830597,
-0.2893107235431671,
0.18971434235572815,
-0.1778041124343872,
-0.22012463212013245,
0.259885311126709,
-0.00010609811579342932,
0.06207677721977234,
0.4077569842338562,
0.049807026982307434,
-0.2411380261182785,
-0.13297505676746368,
-0.29373109340667725,
0.07795015722513199,
-0.1174921840429306,
-0.3742959201335907,
-0.1084788590669632,
-0.16993947327136993,
-0.15880033373832703,
-0.30634263157844543,
0.7054424285888672,
0.331430584192276,
0.23277464509010315,
-0.0111805759370327,
0.11429344117641449,
-0.07272511720657349,
0.42983731627464294,
0.3433683216571808,
-0.09498411417007446,
-0.1322554498910904,
-0.25734683871269226,
0.04719609022140503,
0.03659772127866745,
0.31393957138061523,
-0.16736260056495667,
0.005901111289858818,
0.15913714468479156,
0.24970027804374695,
-0.13912111520767212,
-0.25681912899017334,
-0.023533577099442482,
0.2173217535018921,
-0.055103372782468796,
-0.26205095648765564,
-0.27958542108535767,
-0.35682412981987,
-0.08268633484840393,
-0.4586637616157532,
0.11594999581575394,
0.09201992303133011,
-0.3122900724411011,
0.0677146315574646,
-0.0877026915550232,
0.006484527140855789,
-0.15010270476341248,
-0.04630066454410553,
0.1011822298169136,
0.16190913319587708,
-0.039254650473594666,
0.29482302069664,
0.24209558963775635,
0.05493514612317085,
-0.05267195403575897,
-0.0015112627297639847,
-0.0795370563864708,
-0.019040921702980995,
-0.4661932587623596,
-0.02479834109544754,
0.2009052038192749,
-0.276576429605484,
0.0862012580037117,
0.07945075631141663,
-0.02193094603717327,
-0.10098148882389069,
0.242404043674469,
0.1604568362236023,
0.27836355566978455,
-0.0456102080643177,
0.18043239414691925,
0.3785388171672821,
0.13116325438022614,
0.044349342584609985,
-0.3036634624004364,
0.0809030532836914,
0.008122533559799194,
-0.193753182888031,
0.27301284670829773,
-0.01460731215775013,
0.28890252113342285,
0.17850612103939056,
-0.3090308606624603,
0.11624543368816376,
-0.30112677812576294,
-0.08697660267353058,
0.03894142061471939,
0.32567957043647766,
-0.015029698610305786,
0.050866853445768356,
-0.1166703924536705,
0.018695807084441185,
-0.0795060247182846,
-0.3491377532482147,
-0.35638630390167236,
-0.07875393331050873,
-0.12187393754720688,
0.103138767182827,
-0.10816357284784317,
0.15306691825389862,
0.2628326416015625,
0.22616730630397797,
0.018397357314825058,
-0.21673408150672913,
0.236505925655365,
-0.0792684257030487,
0.17069011926651,
0.29507318139076233,
-0.16784079372882843,
0.17946548759937286,
0.31153082847595215,
-0.15768113732337952,
0.04069820046424866,
0.09573684632778168,
-0.20743459463119507,
-0.24198220670223236,
0.2103128433227539,
0.2611261308193207,
-0.1624443531036377,
0.2883467674255371,
-0.2608499526977539,
-0.023726588115096092,
0.5064906477928162,
0.05266067385673523,
-0.13782894611358643,
-0.2666981518268585,
-0.4021056890487671,
-0.4032999277114868,
0.2591351270675659,
0.2868085205554962,
-0.2034398913383484,
-0.08259401470422745,
-0.39772331714630127,
-0.04495704174041748,
0.3474798798561096,
0.04529901593923569,
-0.2977654039859772,
0.3502030372619629,
-0.20216187834739685,
0.19374851882457733,
0.36650002002716064,
0.048314169049263,
-0.3252546787261963,
0.3235197365283966,
-0.2271762490272522,
0.1593630015850067,
0.26789242029190063,
0.01734389364719391,
0.12171928584575653,
-0.10525019466876984,
0.07779577374458313,
0.23388715088367462,
-0.1331402063369751,
0.041271358728408813,
-0.2166253626346588,
0.1735142171382904,
-0.0811433270573616,
-0.1009964644908905,
-0.028715576976537704,
0.13521499931812286,
-0.016546592116355896,
0.043711550533771515,
0.37048688530921936,
-0.1652609407901764,
0.0911550521850586,
0.18870586156845093,
0.25282353162765503,
-0.1496049463748932,
0.13846755027770996,
-0.021027766168117523,
-0.3107548654079437,
0.21378810703754425,
-0.1389680802822113,
0.10406774282455444,
-0.40398091077804565,
-0.1228102594614029,
-0.23692521452903748,
0.30418160557746887,
-0.355906218290329,
-0.17567405104637146,
0.13329264521598816,
0.09730380773544312,
-0.10920222848653793,
-0.04176604375243187,
-0.17816254496574402,
0.09278661757707596,
-0.351763516664505,
0.0952969565987587,
-0.36988261342048645,
0.14325009286403656,
0.03660898655653,
-0.19214960932731628,
-0.08577239513397217,
0.04368959367275238,
0.14083275198936462,
-0.010060237720608711,
-0.03360937535762787,
0.2355310022830963,
0.4105110168457031,
0.0342116579413414,
-0.27520766854286194,
-0.0881127268075943,
-0.04730646312236786,
-0.0333423987030983,
-0.17359331250190735,
0.11127965897321701,
0.06077062711119652,
-0.16199812293052673,
0.038533054292201996,
0.3997645378112793,
-0.020583420991897583,
0.3240191340446472,
-0.06981866806745529,
0.2005484700202942,
0.24245473742485046,
0.021220237016677856,
0.004040353000164032,
-0.36596935987472534,
-0.09860140830278397,
0.1262367218732834,
0.031862132251262665,
0.17157992720603943,
-0.18312573432922363,
0.14698255062103271,
0.8064930438995361,
0.052492596209049225,
-0.1075921282172203,
-0.04722781479358673,
-0.2181302309036255,
-0.1424514800310135,
0.0904737189412117,
0.7266733646392822,
0.3785043954849243,
0.09051747620105743,
0.09853796660900116,
0.12512347102165222,
-0.10116367042064667,
-0.24194714426994324,
0.1314166933298111,
-0.09140820801258087,
0.26452890038490295,
0.13556770980358124,
0.06517429649829865,
-0.12995871901512146,
-0.32056236267089844,
-0.09169786423444748,
0.09210538864135742,
0.3198549449443817,
-0.28235018253326416,
0.38193175196647644,
-0.27775952219963074,
0.23330789804458618,
-0.263860285282135,
0.007037632167339325,
-0.046177756041288376,
-0.3171912133693695,
-0.02566426247358322,
0.2552991509437561,
-0.2555367350578308,
0.23317575454711914,
0.27462518215179443,
-0.06871207058429718,
0.3267672657966614,
-0.16282068192958832,
-0.16732853651046753,
-0.17645373940467834,
-0.2641761004924774,
0.08975377678871155,
0.27897346019744873,
-0.11483801156282425,
0.20433172583580017,
-0.039966970682144165,
-0.21791282296180725,
-0.15109029412269592,
-0.11985094100236893,
0.13655906915664673,
-0.3961308002471924,
0.6054110527038574,
0.3316963315010071,
0.017838548868894577,
-0.2102777510881424,
-0.22534418106079102,
0.3435792624950409,
0.03946086764335632,
-0.22080092132091522,
0.3147134780883789,
0.08072911947965622,
0.18667803704738617,
-0.2370038628578186,
-0.3330809772014618,
0.13968978822231293,
-0.15045702457427979,
0.09063811600208282,
0.14340093731880188,
0.32835716009140015,
0.18592576682567596,
0.23984166979789734,
-0.04028237611055374,
-0.15048529207706451,
0.10879357159137726,
-0.15397000312805176,
-0.32664892077445984,
0.16311410069465637,
-0.1309162974357605,
-0.3727894425392151,
0.009502731263637543,
-0.25579822063446045,
0.3095617890357971,
0.33607590198516846,
-0.35933125019073486,
-0.07952391356229782,
-0.09548017382621765,
0.09608592838048935,
0.04959162324666977,
-0.09582014381885529,
0.06153514236211777,
0.2093369960784912,
-0.11627832055091858,
-0.2525187134742737,
0.2807512879371643,
0.5255702137947083,
-0.2480117827653885,
-0.058763984590768814,
0.2321254014968872,
0.3146638870239258,
0.16989146173000336,
0.6522672176361084,
0.33269891142845154,
-0.23868818581104279,
0.026250695809721947,
-0.09359810501337051,
0.0958968847990036,
-0.12675878405570984,
-0.3676437735557556,
-0.20000439882278442,
0.11944623291492462,
-0.21220935881137848,
-0.037183962762355804,
-0.06948718428611755,
0.14362558722496033,
0.04778457432985306,
0.19904661178588867,
-0.02931852638721466,
-0.4188997745513916,
0.06207998842000961,
-0.3534839153289795,
0.23390522599220276,
-0.0018185153603553772,
0.29953569173812866,
-0.07888168096542358,
0.12136063724756241,
-0.15275900065898895,
-0.2272331416606903,
0.34357696771621704,
-0.22264662384986877,
-0.20912271738052368,
-0.20330777764320374,
-0.21964240074157715,
0.07948513329029083,
-0.002013538032770157,
0.12372930347919464,
-0.013597249984741211,
-0.31149935722351074,
0.1864255666732788,
-0.0752110406756401,
0.7218579053878784,
-0.14527854323387146,
0.0806717574596405,
0.22514064610004425,
-0.0037493929266929626,
0.08861763030290604,
0.1396578997373581,
-0.08758695423603058,
-0.10628650337457657,
0.024564165621995926,
0.19608071446418762,
-0.4938080906867981,
-0.1832541674375534,
0.022517144680023193,
0.16170810163021088,
-0.27420419454574585,
-0.004729650914669037,
-0.24293479323387146,
-0.25218188762664795,
-0.12842820584774017,
0.004679866135120392,
-0.043963316828012466,
0.320157527923584,
-0.22588929533958435,
-0.042550791054964066,
-0.22720099985599518,
-0.1451486498117447,
-0.03546355292201042,
0.25693953037261963,
0.2892206013202667,
-0.4538407623767853,
0.1847544014453888,
-0.09518636763095856,
0.0014899475499987602,
0.17531374096870422,
0.3397604525089264,
-0.051615312695503235,
-0.3519446849822998,
-0.36475303769111633,
-0.0782531127333641,
0.07314300537109375,
0.19057652354240417,
-0.3861370086669922,
0.07060487568378448,
-0.01658930629491806,
0.20212285220623016,
-0.10218991339206696,
0.06460395455360413,
0.5791630744934082,
-0.07099157571792603,
-0.04548242688179016,
-0.7101126313209534,
0.30384185910224915,
0.12906068563461304,
-0.15801063179969788,
0.3936196565628052,
0.01013290323317051,
-0.3858549892902374,
0.5526435971260071,
0.047394268214702606,
0.8315760493278503,
-0.032363276928663254,
0.08781810104846954,
0.5476921200752258,
0.481478750705719,
0.46340155601501465,
0.061275795102119446,
0.22169171273708344,
-0.436667263507843,
-0.06644263863563538,
0.006198473274707794,
-0.0649719089269638,
0.26376521587371826,
0.3466538190841675,
-0.06306405365467072,
0.0600644126534462,
-0.18439751863479614,
0.3075667917728424,
-0.020541496574878693,
0.04443950951099396,
0.05073004961013794,
-0.025608977302908897,
-0.3046756982803345,
0.13165447115898132,
0.05248681828379631,
-0.16619986295700073,
0.19981227815151215,
-0.2772303819656372,
-0.09476418048143387,
-0.45874205231666565,
-0.19773977994918823,
0.2560681402683258,
0.16485260426998138,
0.20870104432106018,
0.14699779450893402,
-0.3647993505001068,
-0.09907680004835129,
0.4680759906768799,
0.22057294845581055,
0.14880771934986115,
0.044703468680381775,
0.25167137384414673,
-0.013462714850902557,
0.2530905604362488,
-0.02477450855076313,
-0.19791486859321594,
0.40481430292129517,
-0.0469871386885643,
-0.2681368589401245,
0.09421196579933167,
-0.03376689553260803,
-0.3844759464263916,
-0.17629912495613098,
0.17863363027572632,
-0.1744941920042038,
-0.3034570813179016,
0.17454321682453156,
0.18681448698043823,
-0.11816760897636414,
-0.35960614681243896,
0.1977262794971466,
0.10988959670066833,
-0.29411888122558594,
0.3485908508300781,
-0.2193504422903061,
-0.06496137380599976,
-0.05059446394443512,
0.07009704411029816,
0.2770228981971741,
0.2781606912612915,
0.5193920135498047,
0.05686628818511963,
0.003728054463863373,
-0.38686978816986084,
-0.04071108251810074,
0.0993226170539856,
-0.32551977038383484,
0.4965094327926636,
0.14515116810798645,
0.26451054215431213,
0.07115666568279266,
0.12535758316516876,
-0.17370536923408508,
0.21235910058021545,
-0.13882337510585785,
-0.18387305736541748,
-0.08349190652370453,
0.0191964078694582,
-0.21004465222358704,
0.10635311901569366,
0.012596972286701202,
0.12514428794384003,
-0.28081876039505005,
0.27288058400154114,
-0.3642040491104126,
-0.0636899396777153,
-0.14787113666534424,
0.19674301147460938,
0.12510599195957184,
-0.12280357629060745,
0.12618182599544525,
0.04377398267388344,
0.2551786005496979,
-0.02453000470995903,
-0.20257897675037384,
-0.28495123982429504,
-0.11279991269111633,
0.08897656202316284,
0.010875297710299492,
-0.01983475312590599,
-0.06346739828586578,
0.055291056632995605,
-0.18079206347465515,
-0.19998547434806824,
0.34668898582458496,
-0.041756466031074524,
-0.05318190157413483,
0.3286387026309967,
0.22971105575561523,
0.40859198570251465,
0.02946341037750244,
-0.13359490036964417,
-0.4766758382320404,
0.14858758449554443,
-0.01601610705256462,
0.202903613448143,
0.16567710041999817,
-0.16246283054351807,
-0.1720626950263977,
0.08338387310504913,
-0.16632920503616333,
-0.17694690823554993,
0.6944023370742798,
-0.35234886407852173,
-0.35318130254745483,
-0.059244416654109955,
0.5709480047225952,
0.3852596580982208,
-0.14849452674388885,
-0.1366128921508789,
0.172578364610672,
0.2660880982875824,
-0.2827227711677551,
-0.2438805252313614,
0.16841989755630493,
0.04368026182055473,
0.152430459856987,
0.21906839311122894,
-0.006831161677837372,
-0.18577969074249268,
-0.13661006093025208,
0.02144952490925789,
0.30737942457199097,
-0.35207194089889526,
0.3450411260128021,
0.5913934111595154,
0.03600652515888214,
0.09812483191490173,
0.2469237595796585,
-0.01257352065294981,
0.2575858235359192,
0.8022925853729248,
-0.21473823487758636,
0.48949500918388367,
-0.10421648621559143,
-0.12635324895381927,
0.13281460106372833,
-0.37151122093200684,
0.2334393560886383,
0.3077058792114258,
-0.3464195728302002,
-0.11042803525924683,
-0.10757662355899811,
0.478206604719162,
0.16364721953868866,
-0.02160448022186756,
-0.28433549404144287,
0.3604546785354614,
-0.059491731226444244,
-0.15640142560005188,
-0.42755118012428284,
-0.18138667941093445,
-0.2011992335319519,
0.0033804625272750854,
0.1361466348171234,
-0.10238434374332428,
0.4187743067741394,
-0.04344240948557854,
-0.04847734421491623,
-0.15251952409744263,
0.22734910249710083,
-0.11629734188318253,
0.04332106187939644,
-0.3451710343360901,
-0.034015268087387085,
0.3565813899040222,
-0.08095864951610565,
0.05285690352320671,
-0.1462164670228958,
0.3024649918079376,
0.36468616127967834,
0.011158954352140427,
-0.07417701184749603,
-0.1680934876203537,
-0.2048870474100113,
-0.34814587235450745,
0.3729678988456726,
-0.3150898218154907,
0.09356921911239624,
0.18638193607330322,
0.13495315611362457,
-0.17654219269752502,
-0.01852545142173767,
0.18300718069076538,
0.44401127099990845,
-0.1696707308292389,
0.48180800676345825,
-0.2359336018562317,
-0.1163000762462616,
-0.14245203137397766,
0.1533540040254593,
-0.2931213974952698,
-0.10921701788902283,
0.5346869826316833,
0.13562452793121338,
0.17210228741168976,
-0.29986464977264404,
0.10618337243795395,
-0.16508769989013672,
0.3083075284957886,
-0.18725711107254028,
0.08362914621829987,
-0.22967875003814697,
-0.09506864845752716,
-0.3746106028556824,
0.1000114306807518,
-0.18890945613384247,
0.1772850602865219,
-0.06488794088363647,
0.2627214193344116,
0.019840437918901443,
0.12302009761333466,
-0.16196206212043762,
-0.18251562118530273,
-0.3567834794521332,
0.4094754457473755,
-0.23212680220603943,
-0.14471988379955292,
-0.0760062038898468,
-0.17873293161392212,
-0.0732550248503685,
-0.330486536026001,
0.2590421140193939,
-0.29810550808906555,
0.13757939636707306,
0.0018403511494398117,
-0.06966988742351532,
0.23709118366241455,
0.10657782852649689,
0.14694161713123322,
0.4893016815185547,
0.142564594745636,
-0.024495434015989304,
-0.16443750262260437,
-0.338314950466156,
-0.1415187418460846,
-0.30600613355636597,
0.12002711743116379,
-0.020306933671236038,
0.547357976436615,
-0.05868305638432503,
0.007012508809566498,
-0.38081052899360657,
0.24240729212760925,
0.0697404071688652,
-0.20524655282497406,
-0.2095746099948883,
0.24344104528427124,
-0.27421319484710693,
0.16151446104049683,
0.014361981302499771,
0.004746877588331699,
0.02521655708551407,
0.09547092765569687,
-0.23009872436523438,
-0.5110782980918884,
0.36375904083251953,
-0.5501344799995422,
-0.30043262243270874,
-0.09401419013738632,
0.20327742397785187,
-0.013635654002428055,
-0.26886773109436035,
-0.17490705847740173,
-0.07122842967510223,
0.38877516984939575,
-0.04315933585166931,
-0.036049146205186844,
0.1864093840122223,
0.2220209836959839,
-0.0035575851798057556,
-0.01628410443663597,
0.035193223506212234,
-0.04149104654788971,
-0.35925915837287903,
0.21217551827430725,
-0.27191686630249023
] |
https://github.com/huggingface/datasets/issues/6267 | You can use a `Sequence(ClassLabel(...))` feature type to represent a list of labels, and `cast_column`/`cast` to perform the "string to label" conversion (`class_encode_column` does support nested fields), e.g., in your case:
```python
from datasets import Dataset, Sequence, ClassLabel
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.cast_column('labels', Sequence(ClassLabel(names=["a", "b", "c", "d"])))
``` | Multi label class encoding | ### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests. | 66 | Multi label class encoding
### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
You can use a `Sequence(ClassLabel(...))` feature type to represent a list of labels, and `cast_column`/`cast` to perform the "string to label" conversion (`class_encode_column` does support nested fields), e.g., in your case:
```python
from datasets import Dataset, Sequence, ClassLabel
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.cast_column('labels', Sequence(ClassLabel(names=["a", "b", "c", "d"])))
``` | [
0.13402794301509857,
0.1659838855266571,
0.07211393117904663,
0.2635546326637268,
0.344813734292984,
0.13794733583927155,
0.7133165597915649,
-0.18815426528453827,
0.0459604486823082,
-0.022461630403995514,
0.12441209703683853,
0.4255562126636505,
-0.25185367465019226,
0.558788537979126,
-0.19353589415550232,
-0.11879552155733109,
0.0013904459774494171,
-0.07339064031839371,
-0.005307093262672424,
0.02107281982898712,
-0.2726411819458008,
0.09288059920072556,
-0.2554440200328827,
0.16254714131355286,
-0.28689879179000854,
-0.23715901374816895,
-0.3237224817276001,
-0.17942091822624207,
-0.08997784554958344,
-0.34019288420677185,
0.3595796823501587,
0.20719978213310242,
0.23528005182743073,
0.2010670006275177,
-0.0001134565900429152,
-0.19580653309822083,
-0.08624277263879776,
-0.0715755969285965,
-0.22682760655879974,
0.2050929069519043,
-0.23258845508098602,
-0.23182672262191772,
0.1506909877061844,
-0.5585423707962036,
0.010546542704105377,
-0.08977856487035751,
-0.22037361562252045,
-0.3212565779685974,
-0.013486221432685852,
-0.09472142159938812,
0.13155034184455872,
-0.3456973135471344,
0.1944274604320526,
0.14163269102573395,
-0.006789706647396088,
0.12394113838672638,
-0.19292503595352173,
0.02550147846341133,
0.21219003200531006,
0.25620052218437195,
-0.17738746106624603,
0.553413987159729,
0.08334571123123169,
-0.19549138844013214,
0.229771688580513,
0.20939649641513824,
0.16246725618839264,
-0.07623198628425598,
0.018503397703170776,
0.0679733157157898,
0.5594709515571594,
-0.10356093943119049,
-0.6379072666168213,
-0.17917758226394653,
0.19271978735923767,
-0.6277031898498535,
0.11329682171344757,
0.010703310370445251,
0.07134082168340683,
0.1524108350276947,
-0.17682601511478424,
-0.116712786257267,
-0.17023178935050964,
-0.041682180017232895,
-0.34470134973526,
0.22678524255752563,
-0.0673467218875885,
0.11892420053482056,
-0.11162987351417542,
-0.18395912647247314,
-0.10149997472763062,
0.0056190211325883865,
0.30206072330474854,
0.20236384868621826,
-0.16506576538085938,
-0.28469961881637573,
-0.16054433584213257,
-0.09007266908884048,
0.037950314581394196,
0.14716850221157074,
-0.43679630756378174,
0.2738991379737854,
-0.24037694931030273,
-0.07069171965122223,
0.27798187732696533,
0.314125120639801,
0.27224200963974,
0.2878831624984741,
0.021238241344690323,
-0.025216933339834213,
-0.1125740259885788,
-0.09203433990478516,
-0.40581122040748596,
0.36920955777168274,
0.3314955532550812,
0.2634330689907074,
-0.35801923274993896,
-0.012817442417144775,
-0.06163538992404938,
0.13971523940563202,
-0.1570475846529007,
-0.04527062922716141,
0.23035742342472076,
0.08738814294338226,
0.2427973598241806,
0.4096068739891052,
0.0011574476957321167,
0.2391750067472458,
-0.10100406408309937,
-0.39828741550445557,
0.034127313643693924,
0.07641027867794037,
-0.2507226765155792,
0.08660951256752014,
0.11556491255760193,
0.3652885854244232,
-0.2072172462940216,
0.173064187169075,
0.12356481701135635,
-0.212093785405159,
-0.09384622424840927,
-0.04612430930137634,
0.2494891881942749,
-0.16938644647598267,
-0.39558684825897217,
0.38980022072792053,
0.20446354150772095,
-0.23710890114307404,
-0.22557887434959412,
-0.04906194657087326,
-0.21566881239414215,
-0.1583142876625061,
-0.275602251291275,
0.038302019238471985,
0.1374334841966629,
0.015839694067835808,
0.06653144210577011,
0.21550795435905457,
0.3993675112724304,
-0.24523870646953583,
0.07842493057250977,
-0.3443852663040161,
-0.02116759866476059,
-0.15981148183345795,
0.11301194876432419,
0.05392822250723839,
-0.06156329810619354,
-0.053745660930871964,
0.4054395854473114,
0.32845252752304077,
0.19445110857486725,
0.002278955653309822,
-0.08984814584255219,
-0.14663901925086975,
0.10179539769887924,
0.0010074228048324585,
-0.007718510925769806,
-0.5534077286720276,
-0.12308995425701141,
0.13924916088581085,
0.013929948210716248,
0.23031210899353027,
0.43156710267066956,
0.22919102013111115,
0.16857074201107025,
-0.3032926321029663,
0.3523431420326233,
0.2655864655971527,
-0.11342614144086838,
-0.020235851407051086,
0.028128109872341156,
-0.27342018485069275,
0.1177443340420723,
0.032811619341373444,
-0.1484166979789734,
-0.27309730648994446,
-0.23542451858520508,
0.03211711347103119,
-0.004193773493170738,
-0.42455917596817017,
0.2626887261867523,
0.14302338659763336,
-0.25052329897880554,
0.03470894321799278,
-0.1743174046278,
-0.27134954929351807,
-0.45324912667274475,
0.23014365136623383,
0.11495064198970795,
-0.05107063427567482,
-0.09768638014793396,
-0.4818090796470642,
0.2982674837112427,
-0.03512365370988846,
-0.21730569005012512,
-0.08451444655656815,
0.103615403175354,
0.06148168444633484,
-0.2117317020893097,
-0.08252021670341492,
-0.35923993587493896,
0.32795801758766174,
0.3438055217266083,
-0.04114427790045738,
-0.18069526553153992,
-0.1298065036535263,
-0.05931120365858078,
0.11762750148773193,
-0.1773897409439087,
0.49597930908203125,
0.17374004423618317,
-0.17232458293437958,
0.28098350763320923,
0.1877657175064087,
0.19996657967567444,
-0.3772127330303192,
-0.16393233835697174,
0.08713585138320923,
0.5095041990280151,
0.05019877105951309,
-0.024931907653808594,
-0.18116514384746552,
-0.05994386225938797,
-0.08024536818265915,
-0.556510865688324,
0.7267465591430664,
0.05744345486164093,
0.21541067957878113,
0.013594672083854675,
0.15722663700580597,
0.1192374899983406,
-0.008198060095310211,
-0.2908778786659241,
-0.25523585081100464,
-0.2322975993156433,
-0.18988171219825745,
-0.3253849446773529,
0.03790286183357239,
-0.45852532982826233,
0.4317970275878906,
0.4781964123249054,
0.15030845999717712,
0.2262502908706665,
-0.1560327410697937,
-0.08643527328968048,
0.012425526976585388,
0.09466224163770676,
0.2333715260028839,
0.1644039750099182,
0.02463531494140625,
0.15627503395080566,
-0.25170478224754333,
-0.1871064454317093,
0.1552981436252594,
0.0709330141544342,
-0.17935200035572052,
0.1633114069700241,
0.0009675361216068268,
0.08439651131629944,
0.08439233899116516,
0.12471474707126617,
-0.30061399936676025,
0.24859172105789185,
-0.2879396677017212,
-0.26548582315444946,
0.22854483127593994,
-0.6022520065307617,
-0.20706531405448914,
-0.18602332472801208,
-0.5071479082107544,
0.05997701361775398,
-0.26047414541244507,
0.0034649334847927094,
-0.14117906987667084,
0.006546705961227417,
-0.0014486238360404968,
-0.20084944367408752,
0.10079268366098404,
-0.0939241424202919,
-0.201433464884758,
0.27197265625,
-0.13296523690223694,
-0.22543497383594513,
-0.0389481745660305,
0.15713298320770264,
-0.19300290942192078,
0.040491990745067596,
0.3550816774368286,
-0.15192881226539612,
0.05073438584804535,
-0.37056708335876465,
-0.054254405200481415,
-0.18538245558738708,
-0.23929935693740845,
0.17648664116859436,
-0.3263547718524933,
-0.26466721296310425,
0.04443276301026344,
0.29144287109375,
0.33423927426338196,
0.09206099808216095,
0.1258823573589325,
0.2900301218032837,
-0.07142569124698639,
-0.13453668355941772,
-0.2483275979757309,
-0.3271825611591339,
-0.004353173077106476,
0.22914870083332062,
-0.07294298708438873,
0.20071683824062347,
-0.06687241047620773,
-0.3217645585536957,
0.0972629114985466,
0.23974400758743286,
-0.06372535228729248,
-0.24628330767154694,
0.08511541783809662,
0.33899611234664917,
-0.3051331341266632,
-0.20942477881908417,
-0.0821915790438652,
-0.07373973727226257,
0.09641432762145996,
-0.08852848410606384,
0.08208438754081726,
-0.11789008229970932,
0.18601754307746887,
0.14538736641407013,
0.13310764729976654,
-0.009280781261622906,
0.3074979782104492,
0.3532514274120331,
-0.008633438497781754,
-0.02109035849571228,
-0.1760857105255127,
0.19189587235450745,
-0.06863148510456085,
0.07466143369674683,
-0.13515828549861908,
0.08025238662958145,
-0.012073002755641937,
0.11498285830020905,
0.3200591802597046,
-0.0483260303735733,
0.059981562197208405,
0.013970872387290001,
-0.09734836220741272,
-0.054346222430467606,
0.06195801496505737,
-0.01880704239010811,
-0.5165598392486572,
-0.02184285596013069,
0.1555536389350891,
0.09743045270442963,
-0.1277593970298767,
0.030269227921962738,
0.7927091121673584,
0.19458900392055511,
-0.4489023685455322,
0.19048775732517242,
-0.27542752027511597,
0.12292565405368805,
-0.21910293400287628,
0.04941233992576599,
-0.35250672698020935,
0.11194213479757309,
-0.08920378983020782,
-0.1486528515815735,
-0.1239316463470459,
-0.12664425373077393,
-0.5414209365844727,
-0.41151341795921326,
-0.3145613968372345,
0.033044908195734024,
0.37846535444259644,
0.27676820755004883,
0.026882857084274292,
0.12658120691776276,
0.13721932470798492,
-0.041012536734342575,
0.1706334352493286,
-0.3981577157974243,
-0.21393391489982605,
0.3153446912765503,
-0.030777107924222946,
-0.20080262422561646,
-0.15705141425132751,
-0.24240107834339142,
-0.0897088497877121,
-0.12958669662475586,
0.2953537404537201,
-0.15026076138019562,
-0.1406499147415161,
0.4709111154079437,
0.013261284679174423,
-0.2733774483203888,
0.05103179067373276,
0.03713126480579376,
-0.15562888979911804,
-0.05870980769395828,
-0.10613901913166046,
0.433987557888031,
0.19747987389564514,
0.044557586312294006,
-0.044238343834877014,
-0.10664817690849304,
0.07833532989025116,
0.1340012401342392,
-0.12209911644458771,
0.05396774783730507,
0.09646935760974884,
-0.026123352348804474,
0.12613041698932648,
0.09603343158960342,
0.19402183592319489,
0.6153683662414551,
-0.10657048970460892,
-0.47773319482803345,
0.26753753423690796,
-0.3399054706096649,
0.4084867835044861,
0.16616389155387878,
0.0523870512843132,
0.07150635868310928,
-0.23045775294303894,
-0.18902181088924408,
-0.4494117200374603,
-0.34003323316574097,
0.21122005581855774,
0.16919314861297607,
-0.46709540486335754,
-0.23294401168823242,
0.5591332316398621,
0.03525747358798981,
-0.2130224108695984,
0.008463242091238499,
0.034224823117256165,
-0.45332077145576477,
0.26530951261520386,
0.5597101449966431,
0.6481292843818665,
-0.1308351308107376,
0.24387937784194946,
0.04638234153389931,
-0.145403191447258,
0.5850757360458374,
-0.12176161259412766,
0.3354727029800415,
-0.17644542455673218,
-0.09945023059844971,
-0.17744112014770508,
0.15441536903381348,
0.05863076075911522,
0.1370602697134018,
-0.32904982566833496,
0.314365029335022,
-0.2322838306427002,
-0.025765350088477135,
0.007453896105289459,
0.02771112322807312,
0.2482946664094925,
-0.4901580512523651,
0.17270614206790924,
0.1226109191775322,
0.21068283915519714,
-0.29487144947052,
0.006966695189476013,
0.01007060706615448,
-0.05239114165306091,
0.1579681634902954,
-0.2663854956626892,
-0.013523794710636139,
0.01997818425297737,
0.28752899169921875,
0.03328965604305267,
-0.014568224549293518,
0.4014478325843811,
0.350564181804657,
0.4282733201980591,
-0.294955849647522,
0.007031697779893875,
-0.25064176321029663,
-0.13261748850345612,
0.3051365911960602,
-0.09841719269752502,
-0.285577654838562,
0.6323850750923157,
0.18596290051937103,
0.2147558331489563,
0.11875692009925842,
-0.03534136712551117,
-0.05625879019498825,
0.05452290177345276,
0.07410156726837158,
0.2878457307815552,
-0.20346185564994812,
0.3483930826187134,
0.09903315454721451,
0.2312028706073761,
-0.24344244599342346,
0.06886468082666397,
-0.10423314571380615,
-0.23054778575897217,
0.24817624688148499,
-0.2970580458641052,
0.17480257153511047,
0.14227166771888733,
0.28099551796913147,
0.3384026288986206,
-0.08468521386384964,
0.38238102197647095,
0.1092028021812439,
-0.0724453330039978,
-0.09102822095155716,
0.34438252449035645,
0.5859231948852539,
-0.2440563589334488,
0.006714668124914169,
-0.1450314074754715,
-0.2656583786010742,
0.1795032024383545,
0.34523648023605347,
0.13838833570480347,
0.14241956174373627,
-0.16867133975028992,
-0.21276326477527618,
-0.2003069370985031,
0.2608524560928345,
-0.00010780920274555683,
0.05228817090392113,
-0.18364453315734863,
0.000403478741645813,
-0.07328338921070099,
0.12171562016010284,
-0.256377637386322,
-0.15930627286434174,
-0.21662701666355133,
-0.015778932720422745,
0.4268166720867157,
0.09931932389736176,
-0.05716996639966965,
0.1859472543001175,
0.09608827531337738,
-0.007192232646048069,
0.08685372024774551,
-0.06310774385929108,
-0.2004002034664154,
0.09364988654851913,
0.04786205291748047,
0.37914857268333435,
0.06228116899728775,
-0.08485803008079529,
-0.1944800764322281,
-0.20853279531002045,
0.11561208218336105,
-0.0007757097482681274,
-0.01920327916741371,
0.12135250866413116,
-0.4059712886810303,
0.29833799600601196,
-0.3597489297389984,
-0.01010228507220745,
0.28249239921569824,
0.08674194663763046,
0.18139415979385376,
0.10240590572357178,
-0.07028523832559586,
-0.030893124639987946,
-0.43938982486724854,
0.367901086807251,
-0.25336748361587524,
-0.10748890787363052,
0.22230415046215057,
-0.2969718277454376,
0.3106408715248108,
0.3970347046852112,
0.056966088712215424,
-0.03791619837284088,
-0.18237647414207458,
-0.1563061773777008,
0.25345438718795776,
0.11623062193393707,
0.0034862011671066284,
-0.12751998007297516,
-0.19799727201461792,
-0.20061342418193817,
-0.11902657896280289,
0.5287008285522461,
0.2362040877342224,
0.18698564171791077,
-0.08430265635251999,
-0.26474446058273315,
0.17808587849140167,
-0.09653151035308838,
0.22917254269123077,
0.2836892008781433,
-0.0636196881532669,
0.10573062300682068,
0.6053395867347717,
0.20263686776161194,
0.35162562131881714,
0.3697882294654846,
0.08073527365922928,
0.08362064510583878,
0.5480480790138245,
0.3167416453361511,
-0.04245010390877724,
-0.05202014744281769,
0.203671395778656,
0.21979984641075134,
0.14126017689704895,
0.3025450110435486,
0.04263032227754593,
0.04949566721916199,
-0.9010520577430725,
-0.4823310077190399,
-0.1854555606842041,
0.41104575991630554,
-0.1251826137304306,
-0.1679200828075409,
-0.02728898450732231,
-0.1404435932636261,
-0.19033506512641907,
-0.13853979110717773,
-0.45609796047210693,
0.14064691960811615,
0.6388472318649292,
0.13089653849601746,
0.34038883447647095,
-0.44766563177108765,
-0.3778817355632782,
-0.07242058217525482,
0.5721502900123596,
-0.1604488044977188,
0.39342623949050903,
0.2812058925628662,
-0.03989477455615997,
0.15204991400241852,
-0.085703544318676,
0.2019861489534378,
0.10623356699943542,
0.09113796055316925,
-0.11218657344579697,
-0.24802039563655853,
0.016438066959381104,
0.15762688219547272,
-0.1078597754240036,
0.16094832122325897,
-0.02031950280070305,
0.2545611262321472,
-0.04115375131368637,
-0.05492966249585152,
0.16663028299808502,
0.26845335960388184,
0.3155748248100281,
-0.009353958070278168,
0.5089624524116516,
0.1605912297964096,
-0.18388435244560242,
0.21969471871852875,
-0.01619298756122589,
-0.10420218855142593,
-0.19224922358989716,
0.07496437430381775,
-0.05557628720998764,
0.14511576294898987,
0.3766848146915436,
0.06765308231115341,
0.2992438077926636,
0.3989931344985962,
0.1706959307193756,
-0.4512961506843567,
-0.056396715342998505,
0.0061568766832351685,
-0.4899219870567322,
-0.03817391395568848,
0.02333391271531582,
-0.745287299156189,
0.19181403517723083,
0.1694442629814148,
0.2428244948387146,
0.042368508875370026,
0.06011703237891197,
-0.26181209087371826,
0.48223602771759033,
0.20437712967395782,
-0.3109924793243408,
0.13508382439613342,
0.539929986000061,
0.1831645667552948,
-0.09833421558141708,
-0.19403290748596191,
0.16513395309448242,
0.16914963722229004,
-0.03972424194216728,
0.12945346534252167,
0.1309615969657898,
-0.22421978414058685,
-0.4243394136428833,
0.07028712332248688,
0.1467573344707489,
0.23196956515312195,
0.22090882062911987,
-0.22812490165233612,
0.19052492082118988,
0.19671180844306946,
-0.02093394100666046,
0.25763872265815735,
-0.02777913771569729,
0.5791330933570862,
-0.20282132923603058,
0.3640148341655731,
-0.18226665258407593,
-0.033365339040756226,
0.04967482388019562,
0.0422707237303257,
-0.3150275945663452,
0.3750915229320526,
-0.2086731493473053,
-0.017354944720864296,
0.4995990991592407,
0.45146647095680237,
-0.005608031526207924,
0.2574060261249542,
-0.042500972747802734,
-0.339623361825943,
0.07757081091403961,
-0.2763092815876007,
-0.3755783438682556,
0.12212327122688293,
0.3234434723854065,
-0.19254736602306366,
0.3154297471046448,
-0.49654078483581543,
-0.06428252160549164,
0.1642414629459381,
0.04418041557073593,
-0.609551191329956,
0.17415852844715118,
0.027120579034090042,
-0.308194637298584,
-0.1511620581150055,
0.1377672702074051,
-0.18748439848423004,
0.021706566214561462,
-0.11178845167160034,
-0.17242509126663208
] |
https://github.com/huggingface/datasets/issues/6267 | Great! Can you elaborate on "class_encode_column does support nested fields"? Do you mean that there is a way to `class_encode_column` on a Sequence? | Multi label class encoding | ### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests. | 23 | Multi label class encoding
### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
Great! Can you elaborate on "class_encode_column does support nested fields"? Do you mean that there is a way to `class_encode_column` on a Sequence? | [
0.13402794301509857,
0.1659838855266571,
0.07211393117904663,
0.2635546326637268,
0.344813734292984,
0.13794733583927155,
0.7133165597915649,
-0.18815426528453827,
0.0459604486823082,
-0.022461630403995514,
0.12441209703683853,
0.4255562126636505,
-0.25185367465019226,
0.558788537979126,
-0.19353589415550232,
-0.11879552155733109,
0.0013904459774494171,
-0.07339064031839371,
-0.005307093262672424,
0.02107281982898712,
-0.2726411819458008,
0.09288059920072556,
-0.2554440200328827,
0.16254714131355286,
-0.28689879179000854,
-0.23715901374816895,
-0.3237224817276001,
-0.17942091822624207,
-0.08997784554958344,
-0.34019288420677185,
0.3595796823501587,
0.20719978213310242,
0.23528005182743073,
0.2010670006275177,
-0.0001134565900429152,
-0.19580653309822083,
-0.08624277263879776,
-0.0715755969285965,
-0.22682760655879974,
0.2050929069519043,
-0.23258845508098602,
-0.23182672262191772,
0.1506909877061844,
-0.5585423707962036,
0.010546542704105377,
-0.08977856487035751,
-0.22037361562252045,
-0.3212565779685974,
-0.013486221432685852,
-0.09472142159938812,
0.13155034184455872,
-0.3456973135471344,
0.1944274604320526,
0.14163269102573395,
-0.006789706647396088,
0.12394113838672638,
-0.19292503595352173,
0.02550147846341133,
0.21219003200531006,
0.25620052218437195,
-0.17738746106624603,
0.553413987159729,
0.08334571123123169,
-0.19549138844013214,
0.229771688580513,
0.20939649641513824,
0.16246725618839264,
-0.07623198628425598,
0.018503397703170776,
0.0679733157157898,
0.5594709515571594,
-0.10356093943119049,
-0.6379072666168213,
-0.17917758226394653,
0.19271978735923767,
-0.6277031898498535,
0.11329682171344757,
0.010703310370445251,
0.07134082168340683,
0.1524108350276947,
-0.17682601511478424,
-0.116712786257267,
-0.17023178935050964,
-0.041682180017232895,
-0.34470134973526,
0.22678524255752563,
-0.0673467218875885,
0.11892420053482056,
-0.11162987351417542,
-0.18395912647247314,
-0.10149997472763062,
0.0056190211325883865,
0.30206072330474854,
0.20236384868621826,
-0.16506576538085938,
-0.28469961881637573,
-0.16054433584213257,
-0.09007266908884048,
0.037950314581394196,
0.14716850221157074,
-0.43679630756378174,
0.2738991379737854,
-0.24037694931030273,
-0.07069171965122223,
0.27798187732696533,
0.314125120639801,
0.27224200963974,
0.2878831624984741,
0.021238241344690323,
-0.025216933339834213,
-0.1125740259885788,
-0.09203433990478516,
-0.40581122040748596,
0.36920955777168274,
0.3314955532550812,
0.2634330689907074,
-0.35801923274993896,
-0.012817442417144775,
-0.06163538992404938,
0.13971523940563202,
-0.1570475846529007,
-0.04527062922716141,
0.23035742342472076,
0.08738814294338226,
0.2427973598241806,
0.4096068739891052,
0.0011574476957321167,
0.2391750067472458,
-0.10100406408309937,
-0.39828741550445557,
0.034127313643693924,
0.07641027867794037,
-0.2507226765155792,
0.08660951256752014,
0.11556491255760193,
0.3652885854244232,
-0.2072172462940216,
0.173064187169075,
0.12356481701135635,
-0.212093785405159,
-0.09384622424840927,
-0.04612430930137634,
0.2494891881942749,
-0.16938644647598267,
-0.39558684825897217,
0.38980022072792053,
0.20446354150772095,
-0.23710890114307404,
-0.22557887434959412,
-0.04906194657087326,
-0.21566881239414215,
-0.1583142876625061,
-0.275602251291275,
0.038302019238471985,
0.1374334841966629,
0.015839694067835808,
0.06653144210577011,
0.21550795435905457,
0.3993675112724304,
-0.24523870646953583,
0.07842493057250977,
-0.3443852663040161,
-0.02116759866476059,
-0.15981148183345795,
0.11301194876432419,
0.05392822250723839,
-0.06156329810619354,
-0.053745660930871964,
0.4054395854473114,
0.32845252752304077,
0.19445110857486725,
0.002278955653309822,
-0.08984814584255219,
-0.14663901925086975,
0.10179539769887924,
0.0010074228048324585,
-0.007718510925769806,
-0.5534077286720276,
-0.12308995425701141,
0.13924916088581085,
0.013929948210716248,
0.23031210899353027,
0.43156710267066956,
0.22919102013111115,
0.16857074201107025,
-0.3032926321029663,
0.3523431420326233,
0.2655864655971527,
-0.11342614144086838,
-0.020235851407051086,
0.028128109872341156,
-0.27342018485069275,
0.1177443340420723,
0.032811619341373444,
-0.1484166979789734,
-0.27309730648994446,
-0.23542451858520508,
0.03211711347103119,
-0.004193773493170738,
-0.42455917596817017,
0.2626887261867523,
0.14302338659763336,
-0.25052329897880554,
0.03470894321799278,
-0.1743174046278,
-0.27134954929351807,
-0.45324912667274475,
0.23014365136623383,
0.11495064198970795,
-0.05107063427567482,
-0.09768638014793396,
-0.4818090796470642,
0.2982674837112427,
-0.03512365370988846,
-0.21730569005012512,
-0.08451444655656815,
0.103615403175354,
0.06148168444633484,
-0.2117317020893097,
-0.08252021670341492,
-0.35923993587493896,
0.32795801758766174,
0.3438055217266083,
-0.04114427790045738,
-0.18069526553153992,
-0.1298065036535263,
-0.05931120365858078,
0.11762750148773193,
-0.1773897409439087,
0.49597930908203125,
0.17374004423618317,
-0.17232458293437958,
0.28098350763320923,
0.1877657175064087,
0.19996657967567444,
-0.3772127330303192,
-0.16393233835697174,
0.08713585138320923,
0.5095041990280151,
0.05019877105951309,
-0.024931907653808594,
-0.18116514384746552,
-0.05994386225938797,
-0.08024536818265915,
-0.556510865688324,
0.7267465591430664,
0.05744345486164093,
0.21541067957878113,
0.013594672083854675,
0.15722663700580597,
0.1192374899983406,
-0.008198060095310211,
-0.2908778786659241,
-0.25523585081100464,
-0.2322975993156433,
-0.18988171219825745,
-0.3253849446773529,
0.03790286183357239,
-0.45852532982826233,
0.4317970275878906,
0.4781964123249054,
0.15030845999717712,
0.2262502908706665,
-0.1560327410697937,
-0.08643527328968048,
0.012425526976585388,
0.09466224163770676,
0.2333715260028839,
0.1644039750099182,
0.02463531494140625,
0.15627503395080566,
-0.25170478224754333,
-0.1871064454317093,
0.1552981436252594,
0.0709330141544342,
-0.17935200035572052,
0.1633114069700241,
0.0009675361216068268,
0.08439651131629944,
0.08439233899116516,
0.12471474707126617,
-0.30061399936676025,
0.24859172105789185,
-0.2879396677017212,
-0.26548582315444946,
0.22854483127593994,
-0.6022520065307617,
-0.20706531405448914,
-0.18602332472801208,
-0.5071479082107544,
0.05997701361775398,
-0.26047414541244507,
0.0034649334847927094,
-0.14117906987667084,
0.006546705961227417,
-0.0014486238360404968,
-0.20084944367408752,
0.10079268366098404,
-0.0939241424202919,
-0.201433464884758,
0.27197265625,
-0.13296523690223694,
-0.22543497383594513,
-0.0389481745660305,
0.15713298320770264,
-0.19300290942192078,
0.040491990745067596,
0.3550816774368286,
-0.15192881226539612,
0.05073438584804535,
-0.37056708335876465,
-0.054254405200481415,
-0.18538245558738708,
-0.23929935693740845,
0.17648664116859436,
-0.3263547718524933,
-0.26466721296310425,
0.04443276301026344,
0.29144287109375,
0.33423927426338196,
0.09206099808216095,
0.1258823573589325,
0.2900301218032837,
-0.07142569124698639,
-0.13453668355941772,
-0.2483275979757309,
-0.3271825611591339,
-0.004353173077106476,
0.22914870083332062,
-0.07294298708438873,
0.20071683824062347,
-0.06687241047620773,
-0.3217645585536957,
0.0972629114985466,
0.23974400758743286,
-0.06372535228729248,
-0.24628330767154694,
0.08511541783809662,
0.33899611234664917,
-0.3051331341266632,
-0.20942477881908417,
-0.0821915790438652,
-0.07373973727226257,
0.09641432762145996,
-0.08852848410606384,
0.08208438754081726,
-0.11789008229970932,
0.18601754307746887,
0.14538736641407013,
0.13310764729976654,
-0.009280781261622906,
0.3074979782104492,
0.3532514274120331,
-0.008633438497781754,
-0.02109035849571228,
-0.1760857105255127,
0.19189587235450745,
-0.06863148510456085,
0.07466143369674683,
-0.13515828549861908,
0.08025238662958145,
-0.012073002755641937,
0.11498285830020905,
0.3200591802597046,
-0.0483260303735733,
0.059981562197208405,
0.013970872387290001,
-0.09734836220741272,
-0.054346222430467606,
0.06195801496505737,
-0.01880704239010811,
-0.5165598392486572,
-0.02184285596013069,
0.1555536389350891,
0.09743045270442963,
-0.1277593970298767,
0.030269227921962738,
0.7927091121673584,
0.19458900392055511,
-0.4489023685455322,
0.19048775732517242,
-0.27542752027511597,
0.12292565405368805,
-0.21910293400287628,
0.04941233992576599,
-0.35250672698020935,
0.11194213479757309,
-0.08920378983020782,
-0.1486528515815735,
-0.1239316463470459,
-0.12664425373077393,
-0.5414209365844727,
-0.41151341795921326,
-0.3145613968372345,
0.033044908195734024,
0.37846535444259644,
0.27676820755004883,
0.026882857084274292,
0.12658120691776276,
0.13721932470798492,
-0.041012536734342575,
0.1706334352493286,
-0.3981577157974243,
-0.21393391489982605,
0.3153446912765503,
-0.030777107924222946,
-0.20080262422561646,
-0.15705141425132751,
-0.24240107834339142,
-0.0897088497877121,
-0.12958669662475586,
0.2953537404537201,
-0.15026076138019562,
-0.1406499147415161,
0.4709111154079437,
0.013261284679174423,
-0.2733774483203888,
0.05103179067373276,
0.03713126480579376,
-0.15562888979911804,
-0.05870980769395828,
-0.10613901913166046,
0.433987557888031,
0.19747987389564514,
0.044557586312294006,
-0.044238343834877014,
-0.10664817690849304,
0.07833532989025116,
0.1340012401342392,
-0.12209911644458771,
0.05396774783730507,
0.09646935760974884,
-0.026123352348804474,
0.12613041698932648,
0.09603343158960342,
0.19402183592319489,
0.6153683662414551,
-0.10657048970460892,
-0.47773319482803345,
0.26753753423690796,
-0.3399054706096649,
0.4084867835044861,
0.16616389155387878,
0.0523870512843132,
0.07150635868310928,
-0.23045775294303894,
-0.18902181088924408,
-0.4494117200374603,
-0.34003323316574097,
0.21122005581855774,
0.16919314861297607,
-0.46709540486335754,
-0.23294401168823242,
0.5591332316398621,
0.03525747358798981,
-0.2130224108695984,
0.008463242091238499,
0.034224823117256165,
-0.45332077145576477,
0.26530951261520386,
0.5597101449966431,
0.6481292843818665,
-0.1308351308107376,
0.24387937784194946,
0.04638234153389931,
-0.145403191447258,
0.5850757360458374,
-0.12176161259412766,
0.3354727029800415,
-0.17644542455673218,
-0.09945023059844971,
-0.17744112014770508,
0.15441536903381348,
0.05863076075911522,
0.1370602697134018,
-0.32904982566833496,
0.314365029335022,
-0.2322838306427002,
-0.025765350088477135,
0.007453896105289459,
0.02771112322807312,
0.2482946664094925,
-0.4901580512523651,
0.17270614206790924,
0.1226109191775322,
0.21068283915519714,
-0.29487144947052,
0.006966695189476013,
0.01007060706615448,
-0.05239114165306091,
0.1579681634902954,
-0.2663854956626892,
-0.013523794710636139,
0.01997818425297737,
0.28752899169921875,
0.03328965604305267,
-0.014568224549293518,
0.4014478325843811,
0.350564181804657,
0.4282733201980591,
-0.294955849647522,
0.007031697779893875,
-0.25064176321029663,
-0.13261748850345612,
0.3051365911960602,
-0.09841719269752502,
-0.285577654838562,
0.6323850750923157,
0.18596290051937103,
0.2147558331489563,
0.11875692009925842,
-0.03534136712551117,
-0.05625879019498825,
0.05452290177345276,
0.07410156726837158,
0.2878457307815552,
-0.20346185564994812,
0.3483930826187134,
0.09903315454721451,
0.2312028706073761,
-0.24344244599342346,
0.06886468082666397,
-0.10423314571380615,
-0.23054778575897217,
0.24817624688148499,
-0.2970580458641052,
0.17480257153511047,
0.14227166771888733,
0.28099551796913147,
0.3384026288986206,
-0.08468521386384964,
0.38238102197647095,
0.1092028021812439,
-0.0724453330039978,
-0.09102822095155716,
0.34438252449035645,
0.5859231948852539,
-0.2440563589334488,
0.006714668124914169,
-0.1450314074754715,
-0.2656583786010742,
0.1795032024383545,
0.34523648023605347,
0.13838833570480347,
0.14241956174373627,
-0.16867133975028992,
-0.21276326477527618,
-0.2003069370985031,
0.2608524560928345,
-0.00010780920274555683,
0.05228817090392113,
-0.18364453315734863,
0.000403478741645813,
-0.07328338921070099,
0.12171562016010284,
-0.256377637386322,
-0.15930627286434174,
-0.21662701666355133,
-0.015778932720422745,
0.4268166720867157,
0.09931932389736176,
-0.05716996639966965,
0.1859472543001175,
0.09608827531337738,
-0.007192232646048069,
0.08685372024774551,
-0.06310774385929108,
-0.2004002034664154,
0.09364988654851913,
0.04786205291748047,
0.37914857268333435,
0.06228116899728775,
-0.08485803008079529,
-0.1944800764322281,
-0.20853279531002045,
0.11561208218336105,
-0.0007757097482681274,
-0.01920327916741371,
0.12135250866413116,
-0.4059712886810303,
0.29833799600601196,
-0.3597489297389984,
-0.01010228507220745,
0.28249239921569824,
0.08674194663763046,
0.18139415979385376,
0.10240590572357178,
-0.07028523832559586,
-0.030893124639987946,
-0.43938982486724854,
0.367901086807251,
-0.25336748361587524,
-0.10748890787363052,
0.22230415046215057,
-0.2969718277454376,
0.3106408715248108,
0.3970347046852112,
0.056966088712215424,
-0.03791619837284088,
-0.18237647414207458,
-0.1563061773777008,
0.25345438718795776,
0.11623062193393707,
0.0034862011671066284,
-0.12751998007297516,
-0.19799727201461792,
-0.20061342418193817,
-0.11902657896280289,
0.5287008285522461,
0.2362040877342224,
0.18698564171791077,
-0.08430265635251999,
-0.26474446058273315,
0.17808587849140167,
-0.09653151035308838,
0.22917254269123077,
0.2836892008781433,
-0.0636196881532669,
0.10573062300682068,
0.6053395867347717,
0.20263686776161194,
0.35162562131881714,
0.3697882294654846,
0.08073527365922928,
0.08362064510583878,
0.5480480790138245,
0.3167416453361511,
-0.04245010390877724,
-0.05202014744281769,
0.203671395778656,
0.21979984641075134,
0.14126017689704895,
0.3025450110435486,
0.04263032227754593,
0.04949566721916199,
-0.9010520577430725,
-0.4823310077190399,
-0.1854555606842041,
0.41104575991630554,
-0.1251826137304306,
-0.1679200828075409,
-0.02728898450732231,
-0.1404435932636261,
-0.19033506512641907,
-0.13853979110717773,
-0.45609796047210693,
0.14064691960811615,
0.6388472318649292,
0.13089653849601746,
0.34038883447647095,
-0.44766563177108765,
-0.3778817355632782,
-0.07242058217525482,
0.5721502900123596,
-0.1604488044977188,
0.39342623949050903,
0.2812058925628662,
-0.03989477455615997,
0.15204991400241852,
-0.085703544318676,
0.2019861489534378,
0.10623356699943542,
0.09113796055316925,
-0.11218657344579697,
-0.24802039563655853,
0.016438066959381104,
0.15762688219547272,
-0.1078597754240036,
0.16094832122325897,
-0.02031950280070305,
0.2545611262321472,
-0.04115375131368637,
-0.05492966249585152,
0.16663028299808502,
0.26845335960388184,
0.3155748248100281,
-0.009353958070278168,
0.5089624524116516,
0.1605912297964096,
-0.18388435244560242,
0.21969471871852875,
-0.01619298756122589,
-0.10420218855142593,
-0.19224922358989716,
0.07496437430381775,
-0.05557628720998764,
0.14511576294898987,
0.3766848146915436,
0.06765308231115341,
0.2992438077926636,
0.3989931344985962,
0.1706959307193756,
-0.4512961506843567,
-0.056396715342998505,
0.0061568766832351685,
-0.4899219870567322,
-0.03817391395568848,
0.02333391271531582,
-0.745287299156189,
0.19181403517723083,
0.1694442629814148,
0.2428244948387146,
0.042368508875370026,
0.06011703237891197,
-0.26181209087371826,
0.48223602771759033,
0.20437712967395782,
-0.3109924793243408,
0.13508382439613342,
0.539929986000061,
0.1831645667552948,
-0.09833421558141708,
-0.19403290748596191,
0.16513395309448242,
0.16914963722229004,
-0.03972424194216728,
0.12945346534252167,
0.1309615969657898,
-0.22421978414058685,
-0.4243394136428833,
0.07028712332248688,
0.1467573344707489,
0.23196956515312195,
0.22090882062911987,
-0.22812490165233612,
0.19052492082118988,
0.19671180844306946,
-0.02093394100666046,
0.25763872265815735,
-0.02777913771569729,
0.5791330933570862,
-0.20282132923603058,
0.3640148341655731,
-0.18226665258407593,
-0.033365339040756226,
0.04967482388019562,
0.0422707237303257,
-0.3150275945663452,
0.3750915229320526,
-0.2086731493473053,
-0.017354944720864296,
0.4995990991592407,
0.45146647095680237,
-0.005608031526207924,
0.2574060261249542,
-0.042500972747802734,
-0.339623361825943,
0.07757081091403961,
-0.2763092815876007,
-0.3755783438682556,
0.12212327122688293,
0.3234434723854065,
-0.19254736602306366,
0.3154297471046448,
-0.49654078483581543,
-0.06428252160549164,
0.1642414629459381,
0.04418041557073593,
-0.609551191329956,
0.17415852844715118,
0.027120579034090042,
-0.308194637298584,
-0.1511620581150055,
0.1377672702074051,
-0.18748439848423004,
0.021706566214561462,
-0.11178845167160034,
-0.17242509126663208
] |
https://github.com/huggingface/datasets/issues/6267 | Sorry, I'm still not following. Are you saying that there currently exists a way to call `class_encode_column` on a `Sequence(ClassLabel)` type? Or that the underlying data structures support it and a contribution of a method to do that would be welcome? | Multi label class encoding | ### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests. | 41 | Multi label class encoding
### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
Sorry, I'm still not following. Are you saying that there currently exists a way to call `class_encode_column` on a `Sequence(ClassLabel)` type? Or that the underlying data structures support it and a contribution of a method to do that would be welcome? | [
0.13402794301509857,
0.1659838855266571,
0.07211393117904663,
0.2635546326637268,
0.344813734292984,
0.13794733583927155,
0.7133165597915649,
-0.18815426528453827,
0.0459604486823082,
-0.022461630403995514,
0.12441209703683853,
0.4255562126636505,
-0.25185367465019226,
0.558788537979126,
-0.19353589415550232,
-0.11879552155733109,
0.0013904459774494171,
-0.07339064031839371,
-0.005307093262672424,
0.02107281982898712,
-0.2726411819458008,
0.09288059920072556,
-0.2554440200328827,
0.16254714131355286,
-0.28689879179000854,
-0.23715901374816895,
-0.3237224817276001,
-0.17942091822624207,
-0.08997784554958344,
-0.34019288420677185,
0.3595796823501587,
0.20719978213310242,
0.23528005182743073,
0.2010670006275177,
-0.0001134565900429152,
-0.19580653309822083,
-0.08624277263879776,
-0.0715755969285965,
-0.22682760655879974,
0.2050929069519043,
-0.23258845508098602,
-0.23182672262191772,
0.1506909877061844,
-0.5585423707962036,
0.010546542704105377,
-0.08977856487035751,
-0.22037361562252045,
-0.3212565779685974,
-0.013486221432685852,
-0.09472142159938812,
0.13155034184455872,
-0.3456973135471344,
0.1944274604320526,
0.14163269102573395,
-0.006789706647396088,
0.12394113838672638,
-0.19292503595352173,
0.02550147846341133,
0.21219003200531006,
0.25620052218437195,
-0.17738746106624603,
0.553413987159729,
0.08334571123123169,
-0.19549138844013214,
0.229771688580513,
0.20939649641513824,
0.16246725618839264,
-0.07623198628425598,
0.018503397703170776,
0.0679733157157898,
0.5594709515571594,
-0.10356093943119049,
-0.6379072666168213,
-0.17917758226394653,
0.19271978735923767,
-0.6277031898498535,
0.11329682171344757,
0.010703310370445251,
0.07134082168340683,
0.1524108350276947,
-0.17682601511478424,
-0.116712786257267,
-0.17023178935050964,
-0.041682180017232895,
-0.34470134973526,
0.22678524255752563,
-0.0673467218875885,
0.11892420053482056,
-0.11162987351417542,
-0.18395912647247314,
-0.10149997472763062,
0.0056190211325883865,
0.30206072330474854,
0.20236384868621826,
-0.16506576538085938,
-0.28469961881637573,
-0.16054433584213257,
-0.09007266908884048,
0.037950314581394196,
0.14716850221157074,
-0.43679630756378174,
0.2738991379737854,
-0.24037694931030273,
-0.07069171965122223,
0.27798187732696533,
0.314125120639801,
0.27224200963974,
0.2878831624984741,
0.021238241344690323,
-0.025216933339834213,
-0.1125740259885788,
-0.09203433990478516,
-0.40581122040748596,
0.36920955777168274,
0.3314955532550812,
0.2634330689907074,
-0.35801923274993896,
-0.012817442417144775,
-0.06163538992404938,
0.13971523940563202,
-0.1570475846529007,
-0.04527062922716141,
0.23035742342472076,
0.08738814294338226,
0.2427973598241806,
0.4096068739891052,
0.0011574476957321167,
0.2391750067472458,
-0.10100406408309937,
-0.39828741550445557,
0.034127313643693924,
0.07641027867794037,
-0.2507226765155792,
0.08660951256752014,
0.11556491255760193,
0.3652885854244232,
-0.2072172462940216,
0.173064187169075,
0.12356481701135635,
-0.212093785405159,
-0.09384622424840927,
-0.04612430930137634,
0.2494891881942749,
-0.16938644647598267,
-0.39558684825897217,
0.38980022072792053,
0.20446354150772095,
-0.23710890114307404,
-0.22557887434959412,
-0.04906194657087326,
-0.21566881239414215,
-0.1583142876625061,
-0.275602251291275,
0.038302019238471985,
0.1374334841966629,
0.015839694067835808,
0.06653144210577011,
0.21550795435905457,
0.3993675112724304,
-0.24523870646953583,
0.07842493057250977,
-0.3443852663040161,
-0.02116759866476059,
-0.15981148183345795,
0.11301194876432419,
0.05392822250723839,
-0.06156329810619354,
-0.053745660930871964,
0.4054395854473114,
0.32845252752304077,
0.19445110857486725,
0.002278955653309822,
-0.08984814584255219,
-0.14663901925086975,
0.10179539769887924,
0.0010074228048324585,
-0.007718510925769806,
-0.5534077286720276,
-0.12308995425701141,
0.13924916088581085,
0.013929948210716248,
0.23031210899353027,
0.43156710267066956,
0.22919102013111115,
0.16857074201107025,
-0.3032926321029663,
0.3523431420326233,
0.2655864655971527,
-0.11342614144086838,
-0.020235851407051086,
0.028128109872341156,
-0.27342018485069275,
0.1177443340420723,
0.032811619341373444,
-0.1484166979789734,
-0.27309730648994446,
-0.23542451858520508,
0.03211711347103119,
-0.004193773493170738,
-0.42455917596817017,
0.2626887261867523,
0.14302338659763336,
-0.25052329897880554,
0.03470894321799278,
-0.1743174046278,
-0.27134954929351807,
-0.45324912667274475,
0.23014365136623383,
0.11495064198970795,
-0.05107063427567482,
-0.09768638014793396,
-0.4818090796470642,
0.2982674837112427,
-0.03512365370988846,
-0.21730569005012512,
-0.08451444655656815,
0.103615403175354,
0.06148168444633484,
-0.2117317020893097,
-0.08252021670341492,
-0.35923993587493896,
0.32795801758766174,
0.3438055217266083,
-0.04114427790045738,
-0.18069526553153992,
-0.1298065036535263,
-0.05931120365858078,
0.11762750148773193,
-0.1773897409439087,
0.49597930908203125,
0.17374004423618317,
-0.17232458293437958,
0.28098350763320923,
0.1877657175064087,
0.19996657967567444,
-0.3772127330303192,
-0.16393233835697174,
0.08713585138320923,
0.5095041990280151,
0.05019877105951309,
-0.024931907653808594,
-0.18116514384746552,
-0.05994386225938797,
-0.08024536818265915,
-0.556510865688324,
0.7267465591430664,
0.05744345486164093,
0.21541067957878113,
0.013594672083854675,
0.15722663700580597,
0.1192374899983406,
-0.008198060095310211,
-0.2908778786659241,
-0.25523585081100464,
-0.2322975993156433,
-0.18988171219825745,
-0.3253849446773529,
0.03790286183357239,
-0.45852532982826233,
0.4317970275878906,
0.4781964123249054,
0.15030845999717712,
0.2262502908706665,
-0.1560327410697937,
-0.08643527328968048,
0.012425526976585388,
0.09466224163770676,
0.2333715260028839,
0.1644039750099182,
0.02463531494140625,
0.15627503395080566,
-0.25170478224754333,
-0.1871064454317093,
0.1552981436252594,
0.0709330141544342,
-0.17935200035572052,
0.1633114069700241,
0.0009675361216068268,
0.08439651131629944,
0.08439233899116516,
0.12471474707126617,
-0.30061399936676025,
0.24859172105789185,
-0.2879396677017212,
-0.26548582315444946,
0.22854483127593994,
-0.6022520065307617,
-0.20706531405448914,
-0.18602332472801208,
-0.5071479082107544,
0.05997701361775398,
-0.26047414541244507,
0.0034649334847927094,
-0.14117906987667084,
0.006546705961227417,
-0.0014486238360404968,
-0.20084944367408752,
0.10079268366098404,
-0.0939241424202919,
-0.201433464884758,
0.27197265625,
-0.13296523690223694,
-0.22543497383594513,
-0.0389481745660305,
0.15713298320770264,
-0.19300290942192078,
0.040491990745067596,
0.3550816774368286,
-0.15192881226539612,
0.05073438584804535,
-0.37056708335876465,
-0.054254405200481415,
-0.18538245558738708,
-0.23929935693740845,
0.17648664116859436,
-0.3263547718524933,
-0.26466721296310425,
0.04443276301026344,
0.29144287109375,
0.33423927426338196,
0.09206099808216095,
0.1258823573589325,
0.2900301218032837,
-0.07142569124698639,
-0.13453668355941772,
-0.2483275979757309,
-0.3271825611591339,
-0.004353173077106476,
0.22914870083332062,
-0.07294298708438873,
0.20071683824062347,
-0.06687241047620773,
-0.3217645585536957,
0.0972629114985466,
0.23974400758743286,
-0.06372535228729248,
-0.24628330767154694,
0.08511541783809662,
0.33899611234664917,
-0.3051331341266632,
-0.20942477881908417,
-0.0821915790438652,
-0.07373973727226257,
0.09641432762145996,
-0.08852848410606384,
0.08208438754081726,
-0.11789008229970932,
0.18601754307746887,
0.14538736641407013,
0.13310764729976654,
-0.009280781261622906,
0.3074979782104492,
0.3532514274120331,
-0.008633438497781754,
-0.02109035849571228,
-0.1760857105255127,
0.19189587235450745,
-0.06863148510456085,
0.07466143369674683,
-0.13515828549861908,
0.08025238662958145,
-0.012073002755641937,
0.11498285830020905,
0.3200591802597046,
-0.0483260303735733,
0.059981562197208405,
0.013970872387290001,
-0.09734836220741272,
-0.054346222430467606,
0.06195801496505737,
-0.01880704239010811,
-0.5165598392486572,
-0.02184285596013069,
0.1555536389350891,
0.09743045270442963,
-0.1277593970298767,
0.030269227921962738,
0.7927091121673584,
0.19458900392055511,
-0.4489023685455322,
0.19048775732517242,
-0.27542752027511597,
0.12292565405368805,
-0.21910293400287628,
0.04941233992576599,
-0.35250672698020935,
0.11194213479757309,
-0.08920378983020782,
-0.1486528515815735,
-0.1239316463470459,
-0.12664425373077393,
-0.5414209365844727,
-0.41151341795921326,
-0.3145613968372345,
0.033044908195734024,
0.37846535444259644,
0.27676820755004883,
0.026882857084274292,
0.12658120691776276,
0.13721932470798492,
-0.041012536734342575,
0.1706334352493286,
-0.3981577157974243,
-0.21393391489982605,
0.3153446912765503,
-0.030777107924222946,
-0.20080262422561646,
-0.15705141425132751,
-0.24240107834339142,
-0.0897088497877121,
-0.12958669662475586,
0.2953537404537201,
-0.15026076138019562,
-0.1406499147415161,
0.4709111154079437,
0.013261284679174423,
-0.2733774483203888,
0.05103179067373276,
0.03713126480579376,
-0.15562888979911804,
-0.05870980769395828,
-0.10613901913166046,
0.433987557888031,
0.19747987389564514,
0.044557586312294006,
-0.044238343834877014,
-0.10664817690849304,
0.07833532989025116,
0.1340012401342392,
-0.12209911644458771,
0.05396774783730507,
0.09646935760974884,
-0.026123352348804474,
0.12613041698932648,
0.09603343158960342,
0.19402183592319489,
0.6153683662414551,
-0.10657048970460892,
-0.47773319482803345,
0.26753753423690796,
-0.3399054706096649,
0.4084867835044861,
0.16616389155387878,
0.0523870512843132,
0.07150635868310928,
-0.23045775294303894,
-0.18902181088924408,
-0.4494117200374603,
-0.34003323316574097,
0.21122005581855774,
0.16919314861297607,
-0.46709540486335754,
-0.23294401168823242,
0.5591332316398621,
0.03525747358798981,
-0.2130224108695984,
0.008463242091238499,
0.034224823117256165,
-0.45332077145576477,
0.26530951261520386,
0.5597101449966431,
0.6481292843818665,
-0.1308351308107376,
0.24387937784194946,
0.04638234153389931,
-0.145403191447258,
0.5850757360458374,
-0.12176161259412766,
0.3354727029800415,
-0.17644542455673218,
-0.09945023059844971,
-0.17744112014770508,
0.15441536903381348,
0.05863076075911522,
0.1370602697134018,
-0.32904982566833496,
0.314365029335022,
-0.2322838306427002,
-0.025765350088477135,
0.007453896105289459,
0.02771112322807312,
0.2482946664094925,
-0.4901580512523651,
0.17270614206790924,
0.1226109191775322,
0.21068283915519714,
-0.29487144947052,
0.006966695189476013,
0.01007060706615448,
-0.05239114165306091,
0.1579681634902954,
-0.2663854956626892,
-0.013523794710636139,
0.01997818425297737,
0.28752899169921875,
0.03328965604305267,
-0.014568224549293518,
0.4014478325843811,
0.350564181804657,
0.4282733201980591,
-0.294955849647522,
0.007031697779893875,
-0.25064176321029663,
-0.13261748850345612,
0.3051365911960602,
-0.09841719269752502,
-0.285577654838562,
0.6323850750923157,
0.18596290051937103,
0.2147558331489563,
0.11875692009925842,
-0.03534136712551117,
-0.05625879019498825,
0.05452290177345276,
0.07410156726837158,
0.2878457307815552,
-0.20346185564994812,
0.3483930826187134,
0.09903315454721451,
0.2312028706073761,
-0.24344244599342346,
0.06886468082666397,
-0.10423314571380615,
-0.23054778575897217,
0.24817624688148499,
-0.2970580458641052,
0.17480257153511047,
0.14227166771888733,
0.28099551796913147,
0.3384026288986206,
-0.08468521386384964,
0.38238102197647095,
0.1092028021812439,
-0.0724453330039978,
-0.09102822095155716,
0.34438252449035645,
0.5859231948852539,
-0.2440563589334488,
0.006714668124914169,
-0.1450314074754715,
-0.2656583786010742,
0.1795032024383545,
0.34523648023605347,
0.13838833570480347,
0.14241956174373627,
-0.16867133975028992,
-0.21276326477527618,
-0.2003069370985031,
0.2608524560928345,
-0.00010780920274555683,
0.05228817090392113,
-0.18364453315734863,
0.000403478741645813,
-0.07328338921070099,
0.12171562016010284,
-0.256377637386322,
-0.15930627286434174,
-0.21662701666355133,
-0.015778932720422745,
0.4268166720867157,
0.09931932389736176,
-0.05716996639966965,
0.1859472543001175,
0.09608827531337738,
-0.007192232646048069,
0.08685372024774551,
-0.06310774385929108,
-0.2004002034664154,
0.09364988654851913,
0.04786205291748047,
0.37914857268333435,
0.06228116899728775,
-0.08485803008079529,
-0.1944800764322281,
-0.20853279531002045,
0.11561208218336105,
-0.0007757097482681274,
-0.01920327916741371,
0.12135250866413116,
-0.4059712886810303,
0.29833799600601196,
-0.3597489297389984,
-0.01010228507220745,
0.28249239921569824,
0.08674194663763046,
0.18139415979385376,
0.10240590572357178,
-0.07028523832559586,
-0.030893124639987946,
-0.43938982486724854,
0.367901086807251,
-0.25336748361587524,
-0.10748890787363052,
0.22230415046215057,
-0.2969718277454376,
0.3106408715248108,
0.3970347046852112,
0.056966088712215424,
-0.03791619837284088,
-0.18237647414207458,
-0.1563061773777008,
0.25345438718795776,
0.11623062193393707,
0.0034862011671066284,
-0.12751998007297516,
-0.19799727201461792,
-0.20061342418193817,
-0.11902657896280289,
0.5287008285522461,
0.2362040877342224,
0.18698564171791077,
-0.08430265635251999,
-0.26474446058273315,
0.17808587849140167,
-0.09653151035308838,
0.22917254269123077,
0.2836892008781433,
-0.0636196881532669,
0.10573062300682068,
0.6053395867347717,
0.20263686776161194,
0.35162562131881714,
0.3697882294654846,
0.08073527365922928,
0.08362064510583878,
0.5480480790138245,
0.3167416453361511,
-0.04245010390877724,
-0.05202014744281769,
0.203671395778656,
0.21979984641075134,
0.14126017689704895,
0.3025450110435486,
0.04263032227754593,
0.04949566721916199,
-0.9010520577430725,
-0.4823310077190399,
-0.1854555606842041,
0.41104575991630554,
-0.1251826137304306,
-0.1679200828075409,
-0.02728898450732231,
-0.1404435932636261,
-0.19033506512641907,
-0.13853979110717773,
-0.45609796047210693,
0.14064691960811615,
0.6388472318649292,
0.13089653849601746,
0.34038883447647095,
-0.44766563177108765,
-0.3778817355632782,
-0.07242058217525482,
0.5721502900123596,
-0.1604488044977188,
0.39342623949050903,
0.2812058925628662,
-0.03989477455615997,
0.15204991400241852,
-0.085703544318676,
0.2019861489534378,
0.10623356699943542,
0.09113796055316925,
-0.11218657344579697,
-0.24802039563655853,
0.016438066959381104,
0.15762688219547272,
-0.1078597754240036,
0.16094832122325897,
-0.02031950280070305,
0.2545611262321472,
-0.04115375131368637,
-0.05492966249585152,
0.16663028299808502,
0.26845335960388184,
0.3155748248100281,
-0.009353958070278168,
0.5089624524116516,
0.1605912297964096,
-0.18388435244560242,
0.21969471871852875,
-0.01619298756122589,
-0.10420218855142593,
-0.19224922358989716,
0.07496437430381775,
-0.05557628720998764,
0.14511576294898987,
0.3766848146915436,
0.06765308231115341,
0.2992438077926636,
0.3989931344985962,
0.1706959307193756,
-0.4512961506843567,
-0.056396715342998505,
0.0061568766832351685,
-0.4899219870567322,
-0.03817391395568848,
0.02333391271531582,
-0.745287299156189,
0.19181403517723083,
0.1694442629814148,
0.2428244948387146,
0.042368508875370026,
0.06011703237891197,
-0.26181209087371826,
0.48223602771759033,
0.20437712967395782,
-0.3109924793243408,
0.13508382439613342,
0.539929986000061,
0.1831645667552948,
-0.09833421558141708,
-0.19403290748596191,
0.16513395309448242,
0.16914963722229004,
-0.03972424194216728,
0.12945346534252167,
0.1309615969657898,
-0.22421978414058685,
-0.4243394136428833,
0.07028712332248688,
0.1467573344707489,
0.23196956515312195,
0.22090882062911987,
-0.22812490165233612,
0.19052492082118988,
0.19671180844306946,
-0.02093394100666046,
0.25763872265815735,
-0.02777913771569729,
0.5791330933570862,
-0.20282132923603058,
0.3640148341655731,
-0.18226665258407593,
-0.033365339040756226,
0.04967482388019562,
0.0422707237303257,
-0.3150275945663452,
0.3750915229320526,
-0.2086731493473053,
-0.017354944720864296,
0.4995990991592407,
0.45146647095680237,
-0.005608031526207924,
0.2574060261249542,
-0.042500972747802734,
-0.339623361825943,
0.07757081091403961,
-0.2763092815876007,
-0.3755783438682556,
0.12212327122688293,
0.3234434723854065,
-0.19254736602306366,
0.3154297471046448,
-0.49654078483581543,
-0.06428252160549164,
0.1642414629459381,
0.04418041557073593,
-0.609551191329956,
0.17415852844715118,
0.027120579034090042,
-0.308194637298584,
-0.1511620581150055,
0.1377672702074051,
-0.18748439848423004,
0.021706566214561462,
-0.11178845167160034,
-0.17242509126663208
] |
https://github.com/huggingface/datasets/issues/6267 | `class_encode_column ` currently does not support `Sequence(ClassLabel)`. Implementing support for this would be a nice contribution.
In the meantime, this limitation can be circumvented by fetching (unique) labels and calling `.cast_column(col, Sequence(ClassLabel(names=labels)))`. | Multi label class encoding | ### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests. | 32 | Multi label class encoding
### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
`class_encode_column ` currently does not support `Sequence(ClassLabel)`. Implementing support for this would be a nice contribution.
In the meantime, this limitation can be circumvented by fetching (unique) labels and calling `.cast_column(col, Sequence(ClassLabel(names=labels)))`. | [
0.13402794301509857,
0.1659838855266571,
0.07211393117904663,
0.2635546326637268,
0.344813734292984,
0.13794733583927155,
0.7133165597915649,
-0.18815426528453827,
0.0459604486823082,
-0.022461630403995514,
0.12441209703683853,
0.4255562126636505,
-0.25185367465019226,
0.558788537979126,
-0.19353589415550232,
-0.11879552155733109,
0.0013904459774494171,
-0.07339064031839371,
-0.005307093262672424,
0.02107281982898712,
-0.2726411819458008,
0.09288059920072556,
-0.2554440200328827,
0.16254714131355286,
-0.28689879179000854,
-0.23715901374816895,
-0.3237224817276001,
-0.17942091822624207,
-0.08997784554958344,
-0.34019288420677185,
0.3595796823501587,
0.20719978213310242,
0.23528005182743073,
0.2010670006275177,
-0.0001134565900429152,
-0.19580653309822083,
-0.08624277263879776,
-0.0715755969285965,
-0.22682760655879974,
0.2050929069519043,
-0.23258845508098602,
-0.23182672262191772,
0.1506909877061844,
-0.5585423707962036,
0.010546542704105377,
-0.08977856487035751,
-0.22037361562252045,
-0.3212565779685974,
-0.013486221432685852,
-0.09472142159938812,
0.13155034184455872,
-0.3456973135471344,
0.1944274604320526,
0.14163269102573395,
-0.006789706647396088,
0.12394113838672638,
-0.19292503595352173,
0.02550147846341133,
0.21219003200531006,
0.25620052218437195,
-0.17738746106624603,
0.553413987159729,
0.08334571123123169,
-0.19549138844013214,
0.229771688580513,
0.20939649641513824,
0.16246725618839264,
-0.07623198628425598,
0.018503397703170776,
0.0679733157157898,
0.5594709515571594,
-0.10356093943119049,
-0.6379072666168213,
-0.17917758226394653,
0.19271978735923767,
-0.6277031898498535,
0.11329682171344757,
0.010703310370445251,
0.07134082168340683,
0.1524108350276947,
-0.17682601511478424,
-0.116712786257267,
-0.17023178935050964,
-0.041682180017232895,
-0.34470134973526,
0.22678524255752563,
-0.0673467218875885,
0.11892420053482056,
-0.11162987351417542,
-0.18395912647247314,
-0.10149997472763062,
0.0056190211325883865,
0.30206072330474854,
0.20236384868621826,
-0.16506576538085938,
-0.28469961881637573,
-0.16054433584213257,
-0.09007266908884048,
0.037950314581394196,
0.14716850221157074,
-0.43679630756378174,
0.2738991379737854,
-0.24037694931030273,
-0.07069171965122223,
0.27798187732696533,
0.314125120639801,
0.27224200963974,
0.2878831624984741,
0.021238241344690323,
-0.025216933339834213,
-0.1125740259885788,
-0.09203433990478516,
-0.40581122040748596,
0.36920955777168274,
0.3314955532550812,
0.2634330689907074,
-0.35801923274993896,
-0.012817442417144775,
-0.06163538992404938,
0.13971523940563202,
-0.1570475846529007,
-0.04527062922716141,
0.23035742342472076,
0.08738814294338226,
0.2427973598241806,
0.4096068739891052,
0.0011574476957321167,
0.2391750067472458,
-0.10100406408309937,
-0.39828741550445557,
0.034127313643693924,
0.07641027867794037,
-0.2507226765155792,
0.08660951256752014,
0.11556491255760193,
0.3652885854244232,
-0.2072172462940216,
0.173064187169075,
0.12356481701135635,
-0.212093785405159,
-0.09384622424840927,
-0.04612430930137634,
0.2494891881942749,
-0.16938644647598267,
-0.39558684825897217,
0.38980022072792053,
0.20446354150772095,
-0.23710890114307404,
-0.22557887434959412,
-0.04906194657087326,
-0.21566881239414215,
-0.1583142876625061,
-0.275602251291275,
0.038302019238471985,
0.1374334841966629,
0.015839694067835808,
0.06653144210577011,
0.21550795435905457,
0.3993675112724304,
-0.24523870646953583,
0.07842493057250977,
-0.3443852663040161,
-0.02116759866476059,
-0.15981148183345795,
0.11301194876432419,
0.05392822250723839,
-0.06156329810619354,
-0.053745660930871964,
0.4054395854473114,
0.32845252752304077,
0.19445110857486725,
0.002278955653309822,
-0.08984814584255219,
-0.14663901925086975,
0.10179539769887924,
0.0010074228048324585,
-0.007718510925769806,
-0.5534077286720276,
-0.12308995425701141,
0.13924916088581085,
0.013929948210716248,
0.23031210899353027,
0.43156710267066956,
0.22919102013111115,
0.16857074201107025,
-0.3032926321029663,
0.3523431420326233,
0.2655864655971527,
-0.11342614144086838,
-0.020235851407051086,
0.028128109872341156,
-0.27342018485069275,
0.1177443340420723,
0.032811619341373444,
-0.1484166979789734,
-0.27309730648994446,
-0.23542451858520508,
0.03211711347103119,
-0.004193773493170738,
-0.42455917596817017,
0.2626887261867523,
0.14302338659763336,
-0.25052329897880554,
0.03470894321799278,
-0.1743174046278,
-0.27134954929351807,
-0.45324912667274475,
0.23014365136623383,
0.11495064198970795,
-0.05107063427567482,
-0.09768638014793396,
-0.4818090796470642,
0.2982674837112427,
-0.03512365370988846,
-0.21730569005012512,
-0.08451444655656815,
0.103615403175354,
0.06148168444633484,
-0.2117317020893097,
-0.08252021670341492,
-0.35923993587493896,
0.32795801758766174,
0.3438055217266083,
-0.04114427790045738,
-0.18069526553153992,
-0.1298065036535263,
-0.05931120365858078,
0.11762750148773193,
-0.1773897409439087,
0.49597930908203125,
0.17374004423618317,
-0.17232458293437958,
0.28098350763320923,
0.1877657175064087,
0.19996657967567444,
-0.3772127330303192,
-0.16393233835697174,
0.08713585138320923,
0.5095041990280151,
0.05019877105951309,
-0.024931907653808594,
-0.18116514384746552,
-0.05994386225938797,
-0.08024536818265915,
-0.556510865688324,
0.7267465591430664,
0.05744345486164093,
0.21541067957878113,
0.013594672083854675,
0.15722663700580597,
0.1192374899983406,
-0.008198060095310211,
-0.2908778786659241,
-0.25523585081100464,
-0.2322975993156433,
-0.18988171219825745,
-0.3253849446773529,
0.03790286183357239,
-0.45852532982826233,
0.4317970275878906,
0.4781964123249054,
0.15030845999717712,
0.2262502908706665,
-0.1560327410697937,
-0.08643527328968048,
0.012425526976585388,
0.09466224163770676,
0.2333715260028839,
0.1644039750099182,
0.02463531494140625,
0.15627503395080566,
-0.25170478224754333,
-0.1871064454317093,
0.1552981436252594,
0.0709330141544342,
-0.17935200035572052,
0.1633114069700241,
0.0009675361216068268,
0.08439651131629944,
0.08439233899116516,
0.12471474707126617,
-0.30061399936676025,
0.24859172105789185,
-0.2879396677017212,
-0.26548582315444946,
0.22854483127593994,
-0.6022520065307617,
-0.20706531405448914,
-0.18602332472801208,
-0.5071479082107544,
0.05997701361775398,
-0.26047414541244507,
0.0034649334847927094,
-0.14117906987667084,
0.006546705961227417,
-0.0014486238360404968,
-0.20084944367408752,
0.10079268366098404,
-0.0939241424202919,
-0.201433464884758,
0.27197265625,
-0.13296523690223694,
-0.22543497383594513,
-0.0389481745660305,
0.15713298320770264,
-0.19300290942192078,
0.040491990745067596,
0.3550816774368286,
-0.15192881226539612,
0.05073438584804535,
-0.37056708335876465,
-0.054254405200481415,
-0.18538245558738708,
-0.23929935693740845,
0.17648664116859436,
-0.3263547718524933,
-0.26466721296310425,
0.04443276301026344,
0.29144287109375,
0.33423927426338196,
0.09206099808216095,
0.1258823573589325,
0.2900301218032837,
-0.07142569124698639,
-0.13453668355941772,
-0.2483275979757309,
-0.3271825611591339,
-0.004353173077106476,
0.22914870083332062,
-0.07294298708438873,
0.20071683824062347,
-0.06687241047620773,
-0.3217645585536957,
0.0972629114985466,
0.23974400758743286,
-0.06372535228729248,
-0.24628330767154694,
0.08511541783809662,
0.33899611234664917,
-0.3051331341266632,
-0.20942477881908417,
-0.0821915790438652,
-0.07373973727226257,
0.09641432762145996,
-0.08852848410606384,
0.08208438754081726,
-0.11789008229970932,
0.18601754307746887,
0.14538736641407013,
0.13310764729976654,
-0.009280781261622906,
0.3074979782104492,
0.3532514274120331,
-0.008633438497781754,
-0.02109035849571228,
-0.1760857105255127,
0.19189587235450745,
-0.06863148510456085,
0.07466143369674683,
-0.13515828549861908,
0.08025238662958145,
-0.012073002755641937,
0.11498285830020905,
0.3200591802597046,
-0.0483260303735733,
0.059981562197208405,
0.013970872387290001,
-0.09734836220741272,
-0.054346222430467606,
0.06195801496505737,
-0.01880704239010811,
-0.5165598392486572,
-0.02184285596013069,
0.1555536389350891,
0.09743045270442963,
-0.1277593970298767,
0.030269227921962738,
0.7927091121673584,
0.19458900392055511,
-0.4489023685455322,
0.19048775732517242,
-0.27542752027511597,
0.12292565405368805,
-0.21910293400287628,
0.04941233992576599,
-0.35250672698020935,
0.11194213479757309,
-0.08920378983020782,
-0.1486528515815735,
-0.1239316463470459,
-0.12664425373077393,
-0.5414209365844727,
-0.41151341795921326,
-0.3145613968372345,
0.033044908195734024,
0.37846535444259644,
0.27676820755004883,
0.026882857084274292,
0.12658120691776276,
0.13721932470798492,
-0.041012536734342575,
0.1706334352493286,
-0.3981577157974243,
-0.21393391489982605,
0.3153446912765503,
-0.030777107924222946,
-0.20080262422561646,
-0.15705141425132751,
-0.24240107834339142,
-0.0897088497877121,
-0.12958669662475586,
0.2953537404537201,
-0.15026076138019562,
-0.1406499147415161,
0.4709111154079437,
0.013261284679174423,
-0.2733774483203888,
0.05103179067373276,
0.03713126480579376,
-0.15562888979911804,
-0.05870980769395828,
-0.10613901913166046,
0.433987557888031,
0.19747987389564514,
0.044557586312294006,
-0.044238343834877014,
-0.10664817690849304,
0.07833532989025116,
0.1340012401342392,
-0.12209911644458771,
0.05396774783730507,
0.09646935760974884,
-0.026123352348804474,
0.12613041698932648,
0.09603343158960342,
0.19402183592319489,
0.6153683662414551,
-0.10657048970460892,
-0.47773319482803345,
0.26753753423690796,
-0.3399054706096649,
0.4084867835044861,
0.16616389155387878,
0.0523870512843132,
0.07150635868310928,
-0.23045775294303894,
-0.18902181088924408,
-0.4494117200374603,
-0.34003323316574097,
0.21122005581855774,
0.16919314861297607,
-0.46709540486335754,
-0.23294401168823242,
0.5591332316398621,
0.03525747358798981,
-0.2130224108695984,
0.008463242091238499,
0.034224823117256165,
-0.45332077145576477,
0.26530951261520386,
0.5597101449966431,
0.6481292843818665,
-0.1308351308107376,
0.24387937784194946,
0.04638234153389931,
-0.145403191447258,
0.5850757360458374,
-0.12176161259412766,
0.3354727029800415,
-0.17644542455673218,
-0.09945023059844971,
-0.17744112014770508,
0.15441536903381348,
0.05863076075911522,
0.1370602697134018,
-0.32904982566833496,
0.314365029335022,
-0.2322838306427002,
-0.025765350088477135,
0.007453896105289459,
0.02771112322807312,
0.2482946664094925,
-0.4901580512523651,
0.17270614206790924,
0.1226109191775322,
0.21068283915519714,
-0.29487144947052,
0.006966695189476013,
0.01007060706615448,
-0.05239114165306091,
0.1579681634902954,
-0.2663854956626892,
-0.013523794710636139,
0.01997818425297737,
0.28752899169921875,
0.03328965604305267,
-0.014568224549293518,
0.4014478325843811,
0.350564181804657,
0.4282733201980591,
-0.294955849647522,
0.007031697779893875,
-0.25064176321029663,
-0.13261748850345612,
0.3051365911960602,
-0.09841719269752502,
-0.285577654838562,
0.6323850750923157,
0.18596290051937103,
0.2147558331489563,
0.11875692009925842,
-0.03534136712551117,
-0.05625879019498825,
0.05452290177345276,
0.07410156726837158,
0.2878457307815552,
-0.20346185564994812,
0.3483930826187134,
0.09903315454721451,
0.2312028706073761,
-0.24344244599342346,
0.06886468082666397,
-0.10423314571380615,
-0.23054778575897217,
0.24817624688148499,
-0.2970580458641052,
0.17480257153511047,
0.14227166771888733,
0.28099551796913147,
0.3384026288986206,
-0.08468521386384964,
0.38238102197647095,
0.1092028021812439,
-0.0724453330039978,
-0.09102822095155716,
0.34438252449035645,
0.5859231948852539,
-0.2440563589334488,
0.006714668124914169,
-0.1450314074754715,
-0.2656583786010742,
0.1795032024383545,
0.34523648023605347,
0.13838833570480347,
0.14241956174373627,
-0.16867133975028992,
-0.21276326477527618,
-0.2003069370985031,
0.2608524560928345,
-0.00010780920274555683,
0.05228817090392113,
-0.18364453315734863,
0.000403478741645813,
-0.07328338921070099,
0.12171562016010284,
-0.256377637386322,
-0.15930627286434174,
-0.21662701666355133,
-0.015778932720422745,
0.4268166720867157,
0.09931932389736176,
-0.05716996639966965,
0.1859472543001175,
0.09608827531337738,
-0.007192232646048069,
0.08685372024774551,
-0.06310774385929108,
-0.2004002034664154,
0.09364988654851913,
0.04786205291748047,
0.37914857268333435,
0.06228116899728775,
-0.08485803008079529,
-0.1944800764322281,
-0.20853279531002045,
0.11561208218336105,
-0.0007757097482681274,
-0.01920327916741371,
0.12135250866413116,
-0.4059712886810303,
0.29833799600601196,
-0.3597489297389984,
-0.01010228507220745,
0.28249239921569824,
0.08674194663763046,
0.18139415979385376,
0.10240590572357178,
-0.07028523832559586,
-0.030893124639987946,
-0.43938982486724854,
0.367901086807251,
-0.25336748361587524,
-0.10748890787363052,
0.22230415046215057,
-0.2969718277454376,
0.3106408715248108,
0.3970347046852112,
0.056966088712215424,
-0.03791619837284088,
-0.18237647414207458,
-0.1563061773777008,
0.25345438718795776,
0.11623062193393707,
0.0034862011671066284,
-0.12751998007297516,
-0.19799727201461792,
-0.20061342418193817,
-0.11902657896280289,
0.5287008285522461,
0.2362040877342224,
0.18698564171791077,
-0.08430265635251999,
-0.26474446058273315,
0.17808587849140167,
-0.09653151035308838,
0.22917254269123077,
0.2836892008781433,
-0.0636196881532669,
0.10573062300682068,
0.6053395867347717,
0.20263686776161194,
0.35162562131881714,
0.3697882294654846,
0.08073527365922928,
0.08362064510583878,
0.5480480790138245,
0.3167416453361511,
-0.04245010390877724,
-0.05202014744281769,
0.203671395778656,
0.21979984641075134,
0.14126017689704895,
0.3025450110435486,
0.04263032227754593,
0.04949566721916199,
-0.9010520577430725,
-0.4823310077190399,
-0.1854555606842041,
0.41104575991630554,
-0.1251826137304306,
-0.1679200828075409,
-0.02728898450732231,
-0.1404435932636261,
-0.19033506512641907,
-0.13853979110717773,
-0.45609796047210693,
0.14064691960811615,
0.6388472318649292,
0.13089653849601746,
0.34038883447647095,
-0.44766563177108765,
-0.3778817355632782,
-0.07242058217525482,
0.5721502900123596,
-0.1604488044977188,
0.39342623949050903,
0.2812058925628662,
-0.03989477455615997,
0.15204991400241852,
-0.085703544318676,
0.2019861489534378,
0.10623356699943542,
0.09113796055316925,
-0.11218657344579697,
-0.24802039563655853,
0.016438066959381104,
0.15762688219547272,
-0.1078597754240036,
0.16094832122325897,
-0.02031950280070305,
0.2545611262321472,
-0.04115375131368637,
-0.05492966249585152,
0.16663028299808502,
0.26845335960388184,
0.3155748248100281,
-0.009353958070278168,
0.5089624524116516,
0.1605912297964096,
-0.18388435244560242,
0.21969471871852875,
-0.01619298756122589,
-0.10420218855142593,
-0.19224922358989716,
0.07496437430381775,
-0.05557628720998764,
0.14511576294898987,
0.3766848146915436,
0.06765308231115341,
0.2992438077926636,
0.3989931344985962,
0.1706959307193756,
-0.4512961506843567,
-0.056396715342998505,
0.0061568766832351685,
-0.4899219870567322,
-0.03817391395568848,
0.02333391271531582,
-0.745287299156189,
0.19181403517723083,
0.1694442629814148,
0.2428244948387146,
0.042368508875370026,
0.06011703237891197,
-0.26181209087371826,
0.48223602771759033,
0.20437712967395782,
-0.3109924793243408,
0.13508382439613342,
0.539929986000061,
0.1831645667552948,
-0.09833421558141708,
-0.19403290748596191,
0.16513395309448242,
0.16914963722229004,
-0.03972424194216728,
0.12945346534252167,
0.1309615969657898,
-0.22421978414058685,
-0.4243394136428833,
0.07028712332248688,
0.1467573344707489,
0.23196956515312195,
0.22090882062911987,
-0.22812490165233612,
0.19052492082118988,
0.19671180844306946,
-0.02093394100666046,
0.25763872265815735,
-0.02777913771569729,
0.5791330933570862,
-0.20282132923603058,
0.3640148341655731,
-0.18226665258407593,
-0.033365339040756226,
0.04967482388019562,
0.0422707237303257,
-0.3150275945663452,
0.3750915229320526,
-0.2086731493473053,
-0.017354944720864296,
0.4995990991592407,
0.45146647095680237,
-0.005608031526207924,
0.2574060261249542,
-0.042500972747802734,
-0.339623361825943,
0.07757081091403961,
-0.2763092815876007,
-0.3755783438682556,
0.12212327122688293,
0.3234434723854065,
-0.19254736602306366,
0.3154297471046448,
-0.49654078483581543,
-0.06428252160549164,
0.1642414629459381,
0.04418041557073593,
-0.609551191329956,
0.17415852844715118,
0.027120579034090042,
-0.308194637298584,
-0.1511620581150055,
0.1377672702074051,
-0.18748439848423004,
0.021706566214561462,
-0.11178845167160034,
-0.17242509126663208
] |
https://github.com/huggingface/datasets/issues/6267 | Ok makes sense, can you take a look at the POC implementation I did [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e)? Happy to take another pass / submit as a PR but would be helpful if I got a thumbs up that this was directionally correct with respect to implementation / architecture. | Multi label class encoding | ### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests. | 46 | Multi label class encoding
### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
Ok makes sense, can you take a look at the POC implementation I did [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e)? Happy to take another pass / submit as a PR but would be helpful if I got a thumbs up that this was directionally correct with respect to implementation / architecture. | [
0.13402794301509857,
0.1659838855266571,
0.07211393117904663,
0.2635546326637268,
0.344813734292984,
0.13794733583927155,
0.7133165597915649,
-0.18815426528453827,
0.0459604486823082,
-0.022461630403995514,
0.12441209703683853,
0.4255562126636505,
-0.25185367465019226,
0.558788537979126,
-0.19353589415550232,
-0.11879552155733109,
0.0013904459774494171,
-0.07339064031839371,
-0.005307093262672424,
0.02107281982898712,
-0.2726411819458008,
0.09288059920072556,
-0.2554440200328827,
0.16254714131355286,
-0.28689879179000854,
-0.23715901374816895,
-0.3237224817276001,
-0.17942091822624207,
-0.08997784554958344,
-0.34019288420677185,
0.3595796823501587,
0.20719978213310242,
0.23528005182743073,
0.2010670006275177,
-0.0001134565900429152,
-0.19580653309822083,
-0.08624277263879776,
-0.0715755969285965,
-0.22682760655879974,
0.2050929069519043,
-0.23258845508098602,
-0.23182672262191772,
0.1506909877061844,
-0.5585423707962036,
0.010546542704105377,
-0.08977856487035751,
-0.22037361562252045,
-0.3212565779685974,
-0.013486221432685852,
-0.09472142159938812,
0.13155034184455872,
-0.3456973135471344,
0.1944274604320526,
0.14163269102573395,
-0.006789706647396088,
0.12394113838672638,
-0.19292503595352173,
0.02550147846341133,
0.21219003200531006,
0.25620052218437195,
-0.17738746106624603,
0.553413987159729,
0.08334571123123169,
-0.19549138844013214,
0.229771688580513,
0.20939649641513824,
0.16246725618839264,
-0.07623198628425598,
0.018503397703170776,
0.0679733157157898,
0.5594709515571594,
-0.10356093943119049,
-0.6379072666168213,
-0.17917758226394653,
0.19271978735923767,
-0.6277031898498535,
0.11329682171344757,
0.010703310370445251,
0.07134082168340683,
0.1524108350276947,
-0.17682601511478424,
-0.116712786257267,
-0.17023178935050964,
-0.041682180017232895,
-0.34470134973526,
0.22678524255752563,
-0.0673467218875885,
0.11892420053482056,
-0.11162987351417542,
-0.18395912647247314,
-0.10149997472763062,
0.0056190211325883865,
0.30206072330474854,
0.20236384868621826,
-0.16506576538085938,
-0.28469961881637573,
-0.16054433584213257,
-0.09007266908884048,
0.037950314581394196,
0.14716850221157074,
-0.43679630756378174,
0.2738991379737854,
-0.24037694931030273,
-0.07069171965122223,
0.27798187732696533,
0.314125120639801,
0.27224200963974,
0.2878831624984741,
0.021238241344690323,
-0.025216933339834213,
-0.1125740259885788,
-0.09203433990478516,
-0.40581122040748596,
0.36920955777168274,
0.3314955532550812,
0.2634330689907074,
-0.35801923274993896,
-0.012817442417144775,
-0.06163538992404938,
0.13971523940563202,
-0.1570475846529007,
-0.04527062922716141,
0.23035742342472076,
0.08738814294338226,
0.2427973598241806,
0.4096068739891052,
0.0011574476957321167,
0.2391750067472458,
-0.10100406408309937,
-0.39828741550445557,
0.034127313643693924,
0.07641027867794037,
-0.2507226765155792,
0.08660951256752014,
0.11556491255760193,
0.3652885854244232,
-0.2072172462940216,
0.173064187169075,
0.12356481701135635,
-0.212093785405159,
-0.09384622424840927,
-0.04612430930137634,
0.2494891881942749,
-0.16938644647598267,
-0.39558684825897217,
0.38980022072792053,
0.20446354150772095,
-0.23710890114307404,
-0.22557887434959412,
-0.04906194657087326,
-0.21566881239414215,
-0.1583142876625061,
-0.275602251291275,
0.038302019238471985,
0.1374334841966629,
0.015839694067835808,
0.06653144210577011,
0.21550795435905457,
0.3993675112724304,
-0.24523870646953583,
0.07842493057250977,
-0.3443852663040161,
-0.02116759866476059,
-0.15981148183345795,
0.11301194876432419,
0.05392822250723839,
-0.06156329810619354,
-0.053745660930871964,
0.4054395854473114,
0.32845252752304077,
0.19445110857486725,
0.002278955653309822,
-0.08984814584255219,
-0.14663901925086975,
0.10179539769887924,
0.0010074228048324585,
-0.007718510925769806,
-0.5534077286720276,
-0.12308995425701141,
0.13924916088581085,
0.013929948210716248,
0.23031210899353027,
0.43156710267066956,
0.22919102013111115,
0.16857074201107025,
-0.3032926321029663,
0.3523431420326233,
0.2655864655971527,
-0.11342614144086838,
-0.020235851407051086,
0.028128109872341156,
-0.27342018485069275,
0.1177443340420723,
0.032811619341373444,
-0.1484166979789734,
-0.27309730648994446,
-0.23542451858520508,
0.03211711347103119,
-0.004193773493170738,
-0.42455917596817017,
0.2626887261867523,
0.14302338659763336,
-0.25052329897880554,
0.03470894321799278,
-0.1743174046278,
-0.27134954929351807,
-0.45324912667274475,
0.23014365136623383,
0.11495064198970795,
-0.05107063427567482,
-0.09768638014793396,
-0.4818090796470642,
0.2982674837112427,
-0.03512365370988846,
-0.21730569005012512,
-0.08451444655656815,
0.103615403175354,
0.06148168444633484,
-0.2117317020893097,
-0.08252021670341492,
-0.35923993587493896,
0.32795801758766174,
0.3438055217266083,
-0.04114427790045738,
-0.18069526553153992,
-0.1298065036535263,
-0.05931120365858078,
0.11762750148773193,
-0.1773897409439087,
0.49597930908203125,
0.17374004423618317,
-0.17232458293437958,
0.28098350763320923,
0.1877657175064087,
0.19996657967567444,
-0.3772127330303192,
-0.16393233835697174,
0.08713585138320923,
0.5095041990280151,
0.05019877105951309,
-0.024931907653808594,
-0.18116514384746552,
-0.05994386225938797,
-0.08024536818265915,
-0.556510865688324,
0.7267465591430664,
0.05744345486164093,
0.21541067957878113,
0.013594672083854675,
0.15722663700580597,
0.1192374899983406,
-0.008198060095310211,
-0.2908778786659241,
-0.25523585081100464,
-0.2322975993156433,
-0.18988171219825745,
-0.3253849446773529,
0.03790286183357239,
-0.45852532982826233,
0.4317970275878906,
0.4781964123249054,
0.15030845999717712,
0.2262502908706665,
-0.1560327410697937,
-0.08643527328968048,
0.012425526976585388,
0.09466224163770676,
0.2333715260028839,
0.1644039750099182,
0.02463531494140625,
0.15627503395080566,
-0.25170478224754333,
-0.1871064454317093,
0.1552981436252594,
0.0709330141544342,
-0.17935200035572052,
0.1633114069700241,
0.0009675361216068268,
0.08439651131629944,
0.08439233899116516,
0.12471474707126617,
-0.30061399936676025,
0.24859172105789185,
-0.2879396677017212,
-0.26548582315444946,
0.22854483127593994,
-0.6022520065307617,
-0.20706531405448914,
-0.18602332472801208,
-0.5071479082107544,
0.05997701361775398,
-0.26047414541244507,
0.0034649334847927094,
-0.14117906987667084,
0.006546705961227417,
-0.0014486238360404968,
-0.20084944367408752,
0.10079268366098404,
-0.0939241424202919,
-0.201433464884758,
0.27197265625,
-0.13296523690223694,
-0.22543497383594513,
-0.0389481745660305,
0.15713298320770264,
-0.19300290942192078,
0.040491990745067596,
0.3550816774368286,
-0.15192881226539612,
0.05073438584804535,
-0.37056708335876465,
-0.054254405200481415,
-0.18538245558738708,
-0.23929935693740845,
0.17648664116859436,
-0.3263547718524933,
-0.26466721296310425,
0.04443276301026344,
0.29144287109375,
0.33423927426338196,
0.09206099808216095,
0.1258823573589325,
0.2900301218032837,
-0.07142569124698639,
-0.13453668355941772,
-0.2483275979757309,
-0.3271825611591339,
-0.004353173077106476,
0.22914870083332062,
-0.07294298708438873,
0.20071683824062347,
-0.06687241047620773,
-0.3217645585536957,
0.0972629114985466,
0.23974400758743286,
-0.06372535228729248,
-0.24628330767154694,
0.08511541783809662,
0.33899611234664917,
-0.3051331341266632,
-0.20942477881908417,
-0.0821915790438652,
-0.07373973727226257,
0.09641432762145996,
-0.08852848410606384,
0.08208438754081726,
-0.11789008229970932,
0.18601754307746887,
0.14538736641407013,
0.13310764729976654,
-0.009280781261622906,
0.3074979782104492,
0.3532514274120331,
-0.008633438497781754,
-0.02109035849571228,
-0.1760857105255127,
0.19189587235450745,
-0.06863148510456085,
0.07466143369674683,
-0.13515828549861908,
0.08025238662958145,
-0.012073002755641937,
0.11498285830020905,
0.3200591802597046,
-0.0483260303735733,
0.059981562197208405,
0.013970872387290001,
-0.09734836220741272,
-0.054346222430467606,
0.06195801496505737,
-0.01880704239010811,
-0.5165598392486572,
-0.02184285596013069,
0.1555536389350891,
0.09743045270442963,
-0.1277593970298767,
0.030269227921962738,
0.7927091121673584,
0.19458900392055511,
-0.4489023685455322,
0.19048775732517242,
-0.27542752027511597,
0.12292565405368805,
-0.21910293400287628,
0.04941233992576599,
-0.35250672698020935,
0.11194213479757309,
-0.08920378983020782,
-0.1486528515815735,
-0.1239316463470459,
-0.12664425373077393,
-0.5414209365844727,
-0.41151341795921326,
-0.3145613968372345,
0.033044908195734024,
0.37846535444259644,
0.27676820755004883,
0.026882857084274292,
0.12658120691776276,
0.13721932470798492,
-0.041012536734342575,
0.1706334352493286,
-0.3981577157974243,
-0.21393391489982605,
0.3153446912765503,
-0.030777107924222946,
-0.20080262422561646,
-0.15705141425132751,
-0.24240107834339142,
-0.0897088497877121,
-0.12958669662475586,
0.2953537404537201,
-0.15026076138019562,
-0.1406499147415161,
0.4709111154079437,
0.013261284679174423,
-0.2733774483203888,
0.05103179067373276,
0.03713126480579376,
-0.15562888979911804,
-0.05870980769395828,
-0.10613901913166046,
0.433987557888031,
0.19747987389564514,
0.044557586312294006,
-0.044238343834877014,
-0.10664817690849304,
0.07833532989025116,
0.1340012401342392,
-0.12209911644458771,
0.05396774783730507,
0.09646935760974884,
-0.026123352348804474,
0.12613041698932648,
0.09603343158960342,
0.19402183592319489,
0.6153683662414551,
-0.10657048970460892,
-0.47773319482803345,
0.26753753423690796,
-0.3399054706096649,
0.4084867835044861,
0.16616389155387878,
0.0523870512843132,
0.07150635868310928,
-0.23045775294303894,
-0.18902181088924408,
-0.4494117200374603,
-0.34003323316574097,
0.21122005581855774,
0.16919314861297607,
-0.46709540486335754,
-0.23294401168823242,
0.5591332316398621,
0.03525747358798981,
-0.2130224108695984,
0.008463242091238499,
0.034224823117256165,
-0.45332077145576477,
0.26530951261520386,
0.5597101449966431,
0.6481292843818665,
-0.1308351308107376,
0.24387937784194946,
0.04638234153389931,
-0.145403191447258,
0.5850757360458374,
-0.12176161259412766,
0.3354727029800415,
-0.17644542455673218,
-0.09945023059844971,
-0.17744112014770508,
0.15441536903381348,
0.05863076075911522,
0.1370602697134018,
-0.32904982566833496,
0.314365029335022,
-0.2322838306427002,
-0.025765350088477135,
0.007453896105289459,
0.02771112322807312,
0.2482946664094925,
-0.4901580512523651,
0.17270614206790924,
0.1226109191775322,
0.21068283915519714,
-0.29487144947052,
0.006966695189476013,
0.01007060706615448,
-0.05239114165306091,
0.1579681634902954,
-0.2663854956626892,
-0.013523794710636139,
0.01997818425297737,
0.28752899169921875,
0.03328965604305267,
-0.014568224549293518,
0.4014478325843811,
0.350564181804657,
0.4282733201980591,
-0.294955849647522,
0.007031697779893875,
-0.25064176321029663,
-0.13261748850345612,
0.3051365911960602,
-0.09841719269752502,
-0.285577654838562,
0.6323850750923157,
0.18596290051937103,
0.2147558331489563,
0.11875692009925842,
-0.03534136712551117,
-0.05625879019498825,
0.05452290177345276,
0.07410156726837158,
0.2878457307815552,
-0.20346185564994812,
0.3483930826187134,
0.09903315454721451,
0.2312028706073761,
-0.24344244599342346,
0.06886468082666397,
-0.10423314571380615,
-0.23054778575897217,
0.24817624688148499,
-0.2970580458641052,
0.17480257153511047,
0.14227166771888733,
0.28099551796913147,
0.3384026288986206,
-0.08468521386384964,
0.38238102197647095,
0.1092028021812439,
-0.0724453330039978,
-0.09102822095155716,
0.34438252449035645,
0.5859231948852539,
-0.2440563589334488,
0.006714668124914169,
-0.1450314074754715,
-0.2656583786010742,
0.1795032024383545,
0.34523648023605347,
0.13838833570480347,
0.14241956174373627,
-0.16867133975028992,
-0.21276326477527618,
-0.2003069370985031,
0.2608524560928345,
-0.00010780920274555683,
0.05228817090392113,
-0.18364453315734863,
0.000403478741645813,
-0.07328338921070099,
0.12171562016010284,
-0.256377637386322,
-0.15930627286434174,
-0.21662701666355133,
-0.015778932720422745,
0.4268166720867157,
0.09931932389736176,
-0.05716996639966965,
0.1859472543001175,
0.09608827531337738,
-0.007192232646048069,
0.08685372024774551,
-0.06310774385929108,
-0.2004002034664154,
0.09364988654851913,
0.04786205291748047,
0.37914857268333435,
0.06228116899728775,
-0.08485803008079529,
-0.1944800764322281,
-0.20853279531002045,
0.11561208218336105,
-0.0007757097482681274,
-0.01920327916741371,
0.12135250866413116,
-0.4059712886810303,
0.29833799600601196,
-0.3597489297389984,
-0.01010228507220745,
0.28249239921569824,
0.08674194663763046,
0.18139415979385376,
0.10240590572357178,
-0.07028523832559586,
-0.030893124639987946,
-0.43938982486724854,
0.367901086807251,
-0.25336748361587524,
-0.10748890787363052,
0.22230415046215057,
-0.2969718277454376,
0.3106408715248108,
0.3970347046852112,
0.056966088712215424,
-0.03791619837284088,
-0.18237647414207458,
-0.1563061773777008,
0.25345438718795776,
0.11623062193393707,
0.0034862011671066284,
-0.12751998007297516,
-0.19799727201461792,
-0.20061342418193817,
-0.11902657896280289,
0.5287008285522461,
0.2362040877342224,
0.18698564171791077,
-0.08430265635251999,
-0.26474446058273315,
0.17808587849140167,
-0.09653151035308838,
0.22917254269123077,
0.2836892008781433,
-0.0636196881532669,
0.10573062300682068,
0.6053395867347717,
0.20263686776161194,
0.35162562131881714,
0.3697882294654846,
0.08073527365922928,
0.08362064510583878,
0.5480480790138245,
0.3167416453361511,
-0.04245010390877724,
-0.05202014744281769,
0.203671395778656,
0.21979984641075134,
0.14126017689704895,
0.3025450110435486,
0.04263032227754593,
0.04949566721916199,
-0.9010520577430725,
-0.4823310077190399,
-0.1854555606842041,
0.41104575991630554,
-0.1251826137304306,
-0.1679200828075409,
-0.02728898450732231,
-0.1404435932636261,
-0.19033506512641907,
-0.13853979110717773,
-0.45609796047210693,
0.14064691960811615,
0.6388472318649292,
0.13089653849601746,
0.34038883447647095,
-0.44766563177108765,
-0.3778817355632782,
-0.07242058217525482,
0.5721502900123596,
-0.1604488044977188,
0.39342623949050903,
0.2812058925628662,
-0.03989477455615997,
0.15204991400241852,
-0.085703544318676,
0.2019861489534378,
0.10623356699943542,
0.09113796055316925,
-0.11218657344579697,
-0.24802039563655853,
0.016438066959381104,
0.15762688219547272,
-0.1078597754240036,
0.16094832122325897,
-0.02031950280070305,
0.2545611262321472,
-0.04115375131368637,
-0.05492966249585152,
0.16663028299808502,
0.26845335960388184,
0.3155748248100281,
-0.009353958070278168,
0.5089624524116516,
0.1605912297964096,
-0.18388435244560242,
0.21969471871852875,
-0.01619298756122589,
-0.10420218855142593,
-0.19224922358989716,
0.07496437430381775,
-0.05557628720998764,
0.14511576294898987,
0.3766848146915436,
0.06765308231115341,
0.2992438077926636,
0.3989931344985962,
0.1706959307193756,
-0.4512961506843567,
-0.056396715342998505,
0.0061568766832351685,
-0.4899219870567322,
-0.03817391395568848,
0.02333391271531582,
-0.745287299156189,
0.19181403517723083,
0.1694442629814148,
0.2428244948387146,
0.042368508875370026,
0.06011703237891197,
-0.26181209087371826,
0.48223602771759033,
0.20437712967395782,
-0.3109924793243408,
0.13508382439613342,
0.539929986000061,
0.1831645667552948,
-0.09833421558141708,
-0.19403290748596191,
0.16513395309448242,
0.16914963722229004,
-0.03972424194216728,
0.12945346534252167,
0.1309615969657898,
-0.22421978414058685,
-0.4243394136428833,
0.07028712332248688,
0.1467573344707489,
0.23196956515312195,
0.22090882062911987,
-0.22812490165233612,
0.19052492082118988,
0.19671180844306946,
-0.02093394100666046,
0.25763872265815735,
-0.02777913771569729,
0.5791330933570862,
-0.20282132923603058,
0.3640148341655731,
-0.18226665258407593,
-0.033365339040756226,
0.04967482388019562,
0.0422707237303257,
-0.3150275945663452,
0.3750915229320526,
-0.2086731493473053,
-0.017354944720864296,
0.4995990991592407,
0.45146647095680237,
-0.005608031526207924,
0.2574060261249542,
-0.042500972747802734,
-0.339623361825943,
0.07757081091403961,
-0.2763092815876007,
-0.3755783438682556,
0.12212327122688293,
0.3234434723854065,
-0.19254736602306366,
0.3154297471046448,
-0.49654078483581543,
-0.06428252160549164,
0.1642414629459381,
0.04418041557073593,
-0.609551191329956,
0.17415852844715118,
0.027120579034090042,
-0.308194637298584,
-0.1511620581150055,
0.1377672702074051,
-0.18748439848423004,
0.021706566214561462,
-0.11178845167160034,
-0.17242509126663208
] |
https://github.com/huggingface/datasets/issues/6267 | There is no need to introduce a new type (`MultiLabel`) for this feature. Also, I think we can keep the logic inside a single method instead of separating the two cases.
Maybe https://github.com/huggingface/datasets/pull/4277 can help with the implementation. We extended `align_labels_with_mapping` to support `Sequence(ClassLabel(...))` in that PR (initially, it only worked with `ClassLabel(...)`) | Multi label class encoding | ### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests. | 53 | Multi label class encoding
### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
There is no need to introduce a new type (`MultiLabel`) for this feature. Also, I think we can keep the logic inside a single method instead of separating the two cases.
Maybe https://github.com/huggingface/datasets/pull/4277 can help with the implementation. We extended `align_labels_with_mapping` to support `Sequence(ClassLabel(...))` in that PR (initially, it only worked with `ClassLabel(...)`) | [
0.13402794301509857,
0.1659838855266571,
0.07211393117904663,
0.2635546326637268,
0.344813734292984,
0.13794733583927155,
0.7133165597915649,
-0.18815426528453827,
0.0459604486823082,
-0.022461630403995514,
0.12441209703683853,
0.4255562126636505,
-0.25185367465019226,
0.558788537979126,
-0.19353589415550232,
-0.11879552155733109,
0.0013904459774494171,
-0.07339064031839371,
-0.005307093262672424,
0.02107281982898712,
-0.2726411819458008,
0.09288059920072556,
-0.2554440200328827,
0.16254714131355286,
-0.28689879179000854,
-0.23715901374816895,
-0.3237224817276001,
-0.17942091822624207,
-0.08997784554958344,
-0.34019288420677185,
0.3595796823501587,
0.20719978213310242,
0.23528005182743073,
0.2010670006275177,
-0.0001134565900429152,
-0.19580653309822083,
-0.08624277263879776,
-0.0715755969285965,
-0.22682760655879974,
0.2050929069519043,
-0.23258845508098602,
-0.23182672262191772,
0.1506909877061844,
-0.5585423707962036,
0.010546542704105377,
-0.08977856487035751,
-0.22037361562252045,
-0.3212565779685974,
-0.013486221432685852,
-0.09472142159938812,
0.13155034184455872,
-0.3456973135471344,
0.1944274604320526,
0.14163269102573395,
-0.006789706647396088,
0.12394113838672638,
-0.19292503595352173,
0.02550147846341133,
0.21219003200531006,
0.25620052218437195,
-0.17738746106624603,
0.553413987159729,
0.08334571123123169,
-0.19549138844013214,
0.229771688580513,
0.20939649641513824,
0.16246725618839264,
-0.07623198628425598,
0.018503397703170776,
0.0679733157157898,
0.5594709515571594,
-0.10356093943119049,
-0.6379072666168213,
-0.17917758226394653,
0.19271978735923767,
-0.6277031898498535,
0.11329682171344757,
0.010703310370445251,
0.07134082168340683,
0.1524108350276947,
-0.17682601511478424,
-0.116712786257267,
-0.17023178935050964,
-0.041682180017232895,
-0.34470134973526,
0.22678524255752563,
-0.0673467218875885,
0.11892420053482056,
-0.11162987351417542,
-0.18395912647247314,
-0.10149997472763062,
0.0056190211325883865,
0.30206072330474854,
0.20236384868621826,
-0.16506576538085938,
-0.28469961881637573,
-0.16054433584213257,
-0.09007266908884048,
0.037950314581394196,
0.14716850221157074,
-0.43679630756378174,
0.2738991379737854,
-0.24037694931030273,
-0.07069171965122223,
0.27798187732696533,
0.314125120639801,
0.27224200963974,
0.2878831624984741,
0.021238241344690323,
-0.025216933339834213,
-0.1125740259885788,
-0.09203433990478516,
-0.40581122040748596,
0.36920955777168274,
0.3314955532550812,
0.2634330689907074,
-0.35801923274993896,
-0.012817442417144775,
-0.06163538992404938,
0.13971523940563202,
-0.1570475846529007,
-0.04527062922716141,
0.23035742342472076,
0.08738814294338226,
0.2427973598241806,
0.4096068739891052,
0.0011574476957321167,
0.2391750067472458,
-0.10100406408309937,
-0.39828741550445557,
0.034127313643693924,
0.07641027867794037,
-0.2507226765155792,
0.08660951256752014,
0.11556491255760193,
0.3652885854244232,
-0.2072172462940216,
0.173064187169075,
0.12356481701135635,
-0.212093785405159,
-0.09384622424840927,
-0.04612430930137634,
0.2494891881942749,
-0.16938644647598267,
-0.39558684825897217,
0.38980022072792053,
0.20446354150772095,
-0.23710890114307404,
-0.22557887434959412,
-0.04906194657087326,
-0.21566881239414215,
-0.1583142876625061,
-0.275602251291275,
0.038302019238471985,
0.1374334841966629,
0.015839694067835808,
0.06653144210577011,
0.21550795435905457,
0.3993675112724304,
-0.24523870646953583,
0.07842493057250977,
-0.3443852663040161,
-0.02116759866476059,
-0.15981148183345795,
0.11301194876432419,
0.05392822250723839,
-0.06156329810619354,
-0.053745660930871964,
0.4054395854473114,
0.32845252752304077,
0.19445110857486725,
0.002278955653309822,
-0.08984814584255219,
-0.14663901925086975,
0.10179539769887924,
0.0010074228048324585,
-0.007718510925769806,
-0.5534077286720276,
-0.12308995425701141,
0.13924916088581085,
0.013929948210716248,
0.23031210899353027,
0.43156710267066956,
0.22919102013111115,
0.16857074201107025,
-0.3032926321029663,
0.3523431420326233,
0.2655864655971527,
-0.11342614144086838,
-0.020235851407051086,
0.028128109872341156,
-0.27342018485069275,
0.1177443340420723,
0.032811619341373444,
-0.1484166979789734,
-0.27309730648994446,
-0.23542451858520508,
0.03211711347103119,
-0.004193773493170738,
-0.42455917596817017,
0.2626887261867523,
0.14302338659763336,
-0.25052329897880554,
0.03470894321799278,
-0.1743174046278,
-0.27134954929351807,
-0.45324912667274475,
0.23014365136623383,
0.11495064198970795,
-0.05107063427567482,
-0.09768638014793396,
-0.4818090796470642,
0.2982674837112427,
-0.03512365370988846,
-0.21730569005012512,
-0.08451444655656815,
0.103615403175354,
0.06148168444633484,
-0.2117317020893097,
-0.08252021670341492,
-0.35923993587493896,
0.32795801758766174,
0.3438055217266083,
-0.04114427790045738,
-0.18069526553153992,
-0.1298065036535263,
-0.05931120365858078,
0.11762750148773193,
-0.1773897409439087,
0.49597930908203125,
0.17374004423618317,
-0.17232458293437958,
0.28098350763320923,
0.1877657175064087,
0.19996657967567444,
-0.3772127330303192,
-0.16393233835697174,
0.08713585138320923,
0.5095041990280151,
0.05019877105951309,
-0.024931907653808594,
-0.18116514384746552,
-0.05994386225938797,
-0.08024536818265915,
-0.556510865688324,
0.7267465591430664,
0.05744345486164093,
0.21541067957878113,
0.013594672083854675,
0.15722663700580597,
0.1192374899983406,
-0.008198060095310211,
-0.2908778786659241,
-0.25523585081100464,
-0.2322975993156433,
-0.18988171219825745,
-0.3253849446773529,
0.03790286183357239,
-0.45852532982826233,
0.4317970275878906,
0.4781964123249054,
0.15030845999717712,
0.2262502908706665,
-0.1560327410697937,
-0.08643527328968048,
0.012425526976585388,
0.09466224163770676,
0.2333715260028839,
0.1644039750099182,
0.02463531494140625,
0.15627503395080566,
-0.25170478224754333,
-0.1871064454317093,
0.1552981436252594,
0.0709330141544342,
-0.17935200035572052,
0.1633114069700241,
0.0009675361216068268,
0.08439651131629944,
0.08439233899116516,
0.12471474707126617,
-0.30061399936676025,
0.24859172105789185,
-0.2879396677017212,
-0.26548582315444946,
0.22854483127593994,
-0.6022520065307617,
-0.20706531405448914,
-0.18602332472801208,
-0.5071479082107544,
0.05997701361775398,
-0.26047414541244507,
0.0034649334847927094,
-0.14117906987667084,
0.006546705961227417,
-0.0014486238360404968,
-0.20084944367408752,
0.10079268366098404,
-0.0939241424202919,
-0.201433464884758,
0.27197265625,
-0.13296523690223694,
-0.22543497383594513,
-0.0389481745660305,
0.15713298320770264,
-0.19300290942192078,
0.040491990745067596,
0.3550816774368286,
-0.15192881226539612,
0.05073438584804535,
-0.37056708335876465,
-0.054254405200481415,
-0.18538245558738708,
-0.23929935693740845,
0.17648664116859436,
-0.3263547718524933,
-0.26466721296310425,
0.04443276301026344,
0.29144287109375,
0.33423927426338196,
0.09206099808216095,
0.1258823573589325,
0.2900301218032837,
-0.07142569124698639,
-0.13453668355941772,
-0.2483275979757309,
-0.3271825611591339,
-0.004353173077106476,
0.22914870083332062,
-0.07294298708438873,
0.20071683824062347,
-0.06687241047620773,
-0.3217645585536957,
0.0972629114985466,
0.23974400758743286,
-0.06372535228729248,
-0.24628330767154694,
0.08511541783809662,
0.33899611234664917,
-0.3051331341266632,
-0.20942477881908417,
-0.0821915790438652,
-0.07373973727226257,
0.09641432762145996,
-0.08852848410606384,
0.08208438754081726,
-0.11789008229970932,
0.18601754307746887,
0.14538736641407013,
0.13310764729976654,
-0.009280781261622906,
0.3074979782104492,
0.3532514274120331,
-0.008633438497781754,
-0.02109035849571228,
-0.1760857105255127,
0.19189587235450745,
-0.06863148510456085,
0.07466143369674683,
-0.13515828549861908,
0.08025238662958145,
-0.012073002755641937,
0.11498285830020905,
0.3200591802597046,
-0.0483260303735733,
0.059981562197208405,
0.013970872387290001,
-0.09734836220741272,
-0.054346222430467606,
0.06195801496505737,
-0.01880704239010811,
-0.5165598392486572,
-0.02184285596013069,
0.1555536389350891,
0.09743045270442963,
-0.1277593970298767,
0.030269227921962738,
0.7927091121673584,
0.19458900392055511,
-0.4489023685455322,
0.19048775732517242,
-0.27542752027511597,
0.12292565405368805,
-0.21910293400287628,
0.04941233992576599,
-0.35250672698020935,
0.11194213479757309,
-0.08920378983020782,
-0.1486528515815735,
-0.1239316463470459,
-0.12664425373077393,
-0.5414209365844727,
-0.41151341795921326,
-0.3145613968372345,
0.033044908195734024,
0.37846535444259644,
0.27676820755004883,
0.026882857084274292,
0.12658120691776276,
0.13721932470798492,
-0.041012536734342575,
0.1706334352493286,
-0.3981577157974243,
-0.21393391489982605,
0.3153446912765503,
-0.030777107924222946,
-0.20080262422561646,
-0.15705141425132751,
-0.24240107834339142,
-0.0897088497877121,
-0.12958669662475586,
0.2953537404537201,
-0.15026076138019562,
-0.1406499147415161,
0.4709111154079437,
0.013261284679174423,
-0.2733774483203888,
0.05103179067373276,
0.03713126480579376,
-0.15562888979911804,
-0.05870980769395828,
-0.10613901913166046,
0.433987557888031,
0.19747987389564514,
0.044557586312294006,
-0.044238343834877014,
-0.10664817690849304,
0.07833532989025116,
0.1340012401342392,
-0.12209911644458771,
0.05396774783730507,
0.09646935760974884,
-0.026123352348804474,
0.12613041698932648,
0.09603343158960342,
0.19402183592319489,
0.6153683662414551,
-0.10657048970460892,
-0.47773319482803345,
0.26753753423690796,
-0.3399054706096649,
0.4084867835044861,
0.16616389155387878,
0.0523870512843132,
0.07150635868310928,
-0.23045775294303894,
-0.18902181088924408,
-0.4494117200374603,
-0.34003323316574097,
0.21122005581855774,
0.16919314861297607,
-0.46709540486335754,
-0.23294401168823242,
0.5591332316398621,
0.03525747358798981,
-0.2130224108695984,
0.008463242091238499,
0.034224823117256165,
-0.45332077145576477,
0.26530951261520386,
0.5597101449966431,
0.6481292843818665,
-0.1308351308107376,
0.24387937784194946,
0.04638234153389931,
-0.145403191447258,
0.5850757360458374,
-0.12176161259412766,
0.3354727029800415,
-0.17644542455673218,
-0.09945023059844971,
-0.17744112014770508,
0.15441536903381348,
0.05863076075911522,
0.1370602697134018,
-0.32904982566833496,
0.314365029335022,
-0.2322838306427002,
-0.025765350088477135,
0.007453896105289459,
0.02771112322807312,
0.2482946664094925,
-0.4901580512523651,
0.17270614206790924,
0.1226109191775322,
0.21068283915519714,
-0.29487144947052,
0.006966695189476013,
0.01007060706615448,
-0.05239114165306091,
0.1579681634902954,
-0.2663854956626892,
-0.013523794710636139,
0.01997818425297737,
0.28752899169921875,
0.03328965604305267,
-0.014568224549293518,
0.4014478325843811,
0.350564181804657,
0.4282733201980591,
-0.294955849647522,
0.007031697779893875,
-0.25064176321029663,
-0.13261748850345612,
0.3051365911960602,
-0.09841719269752502,
-0.285577654838562,
0.6323850750923157,
0.18596290051937103,
0.2147558331489563,
0.11875692009925842,
-0.03534136712551117,
-0.05625879019498825,
0.05452290177345276,
0.07410156726837158,
0.2878457307815552,
-0.20346185564994812,
0.3483930826187134,
0.09903315454721451,
0.2312028706073761,
-0.24344244599342346,
0.06886468082666397,
-0.10423314571380615,
-0.23054778575897217,
0.24817624688148499,
-0.2970580458641052,
0.17480257153511047,
0.14227166771888733,
0.28099551796913147,
0.3384026288986206,
-0.08468521386384964,
0.38238102197647095,
0.1092028021812439,
-0.0724453330039978,
-0.09102822095155716,
0.34438252449035645,
0.5859231948852539,
-0.2440563589334488,
0.006714668124914169,
-0.1450314074754715,
-0.2656583786010742,
0.1795032024383545,
0.34523648023605347,
0.13838833570480347,
0.14241956174373627,
-0.16867133975028992,
-0.21276326477527618,
-0.2003069370985031,
0.2608524560928345,
-0.00010780920274555683,
0.05228817090392113,
-0.18364453315734863,
0.000403478741645813,
-0.07328338921070099,
0.12171562016010284,
-0.256377637386322,
-0.15930627286434174,
-0.21662701666355133,
-0.015778932720422745,
0.4268166720867157,
0.09931932389736176,
-0.05716996639966965,
0.1859472543001175,
0.09608827531337738,
-0.007192232646048069,
0.08685372024774551,
-0.06310774385929108,
-0.2004002034664154,
0.09364988654851913,
0.04786205291748047,
0.37914857268333435,
0.06228116899728775,
-0.08485803008079529,
-0.1944800764322281,
-0.20853279531002045,
0.11561208218336105,
-0.0007757097482681274,
-0.01920327916741371,
0.12135250866413116,
-0.4059712886810303,
0.29833799600601196,
-0.3597489297389984,
-0.01010228507220745,
0.28249239921569824,
0.08674194663763046,
0.18139415979385376,
0.10240590572357178,
-0.07028523832559586,
-0.030893124639987946,
-0.43938982486724854,
0.367901086807251,
-0.25336748361587524,
-0.10748890787363052,
0.22230415046215057,
-0.2969718277454376,
0.3106408715248108,
0.3970347046852112,
0.056966088712215424,
-0.03791619837284088,
-0.18237647414207458,
-0.1563061773777008,
0.25345438718795776,
0.11623062193393707,
0.0034862011671066284,
-0.12751998007297516,
-0.19799727201461792,
-0.20061342418193817,
-0.11902657896280289,
0.5287008285522461,
0.2362040877342224,
0.18698564171791077,
-0.08430265635251999,
-0.26474446058273315,
0.17808587849140167,
-0.09653151035308838,
0.22917254269123077,
0.2836892008781433,
-0.0636196881532669,
0.10573062300682068,
0.6053395867347717,
0.20263686776161194,
0.35162562131881714,
0.3697882294654846,
0.08073527365922928,
0.08362064510583878,
0.5480480790138245,
0.3167416453361511,
-0.04245010390877724,
-0.05202014744281769,
0.203671395778656,
0.21979984641075134,
0.14126017689704895,
0.3025450110435486,
0.04263032227754593,
0.04949566721916199,
-0.9010520577430725,
-0.4823310077190399,
-0.1854555606842041,
0.41104575991630554,
-0.1251826137304306,
-0.1679200828075409,
-0.02728898450732231,
-0.1404435932636261,
-0.19033506512641907,
-0.13853979110717773,
-0.45609796047210693,
0.14064691960811615,
0.6388472318649292,
0.13089653849601746,
0.34038883447647095,
-0.44766563177108765,
-0.3778817355632782,
-0.07242058217525482,
0.5721502900123596,
-0.1604488044977188,
0.39342623949050903,
0.2812058925628662,
-0.03989477455615997,
0.15204991400241852,
-0.085703544318676,
0.2019861489534378,
0.10623356699943542,
0.09113796055316925,
-0.11218657344579697,
-0.24802039563655853,
0.016438066959381104,
0.15762688219547272,
-0.1078597754240036,
0.16094832122325897,
-0.02031950280070305,
0.2545611262321472,
-0.04115375131368637,
-0.05492966249585152,
0.16663028299808502,
0.26845335960388184,
0.3155748248100281,
-0.009353958070278168,
0.5089624524116516,
0.1605912297964096,
-0.18388435244560242,
0.21969471871852875,
-0.01619298756122589,
-0.10420218855142593,
-0.19224922358989716,
0.07496437430381775,
-0.05557628720998764,
0.14511576294898987,
0.3766848146915436,
0.06765308231115341,
0.2992438077926636,
0.3989931344985962,
0.1706959307193756,
-0.4512961506843567,
-0.056396715342998505,
0.0061568766832351685,
-0.4899219870567322,
-0.03817391395568848,
0.02333391271531582,
-0.745287299156189,
0.19181403517723083,
0.1694442629814148,
0.2428244948387146,
0.042368508875370026,
0.06011703237891197,
-0.26181209087371826,
0.48223602771759033,
0.20437712967395782,
-0.3109924793243408,
0.13508382439613342,
0.539929986000061,
0.1831645667552948,
-0.09833421558141708,
-0.19403290748596191,
0.16513395309448242,
0.16914963722229004,
-0.03972424194216728,
0.12945346534252167,
0.1309615969657898,
-0.22421978414058685,
-0.4243394136428833,
0.07028712332248688,
0.1467573344707489,
0.23196956515312195,
0.22090882062911987,
-0.22812490165233612,
0.19052492082118988,
0.19671180844306946,
-0.02093394100666046,
0.25763872265815735,
-0.02777913771569729,
0.5791330933570862,
-0.20282132923603058,
0.3640148341655731,
-0.18226665258407593,
-0.033365339040756226,
0.04967482388019562,
0.0422707237303257,
-0.3150275945663452,
0.3750915229320526,
-0.2086731493473053,
-0.017354944720864296,
0.4995990991592407,
0.45146647095680237,
-0.005608031526207924,
0.2574060261249542,
-0.042500972747802734,
-0.339623361825943,
0.07757081091403961,
-0.2763092815876007,
-0.3755783438682556,
0.12212327122688293,
0.3234434723854065,
-0.19254736602306366,
0.3154297471046448,
-0.49654078483581543,
-0.06428252160549164,
0.1642414629459381,
0.04418041557073593,
-0.609551191329956,
0.17415852844715118,
0.027120579034090042,
-0.308194637298584,
-0.1511620581150055,
0.1377672702074051,
-0.18748439848423004,
0.021706566214561462,
-0.11178845167160034,
-0.17242509126663208
] |
https://github.com/huggingface/datasets/issues/6261 | `JourneyDB/JourneyDB` is a gated dataset, so this error means you are not authenticated to access it, either by using an invalid token or by not agreeing to the terms in the dialog on the dataset page.
> I believe is due to the fact that doesn't work with .tgz files.
Indeed, the dataset's data files structure is not supported natively by `datasets`. To load it, one option is to clone the repo (or download it with `huggingface_hub.snapshot_download`) and use `Dataset.from_generator` to process the files. | Can't load a dataset | ### Describe the bug
Can't seem to load the JourneyDB dataset.
It throws the following error:
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[15], line 2
1 # If the dataset is gated/private, make sure you have run huggingface-cli login
----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1661 ignore_verifications = ignore_verifications or save_infos
1663 # Create a dataset builder
-> 1664 builder_instance = load_dataset_builder(
1665 path=path,
1666 name=name,
1667 data_dir=data_dir,
1668 data_files=data_files,
1669 cache_dir=cache_dir,
1670 features=features,
1671 download_config=download_config,
1672 download_mode=download_mode,
1673 revision=revision,
1674 use_auth_token=use_auth_token,
1675 **config_kwargs,
1676 )
1678 # Return iterable dataset in case of streaming
1679 if streaming:
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs)
1488 download_config = download_config.copy() if download_config else DownloadConfig()
1489 download_config.use_auth_token = use_auth_token
-> 1490 dataset_module = dataset_module_factory(
1491 path,
1492 revision=revision,
1493 download_config=download_config,
1494 download_mode=download_mode,
1495 data_dir=data_dir,
1496 data_files=data_files,
1497 )
1499 # Get dataset builder class from the processing script
1500 builder_cls = import_main_class(dataset_module.module_path)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1237 if isinstance(e1, FileNotFoundError):
-> 1238 raise FileNotFoundError(
1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
1241 ) from None
1242 raise e1 from None
1243 else:
FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip']
```
### Steps to reproduce the bug
1)
```
from huggingface_hub import notebook_login
notebook_login()
```
2)
```
!pip install -q datasets
from datasets import load_dataset
```
3)
`dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)`
### Expected behavior
Load the dataset
### Environment info
Notebook | 84 | Can't load a dataset
### Describe the bug
Can't seem to load the JourneyDB dataset.
It throws the following error:
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[15], line 2
1 # If the dataset is gated/private, make sure you have run huggingface-cli login
----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1661 ignore_verifications = ignore_verifications or save_infos
1663 # Create a dataset builder
-> 1664 builder_instance = load_dataset_builder(
1665 path=path,
1666 name=name,
1667 data_dir=data_dir,
1668 data_files=data_files,
1669 cache_dir=cache_dir,
1670 features=features,
1671 download_config=download_config,
1672 download_mode=download_mode,
1673 revision=revision,
1674 use_auth_token=use_auth_token,
1675 **config_kwargs,
1676 )
1678 # Return iterable dataset in case of streaming
1679 if streaming:
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs)
1488 download_config = download_config.copy() if download_config else DownloadConfig()
1489 download_config.use_auth_token = use_auth_token
-> 1490 dataset_module = dataset_module_factory(
1491 path,
1492 revision=revision,
1493 download_config=download_config,
1494 download_mode=download_mode,
1495 data_dir=data_dir,
1496 data_files=data_files,
1497 )
1499 # Get dataset builder class from the processing script
1500 builder_cls = import_main_class(dataset_module.module_path)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1237 if isinstance(e1, FileNotFoundError):
-> 1238 raise FileNotFoundError(
1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
1241 ) from None
1242 raise e1 from None
1243 else:
FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip']
```
### Steps to reproduce the bug
1)
```
from huggingface_hub import notebook_login
notebook_login()
```
2)
```
!pip install -q datasets
from datasets import load_dataset
```
3)
`dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)`
### Expected behavior
Load the dataset
### Environment info
Notebook
`JourneyDB/JourneyDB` is a gated dataset, so this error means you are not authenticated to access it, either by using an invalid token or by not agreeing to the terms in the dialog on the dataset page.
> I believe is due to the fact that doesn't work with .tgz files.
Indeed, the dataset's data files structure is not supported natively by `datasets`. To load it, one option is to clone the repo (or download it with `huggingface_hub.snapshot_download`) and use `Dataset.from_generator` to process the files. | [
-0.40633130073547363,
-0.12175323814153671,
-0.026935188099741936,
0.4848688840866089,
0.4381573498249054,
0.12115108966827393,
0.25170496106147766,
0.23180124163627625,
-0.07087205350399017,
-0.11361230909824371,
-0.18910205364227295,
0.0730496346950531,
-0.13830894231796265,
0.3248365521430969,
0.2859526574611664,
-0.14289748668670654,
0.009425844997167587,
-0.1766473948955536,
-0.22088328003883362,
0.2775353789329529,
-0.3080146908760071,
0.18124976754188538,
-0.11365130543708801,
0.07569814473390579,
-0.3765476942062378,
-0.03636214882135391,
0.046306461095809937,
0.4566405117511749,
-0.12838499248027802,
-0.38753244280815125,
0.4943099021911621,
-0.05915533006191254,
0.3415291905403137,
0.6146700382232666,
-0.00010437788296258077,
0.25680533051490784,
0.46050938963890076,
0.03550562262535095,
-0.46370729804039,
-0.5422956943511963,
-0.0740673840045929,
0.028826184570789337,
0.11530889570713043,
-0.0385545939207077,
-0.25847309827804565,
-0.09758239984512329,
-0.1444360762834549,
-0.18361309170722961,
0.368051677942276,
0.33636295795440674,
0.27681994438171387,
0.24044197797775269,
0.17166639864444733,
-0.21493294835090637,
0.0356665775179863,
0.015322396531701088,
-0.14877422153949738,
0.2552705705165863,
0.08302852511405945,
-0.23425598442554474,
0.015021219849586487,
0.09504537284374237,
-0.180450439453125,
-0.0204344280064106,
0.4510686993598938,
-0.027124447748064995,
0.09907425940036774,
-0.2473185658454895,
0.15093334019184113,
0.2934921979904175,
0.6759009957313538,
-0.1506168097257614,
-0.3787132501602173,
0.041185587644577026,
0.021249905228614807,
-0.5414942502975464,
0.3927636742591858,
0.1263609528541565,
-0.13409700989723206,
0.2509329617023468,
-0.28136226534843445,
0.02417774498462677,
-0.03981950879096985,
0.10323159396648407,
-0.21613076329231262,
-0.010091517120599747,
-0.08605179190635681,
0.08818741142749786,
0.3127902150154114,
-0.14866891503334045,
0.4131805896759033,
0.2102271318435669,
-0.15099208056926727,
0.13935407996177673,
-0.37084445357322693,
0.26526105403900146,
0.33111071586608887,
0.3483981788158417,
0.3255101144313812,
0.1986699402332306,
0.07285024225711823,
-0.13119950890541077,
-0.11143770068883896,
0.1342940330505371,
0.2300272285938263,
0.015546686947345734,
0.08939877152442932,
-0.02851708047091961,
0.2200625240802765,
0.2761302888393402,
0.1082308441400528,
-0.061803411692380905,
-0.09262269735336304,
-0.2554323673248291,
0.10827293992042542,
-0.09474311769008636,
0.3412347435951233,
-0.19677412509918213,
-0.44980984926223755,
-0.025910314172506332,
0.08046123385429382,
0.027382466942071915,
0.21933989226818085,
0.4987296164035797,
0.09714343398809433,
-0.25877881050109863,
0.16266444325447083,
0.25815367698669434,
0.0060135722160339355,
-0.12443885207176208,
-0.3394370973110199,
-0.1656356006860733,
-0.09688705205917358,
-0.03951215744018555,
0.12474539875984192,
-0.2821020781993866,
0.2297564595937729,
-0.08779654651880264,
-0.2077123075723648,
-0.18900974094867706,
0.067308709025383,
0.07047867774963379,
-0.22760403156280518,
0.4239518642425537,
-0.0440998449921608,
-0.03462395444512367,
0.25310656428337097,
-0.10586318373680115,
-0.05857387185096741,
0.20753557980060577,
-0.3097847104072571,
-0.4423493444919586,
-0.028914103284478188,
0.2037362903356552,
-0.20887547731399536,
-0.17163583636283875,
-0.23910728096961975,
0.10930179059505463,
-0.08436202257871628,
-0.1179397702217102,
-0.11408783495426178,
-0.0433344766497612,
-0.32496628165245056,
-0.14318034052848816,
0.5231491327285767,
0.6002160906791687,
-0.15574806928634644,
-0.26982757449150085,
-0.035922735929489136,
-0.3909570276737213,
0.02454616315662861,
0.22033463418483734,
-0.3456704318523407,
0.22296753525733948,
-0.1999148726463318,
0.07688170671463013,
0.4659714698791504,
-0.228251650929451,
-0.3213511109352112,
0.038376592099666595,
-0.21015626192092896,
0.22030919790267944,
-0.18222202360630035,
0.05876971408724785,
-0.08253026008605957,
-0.024828888475894928,
0.4612589478492737,
0.403099924325943,
-0.07906892150640488,
-0.08042709529399872,
-0.13680675625801086,
-0.23181919753551483,
0.40799617767333984,
0.33579543232917786,
-0.012163307517766953,
0.07082007080316544,
0.1233442947268486,
-0.010151822119951248,
0.2218637466430664,
-0.039842333644628525,
-0.20451314747333527,
0.1528400480747223,
0.09447073191404343,
0.06885017454624176,
-0.015201631933450699,
-0.006388761103153229,
-0.629486083984375,
0.4035143256187439,
0.2900394797325134,
-0.20255553722381592,
0.07769764214754105,
-0.0677788034081459,
-0.39112693071365356,
0.01944885402917862,
-0.2828536629676819,
-0.09735636413097382,
0.11892442405223846,
-0.18507020175457,
-0.04808799922466278,
-0.03221455588936806,
-0.390800416469574,
0.1873612254858017,
-0.24389150738716125,
0.16577112674713135,
-0.23717612028121948,
0.3313685953617096,
0.030113225802779198,
-0.10578174889087677,
0.10180885344743729,
0.22462105751037598,
0.18810299038887024,
-0.21189196407794952,
-0.12367069721221924,
0.3775634169578552,
0.1751774549484253,
0.033784639090299606,
-0.08938303589820862,
0.0909646600484848,
0.12183016538619995,
-0.09591590613126755,
-0.07817067205905914,
-0.12904857099056244,
0.08612719923257828,
-0.10915011167526245,
-0.02730024978518486,
0.04384005814790726,
-0.27059078216552734,
0.2493782341480255,
0.012658648192882538,
0.23208743333816528,
0.3637518286705017,
-0.0481879860162735,
0.06686407327651978,
0.04079868644475937,
0.47649627923965454,
-0.423231840133667,
0.3117177486419678,
0.06897652894258499,
-0.140722393989563,
-0.12821441888809204,
0.05035020411014557,
0.01110793650150299,
-0.04207439720630646,
-0.018192239105701447,
-0.32363438606262207,
0.0736033245921135,
0.03427886217832565,
0.1941881626844406,
0.3244944214820862,
0.12996350228786469,
-0.07521075010299683,
0.022484922781586647,
0.0907173603773117,
-0.1408698856830597,
0.18887275457382202,
0.015154115855693817,
0.29033201932907104,
0.2578449249267578,
-0.011932594701647758,
-0.034896574914455414,
-0.4178003966808319,
-0.2645159363746643,
0.06857654452323914,
0.3258766233921051,
-0.31907737255096436,
-0.0330168753862381,
-0.21341818571090698,
-0.12997257709503174,
0.12574832141399384,
-0.433962345123291,
-0.38129571080207825,
-0.14968597888946533,
-0.09303101897239685,
0.3362707495689392,
0.06138944625854492,
0.07910140603780746,
-0.17790459096431732,
0.11515703797340393,
0.025845743715763092,
-0.30926749110221863,
-0.2813645303249359,
-0.335744172334671,
-0.06863779574632645,
0.09212787449359894,
0.47576093673706055,
-0.12663602828979492,
0.2832795977592468,
-0.36250513792037964,
-0.02586238458752632,
-0.35882243514060974,
-0.19085919857025146,
0.07537390291690826,
-0.23764388263225555,
0.45501717925071716,
0.20452481508255005,
0.2881067395210266,
0.08218814432621002,
-0.0487479493021965,
0.2930433452129364,
-0.04595863074064255,
-0.24507111310958862,
0.2612953782081604,
0.05173437297344208,
-0.08481432497501373,
-0.09551448374986649,
-0.264942467212677,
-0.23078598082065582,
-0.4580644369125366,
0.2859003245830536,
0.08581606298685074,
0.03545307368040085,
0.46395426988601685,
0.06634388864040375,
0.2911980152130127,
0.11520208418369293,
0.17965447902679443,
-0.22026920318603516,
-0.40500399470329285,
0.2566603422164917,
-0.1991870254278183,
-0.32903236150741577,
0.2026325762271881,
0.2043437659740448,
0.39523473381996155,
0.05911063775420189,
-0.5958455801010132,
-0.12639671564102173,
0.001206928864121437,
0.1704563945531845,
-0.1641804426908493,
-0.18350203335285187,
0.20800893008708954,
-0.00020621344447135925,
0.016912642866373062,
0.037561267614364624,
-0.3239360749721527,
-0.22116521000862122,
0.1557738184928894,
0.39022207260131836,
-0.08021621406078339,
0.5127316117286682,
-0.2785537540912628,
0.5439195036888123,
0.14259111881256104,
0.10687447339296341,
0.3123190104961395,
-0.14002415537834167,
0.3682815432548523,
-0.2800649106502533,
-0.3517381250858307,
-0.07037010043859482,
0.03289929777383804,
-0.23514620959758759,
-0.024342797696590424,
0.05310307443141937,
-0.08012698590755463,
-0.2332281470298767,
-0.23242591321468353,
-0.1693907529115677,
-0.07133188098669052,
-0.12189217656850815,
-0.08046562224626541,
0.07606580853462219,
-0.017535503953695297,
0.14530235528945923,
0.054247282445430756,
-0.1301736831665039,
0.09827988594770432,
0.4120944142341614,
0.22944584488868713,
0.07530234754085541,
0.11679765582084656,
0.14363700151443481,
-0.5108779668807983,
0.16948246955871582,
-0.19851212203502655,
0.06761853396892548,
-0.2604944109916687,
-0.03059324622154236,
0.03344874456524849,
-0.13274694979190826,
0.7707854509353638,
-0.05053701251745224,
0.1868005096912384,
0.1612206995487213,
-0.10376883298158646,
-0.24302329123020172,
-0.05616072565317154,
0.1088743805885315,
0.1523832380771637,
0.2626802325248718,
0.4618716835975647,
-0.029787585139274597,
-0.20595243573188782,
0.30430132150650024,
0.09566999226808548,
-0.09790078550577164,
-0.29410332441329956,
-0.3646964430809021,
-0.43590936064720154,
-0.18819500505924225,
-0.01260315626859665,
0.12597697973251343,
0.32309287786483765,
0.0764542743563652,
-0.12223927676677704,
-0.22938990592956543,
-0.14196360111236572,
0.10022992640733719,
0.21884259581565857,
0.37912917137145996,
-0.09638367593288422,
0.3453052043914795,
0.4765874743461609,
0.07743857055902481,
0.4206801950931549,
0.8236397504806519,
0.21144090592861176,
-0.2903149127960205,
0.03201254829764366,
0.015958968549966812,
0.08736073970794678,
0.1713659167289734,
-0.16902796924114227,
-0.11795556545257568,
0.20160171389579773,
0.1418609917163849,
-0.2163325399160385,
-0.10372234880924225,
0.3012966215610504,
0.03151747211813927,
-0.31910252571105957,
-0.17644239962100983,
0.45261096954345703,
0.2211666703224182,
0.141214057803154,
0.297599196434021,
0.16301004588603973,
-0.1967443823814392,
0.3176616132259369,
-0.1477692723274231,
0.6261900067329407,
-0.17455285787582397,
0.04917400702834129,
0.2138809859752655,
0.0006532967090606689,
0.24532850086688995,
-0.19941648840904236,
-0.05237647891044617,
-0.2733869254589081,
-0.43075448274612427,
-0.10168825089931488,
-0.044927701354026794,
0.025797590613365173,
-0.1688060313463211,
0.009124889969825745,
0.18219619989395142,
-0.22475062310695648,
0.2931457757949829,
-0.02661648765206337,
-0.10356144607067108,
-0.09451042115688324,
-0.07871384173631668,
-0.24324998259544373,
0.20696118474006653,
-0.1629396229982376,
0.2893344461917877,
-0.13954749703407288,
-0.029443873092532158,
-0.08508994430303574,
-0.05865037441253662,
-0.22894689440727234,
0.17839740216732025,
-0.2341696172952652,
0.1666760891675949,
0.14671440422534943,
-0.3603453040122986,
0.04112521559000015,
0.4055365025997162,
0.070593923330307,
-0.13315726816654205,
-0.2993040680885315,
0.23180729150772095,
0.07706853002309799,
-0.18722358345985413,
-0.11969831585884094,
0.014355286955833435,
0.48668286204338074,
-0.09405403584241867,
-0.1787039339542389,
0.10336972773075104,
-0.21096694469451904,
-0.21571871638298035,
0.21532076597213745,
0.028347140178084373,
0.1870073527097702,
-0.17764368653297424,
-0.09121475368738174,
0.025466185063123703,
0.1683623343706131,
-0.19281801581382751,
0.19017264246940613,
0.07815767824649811,
0.04601800814270973,
-0.09425261616706848,
0.19133853912353516,
-0.23870940506458282,
0.049050088971853256,
0.4177202880382538,
-0.08338247239589691,
-0.16972273588180542,
0.451308012008667,
0.21061164140701294,
-0.0690726786851883,
-0.2429664433002472,
0.0034192800521850586,
0.2843189239501953,
-0.2877653241157532,
0.1982993632555008,
0.34780779480934143,
0.38959500193595886,
-0.037355367094278336,
0.2936750054359436,
0.2339191883802414,
-0.13048148155212402,
-0.033403489738702774,
-0.38840898871421814,
-0.3293413519859314,
0.2319999486207962,
-0.16594265401363373,
0.15269887447357178,
-0.1727282702922821,
0.15762579441070557,
0.009543351829051971,
-0.1528882384300232,
-0.34337082505226135,
0.07605190575122833,
-0.09265126287937164,
-0.060425251722335815,
0.20818853378295898,
0.043978046625852585,
0.188188835978508,
-0.1842026710510254,
0.21130289137363434,
0.01270771399140358,
-0.1973210573196411,
-0.288845419883728,
-0.22969429194927216,
0.1387166976928711,
0.11987695842981339,
-0.2775629162788391,
0.011721760034561157,
-0.22054246068000793,
-0.24368342757225037,
-0.14051148295402527,
0.09480999410152435,
0.28335994482040405,
0.10778987407684326,
-0.198508620262146,
0.3195706009864807,
0.2724231779575348,
-0.31471943855285645,
0.036288779228925705,
0.17018941044807434,
-0.017157066613435745,
-0.20873023569583893,
-0.0364031083881855,
-0.16064821183681488,
0.007212579250335693,
0.08881950378417969,
0.07408379018306732,
-0.03221053630113602,
-0.002227022312581539,
0.27548539638519287,
-0.3464699983596802,
0.09411606192588806,
0.10378432273864746,
0.2548424005508423,
0.49854493141174316,
-0.31023910641670227,
0.13858529925346375,
0.15916579961776733,
0.24028348922729492,
-0.33368927240371704,
-0.024093985557556152,
0.12267188727855682,
0.13209116458892822,
-0.1123904138803482,
0.11819373071193695,
-0.027565278112888336,
0.055415600538253784,
-0.13507670164108276,
0.08191725611686707,
0.2550475597381592,
-0.30091699957847595,
0.28325387835502625,
0.11647461354732513,
-0.17013415694236755,
0.07434695959091187,
0.4652419090270996,
0.06451693922281265,
0.09010680019855499,
0.3795904219150543,
-0.3944544196128845,
-0.02952292375266552,
-0.14621195197105408,
0.08425396680831909,
-0.17731645703315735,
-0.45946159958839417,
0.04110952466726303,
-0.18697483837604523,
-0.07690654695034027,
-0.1333761215209961,
-0.24352964758872986,
0.36648672819137573,
-0.33679673075675964,
-0.038913577795028687,
-0.2939385771751404,
-0.08622625470161438,
-0.3229113817214966,
0.012107092887163162,
-0.21295946836471558,
-0.18399296700954437,
-0.10980412364006042,
-0.02521882951259613,
-0.1352284997701645,
-0.21388289332389832,
0.11918294429779053,
0.12172100692987442,
-0.13061940670013428,
-0.35415107011795044,
-0.13005399703979492,
0.37384629249572754,
-0.08349822461605072,
-0.25506335496902466,
0.2884630560874939,
0.03852895274758339,
0.04091815650463104,
0.2582172155380249,
0.231129452586174,
0.37220221757888794,
0.26311957836151123,
-0.008096404373645782,
0.02274465188384056,
0.030784111469984055,
-0.04308813810348511,
-0.04306679591536522,
0.3699796795845032,
0.1358400583267212,
0.3165791928768158,
0.16832184791564941,
0.23754212260246277,
-0.13966584205627441,
0.3077675998210907,
-0.09234163165092468,
0.4384751617908478,
-0.32933974266052246,
0.2986895740032196,
-0.2731074392795563,
-0.07270565629005432,
-0.3354560136795044,
-0.040092818439006805,
-0.20469793677330017,
0.008999321609735489,
0.4339320659637451,
0.12947481870651245,
0.11667191237211227,
0.022128876298666,
0.12083055078983307,
-0.002231201156973839,
0.3249237835407257,
0.4607105553150177,
0.0499153658747673,
-0.3392394185066223,
0.006232857704162598,
-0.6643206477165222,
0.02090613543987274,
-0.07057193666696548,
0.024471916258335114,
0.11409659683704376,
0.08135728538036346,
-0.07820646464824677,
0.19235022366046906,
0.30967748165130615,
-0.10005336999893188,
0.058410223573446274,
-0.2098228633403778,
-0.23736852407455444,
-0.24353307485580444,
-0.14452730119228363,
0.12994271516799927,
-0.13488826155662537,
-0.2214563637971878,
0.0642753317952156,
-0.2515636086463928,
-0.0006325617432594299,
-0.03389334678649902,
-0.22264032065868378,
0.15691697597503662,
-0.03167269378900528,
0.33427590131759644,
-0.22135315835475922,
0.42645585536956787,
0.1033955067396164,
0.06890704482793808,
-0.4920668303966522,
-0.5226581692695618,
-0.24944767355918884,
0.14081954956054688,
-0.02214212715625763,
0.12816400825977325,
-0.08145048469305038,
-0.2555093467235565,
-0.375168114900589,
0.3584206998348236,
-0.17302435636520386,
0.06702190637588501,
-0.14643028378486633,
0.13548606634140015,
-0.06525816023349762,
0.10119637846946716,
0.07405287772417068,
0.11532720923423767,
-0.1588083952665329,
0.296317458152771,
-0.2890910804271698,
-0.4158206582069397,
0.6311697959899902,
-0.25507110357284546,
-0.07479313760995865,
0.14926840364933014,
0.16416139900684357,
0.40867698192596436,
-0.16877654194831848,
-0.5403876900672913,
0.16481608152389526,
0.2689399719238281,
-0.08054568618535995,
-0.24011537432670593,
0.31715840101242065,
-0.32320719957351685,
0.1885194629430771,
-0.07841551303863525,
0.28325793147087097,
-0.0029926421120762825,
-0.19053992629051208,
0.17120268940925598,
-0.03831692039966583
] |
https://github.com/huggingface/datasets/issues/6261 | > JourneyDB/JourneyDB is a gated dataset, so this error means you are not authenticated to access it, either by using an invalid token or by not agreeing to the terms in the dialog on the dataset page.Β΄
I did authentication with:
```
from huggingface_hub import notebook_login
notebook_login()
```
Isn't that the correct way to do it?
> Indeed, the dataset's data files structure is not supported natively by datasets. To load it, one option is to clone the repo (or download it with huggingface_hub.snapshot_download) and use Dataset.from_generator to process the files.
Great suggestion I will give it a try. | Can't load a dataset | ### Describe the bug
Can't seem to load the JourneyDB dataset.
It throws the following error:
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[15], line 2
1 # If the dataset is gated/private, make sure you have run huggingface-cli login
----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1661 ignore_verifications = ignore_verifications or save_infos
1663 # Create a dataset builder
-> 1664 builder_instance = load_dataset_builder(
1665 path=path,
1666 name=name,
1667 data_dir=data_dir,
1668 data_files=data_files,
1669 cache_dir=cache_dir,
1670 features=features,
1671 download_config=download_config,
1672 download_mode=download_mode,
1673 revision=revision,
1674 use_auth_token=use_auth_token,
1675 **config_kwargs,
1676 )
1678 # Return iterable dataset in case of streaming
1679 if streaming:
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs)
1488 download_config = download_config.copy() if download_config else DownloadConfig()
1489 download_config.use_auth_token = use_auth_token
-> 1490 dataset_module = dataset_module_factory(
1491 path,
1492 revision=revision,
1493 download_config=download_config,
1494 download_mode=download_mode,
1495 data_dir=data_dir,
1496 data_files=data_files,
1497 )
1499 # Get dataset builder class from the processing script
1500 builder_cls = import_main_class(dataset_module.module_path)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1237 if isinstance(e1, FileNotFoundError):
-> 1238 raise FileNotFoundError(
1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
1241 ) from None
1242 raise e1 from None
1243 else:
FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip']
```
### Steps to reproduce the bug
1)
```
from huggingface_hub import notebook_login
notebook_login()
```
2)
```
!pip install -q datasets
from datasets import load_dataset
```
3)
`dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)`
### Expected behavior
Load the dataset
### Environment info
Notebook | 99 | Can't load a dataset
### Describe the bug
Can't seem to load the JourneyDB dataset.
It throws the following error:
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[15], line 2
1 # If the dataset is gated/private, make sure you have run huggingface-cli login
----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1661 ignore_verifications = ignore_verifications or save_infos
1663 # Create a dataset builder
-> 1664 builder_instance = load_dataset_builder(
1665 path=path,
1666 name=name,
1667 data_dir=data_dir,
1668 data_files=data_files,
1669 cache_dir=cache_dir,
1670 features=features,
1671 download_config=download_config,
1672 download_mode=download_mode,
1673 revision=revision,
1674 use_auth_token=use_auth_token,
1675 **config_kwargs,
1676 )
1678 # Return iterable dataset in case of streaming
1679 if streaming:
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs)
1488 download_config = download_config.copy() if download_config else DownloadConfig()
1489 download_config.use_auth_token = use_auth_token
-> 1490 dataset_module = dataset_module_factory(
1491 path,
1492 revision=revision,
1493 download_config=download_config,
1494 download_mode=download_mode,
1495 data_dir=data_dir,
1496 data_files=data_files,
1497 )
1499 # Get dataset builder class from the processing script
1500 builder_cls = import_main_class(dataset_module.module_path)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1237 if isinstance(e1, FileNotFoundError):
-> 1238 raise FileNotFoundError(
1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
1241 ) from None
1242 raise e1 from None
1243 else:
FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip']
```
### Steps to reproduce the bug
1)
```
from huggingface_hub import notebook_login
notebook_login()
```
2)
```
!pip install -q datasets
from datasets import load_dataset
```
3)
`dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)`
### Expected behavior
Load the dataset
### Environment info
Notebook
> JourneyDB/JourneyDB is a gated dataset, so this error means you are not authenticated to access it, either by using an invalid token or by not agreeing to the terms in the dialog on the dataset page.Β΄
I did authentication with:
```
from huggingface_hub import notebook_login
notebook_login()
```
Isn't that the correct way to do it?
> Indeed, the dataset's data files structure is not supported natively by datasets. To load it, one option is to clone the repo (or download it with huggingface_hub.snapshot_download) and use Dataset.from_generator to process the files.
Great suggestion I will give it a try. | [
-0.40633130073547363,
-0.12175323814153671,
-0.026935188099741936,
0.4848688840866089,
0.4381573498249054,
0.12115108966827393,
0.25170496106147766,
0.23180124163627625,
-0.07087205350399017,
-0.11361230909824371,
-0.18910205364227295,
0.0730496346950531,
-0.13830894231796265,
0.3248365521430969,
0.2859526574611664,
-0.14289748668670654,
0.009425844997167587,
-0.1766473948955536,
-0.22088328003883362,
0.2775353789329529,
-0.3080146908760071,
0.18124976754188538,
-0.11365130543708801,
0.07569814473390579,
-0.3765476942062378,
-0.03636214882135391,
0.046306461095809937,
0.4566405117511749,
-0.12838499248027802,
-0.38753244280815125,
0.4943099021911621,
-0.05915533006191254,
0.3415291905403137,
0.6146700382232666,
-0.00010437788296258077,
0.25680533051490784,
0.46050938963890076,
0.03550562262535095,
-0.46370729804039,
-0.5422956943511963,
-0.0740673840045929,
0.028826184570789337,
0.11530889570713043,
-0.0385545939207077,
-0.25847309827804565,
-0.09758239984512329,
-0.1444360762834549,
-0.18361309170722961,
0.368051677942276,
0.33636295795440674,
0.27681994438171387,
0.24044197797775269,
0.17166639864444733,
-0.21493294835090637,
0.0356665775179863,
0.015322396531701088,
-0.14877422153949738,
0.2552705705165863,
0.08302852511405945,
-0.23425598442554474,
0.015021219849586487,
0.09504537284374237,
-0.180450439453125,
-0.0204344280064106,
0.4510686993598938,
-0.027124447748064995,
0.09907425940036774,
-0.2473185658454895,
0.15093334019184113,
0.2934921979904175,
0.6759009957313538,
-0.1506168097257614,
-0.3787132501602173,
0.041185587644577026,
0.021249905228614807,
-0.5414942502975464,
0.3927636742591858,
0.1263609528541565,
-0.13409700989723206,
0.2509329617023468,
-0.28136226534843445,
0.02417774498462677,
-0.03981950879096985,
0.10323159396648407,
-0.21613076329231262,
-0.010091517120599747,
-0.08605179190635681,
0.08818741142749786,
0.3127902150154114,
-0.14866891503334045,
0.4131805896759033,
0.2102271318435669,
-0.15099208056926727,
0.13935407996177673,
-0.37084445357322693,
0.26526105403900146,
0.33111071586608887,
0.3483981788158417,
0.3255101144313812,
0.1986699402332306,
0.07285024225711823,
-0.13119950890541077,
-0.11143770068883896,
0.1342940330505371,
0.2300272285938263,
0.015546686947345734,
0.08939877152442932,
-0.02851708047091961,
0.2200625240802765,
0.2761302888393402,
0.1082308441400528,
-0.061803411692380905,
-0.09262269735336304,
-0.2554323673248291,
0.10827293992042542,
-0.09474311769008636,
0.3412347435951233,
-0.19677412509918213,
-0.44980984926223755,
-0.025910314172506332,
0.08046123385429382,
0.027382466942071915,
0.21933989226818085,
0.4987296164035797,
0.09714343398809433,
-0.25877881050109863,
0.16266444325447083,
0.25815367698669434,
0.0060135722160339355,
-0.12443885207176208,
-0.3394370973110199,
-0.1656356006860733,
-0.09688705205917358,
-0.03951215744018555,
0.12474539875984192,
-0.2821020781993866,
0.2297564595937729,
-0.08779654651880264,
-0.2077123075723648,
-0.18900974094867706,
0.067308709025383,
0.07047867774963379,
-0.22760403156280518,
0.4239518642425537,
-0.0440998449921608,
-0.03462395444512367,
0.25310656428337097,
-0.10586318373680115,
-0.05857387185096741,
0.20753557980060577,
-0.3097847104072571,
-0.4423493444919586,
-0.028914103284478188,
0.2037362903356552,
-0.20887547731399536,
-0.17163583636283875,
-0.23910728096961975,
0.10930179059505463,
-0.08436202257871628,
-0.1179397702217102,
-0.11408783495426178,
-0.0433344766497612,
-0.32496628165245056,
-0.14318034052848816,
0.5231491327285767,
0.6002160906791687,
-0.15574806928634644,
-0.26982757449150085,
-0.035922735929489136,
-0.3909570276737213,
0.02454616315662861,
0.22033463418483734,
-0.3456704318523407,
0.22296753525733948,
-0.1999148726463318,
0.07688170671463013,
0.4659714698791504,
-0.228251650929451,
-0.3213511109352112,
0.038376592099666595,
-0.21015626192092896,
0.22030919790267944,
-0.18222202360630035,
0.05876971408724785,
-0.08253026008605957,
-0.024828888475894928,
0.4612589478492737,
0.403099924325943,
-0.07906892150640488,
-0.08042709529399872,
-0.13680675625801086,
-0.23181919753551483,
0.40799617767333984,
0.33579543232917786,
-0.012163307517766953,
0.07082007080316544,
0.1233442947268486,
-0.010151822119951248,
0.2218637466430664,
-0.039842333644628525,
-0.20451314747333527,
0.1528400480747223,
0.09447073191404343,
0.06885017454624176,
-0.015201631933450699,
-0.006388761103153229,
-0.629486083984375,
0.4035143256187439,
0.2900394797325134,
-0.20255553722381592,
0.07769764214754105,
-0.0677788034081459,
-0.39112693071365356,
0.01944885402917862,
-0.2828536629676819,
-0.09735636413097382,
0.11892442405223846,
-0.18507020175457,
-0.04808799922466278,
-0.03221455588936806,
-0.390800416469574,
0.1873612254858017,
-0.24389150738716125,
0.16577112674713135,
-0.23717612028121948,
0.3313685953617096,
0.030113225802779198,
-0.10578174889087677,
0.10180885344743729,
0.22462105751037598,
0.18810299038887024,
-0.21189196407794952,
-0.12367069721221924,
0.3775634169578552,
0.1751774549484253,
0.033784639090299606,
-0.08938303589820862,
0.0909646600484848,
0.12183016538619995,
-0.09591590613126755,
-0.07817067205905914,
-0.12904857099056244,
0.08612719923257828,
-0.10915011167526245,
-0.02730024978518486,
0.04384005814790726,
-0.27059078216552734,
0.2493782341480255,
0.012658648192882538,
0.23208743333816528,
0.3637518286705017,
-0.0481879860162735,
0.06686407327651978,
0.04079868644475937,
0.47649627923965454,
-0.423231840133667,
0.3117177486419678,
0.06897652894258499,
-0.140722393989563,
-0.12821441888809204,
0.05035020411014557,
0.01110793650150299,
-0.04207439720630646,
-0.018192239105701447,
-0.32363438606262207,
0.0736033245921135,
0.03427886217832565,
0.1941881626844406,
0.3244944214820862,
0.12996350228786469,
-0.07521075010299683,
0.022484922781586647,
0.0907173603773117,
-0.1408698856830597,
0.18887275457382202,
0.015154115855693817,
0.29033201932907104,
0.2578449249267578,
-0.011932594701647758,
-0.034896574914455414,
-0.4178003966808319,
-0.2645159363746643,
0.06857654452323914,
0.3258766233921051,
-0.31907737255096436,
-0.0330168753862381,
-0.21341818571090698,
-0.12997257709503174,
0.12574832141399384,
-0.433962345123291,
-0.38129571080207825,
-0.14968597888946533,
-0.09303101897239685,
0.3362707495689392,
0.06138944625854492,
0.07910140603780746,
-0.17790459096431732,
0.11515703797340393,
0.025845743715763092,
-0.30926749110221863,
-0.2813645303249359,
-0.335744172334671,
-0.06863779574632645,
0.09212787449359894,
0.47576093673706055,
-0.12663602828979492,
0.2832795977592468,
-0.36250513792037964,
-0.02586238458752632,
-0.35882243514060974,
-0.19085919857025146,
0.07537390291690826,
-0.23764388263225555,
0.45501717925071716,
0.20452481508255005,
0.2881067395210266,
0.08218814432621002,
-0.0487479493021965,
0.2930433452129364,
-0.04595863074064255,
-0.24507111310958862,
0.2612953782081604,
0.05173437297344208,
-0.08481432497501373,
-0.09551448374986649,
-0.264942467212677,
-0.23078598082065582,
-0.4580644369125366,
0.2859003245830536,
0.08581606298685074,
0.03545307368040085,
0.46395426988601685,
0.06634388864040375,
0.2911980152130127,
0.11520208418369293,
0.17965447902679443,
-0.22026920318603516,
-0.40500399470329285,
0.2566603422164917,
-0.1991870254278183,
-0.32903236150741577,
0.2026325762271881,
0.2043437659740448,
0.39523473381996155,
0.05911063775420189,
-0.5958455801010132,
-0.12639671564102173,
0.001206928864121437,
0.1704563945531845,
-0.1641804426908493,
-0.18350203335285187,
0.20800893008708954,
-0.00020621344447135925,
0.016912642866373062,
0.037561267614364624,
-0.3239360749721527,
-0.22116521000862122,
0.1557738184928894,
0.39022207260131836,
-0.08021621406078339,
0.5127316117286682,
-0.2785537540912628,
0.5439195036888123,
0.14259111881256104,
0.10687447339296341,
0.3123190104961395,
-0.14002415537834167,
0.3682815432548523,
-0.2800649106502533,
-0.3517381250858307,
-0.07037010043859482,
0.03289929777383804,
-0.23514620959758759,
-0.024342797696590424,
0.05310307443141937,
-0.08012698590755463,
-0.2332281470298767,
-0.23242591321468353,
-0.1693907529115677,
-0.07133188098669052,
-0.12189217656850815,
-0.08046562224626541,
0.07606580853462219,
-0.017535503953695297,
0.14530235528945923,
0.054247282445430756,
-0.1301736831665039,
0.09827988594770432,
0.4120944142341614,
0.22944584488868713,
0.07530234754085541,
0.11679765582084656,
0.14363700151443481,
-0.5108779668807983,
0.16948246955871582,
-0.19851212203502655,
0.06761853396892548,
-0.2604944109916687,
-0.03059324622154236,
0.03344874456524849,
-0.13274694979190826,
0.7707854509353638,
-0.05053701251745224,
0.1868005096912384,
0.1612206995487213,
-0.10376883298158646,
-0.24302329123020172,
-0.05616072565317154,
0.1088743805885315,
0.1523832380771637,
0.2626802325248718,
0.4618716835975647,
-0.029787585139274597,
-0.20595243573188782,
0.30430132150650024,
0.09566999226808548,
-0.09790078550577164,
-0.29410332441329956,
-0.3646964430809021,
-0.43590936064720154,
-0.18819500505924225,
-0.01260315626859665,
0.12597697973251343,
0.32309287786483765,
0.0764542743563652,
-0.12223927676677704,
-0.22938990592956543,
-0.14196360111236572,
0.10022992640733719,
0.21884259581565857,
0.37912917137145996,
-0.09638367593288422,
0.3453052043914795,
0.4765874743461609,
0.07743857055902481,
0.4206801950931549,
0.8236397504806519,
0.21144090592861176,
-0.2903149127960205,
0.03201254829764366,
0.015958968549966812,
0.08736073970794678,
0.1713659167289734,
-0.16902796924114227,
-0.11795556545257568,
0.20160171389579773,
0.1418609917163849,
-0.2163325399160385,
-0.10372234880924225,
0.3012966215610504,
0.03151747211813927,
-0.31910252571105957,
-0.17644239962100983,
0.45261096954345703,
0.2211666703224182,
0.141214057803154,
0.297599196434021,
0.16301004588603973,
-0.1967443823814392,
0.3176616132259369,
-0.1477692723274231,
0.6261900067329407,
-0.17455285787582397,
0.04917400702834129,
0.2138809859752655,
0.0006532967090606689,
0.24532850086688995,
-0.19941648840904236,
-0.05237647891044617,
-0.2733869254589081,
-0.43075448274612427,
-0.10168825089931488,
-0.044927701354026794,
0.025797590613365173,
-0.1688060313463211,
0.009124889969825745,
0.18219619989395142,
-0.22475062310695648,
0.2931457757949829,
-0.02661648765206337,
-0.10356144607067108,
-0.09451042115688324,
-0.07871384173631668,
-0.24324998259544373,
0.20696118474006653,
-0.1629396229982376,
0.2893344461917877,
-0.13954749703407288,
-0.029443873092532158,
-0.08508994430303574,
-0.05865037441253662,
-0.22894689440727234,
0.17839740216732025,
-0.2341696172952652,
0.1666760891675949,
0.14671440422534943,
-0.3603453040122986,
0.04112521559000015,
0.4055365025997162,
0.070593923330307,
-0.13315726816654205,
-0.2993040680885315,
0.23180729150772095,
0.07706853002309799,
-0.18722358345985413,
-0.11969831585884094,
0.014355286955833435,
0.48668286204338074,
-0.09405403584241867,
-0.1787039339542389,
0.10336972773075104,
-0.21096694469451904,
-0.21571871638298035,
0.21532076597213745,
0.028347140178084373,
0.1870073527097702,
-0.17764368653297424,
-0.09121475368738174,
0.025466185063123703,
0.1683623343706131,
-0.19281801581382751,
0.19017264246940613,
0.07815767824649811,
0.04601800814270973,
-0.09425261616706848,
0.19133853912353516,
-0.23870940506458282,
0.049050088971853256,
0.4177202880382538,
-0.08338247239589691,
-0.16972273588180542,
0.451308012008667,
0.21061164140701294,
-0.0690726786851883,
-0.2429664433002472,
0.0034192800521850586,
0.2843189239501953,
-0.2877653241157532,
0.1982993632555008,
0.34780779480934143,
0.38959500193595886,
-0.037355367094278336,
0.2936750054359436,
0.2339191883802414,
-0.13048148155212402,
-0.033403489738702774,
-0.38840898871421814,
-0.3293413519859314,
0.2319999486207962,
-0.16594265401363373,
0.15269887447357178,
-0.1727282702922821,
0.15762579441070557,
0.009543351829051971,
-0.1528882384300232,
-0.34337082505226135,
0.07605190575122833,
-0.09265126287937164,
-0.060425251722335815,
0.20818853378295898,
0.043978046625852585,
0.188188835978508,
-0.1842026710510254,
0.21130289137363434,
0.01270771399140358,
-0.1973210573196411,
-0.288845419883728,
-0.22969429194927216,
0.1387166976928711,
0.11987695842981339,
-0.2775629162788391,
0.011721760034561157,
-0.22054246068000793,
-0.24368342757225037,
-0.14051148295402527,
0.09480999410152435,
0.28335994482040405,
0.10778987407684326,
-0.198508620262146,
0.3195706009864807,
0.2724231779575348,
-0.31471943855285645,
0.036288779228925705,
0.17018941044807434,
-0.017157066613435745,
-0.20873023569583893,
-0.0364031083881855,
-0.16064821183681488,
0.007212579250335693,
0.08881950378417969,
0.07408379018306732,
-0.03221053630113602,
-0.002227022312581539,
0.27548539638519287,
-0.3464699983596802,
0.09411606192588806,
0.10378432273864746,
0.2548424005508423,
0.49854493141174316,
-0.31023910641670227,
0.13858529925346375,
0.15916579961776733,
0.24028348922729492,
-0.33368927240371704,
-0.024093985557556152,
0.12267188727855682,
0.13209116458892822,
-0.1123904138803482,
0.11819373071193695,
-0.027565278112888336,
0.055415600538253784,
-0.13507670164108276,
0.08191725611686707,
0.2550475597381592,
-0.30091699957847595,
0.28325387835502625,
0.11647461354732513,
-0.17013415694236755,
0.07434695959091187,
0.4652419090270996,
0.06451693922281265,
0.09010680019855499,
0.3795904219150543,
-0.3944544196128845,
-0.02952292375266552,
-0.14621195197105408,
0.08425396680831909,
-0.17731645703315735,
-0.45946159958839417,
0.04110952466726303,
-0.18697483837604523,
-0.07690654695034027,
-0.1333761215209961,
-0.24352964758872986,
0.36648672819137573,
-0.33679673075675964,
-0.038913577795028687,
-0.2939385771751404,
-0.08622625470161438,
-0.3229113817214966,
0.012107092887163162,
-0.21295946836471558,
-0.18399296700954437,
-0.10980412364006042,
-0.02521882951259613,
-0.1352284997701645,
-0.21388289332389832,
0.11918294429779053,
0.12172100692987442,
-0.13061940670013428,
-0.35415107011795044,
-0.13005399703979492,
0.37384629249572754,
-0.08349822461605072,
-0.25506335496902466,
0.2884630560874939,
0.03852895274758339,
0.04091815650463104,
0.2582172155380249,
0.231129452586174,
0.37220221757888794,
0.26311957836151123,
-0.008096404373645782,
0.02274465188384056,
0.030784111469984055,
-0.04308813810348511,
-0.04306679591536522,
0.3699796795845032,
0.1358400583267212,
0.3165791928768158,
0.16832184791564941,
0.23754212260246277,
-0.13966584205627441,
0.3077675998210907,
-0.09234163165092468,
0.4384751617908478,
-0.32933974266052246,
0.2986895740032196,
-0.2731074392795563,
-0.07270565629005432,
-0.3354560136795044,
-0.040092818439006805,
-0.20469793677330017,
0.008999321609735489,
0.4339320659637451,
0.12947481870651245,
0.11667191237211227,
0.022128876298666,
0.12083055078983307,
-0.002231201156973839,
0.3249237835407257,
0.4607105553150177,
0.0499153658747673,
-0.3392394185066223,
0.006232857704162598,
-0.6643206477165222,
0.02090613543987274,
-0.07057193666696548,
0.024471916258335114,
0.11409659683704376,
0.08135728538036346,
-0.07820646464824677,
0.19235022366046906,
0.30967748165130615,
-0.10005336999893188,
0.058410223573446274,
-0.2098228633403778,
-0.23736852407455444,
-0.24353307485580444,
-0.14452730119228363,
0.12994271516799927,
-0.13488826155662537,
-0.2214563637971878,
0.0642753317952156,
-0.2515636086463928,
-0.0006325617432594299,
-0.03389334678649902,
-0.22264032065868378,
0.15691697597503662,
-0.03167269378900528,
0.33427590131759644,
-0.22135315835475922,
0.42645585536956787,
0.1033955067396164,
0.06890704482793808,
-0.4920668303966522,
-0.5226581692695618,
-0.24944767355918884,
0.14081954956054688,
-0.02214212715625763,
0.12816400825977325,
-0.08145048469305038,
-0.2555093467235565,
-0.375168114900589,
0.3584206998348236,
-0.17302435636520386,
0.06702190637588501,
-0.14643028378486633,
0.13548606634140015,
-0.06525816023349762,
0.10119637846946716,
0.07405287772417068,
0.11532720923423767,
-0.1588083952665329,
0.296317458152771,
-0.2890910804271698,
-0.4158206582069397,
0.6311697959899902,
-0.25507110357284546,
-0.07479313760995865,
0.14926840364933014,
0.16416139900684357,
0.40867698192596436,
-0.16877654194831848,
-0.5403876900672913,
0.16481608152389526,
0.2689399719238281,
-0.08054568618535995,
-0.24011537432670593,
0.31715840101242065,
-0.32320719957351685,
0.1885194629430771,
-0.07841551303863525,
0.28325793147087097,
-0.0029926421120762825,
-0.19053992629051208,
0.17120268940925598,
-0.03831692039966583
] |
https://github.com/huggingface/datasets/issues/6261 | Have you accepted the terms in the dialog [here](https://huggingface.co/datasets/JourneyDB/JourneyDB)?
IIRC Kaggle preinstalls an outdated `datasets` version, so it's also a good idea to update it before importing `datasets` (and do the same for `huggingface_hub`) | Can't load a dataset | ### Describe the bug
Can't seem to load the JourneyDB dataset.
It throws the following error:
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[15], line 2
1 # If the dataset is gated/private, make sure you have run huggingface-cli login
----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1661 ignore_verifications = ignore_verifications or save_infos
1663 # Create a dataset builder
-> 1664 builder_instance = load_dataset_builder(
1665 path=path,
1666 name=name,
1667 data_dir=data_dir,
1668 data_files=data_files,
1669 cache_dir=cache_dir,
1670 features=features,
1671 download_config=download_config,
1672 download_mode=download_mode,
1673 revision=revision,
1674 use_auth_token=use_auth_token,
1675 **config_kwargs,
1676 )
1678 # Return iterable dataset in case of streaming
1679 if streaming:
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs)
1488 download_config = download_config.copy() if download_config else DownloadConfig()
1489 download_config.use_auth_token = use_auth_token
-> 1490 dataset_module = dataset_module_factory(
1491 path,
1492 revision=revision,
1493 download_config=download_config,
1494 download_mode=download_mode,
1495 data_dir=data_dir,
1496 data_files=data_files,
1497 )
1499 # Get dataset builder class from the processing script
1500 builder_cls = import_main_class(dataset_module.module_path)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1237 if isinstance(e1, FileNotFoundError):
-> 1238 raise FileNotFoundError(
1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
1241 ) from None
1242 raise e1 from None
1243 else:
FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip']
```
### Steps to reproduce the bug
1)
```
from huggingface_hub import notebook_login
notebook_login()
```
2)
```
!pip install -q datasets
from datasets import load_dataset
```
3)
`dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)`
### Expected behavior
Load the dataset
### Environment info
Notebook | 34 | Can't load a dataset
### Describe the bug
Can't seem to load the JourneyDB dataset.
It throws the following error:
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[15], line 2
1 # If the dataset is gated/private, make sure you have run huggingface-cli login
----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1661 ignore_verifications = ignore_verifications or save_infos
1663 # Create a dataset builder
-> 1664 builder_instance = load_dataset_builder(
1665 path=path,
1666 name=name,
1667 data_dir=data_dir,
1668 data_files=data_files,
1669 cache_dir=cache_dir,
1670 features=features,
1671 download_config=download_config,
1672 download_mode=download_mode,
1673 revision=revision,
1674 use_auth_token=use_auth_token,
1675 **config_kwargs,
1676 )
1678 # Return iterable dataset in case of streaming
1679 if streaming:
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs)
1488 download_config = download_config.copy() if download_config else DownloadConfig()
1489 download_config.use_auth_token = use_auth_token
-> 1490 dataset_module = dataset_module_factory(
1491 path,
1492 revision=revision,
1493 download_config=download_config,
1494 download_mode=download_mode,
1495 data_dir=data_dir,
1496 data_files=data_files,
1497 )
1499 # Get dataset builder class from the processing script
1500 builder_cls = import_main_class(dataset_module.module_path)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1237 if isinstance(e1, FileNotFoundError):
-> 1238 raise FileNotFoundError(
1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
1241 ) from None
1242 raise e1 from None
1243 else:
FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip']
```
### Steps to reproduce the bug
1)
```
from huggingface_hub import notebook_login
notebook_login()
```
2)
```
!pip install -q datasets
from datasets import load_dataset
```
3)
`dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)`
### Expected behavior
Load the dataset
### Environment info
Notebook
Have you accepted the terms in the dialog [here](https://huggingface.co/datasets/JourneyDB/JourneyDB)?
IIRC Kaggle preinstalls an outdated `datasets` version, so it's also a good idea to update it before importing `datasets` (and do the same for `huggingface_hub`) | [
-0.40633130073547363,
-0.12175323814153671,
-0.026935188099741936,
0.4848688840866089,
0.4381573498249054,
0.12115108966827393,
0.25170496106147766,
0.23180124163627625,
-0.07087205350399017,
-0.11361230909824371,
-0.18910205364227295,
0.0730496346950531,
-0.13830894231796265,
0.3248365521430969,
0.2859526574611664,
-0.14289748668670654,
0.009425844997167587,
-0.1766473948955536,
-0.22088328003883362,
0.2775353789329529,
-0.3080146908760071,
0.18124976754188538,
-0.11365130543708801,
0.07569814473390579,
-0.3765476942062378,
-0.03636214882135391,
0.046306461095809937,
0.4566405117511749,
-0.12838499248027802,
-0.38753244280815125,
0.4943099021911621,
-0.05915533006191254,
0.3415291905403137,
0.6146700382232666,
-0.00010437788296258077,
0.25680533051490784,
0.46050938963890076,
0.03550562262535095,
-0.46370729804039,
-0.5422956943511963,
-0.0740673840045929,
0.028826184570789337,
0.11530889570713043,
-0.0385545939207077,
-0.25847309827804565,
-0.09758239984512329,
-0.1444360762834549,
-0.18361309170722961,
0.368051677942276,
0.33636295795440674,
0.27681994438171387,
0.24044197797775269,
0.17166639864444733,
-0.21493294835090637,
0.0356665775179863,
0.015322396531701088,
-0.14877422153949738,
0.2552705705165863,
0.08302852511405945,
-0.23425598442554474,
0.015021219849586487,
0.09504537284374237,
-0.180450439453125,
-0.0204344280064106,
0.4510686993598938,
-0.027124447748064995,
0.09907425940036774,
-0.2473185658454895,
0.15093334019184113,
0.2934921979904175,
0.6759009957313538,
-0.1506168097257614,
-0.3787132501602173,
0.041185587644577026,
0.021249905228614807,
-0.5414942502975464,
0.3927636742591858,
0.1263609528541565,
-0.13409700989723206,
0.2509329617023468,
-0.28136226534843445,
0.02417774498462677,
-0.03981950879096985,
0.10323159396648407,
-0.21613076329231262,
-0.010091517120599747,
-0.08605179190635681,
0.08818741142749786,
0.3127902150154114,
-0.14866891503334045,
0.4131805896759033,
0.2102271318435669,
-0.15099208056926727,
0.13935407996177673,
-0.37084445357322693,
0.26526105403900146,
0.33111071586608887,
0.3483981788158417,
0.3255101144313812,
0.1986699402332306,
0.07285024225711823,
-0.13119950890541077,
-0.11143770068883896,
0.1342940330505371,
0.2300272285938263,
0.015546686947345734,
0.08939877152442932,
-0.02851708047091961,
0.2200625240802765,
0.2761302888393402,
0.1082308441400528,
-0.061803411692380905,
-0.09262269735336304,
-0.2554323673248291,
0.10827293992042542,
-0.09474311769008636,
0.3412347435951233,
-0.19677412509918213,
-0.44980984926223755,
-0.025910314172506332,
0.08046123385429382,
0.027382466942071915,
0.21933989226818085,
0.4987296164035797,
0.09714343398809433,
-0.25877881050109863,
0.16266444325447083,
0.25815367698669434,
0.0060135722160339355,
-0.12443885207176208,
-0.3394370973110199,
-0.1656356006860733,
-0.09688705205917358,
-0.03951215744018555,
0.12474539875984192,
-0.2821020781993866,
0.2297564595937729,
-0.08779654651880264,
-0.2077123075723648,
-0.18900974094867706,
0.067308709025383,
0.07047867774963379,
-0.22760403156280518,
0.4239518642425537,
-0.0440998449921608,
-0.03462395444512367,
0.25310656428337097,
-0.10586318373680115,
-0.05857387185096741,
0.20753557980060577,
-0.3097847104072571,
-0.4423493444919586,
-0.028914103284478188,
0.2037362903356552,
-0.20887547731399536,
-0.17163583636283875,
-0.23910728096961975,
0.10930179059505463,
-0.08436202257871628,
-0.1179397702217102,
-0.11408783495426178,
-0.0433344766497612,
-0.32496628165245056,
-0.14318034052848816,
0.5231491327285767,
0.6002160906791687,
-0.15574806928634644,
-0.26982757449150085,
-0.035922735929489136,
-0.3909570276737213,
0.02454616315662861,
0.22033463418483734,
-0.3456704318523407,
0.22296753525733948,
-0.1999148726463318,
0.07688170671463013,
0.4659714698791504,
-0.228251650929451,
-0.3213511109352112,
0.038376592099666595,
-0.21015626192092896,
0.22030919790267944,
-0.18222202360630035,
0.05876971408724785,
-0.08253026008605957,
-0.024828888475894928,
0.4612589478492737,
0.403099924325943,
-0.07906892150640488,
-0.08042709529399872,
-0.13680675625801086,
-0.23181919753551483,
0.40799617767333984,
0.33579543232917786,
-0.012163307517766953,
0.07082007080316544,
0.1233442947268486,
-0.010151822119951248,
0.2218637466430664,
-0.039842333644628525,
-0.20451314747333527,
0.1528400480747223,
0.09447073191404343,
0.06885017454624176,
-0.015201631933450699,
-0.006388761103153229,
-0.629486083984375,
0.4035143256187439,
0.2900394797325134,
-0.20255553722381592,
0.07769764214754105,
-0.0677788034081459,
-0.39112693071365356,
0.01944885402917862,
-0.2828536629676819,
-0.09735636413097382,
0.11892442405223846,
-0.18507020175457,
-0.04808799922466278,
-0.03221455588936806,
-0.390800416469574,
0.1873612254858017,
-0.24389150738716125,
0.16577112674713135,
-0.23717612028121948,
0.3313685953617096,
0.030113225802779198,
-0.10578174889087677,
0.10180885344743729,
0.22462105751037598,
0.18810299038887024,
-0.21189196407794952,
-0.12367069721221924,
0.3775634169578552,
0.1751774549484253,
0.033784639090299606,
-0.08938303589820862,
0.0909646600484848,
0.12183016538619995,
-0.09591590613126755,
-0.07817067205905914,
-0.12904857099056244,
0.08612719923257828,
-0.10915011167526245,
-0.02730024978518486,
0.04384005814790726,
-0.27059078216552734,
0.2493782341480255,
0.012658648192882538,
0.23208743333816528,
0.3637518286705017,
-0.0481879860162735,
0.06686407327651978,
0.04079868644475937,
0.47649627923965454,
-0.423231840133667,
0.3117177486419678,
0.06897652894258499,
-0.140722393989563,
-0.12821441888809204,
0.05035020411014557,
0.01110793650150299,
-0.04207439720630646,
-0.018192239105701447,
-0.32363438606262207,
0.0736033245921135,
0.03427886217832565,
0.1941881626844406,
0.3244944214820862,
0.12996350228786469,
-0.07521075010299683,
0.022484922781586647,
0.0907173603773117,
-0.1408698856830597,
0.18887275457382202,
0.015154115855693817,
0.29033201932907104,
0.2578449249267578,
-0.011932594701647758,
-0.034896574914455414,
-0.4178003966808319,
-0.2645159363746643,
0.06857654452323914,
0.3258766233921051,
-0.31907737255096436,
-0.0330168753862381,
-0.21341818571090698,
-0.12997257709503174,
0.12574832141399384,
-0.433962345123291,
-0.38129571080207825,
-0.14968597888946533,
-0.09303101897239685,
0.3362707495689392,
0.06138944625854492,
0.07910140603780746,
-0.17790459096431732,
0.11515703797340393,
0.025845743715763092,
-0.30926749110221863,
-0.2813645303249359,
-0.335744172334671,
-0.06863779574632645,
0.09212787449359894,
0.47576093673706055,
-0.12663602828979492,
0.2832795977592468,
-0.36250513792037964,
-0.02586238458752632,
-0.35882243514060974,
-0.19085919857025146,
0.07537390291690826,
-0.23764388263225555,
0.45501717925071716,
0.20452481508255005,
0.2881067395210266,
0.08218814432621002,
-0.0487479493021965,
0.2930433452129364,
-0.04595863074064255,
-0.24507111310958862,
0.2612953782081604,
0.05173437297344208,
-0.08481432497501373,
-0.09551448374986649,
-0.264942467212677,
-0.23078598082065582,
-0.4580644369125366,
0.2859003245830536,
0.08581606298685074,
0.03545307368040085,
0.46395426988601685,
0.06634388864040375,
0.2911980152130127,
0.11520208418369293,
0.17965447902679443,
-0.22026920318603516,
-0.40500399470329285,
0.2566603422164917,
-0.1991870254278183,
-0.32903236150741577,
0.2026325762271881,
0.2043437659740448,
0.39523473381996155,
0.05911063775420189,
-0.5958455801010132,
-0.12639671564102173,
0.001206928864121437,
0.1704563945531845,
-0.1641804426908493,
-0.18350203335285187,
0.20800893008708954,
-0.00020621344447135925,
0.016912642866373062,
0.037561267614364624,
-0.3239360749721527,
-0.22116521000862122,
0.1557738184928894,
0.39022207260131836,
-0.08021621406078339,
0.5127316117286682,
-0.2785537540912628,
0.5439195036888123,
0.14259111881256104,
0.10687447339296341,
0.3123190104961395,
-0.14002415537834167,
0.3682815432548523,
-0.2800649106502533,
-0.3517381250858307,
-0.07037010043859482,
0.03289929777383804,
-0.23514620959758759,
-0.024342797696590424,
0.05310307443141937,
-0.08012698590755463,
-0.2332281470298767,
-0.23242591321468353,
-0.1693907529115677,
-0.07133188098669052,
-0.12189217656850815,
-0.08046562224626541,
0.07606580853462219,
-0.017535503953695297,
0.14530235528945923,
0.054247282445430756,
-0.1301736831665039,
0.09827988594770432,
0.4120944142341614,
0.22944584488868713,
0.07530234754085541,
0.11679765582084656,
0.14363700151443481,
-0.5108779668807983,
0.16948246955871582,
-0.19851212203502655,
0.06761853396892548,
-0.2604944109916687,
-0.03059324622154236,
0.03344874456524849,
-0.13274694979190826,
0.7707854509353638,
-0.05053701251745224,
0.1868005096912384,
0.1612206995487213,
-0.10376883298158646,
-0.24302329123020172,
-0.05616072565317154,
0.1088743805885315,
0.1523832380771637,
0.2626802325248718,
0.4618716835975647,
-0.029787585139274597,
-0.20595243573188782,
0.30430132150650024,
0.09566999226808548,
-0.09790078550577164,
-0.29410332441329956,
-0.3646964430809021,
-0.43590936064720154,
-0.18819500505924225,
-0.01260315626859665,
0.12597697973251343,
0.32309287786483765,
0.0764542743563652,
-0.12223927676677704,
-0.22938990592956543,
-0.14196360111236572,
0.10022992640733719,
0.21884259581565857,
0.37912917137145996,
-0.09638367593288422,
0.3453052043914795,
0.4765874743461609,
0.07743857055902481,
0.4206801950931549,
0.8236397504806519,
0.21144090592861176,
-0.2903149127960205,
0.03201254829764366,
0.015958968549966812,
0.08736073970794678,
0.1713659167289734,
-0.16902796924114227,
-0.11795556545257568,
0.20160171389579773,
0.1418609917163849,
-0.2163325399160385,
-0.10372234880924225,
0.3012966215610504,
0.03151747211813927,
-0.31910252571105957,
-0.17644239962100983,
0.45261096954345703,
0.2211666703224182,
0.141214057803154,
0.297599196434021,
0.16301004588603973,
-0.1967443823814392,
0.3176616132259369,
-0.1477692723274231,
0.6261900067329407,
-0.17455285787582397,
0.04917400702834129,
0.2138809859752655,
0.0006532967090606689,
0.24532850086688995,
-0.19941648840904236,
-0.05237647891044617,
-0.2733869254589081,
-0.43075448274612427,
-0.10168825089931488,
-0.044927701354026794,
0.025797590613365173,
-0.1688060313463211,
0.009124889969825745,
0.18219619989395142,
-0.22475062310695648,
0.2931457757949829,
-0.02661648765206337,
-0.10356144607067108,
-0.09451042115688324,
-0.07871384173631668,
-0.24324998259544373,
0.20696118474006653,
-0.1629396229982376,
0.2893344461917877,
-0.13954749703407288,
-0.029443873092532158,
-0.08508994430303574,
-0.05865037441253662,
-0.22894689440727234,
0.17839740216732025,
-0.2341696172952652,
0.1666760891675949,
0.14671440422534943,
-0.3603453040122986,
0.04112521559000015,
0.4055365025997162,
0.070593923330307,
-0.13315726816654205,
-0.2993040680885315,
0.23180729150772095,
0.07706853002309799,
-0.18722358345985413,
-0.11969831585884094,
0.014355286955833435,
0.48668286204338074,
-0.09405403584241867,
-0.1787039339542389,
0.10336972773075104,
-0.21096694469451904,
-0.21571871638298035,
0.21532076597213745,
0.028347140178084373,
0.1870073527097702,
-0.17764368653297424,
-0.09121475368738174,
0.025466185063123703,
0.1683623343706131,
-0.19281801581382751,
0.19017264246940613,
0.07815767824649811,
0.04601800814270973,
-0.09425261616706848,
0.19133853912353516,
-0.23870940506458282,
0.049050088971853256,
0.4177202880382538,
-0.08338247239589691,
-0.16972273588180542,
0.451308012008667,
0.21061164140701294,
-0.0690726786851883,
-0.2429664433002472,
0.0034192800521850586,
0.2843189239501953,
-0.2877653241157532,
0.1982993632555008,
0.34780779480934143,
0.38959500193595886,
-0.037355367094278336,
0.2936750054359436,
0.2339191883802414,
-0.13048148155212402,
-0.033403489738702774,
-0.38840898871421814,
-0.3293413519859314,
0.2319999486207962,
-0.16594265401363373,
0.15269887447357178,
-0.1727282702922821,
0.15762579441070557,
0.009543351829051971,
-0.1528882384300232,
-0.34337082505226135,
0.07605190575122833,
-0.09265126287937164,
-0.060425251722335815,
0.20818853378295898,
0.043978046625852585,
0.188188835978508,
-0.1842026710510254,
0.21130289137363434,
0.01270771399140358,
-0.1973210573196411,
-0.288845419883728,
-0.22969429194927216,
0.1387166976928711,
0.11987695842981339,
-0.2775629162788391,
0.011721760034561157,
-0.22054246068000793,
-0.24368342757225037,
-0.14051148295402527,
0.09480999410152435,
0.28335994482040405,
0.10778987407684326,
-0.198508620262146,
0.3195706009864807,
0.2724231779575348,
-0.31471943855285645,
0.036288779228925705,
0.17018941044807434,
-0.017157066613435745,
-0.20873023569583893,
-0.0364031083881855,
-0.16064821183681488,
0.007212579250335693,
0.08881950378417969,
0.07408379018306732,
-0.03221053630113602,
-0.002227022312581539,
0.27548539638519287,
-0.3464699983596802,
0.09411606192588806,
0.10378432273864746,
0.2548424005508423,
0.49854493141174316,
-0.31023910641670227,
0.13858529925346375,
0.15916579961776733,
0.24028348922729492,
-0.33368927240371704,
-0.024093985557556152,
0.12267188727855682,
0.13209116458892822,
-0.1123904138803482,
0.11819373071193695,
-0.027565278112888336,
0.055415600538253784,
-0.13507670164108276,
0.08191725611686707,
0.2550475597381592,
-0.30091699957847595,
0.28325387835502625,
0.11647461354732513,
-0.17013415694236755,
0.07434695959091187,
0.4652419090270996,
0.06451693922281265,
0.09010680019855499,
0.3795904219150543,
-0.3944544196128845,
-0.02952292375266552,
-0.14621195197105408,
0.08425396680831909,
-0.17731645703315735,
-0.45946159958839417,
0.04110952466726303,
-0.18697483837604523,
-0.07690654695034027,
-0.1333761215209961,
-0.24352964758872986,
0.36648672819137573,
-0.33679673075675964,
-0.038913577795028687,
-0.2939385771751404,
-0.08622625470161438,
-0.3229113817214966,
0.012107092887163162,
-0.21295946836471558,
-0.18399296700954437,
-0.10980412364006042,
-0.02521882951259613,
-0.1352284997701645,
-0.21388289332389832,
0.11918294429779053,
0.12172100692987442,
-0.13061940670013428,
-0.35415107011795044,
-0.13005399703979492,
0.37384629249572754,
-0.08349822461605072,
-0.25506335496902466,
0.2884630560874939,
0.03852895274758339,
0.04091815650463104,
0.2582172155380249,
0.231129452586174,
0.37220221757888794,
0.26311957836151123,
-0.008096404373645782,
0.02274465188384056,
0.030784111469984055,
-0.04308813810348511,
-0.04306679591536522,
0.3699796795845032,
0.1358400583267212,
0.3165791928768158,
0.16832184791564941,
0.23754212260246277,
-0.13966584205627441,
0.3077675998210907,
-0.09234163165092468,
0.4384751617908478,
-0.32933974266052246,
0.2986895740032196,
-0.2731074392795563,
-0.07270565629005432,
-0.3354560136795044,
-0.040092818439006805,
-0.20469793677330017,
0.008999321609735489,
0.4339320659637451,
0.12947481870651245,
0.11667191237211227,
0.022128876298666,
0.12083055078983307,
-0.002231201156973839,
0.3249237835407257,
0.4607105553150177,
0.0499153658747673,
-0.3392394185066223,
0.006232857704162598,
-0.6643206477165222,
0.02090613543987274,
-0.07057193666696548,
0.024471916258335114,
0.11409659683704376,
0.08135728538036346,
-0.07820646464824677,
0.19235022366046906,
0.30967748165130615,
-0.10005336999893188,
0.058410223573446274,
-0.2098228633403778,
-0.23736852407455444,
-0.24353307485580444,
-0.14452730119228363,
0.12994271516799927,
-0.13488826155662537,
-0.2214563637971878,
0.0642753317952156,
-0.2515636086463928,
-0.0006325617432594299,
-0.03389334678649902,
-0.22264032065868378,
0.15691697597503662,
-0.03167269378900528,
0.33427590131759644,
-0.22135315835475922,
0.42645585536956787,
0.1033955067396164,
0.06890704482793808,
-0.4920668303966522,
-0.5226581692695618,
-0.24944767355918884,
0.14081954956054688,
-0.02214212715625763,
0.12816400825977325,
-0.08145048469305038,
-0.2555093467235565,
-0.375168114900589,
0.3584206998348236,
-0.17302435636520386,
0.06702190637588501,
-0.14643028378486633,
0.13548606634140015,
-0.06525816023349762,
0.10119637846946716,
0.07405287772417068,
0.11532720923423767,
-0.1588083952665329,
0.296317458152771,
-0.2890910804271698,
-0.4158206582069397,
0.6311697959899902,
-0.25507110357284546,
-0.07479313760995865,
0.14926840364933014,
0.16416139900684357,
0.40867698192596436,
-0.16877654194831848,
-0.5403876900672913,
0.16481608152389526,
0.2689399719238281,
-0.08054568618535995,
-0.24011537432670593,
0.31715840101242065,
-0.32320719957351685,
0.1885194629430771,
-0.07841551303863525,
0.28325793147087097,
-0.0029926421120762825,
-0.19053992629051208,
0.17120268940925598,
-0.03831692039966583
] |
https://github.com/huggingface/datasets/issues/6260 | Hi! Unfortunately, the current behavior is to delete the downloaded data when this error happens. So, I've opened a PR that removes the problematic import to avoid losing data due to `apache_beam` not being installed (we host the preprocessed version of `natual_questions` on the HF GCS, so requiring `apache_beam` in that case doesn't make sense) | REUSE_DATASET_IF_EXISTS don't work | ### Describe the bug
I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
---
Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart..
![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41)
### Steps to reproduce the bug
run this two line code
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
### Expected behavior
Download behavior can be correctly follow DownloadMode
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 11.0.0
- Pandas version: 2.0.3 | 55 | REUSE_DATASET_IF_EXISTS don't work
### Describe the bug
I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
---
Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart..
![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41)
### Steps to reproduce the bug
run this two line code
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
### Expected behavior
Download behavior can be correctly follow DownloadMode
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 11.0.0
- Pandas version: 2.0.3
Hi! Unfortunately, the current behavior is to delete the downloaded data when this error happens. So, I've opened a PR that removes the problematic import to avoid losing data due to `apache_beam` not being installed (we host the preprocessed version of `natual_questions` on the HF GCS, so requiring `apache_beam` in that case doesn't make sense) | [
-0.12890778481960297,
-0.1194736510515213,
0.07241126149892807,
0.5413785576820374,
0.29882538318634033,
-0.18821358680725098,
0.042946361005306244,
0.15610699355602264,
0.19228515028953552,
-0.13517247140407562,
-0.047027964144945145,
0.22609251737594604,
-0.1140713021159172,
0.19778533279895782,
0.055307537317276,
-0.12954942882061005,
-0.16523033380508423,
0.20497120916843414,
-0.1430465579032898,
-0.09536933898925781,
-0.031119972467422485,
0.1910828799009323,
-0.22295892238616943,
-0.2426077276468277,
0.12522661685943604,
0.09671090543270111,
-0.11572188884019852,
0.20326627790927887,
0.010280478745698929,
-0.33905643224716187,
0.21758875250816345,
0.13375234603881836,
0.25012990832328796,
0.16580019891262054,
-0.00012064600014127791,
0.0014808103442192078,
0.14738991856575012,
-0.13118885457515717,
-0.3548088073730469,
-0.27620935440063477,
-0.13176372647285461,
-0.17641547322273254,
0.11876000463962555,
-0.13628290593624115,
-0.07610072195529938,
-0.2993066608905792,
0.036218591034412384,
-0.3175937235355377,
0.5966125726699829,
0.2644200026988983,
0.1571289300918579,
0.3051639795303345,
-0.005830839276313782,
-0.07559221237897873,
0.3294965922832489,
0.0035377107560634613,
-0.008570142090320587,
0.17310945689678192,
0.3656153082847595,
0.19081895053386688,
0.10418172180652618,
0.2613217234611511,
-0.011040069162845612,
0.16621628403663635,
0.06712564826011658,
-0.2529394030570984,
-0.1068686693906784,
-0.13733558356761932,
-0.12175758928060532,
0.21368765830993652,
0.6149435043334961,
-0.3207283914089203,
-0.09858281910419464,
-0.2681724429130554,
0.11577610671520233,
-0.041439641267061234,
0.03446982055902481,
-0.06423918902873993,
-0.1316978633403778,
0.1807689368724823,
-0.0730113536119461,
-0.43755394220352173,
0.012808971107006073,
0.08489783108234406,
0.15949146449565887,
-0.028170160949230194,
-0.08591953665018082,
0.26115328073501587,
-0.15470048785209656,
0.04755612835288048,
0.14836257696151733,
-0.2496338188648224,
0.018421005457639694,
-0.0784849226474762,
-0.3177979290485382,
0.07504831254482269,
-0.007554873824119568,
0.20890793204307556,
0.19448770582675934,
0.5538647770881653,
0.18905925750732422,
0.08279654383659363,
-0.03217564523220062,
-0.10251133888959885,
0.13136295974254608,
0.2843085527420044,
0.16578447818756104,
-0.04009386524558067,
0.17364740371704102,
0.27500155568122864,
-0.2114277184009552,
-0.16939222812652588,
-0.03225220739841461,
-0.06538692116737366,
0.13483618199825287,
-0.004699070006608963,
0.38821443915367126,
0.04777401685714722,
-0.19215336441993713,
0.007664896547794342,
-0.3372300863265991,
-0.13629761338233948,
0.18481722474098206,
0.17923183739185333,
-0.06979714334011078,
0.20286965370178223,
0.10674376785755157,
0.18406908214092255,
-0.11686208844184875,
-0.5402539968490601,
-0.17175431549549103,
0.0019998792558908463,
-0.2574576437473297,
0.13500165939331055,
0.413192480802536,
-0.14725390076637268,
0.2988418936729431,
0.15056626498699188,
-0.1866871416568756,
-0.22238434851169586,
0.3174622654914856,
0.20523817837238312,
-0.22581133246421814,
0.18689918518066406,
-0.03882651403546333,
0.30188804864883423,
0.10192538797855377,
0.2125186026096344,
-0.053592368960380554,
0.2365286648273468,
-0.3560997545719147,
-0.23665449023246765,
0.10506071895360947,
0.11131345480680466,
-0.2931677997112274,
0.07825399935245514,
-0.18530423939228058,
-0.23971174657344818,
0.06748445332050323,
-0.12561845779418945,
0.21367670595645905,
-0.12132684141397476,
-0.046221811324357986,
-0.28668665885925293,
0.026587270200252533,
0.7567219734191895,
0.019259408116340637,
-0.13683070242404938,
-0.21513454616069794,
-0.288840115070343,
0.1561254858970642,
0.0039213877171278,
-0.19973167777061462,
0.14246191084384918,
-0.5803224444389343,
0.004531174898147583,
0.5884432792663574,
-0.6467801928520203,
-0.4984300136566162,
0.2994070053100586,
-0.02583770453929901,
0.2012002021074295,
0.048309050500392914,
0.16211643815040588,
-0.026157202199101448,
0.11553551256656647,
-0.49034643173217773,
0.18245770037174225,
0.06231047958135605,
-0.1501101553440094,
-0.3035297393798828,
-0.2468338906764984,
-0.014293769374489784,
0.011780567467212677,
0.05570390447974205,
0.27585044503211975,
0.24305430054664612,
0.0737924575805664,
0.21433332562446594,
0.1555337905883789,
0.2172306329011917,
0.15690386295318604,
0.19847172498703003,
0.011990501545369625,
0.04038526490330696,
-0.2165193110704422,
-0.6228194832801819,
0.42298710346221924,
-0.421578049659729,
-0.2830198109149933,
0.17079734802246094,
-0.13668006658554077,
-0.711131751537323,
-0.20598822832107544,
-0.3826497197151184,
-0.49988478422164917,
0.037506647408008575,
0.4776427149772644,
0.1653459519147873,
0.3200216293334961,
-0.0812457874417305,
0.5371894240379333,
-0.1074586883187294,
0.13450634479522705,
-0.430941104888916,
0.3359948396682739,
0.06634217500686646,
0.06317223608493805,
-0.11880874633789062,
-0.03404274210333824,
0.34307798743247986,
0.02647145465016365,
0.07344822585582733,
0.48299315571784973,
-0.17610716819763184,
0.23922887444496155,
-0.07760593295097351,
-0.20601800084114075,
0.1493188589811325,
-0.17807380855083466,
0.07949861884117126,
-0.09453596919775009,
0.226841002702713,
-0.09023896604776382,
-0.003627285361289978,
0.010820373892784119,
0.04062648490071297,
0.04654781147837639,
0.03043350577354431,
0.011323094367980957,
0.12887009978294373,
-0.3631018102169037,
-0.1170191839337349,
-0.16013085842132568,
0.12315955758094788,
0.11313019692897797,
0.17399990558624268,
-0.09596215188503265,
-0.15060801804065704,
0.02036619558930397,
0.32524728775024414,
0.0050101205706596375,
0.0829063281416893,
-0.10304625332355499,
-0.0887918546795845,
0.10196825116872787,
0.42066994309425354,
0.3023446798324585,
0.4720951318740845,
0.09138648211956024,
0.26025617122650146,
0.1885683238506317,
0.02650885283946991,
-0.3362000584602356,
0.04563004523515701,
-0.18467022478580475,
0.10991434752941132,
0.27721160650253296,
0.24142925441265106,
-0.015147280879318714,
-0.39149004220962524,
-0.11227844655513763,
0.29690924286842346,
0.1767907440662384,
-0.24846263229846954,
-0.08967822790145874,
-0.5505594611167908,
-0.2962728440761566,
-0.2854324281215668,
0.3009091317653656,
-0.02471345290541649,
-0.21948330104351044,
-0.1262548416852951,
0.39894822239875793,
0.08948861062526703,
0.3115185797214508,
0.07706479728221893,
0.04616487771272659,
0.055732518434524536,
-0.377566397190094,
-0.3007403314113617,
0.054960984736680984,
-0.3320239782333374,
0.02637379616498947,
0.2021758258342743,
0.0019003599882125854,
0.36450162529945374,
-0.19701144099235535,
0.12642605602741241,
-0.5277469158172607,
-0.02782299369573593,
0.22983138263225555,
0.27244576811790466,
0.3223368227481842,
0.03289150446653366,
0.14319391548633575,
-0.1953735202550888,
0.19607189297676086,
0.1924450844526291,
0.04072289913892746,
-0.2586541175842285,
0.05756504833698273,
0.1477525681257248,
0.2706848382949829,
-0.3354918360710144,
-0.5027222037315369,
-0.07918143272399902,
-0.31118708848953247,
0.025043586269021034,
-0.08867285400629044,
-0.09772907197475433,
0.1705743968486786,
0.08154424279928207,
0.05633813515305519,
-0.0332469679415226,
0.14581052958965302,
-0.3810931146144867,
-0.1398666501045227,
0.13291330635547638,
-0.07797947525978088,
-0.18769541382789612,
0.0025488287210464478,
-0.29120758175849915,
0.2901524603366852,
0.39415255188941956,
-0.7428380846977234,
-0.1838734745979309,
-0.12605421245098114,
0.21092435717582703,
-0.052192915230989456,
0.32315462827682495,
0.47518613934516907,
-0.16020028293132782,
0.06473234295845032,
-0.16638979315757751,
0.33928000926971436,
0.09778278321027756,
-0.1602611094713211,
0.3986091911792755,
0.22223025560379028,
0.30946269631385803,
0.0777716189622879,
0.7706121802330017,
0.17023523151874542,
0.06609909981489182,
0.7940183281898499,
-0.11002892255783081,
0.5639763474464417,
0.02064993977546692,
-0.07289379090070724,
-0.03361944109201431,
-0.0004574581980705261,
0.25127148628234863,
-0.0305972620844841,
0.08817818760871887,
0.22500702738761902,
-0.2728700637817383,
0.023311324417591095,
-0.4476901590824127,
-0.376569002866745,
-0.09288306534290314,
-0.3698969781398773,
0.20284616947174072,
0.2898544371128082,
0.02068755030632019,
0.32271280884742737,
0.030149731785058975,
-0.03224024921655655,
0.17312130331993103,
0.3011215329170227,
0.08797575533390045,
-0.04472769424319267,
0.2874472439289093,
-0.2948915958404541,
0.23591706156730652,
0.04060661420226097,
0.35340383648872375,
0.016622863709926605,
0.048955872654914856,
0.15276668965816498,
-0.0067471787333488464,
0.7150886058807373,
-0.4707454741001129,
0.09628206491470337,
-0.0016112402081489563,
-0.024813443422317505,
-0.47675037384033203,
-0.004421509802341461,
-0.07150502502918243,
-0.2245018482208252,
0.007963011041283607,
0.24021190404891968,
-0.21950483322143555,
0.19667576253414154,
-0.05754100903868675,
0.39824047684669495,
-0.1708509922027588,
-0.196759432554245,
-0.15488001704216003,
-0.4392741322517395,
-0.6478046178817749,
-0.01257067546248436,
-0.1568174660205841,
-0.03008158504962921,
-0.17426493763923645,
-0.06494928896427155,
-0.29000309109687805,
-0.18506070971488953,
-0.029675956815481186,
0.004865024238824844,
0.29845255613327026,
-0.09342943876981735,
0.30696696043014526,
-0.10013622045516968,
-0.229110985994339,
0.04297083616256714,
0.5028295516967773,
-0.2570348083972931,
0.06566503643989563,
-0.08850985765457153,
0.1720455139875412,
-0.1904458999633789,
0.23522940278053284,
-0.26867035031318665,
-0.04232548549771309,
-0.0216041412204504,
-0.13778986036777496,
-0.23138266801834106,
0.15421146154403687,
0.029263757169246674,
-0.1272105574607849,
-0.026071131229400635,
-0.4554653465747833,
0.3844738006591797,
0.231930211186409,
-0.25667604804039,
0.35812440514564514,
0.20624235272407532,
-0.014811167493462563,
-0.09369798004627228,
-0.21916142106056213,
0.8269984722137451,
-0.1485430896282196,
-0.00551326759159565,
0.36720454692840576,
-0.22636784613132477,
0.8104996681213379,
-0.2217644602060318,
0.12370403110980988,
-0.29097265005111694,
-0.01638937182724476,
-0.015621349215507507,
-0.21494074165821075,
0.3757186830043793,
0.061070702970027924,
0.037515826523303986,
0.5000739693641663,
0.2046947181224823,
0.3373531103134155,
-0.016499238088726997,
0.2629229426383972,
-0.559946596622467,
0.14813187718391418,
0.1243075430393219,
0.0656888335943222,
-0.19953610002994537,
0.50825035572052,
-0.3610917925834656,
0.01320682093501091,
0.04029087722301483,
-0.21499046683311462,
-0.29461055994033813,
0.12881769239902496,
-0.24047616124153137,
0.05202632397413254,
-0.2332845777273178,
-0.35462284088134766,
0.07072079181671143,
0.25940752029418945,
0.26137447357177734,
0.09733486920595169,
-0.31669512391090393,
0.28059399127960205,
-0.010799475014209747,
0.11146862804889679,
-0.15190216898918152,
-0.042624227702617645,
0.3417814075946808,
-0.054302118718624115,
-0.3492377996444702,
0.07947905361652374,
0.0021855905652046204,
0.01590137928724289,
-0.20750845968723297,
0.30406734347343445,
0.2599038779735565,
-0.26379793882369995,
-0.004809282720088959,
0.050864312797784805,
0.11313755810260773,
-0.29162317514419556,
0.04478338733315468,
0.03542764484882355,
0.00018515810370445251,
-0.0736270397901535,
-0.17811213433742523,
-0.03325473517179489,
-0.20558947324752808,
0.43525877594947815,
0.3646925389766693,
-0.20240309834480286,
0.22720731794834137,
-0.13842682540416718,
-0.010693870484828949,
-0.18823027610778809,
-0.05039205402135849,
0.005011498928070068,
-0.6346069574356079,
0.1677824705839157,
-0.08928267657756805,
0.06845411658287048,
0.0007205456495285034,
0.03715449571609497,
-0.20732322335243225,
0.12193293869495392,
0.335753470659256,
-0.31934458017349243,
-0.10460272431373596,
0.11261545121669769,
-0.04398065432906151,
0.21888864040374756,
0.1675264537334442,
0.016091056168079376,
0.062022194266319275,
-0.06825359910726547,
-0.218296617269516,
0.27486979961395264,
0.05371439456939697,
0.0777079313993454,
0.1500217318534851,
0.15292900800704956,
0.03415443003177643,
-0.09881527721881866,
-0.003448702394962311,
0.408171683549881,
-0.25853902101516724,
-0.11168566346168518,
-0.20731057226657867,
0.16196122765541077,
0.14561448991298676,
0.04696314036846161,
-0.07619286328554153,
-0.3001351058483124,
0.12175890803337097,
-0.12486954033374786,
0.20306305587291718,
0.14618082344532013,
0.029938943684101105,
0.18495458364486694,
0.3690529763698578,
0.22891326248645782,
-0.3295464515686035,
0.3197319805622101,
-0.21708457171916962,
0.2638370990753174,
0.1564597487449646,
0.1062450036406517,
0.05301746726036072,
0.0005339980125427246,
-0.6485328674316406,
-0.1970735788345337,
0.4316672086715698,
-0.03951408714056015,
0.24489909410476685,
-0.17006288468837738,
-0.16194823384284973,
-0.1267814338207245,
0.32826709747314453,
0.12667216360569,
-0.24337530136108398,
-0.14829054474830627,
0.22378849983215332,
0.12050123512744904,
-0.42019233107566833,
0.2136106640100479,
0.19943451881408691,
0.10950016975402832,
0.08625881373882294,
0.37001940608024597,
0.21578091382980347,
-0.36727476119995117,
0.15496094524860382,
0.0548994354903698,
0.3776754140853882,
-0.010037174448370934,
0.10838714241981506,
0.19029337167739868,
0.03662124276161194,
-0.1015099585056305,
0.13440249860286713,
0.16844287514686584,
0.2110823690891266,
0.3957471251487732,
-0.213985413312912,
0.40129318833351135,
0.004708463326096535,
0.29944556951522827,
-0.13022856414318085,
-0.5607337355613708,
0.16895028948783875,
0.19120439887046814,
0.003750499337911606,
0.15558378398418427,
-0.15222886204719543,
0.1470050811767578,
0.26122337579727173,
0.017593923956155777,
-0.05896807089447975,
0.3929566740989685,
-0.17146924138069153,
-0.10880176723003387,
0.05406688153743744,
-0.3649945855140686,
-0.10649320483207703,
0.06541887670755386,
-0.007715265266597271,
-0.27844035625457764,
0.14722304046154022,
0.011826647445559502,
-0.37525036931037903,
-0.643613338470459,
0.03795941174030304,
0.17532868683338165,
-0.038571760058403015,
-0.19096407294273376,
0.3300057053565979,
0.45160189270973206,
-0.2027396261692047,
0.025638941675424576,
0.06011487543582916,
0.18555301427841187,
-0.0925271064043045,
0.07344351708889008,
0.12699517607688904,
0.1388208121061325,
0.19716084003448486,
-0.23161230981349945,
0.23091848194599152,
0.15678812563419342,
0.3323488235473633,
0.21947310864925385,
0.049766071140766144,
-0.13958902657032013,
0.1511823534965515,
0.1747255176305771,
-0.01893671602010727,
-0.7442559599876404,
0.4860442280769348,
-0.25650453567504883,
0.1820666790008545,
-0.09384506195783615,
0.21736536920070648,
-0.5013583302497864,
0.026928622275590897,
0.1161772608757019,
-0.06171036511659622,
0.13697461783885956,
-0.3925912082195282,
0.04256118834018707,
-0.21609754860401154,
-0.11763011664152145,
0.400279700756073,
0.13385768234729767,
-0.21986031532287598,
-0.1688547134399414,
-0.9552297592163086,
0.19643741846084595,
-0.2630085349082947,
-0.02605917677283287,
-0.04696103185415268,
0.08930748701095581,
-0.07206465303897858,
0.042094338685274124,
-0.028248727321624756,
0.32843753695487976,
0.05726863071322441,
-0.08176720887422562,
-0.1329108625650406,
-0.5985930562019348,
-0.342008113861084,
-0.19325417280197144,
0.12463513016700745,
-0.5115349888801575,
0.13394473493099213,
-0.20127230882644653,
-0.04082968831062317,
0.019536416977643967,
-0.29184022545814514,
0.39173397421836853,
-0.3075166940689087,
0.6385716199874878,
0.22419677674770355,
0.07731828093528748,
0.05059543251991272,
-0.21344240009784698,
-0.20476047694683075,
-0.05306307598948479,
0.06436637789011002,
-0.023583680391311646,
-0.07549542933702469,
0.11946351081132889,
-0.2897501587867737,
0.02737410180270672,
-0.363411545753479,
0.21805283427238464,
0.27979737520217896,
0.10514985024929047,
-0.13974785804748535,
-0.05201515182852745,
-0.17894107103347778,
0.21894213557243347,
0.05651576817035675,
0.3704579174518585,
-0.1460176706314087,
0.33576279878616333,
-0.27148935198783875,
-0.3385663330554962,
0.5969012975692749,
-0.2701336741447449,
-0.11375641822814941,
0.08547253906726837,
0.26478147506713867,
-0.08454610407352448,
-0.12459886819124222,
-0.41221708059310913,
0.09698319435119629,
0.5298786163330078,
0.0037385262548923492,
0.07668060064315796,
-0.029427390545606613,
-0.147975355386734,
0.07668963074684143,
0.034602053463459015,
0.1331591159105301,
0.2829136252403259,
-0.16091004014015198,
0.5144400596618652,
-0.18861639499664307
] |
https://github.com/huggingface/datasets/issues/6260 | Thanks for your reply. I met another question that I set `export HF_DATASETS_CACHE=/data/lxy/.cache` , but each time I run load_datasets, the datasets module still looking for NQ in the wrong default cache dir '/home/lxy/.cache' γHow to avoid this incorrect behavior. I am sure HF_DATASETS_CACHE was set correctly since I use echo & to check it.
![image](https://github.com/huggingface/datasets/assets/88258534/e7029f27-b9f9-496c-8948-6234ef695646)
by the way I delete the file in '/home/lxy/.cache' since I found there has some kb size file seems useless. | REUSE_DATASET_IF_EXISTS don't work | ### Describe the bug
I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
---
Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart..
![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41)
### Steps to reproduce the bug
run this two line code
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
### Expected behavior
Download behavior can be correctly follow DownloadMode
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 11.0.0
- Pandas version: 2.0.3 | 76 | REUSE_DATASET_IF_EXISTS don't work
### Describe the bug
I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
---
Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart..
![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41)
### Steps to reproduce the bug
run this two line code
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
### Expected behavior
Download behavior can be correctly follow DownloadMode
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 11.0.0
- Pandas version: 2.0.3
Thanks for your reply. I met another question that I set `export HF_DATASETS_CACHE=/data/lxy/.cache` , but each time I run load_datasets, the datasets module still looking for NQ in the wrong default cache dir '/home/lxy/.cache' γHow to avoid this incorrect behavior. I am sure HF_DATASETS_CACHE was set correctly since I use echo & to check it.
![image](https://github.com/huggingface/datasets/assets/88258534/e7029f27-b9f9-496c-8948-6234ef695646)
by the way I delete the file in '/home/lxy/.cache' since I found there has some kb size file seems useless. | [
-0.134069561958313,
-0.13712142407894135,
0.07219859957695007,
0.5493248701095581,
0.29133012890815735,
-0.18467098474502563,
0.04954855144023895,
0.15654130280017853,
0.1943472921848297,
-0.1361657828092575,
-0.04950104281306267,
0.22159229218959808,
-0.10119201987981796,
0.20472568273544312,
0.05869930237531662,
-0.12602028250694275,
-0.1600094586610794,
0.21199654042720795,
-0.14300455152988434,
-0.0989336296916008,
-0.03866023197770119,
0.19097356498241425,
-0.2256755381822586,
-0.2456776201725006,
0.1215384304523468,
0.09255044907331467,
-0.12604394555091858,
0.2026611566543579,
0.005885142832994461,
-0.33955106139183044,
0.2194303423166275,
0.13122744858264923,
0.25910085439682007,
0.17345300316810608,
-0.00012102373148081824,
-0.010480053722858429,
0.14860425889492035,
-0.12917988002300262,
-0.3417792320251465,
-0.28406065702438354,
-0.13505558669567108,
-0.18013763427734375,
0.12400587648153305,
-0.14230448007583618,
-0.07824133336544037,
-0.3056209087371826,
0.03489213436841965,
-0.3172250986099243,
0.6122864484786987,
0.26492056250572205,
0.1543155312538147,
0.30201980471611023,
-0.00034489482641220093,
-0.07136592268943787,
0.32306820154190063,
-0.0013778507709503174,
-0.0032142624258995056,
0.18194502592086792,
0.3673173189163208,
0.1930554360151291,
0.11101344227790833,
0.25248855352401733,
-0.01043701171875,
0.16786742210388184,
0.07089964300394058,
-0.24630555510520935,
-0.10717722773551941,
-0.14851193130016327,
-0.12381337583065033,
0.2195492386817932,
0.6255764365196228,
-0.3188241720199585,
-0.09855476021766663,
-0.25991207361221313,
0.10814549028873444,
-0.0480184480547905,
0.036764681339263916,
-0.056503355503082275,
-0.12354622781276703,
0.1766621321439743,
-0.06575831025838852,
-0.44306591153144836,
0.0036100372672080994,
0.09498672187328339,
0.160049706697464,
-0.025240398943424225,
-0.08766674995422363,
0.26088210940361023,
-0.15774863958358765,
0.04400748386979103,
0.15615160763263702,
-0.2584257423877716,
0.017784934490919113,
-0.06899556517601013,
-0.3201107680797577,
0.06190355867147446,
-0.023857861757278442,
0.20834365487098694,
0.1992260217666626,
0.5577998161315918,
0.18018487095832825,
0.07741988450288773,
-0.03642961382865906,
-0.1025979220867157,
0.13674406707286835,
0.2822495698928833,
0.17247718572616577,
-0.037025436758995056,
0.17704221606254578,
0.2691763639450073,
-0.21329978108406067,
-0.17415256798267365,
-0.028202621266245842,
-0.06429194658994675,
0.13019916415214539,
-0.013911099173128605,
0.39166635274887085,
0.039369136095047,
-0.1749998927116394,
0.006095539778470993,
-0.33893346786499023,
-0.14774680137634277,
0.18181732296943665,
0.1814025342464447,
-0.07362829148769379,
0.1947702020406723,
0.1099107414484024,
0.18960756063461304,
-0.11261867731809616,
-0.5384374856948853,
-0.17398113012313843,
0.010918628424406052,
-0.2533847391605377,
0.13808849453926086,
0.4117574989795685,
-0.15548306703567505,
0.3104053735733032,
0.1591479629278183,
-0.18901881575584412,
-0.23169568181037903,
0.32247233390808105,
0.19628043472766876,
-0.23128707706928253,
0.1840166449546814,
-0.03981447592377663,
0.2981906235218048,
0.09866982698440552,
0.21034438908100128,
-0.0537911131978035,
0.24725425243377686,
-0.3599343001842499,
-0.2242710292339325,
0.10359819233417511,
0.10792882740497589,
-0.2871173024177551,
0.06998264789581299,
-0.19454357028007507,
-0.23466818034648895,
0.06647235155105591,
-0.12125341594219208,
0.2142816185951233,
-0.11573571711778641,
-0.047701288014650345,
-0.28659123182296753,
0.024735823273658752,
0.7594558596611023,
0.01871553063392639,
-0.1389016956090927,
-0.20380446314811707,
-0.28089162707328796,
0.16005046665668488,
0.013536229729652405,
-0.20106211304664612,
0.14518290758132935,
-0.576196551322937,
0.00929713249206543,
0.5981290340423584,
-0.6475926637649536,
-0.4953998923301697,
0.3008107542991638,
-0.020556114614009857,
0.18937337398529053,
0.04803676903247833,
0.1653730720281601,
-0.02873171865940094,
0.11786344647407532,
-0.4990696609020233,
0.17618735134601593,
0.0681561678647995,
-0.15416908264160156,
-0.30374646186828613,
-0.24841788411140442,
-0.006014913786202669,
0.006108805537223816,
0.05930560082197189,
0.29149454832077026,
0.2446850836277008,
0.06842090934515,
0.2182202786207199,
0.15643073618412018,
0.20832034945487976,
0.15398642420768738,
0.20482438802719116,
0.01669163629412651,
0.04574361443519592,
-0.22301766276359558,
-0.626354992389679,
0.41927433013916016,
-0.4304097890853882,
-0.28717225790023804,
0.17732751369476318,
-0.13305416703224182,
-0.7127799987792969,
-0.21554529666900635,
-0.38162171840667725,
-0.5008648633956909,
0.029752716422080994,
0.46559494733810425,
0.17231032252311707,
0.3146633505821228,
-0.08919273316860199,
0.5378382205963135,
-0.11275377124547958,
0.1495356410741806,
-0.42984524369239807,
0.34677088260650635,
0.06676878780126572,
0.06254015862941742,
-0.11574424058198929,
-0.03629960119724274,
0.35534656047821045,
0.021446436643600464,
0.06906606256961823,
0.48497965931892395,
-0.16814129054546356,
0.23396039009094238,
-0.06551223993301392,
-0.2047676295042038,
0.15529455244541168,
-0.18306425213813782,
0.08903418481349945,
-0.10158079862594604,
0.23270410299301147,
-0.09155638515949249,
-0.0005503017455339432,
0.008691675961017609,
0.04252106696367264,
0.046186551451683044,
0.02724214643239975,
0.007723234593868256,
0.1264684796333313,
-0.3630935251712799,
-0.11455905437469482,
-0.15517377853393555,
0.12370286136865616,
0.11358928680419922,
0.17541727423667908,
-0.09777332097291946,
-0.1579095423221588,
0.009891606867313385,
0.32469162344932556,
0.007406488060951233,
0.08262331783771515,
-0.10479886829853058,
-0.08772721886634827,
0.09910863637924194,
0.4139786958694458,
0.293470561504364,
0.4745958149433136,
0.09268796443939209,
0.25302833318710327,
0.1902061402797699,
0.03338021785020828,
-0.33719074726104736,
0.052295152097940445,
-0.1861816793680191,
0.10773368179798126,
0.2681434750556946,
0.2305215746164322,
-0.010645700618624687,
-0.38812410831451416,
-0.10474620759487152,
0.2914777994155884,
0.17683227360248566,
-0.24554221332073212,
-0.09742508828639984,
-0.5502613186836243,
-0.30205804109573364,
-0.28970515727996826,
0.29805415868759155,
-0.02982088178396225,
-0.21134191751480103,
-0.13837234675884247,
0.3979382812976837,
0.10601960122585297,
0.31068480014801025,
0.07774898409843445,
0.05750230699777603,
0.05445700138807297,
-0.36180922389030457,
-0.31150007247924805,
0.055331259965896606,
-0.32512691617012024,
0.024259351193904877,
0.204004168510437,
0.0068533457815647125,
0.3622874319553375,
-0.19563910365104675,
0.12662240862846375,
-0.5297155380249023,
-0.02360481768846512,
0.22559010982513428,
0.27216771245002747,
0.3241579234600067,
0.02506132610142231,
0.1542762964963913,
-0.1899564564228058,
0.2035629153251648,
0.19106963276863098,
0.04519248008728027,
-0.26150915026664734,
0.04853148013353348,
0.15188618004322052,
0.2679639458656311,
-0.3242499828338623,
-0.5057278871536255,
-0.0840742439031601,
-0.30441179871559143,
0.028519513085484505,
-0.07905440032482147,
-0.09346073865890503,
0.16558091342449188,
0.07803544402122498,
0.055778779089450836,
-0.03464189171791077,
0.15101465582847595,
-0.3829450011253357,
-0.14554893970489502,
0.13320885598659515,
-0.07570255547761917,
-0.19208449125289917,
0.007949091494083405,
-0.2895650863647461,
0.2961750328540802,
0.37922582030296326,
-0.7433455586433411,
-0.19325383007526398,
-0.13053947687149048,
0.21572905778884888,
-0.0556175634264946,
0.332550972700119,
0.46910685300827026,
-0.16591709852218628,
0.06781933456659317,
-0.16338124871253967,
0.3344029486179352,
0.0994214192032814,
-0.15727448463439941,
0.391110360622406,
0.23492127656936646,
0.3198402523994446,
0.060475826263427734,
0.776856005191803,
0.18343466520309448,
0.06393775343894958,
0.7995905876159668,
-0.11566013097763062,
0.5595197081565857,
0.014287864789366722,
-0.08035371452569962,
-0.03948994725942612,
0.006425164639949799,
0.26282167434692383,
-0.02737356349825859,
0.08495078235864639,
0.22519633173942566,
-0.2789182960987091,
0.014722846448421478,
-0.45597606897354126,
-0.36804497241973877,
-0.10633528977632523,
-0.3692774474620819,
0.20044374465942383,
0.28752264380455017,
0.012013234198093414,
0.32536470890045166,
0.030852612107992172,
-0.0317084863781929,
0.177607923746109,
0.2967539429664612,
0.08896972239017487,
-0.04463847726583481,
0.28016728162765503,
-0.2934603691101074,
0.24271389842033386,
0.02782493829727173,
0.35011404752731323,
0.01873890310525894,
0.061838299036026,
0.1600463092327118,
-0.00039276108145713806,
0.726682186126709,
-0.4697984457015991,
0.09073074162006378,
-0.01040857657790184,
-0.03207971900701523,
-0.46841466426849365,
0.0034111514687538147,
-0.07141858339309692,
-0.22711704671382904,
0.006222639232873917,
0.24749329686164856,
-0.2177150547504425,
0.18773989379405975,
-0.056696098297834396,
0.39508533477783203,
-0.1750221848487854,
-0.20418773591518402,
-0.15052087604999542,
-0.4341164827346802,
-0.64959317445755,
-0.009005408734083176,
-0.1581961214542389,
-0.02384648472070694,
-0.1713476926088333,
-0.07215514034032822,
-0.29541370272636414,
-0.19431495666503906,
-0.029309377074241638,
-0.0012035295367240906,
0.29930779337882996,
-0.09327413141727448,
0.30890047550201416,
-0.09627828001976013,
-0.2262571156024933,
0.04493596404790878,
0.5049213767051697,
-0.26229241490364075,
0.06571701169013977,
-0.0914616733789444,
0.16048449277877808,
-0.1840239018201828,
0.23246929049491882,
-0.2690015137195587,
-0.037580084055662155,
-0.016851995140314102,
-0.13433155417442322,
-0.2324678897857666,
0.1444254219532013,
0.03278980404138565,
-0.11176836490631104,
-0.024248702451586723,
-0.4629920423030853,
0.38707810640335083,
0.23502127826213837,
-0.25236767530441284,
0.3634975254535675,
0.202276811003685,
-0.011874033138155937,
-0.10356593132019043,
-0.22754326462745667,
0.8382972478866577,
-0.14299793541431427,
-0.008813727647066116,
0.35956212878227234,
-0.22824715077877045,
0.8128811120986938,
-0.21808364987373352,
0.11696930229663849,
-0.2981494665145874,
-0.021829400211572647,
-0.022905059158802032,
-0.22238782048225403,
0.378264844417572,
0.0626637265086174,
0.028278641402721405,
0.5044166445732117,
0.19309452176094055,
0.33514559268951416,
-0.01686418056488037,
0.27141958475112915,
-0.555945634841919,
0.15736083686351776,
0.12523898482322693,
0.06212014704942703,
-0.1953539252281189,
0.5135384798049927,
-0.3618146777153015,
0.014998156577348709,
0.04333318769931793,
-0.21838539838790894,
-0.2896324098110199,
0.12713155150413513,
-0.2382764220237732,
0.05709908530116081,
-0.22997581958770752,
-0.35364511609077454,
0.0814407467842102,
0.2702675461769104,
0.277173787355423,
0.09420716762542725,
-0.31987595558166504,
0.26967453956604004,
-0.010081429034471512,
0.10767829418182373,
-0.15781915187835693,
-0.034271564334630966,
0.33928826451301575,
-0.05720844119787216,
-0.35446542501449585,
0.08489283919334412,
0.005525629967451096,
0.018729954957962036,
-0.20953841507434845,
0.3051297068595886,
0.2556686997413635,
-0.27805018424987793,
-0.009738776832818985,
0.05274409055709839,
0.11510981619358063,
-0.2885374426841736,
0.042785387486219406,
0.044920049607753754,
-0.0005016252398490906,
-0.06826743483543396,
-0.17281019687652588,
-0.03471880406141281,
-0.21074357628822327,
0.43371033668518066,
0.370978444814682,
-0.2025410234928131,
0.23502612113952637,
-0.1392838954925537,
-0.01181551069021225,
-0.18894778192043304,
-0.0475333109498024,
-0.0015583522617816925,
-0.6318691968917847,
0.1791989505290985,
-0.08531785756349564,
0.07649402320384979,
-0.010505393147468567,
0.03968406468629837,
-0.20488998293876648,
0.12399977445602417,
0.341500461101532,
-0.3244153559207916,
-0.10350921005010605,
0.1113366037607193,
-0.04424834996461868,
0.2238205075263977,
0.1671454906463623,
0.01773332804441452,
0.06692676246166229,
-0.060044825077056885,
-0.2160373032093048,
0.2836376130580902,
0.05145842581987381,
0.0743938758969307,
0.152080237865448,
0.15043571591377258,
0.03273552656173706,
-0.09789998829364777,
-0.007129993289709091,
0.40729671716690063,
-0.2557552456855774,
-0.11055992543697357,
-0.20849543809890747,
0.16445979475975037,
0.14369067549705505,
0.040736064314842224,
-0.08174492418766022,
-0.304492712020874,
0.1233079582452774,
-0.1188102662563324,
0.19865520298480988,
0.14117029309272766,
0.035648465156555176,
0.18817612528800964,
0.387118935585022,
0.21636246144771576,
-0.34106624126434326,
0.32584360241889954,
-0.21401537954807281,
0.24914434552192688,
0.1549827605485916,
0.10085073858499527,
0.05296225845813751,
-0.000860169529914856,
-0.6492900848388672,
-0.2003486156463623,
0.4377010464668274,
-0.044569261372089386,
0.2412041276693344,
-0.16555596888065338,
-0.1603594422340393,
-0.12561078369617462,
0.324283629655838,
0.1387760490179062,
-0.24097219109535217,
-0.14037339389324188,
0.22450049221515656,
0.11656215041875839,
-0.42587703466415405,
0.21388833224773407,
0.20282751321792603,
0.11090801656246185,
0.08242813497781754,
0.3716834783554077,
0.20932869613170624,
-0.3626484274864197,
0.15061672031879425,
0.04982280731201172,
0.38194888830184937,
-0.014816829934716225,
0.11642760783433914,
0.1814936399459839,
0.038295045495033264,
-0.10222633183002472,
0.14748166501522064,
0.18266811966896057,
0.19718939065933228,
0.38016408681869507,
-0.216102734208107,
0.3881981670856476,
0.00525167491286993,
0.29459425806999207,
-0.12274344265460968,
-0.5602104663848877,
0.16577601432800293,
0.19412755966186523,
-0.004600588232278824,
0.13905513286590576,
-0.16254787147045135,
0.1487959623336792,
0.265153706073761,
0.010042492300271988,
-0.05622745305299759,
0.3987008333206177,
-0.1716780811548233,
-0.11038735508918762,
0.05049435794353485,
-0.36744654178619385,
-0.10425926744937897,
0.062073469161987305,
-0.006842509843409061,
-0.284417062997818,
0.14034146070480347,
0.011565079912543297,
-0.3717252314090729,
-0.639250636100769,
0.03745464235544205,
0.17763321101665497,
-0.045242730528116226,
-0.1874677538871765,
0.337541788816452,
0.43699222803115845,
-0.19602525234222412,
0.02643432468175888,
0.0707012191414833,
0.18309882283210754,
-0.09101415425539017,
0.07741763442754745,
0.13042184710502625,
0.14736703038215637,
0.18949659168720245,
-0.2195180207490921,
0.23274275660514832,
0.15569226443767548,
0.3288781940937042,
0.2125983089208603,
0.046940915286540985,
-0.13569986820220947,
0.15568889677524567,
0.17253202199935913,
-0.011950299143791199,
-0.7519320845603943,
0.4886151850223541,
-0.2509457468986511,
0.18015480041503906,
-0.09652817249298096,
0.214565247297287,
-0.5054699778556824,
0.03184139356017113,
0.11623455584049225,
-0.06535017490386963,
0.13701416552066803,
-0.39105406403541565,
0.03947778046131134,
-0.2166457176208496,
-0.12173040211200714,
0.40966445207595825,
0.1415286660194397,
-0.2229543775320053,
-0.17125806212425232,
-0.9463502168655396,
0.18952926993370056,
-0.2607569098472595,
-0.02551434189081192,
-0.05025140941143036,
0.08489473164081573,
-0.07771508395671844,
0.04267360642552376,
-0.021733388304710388,
0.3299200236797333,
0.054894864559173584,
-0.079952672123909,
-0.133224219083786,
-0.5935270190238953,
-0.3432648479938507,
-0.17805622518062592,
0.12394902855157852,
-0.4969721734523773,
0.13775628805160522,
-0.19934198260307312,
-0.047316789627075195,
0.026763752102851868,
-0.29012200236320496,
0.3901834785938263,
-0.31293055415153503,
0.6333395838737488,
0.21892015635967255,
0.083634153008461,
0.05174188315868378,
-0.2052709460258484,
-0.18692374229431152,
-0.060786567628383636,
0.06011560186743736,
-0.022329848259687424,
-0.06989318132400513,
0.11354389041662216,
-0.29472771286964417,
0.021552888676524162,
-0.3623368740081787,
0.22178778052330017,
0.2744319438934326,
0.09703142940998077,
-0.13409608602523804,
-0.0609285794198513,
-0.16880565881729126,
0.21201935410499573,
0.05913881957530975,
0.3691788911819458,
-0.15137842297554016,
0.33345189690589905,
-0.27261337637901306,
-0.3304838240146637,
0.6015129685401917,
-0.26968660950660706,
-0.11082760244607925,
0.07976076751947403,
0.26652753353118896,
-0.08299684524536133,
-0.12481991946697235,
-0.4048042297363281,
0.09531795978546143,
0.5409947037696838,
-0.001984654925763607,
0.08322401344776154,
-0.022134415805339813,
-0.1457139253616333,
0.08042899519205093,
0.03233356773853302,
0.1273401975631714,
0.2870872914791107,
-0.15962806344032288,
0.5040501356124878,
-0.19299642741680145
] |
https://github.com/huggingface/datasets/issues/6260 | You need to set this variable before the `datasets` import. Then, you can use `import datasets; datasets.config.HF_DATASETS_CACHE` to verify the cache location. | REUSE_DATASET_IF_EXISTS don't work | ### Describe the bug
I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
---
Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart..
![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41)
### Steps to reproduce the bug
run this two line code
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
### Expected behavior
Download behavior can be correctly follow DownloadMode
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 11.0.0
- Pandas version: 2.0.3 | 22 | REUSE_DATASET_IF_EXISTS don't work
### Describe the bug
I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
---
Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart..
![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41)
### Steps to reproduce the bug
run this two line code
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
### Expected behavior
Download behavior can be correctly follow DownloadMode
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 11.0.0
- Pandas version: 2.0.3
You need to set this variable before the `datasets` import. Then, you can use `import datasets; datasets.config.HF_DATASETS_CACHE` to verify the cache location. | [
-0.14463192224502563,
-0.13387562334537506,
0.07233297824859619,
0.5405831336975098,
0.28377199172973633,
-0.18812668323516846,
0.03885795176029205,
0.1619945466518402,
0.19530384242534637,
-0.1288692057132721,
-0.04892313480377197,
0.21878160536289215,
-0.10770003497600555,
0.1987621784210205,
0.06642161309719086,
-0.12368109077215195,
-0.15948446094989777,
0.20950740575790405,
-0.14458805322647095,
-0.10146252065896988,
-0.041355300694704056,
0.19094912707805634,
-0.2146054059267044,
-0.24972712993621826,
0.12113826721906662,
0.0865841805934906,
-0.12237252295017242,
0.2068062722682953,
0.011639051139354706,
-0.34053105115890503,
0.21157214045524597,
0.13619160652160645,
0.2501826584339142,
0.16013064980506897,
-0.0001204300788231194,
-0.008279383182525635,
0.14771491289138794,
-0.12565025687217712,
-0.3485661745071411,
-0.28005945682525635,
-0.12123966217041016,
-0.18994426727294922,
0.12338252365589142,
-0.1387653946876526,
-0.07820490002632141,
-0.3124699294567108,
0.03788720816373825,
-0.31123238801956177,
0.6140847206115723,
0.2610144019126892,
0.16003137826919556,
0.3049946427345276,
-0.0024062171578407288,
-0.06984619051218033,
0.3265073299407959,
-0.00545201450586319,
-0.007066681981086731,
0.1783221960067749,
0.3613841235637665,
0.1889009177684784,
0.1044749915599823,
0.26122385263442993,
-0.012436453253030777,
0.1711214780807495,
0.07062557339668274,
-0.2424589991569519,
-0.11702855676412582,
-0.14655417203903198,
-0.12033521384000778,
0.227071613073349,
0.610839307308197,
-0.3156994581222534,
-0.09913752973079681,
-0.27621161937713623,
0.1054697334766388,
-0.04675453528761864,
0.04180241376161575,
-0.06583273410797119,
-0.12565878033638,
0.17012743651866913,
-0.06960124522447586,
-0.4417111873626709,
0.014479607343673706,
0.09732979536056519,
0.15923960506916046,
-0.02156851813197136,
-0.09366381168365479,
0.2616143226623535,
-0.14634254574775696,
0.03997549042105675,
0.14250728487968445,
-0.24950078129768372,
0.014661239460110664,
-0.07056093215942383,
-0.31568679213523865,
0.06299823522567749,
-0.009378045797348022,
0.20594626665115356,
0.1996576189994812,
0.5541062355041504,
0.17802457511425018,
0.06868650019168854,
-0.035617634654045105,
-0.1028611809015274,
0.13387231528759003,
0.2917245030403137,
0.16462233662605286,
-0.04209751635789871,
0.17762264609336853,
0.27746209502220154,
-0.20546185970306396,
-0.17300614714622498,
-0.024530068039894104,
-0.06781607866287231,
0.12923157215118408,
-0.013775684870779514,
0.40342193841934204,
0.04224309325218201,
-0.18376067280769348,
0.009771235287189484,
-0.32814541459083557,
-0.14375606179237366,
0.17793747782707214,
0.17574797570705414,
-0.07986009120941162,
0.1970226913690567,
0.10715334862470627,
0.19078148901462555,
-0.119000643491745,
-0.535019040107727,
-0.17935362458229065,
0.00960526242852211,
-0.24174201488494873,
0.1422516405582428,
0.40864431858062744,
-0.15091434121131897,
0.31938421726226807,
0.15841448307037354,
-0.18178924918174744,
-0.22111885249614716,
0.3221270442008972,
0.20359498262405396,
-0.22779197990894318,
0.19382673501968384,
-0.042960185557603836,
0.29917773604393005,
0.11047650873661041,
0.20505210757255554,
-0.058358222246170044,
0.23419690132141113,
-0.35558372735977173,
-0.22405683994293213,
0.1007210984826088,
0.11214737594127655,
-0.28954118490219116,
0.07140880823135376,
-0.18603157997131348,
-0.22672177851200104,
0.06878385692834854,
-0.12437579035758972,
0.22152692079544067,
-0.11933664977550507,
-0.04305751994252205,
-0.28517746925354004,
0.030855558812618256,
0.7544500231742859,
0.015818968415260315,
-0.13921509683132172,
-0.2037678360939026,
-0.2796002924442291,
0.15721002221107483,
0.009874386712908745,
-0.19975778460502625,
0.14771482348442078,
-0.567278265953064,
0.008854866027832031,
0.5867137908935547,
-0.6482793092727661,
-0.4947333335876465,
0.291878879070282,
-0.023898646235466003,
0.204108327627182,
0.042487479746341705,
0.1669483631849289,
-0.02942059561610222,
0.11475928872823715,
-0.49460843205451965,
0.18712101876735687,
0.06660375744104385,
-0.15228009223937988,
-0.30210089683532715,
-0.24621468782424927,
-0.015336351469159126,
0.009028315544128418,
0.05364370718598366,
0.28175538778305054,
0.2388380467891693,
0.06832341849803925,
0.20453888177871704,
0.1593068540096283,
0.2079995721578598,
0.14938423037528992,
0.19535253942012787,
0.019988536834716797,
0.03961014002561569,
-0.22135937213897705,
-0.632084310054779,
0.4225318431854248,
-0.42661240696907043,
-0.2850031554698944,
0.16582012176513672,
-0.13779211044311523,
-0.7028723955154419,
-0.2146177887916565,
-0.38177600502967834,
-0.5047488212585449,
0.03896733373403549,
0.4750846028327942,
0.17015400528907776,
0.3151687681674957,
-0.08977935463190079,
0.5291027426719666,
-0.10666490346193314,
0.1461535543203354,
-0.4453786015510559,
0.3326664865016937,
0.06849821656942368,
0.06618040800094604,
-0.11362265050411224,
-0.03570595011115074,
0.35281848907470703,
0.024382073432207108,
0.07490883767604828,
0.49466049671173096,
-0.17636781930923462,
0.23804950714111328,
-0.07243654876947403,
-0.20128025114536285,
0.14834557473659515,
-0.17677244544029236,
0.08618263155221939,
-0.09555353224277496,
0.22597375512123108,
-0.08824518322944641,
-0.003652108833193779,
0.015698689967393875,
0.0426473468542099,
0.047872234135866165,
0.02781379222869873,
0.010811775922775269,
0.12848711013793945,
-0.36053338646888733,
-0.12161542475223541,
-0.16218173503875732,
0.1249602660536766,
0.1080566793680191,
0.17747943103313446,
-0.09876611828804016,
-0.15591342747211456,
0.01602327451109886,
0.33755043148994446,
0.004930153489112854,
0.08442015945911407,
-0.10157152265310287,
-0.08767062425613403,
0.09323584288358688,
0.42083820700645447,
0.2938041388988495,
0.4631328880786896,
0.09221470355987549,
0.2554774582386017,
0.19177308678627014,
0.016522306948900223,
-0.3379057049751282,
0.04443645849823952,
-0.1872270107269287,
0.10754826664924622,
0.2679644823074341,
0.23161061108112335,
-0.0066866762936115265,
-0.3955308794975281,
-0.10457949340343475,
0.27722036838531494,
0.17634202539920807,
-0.24126505851745605,
-0.09177707880735397,
-0.5516420006752014,
-0.2947016954421997,
-0.2861793637275696,
0.29862016439437866,
-0.036476075649261475,
-0.21638727188110352,
-0.12602058053016663,
0.39038336277008057,
0.08595165610313416,
0.30771899223327637,
0.08278749138116837,
0.052775464951992035,
0.04826362431049347,
-0.3701397478580475,
-0.31069329380989075,
0.05514694005250931,
-0.32719656825065613,
0.028303667902946472,
0.19811785221099854,
0.007763393223285675,
0.3712731599807739,
-0.19693395495414734,
0.12861129641532898,
-0.5300576686859131,
-0.0322553887963295,
0.2249336838722229,
0.2627049386501312,
0.3286096155643463,
0.02931554801762104,
0.15170028805732727,
-0.18661566078662872,
0.19581389427185059,
0.19699984788894653,
0.043656110763549805,
-0.2599908709526062,
0.05168867111206055,
0.1455032229423523,
0.26743051409721375,
-0.3269193768501282,
-0.5112130641937256,
-0.0719817578792572,
-0.31025564670562744,
0.034478433430194855,
-0.07355216890573502,
-0.09626015275716782,
0.1771671622991562,
0.0804780125617981,
0.057661715894937515,
-0.04018942639231682,
0.15898331999778748,
-0.38773587346076965,
-0.1435794085264206,
0.13004469871520996,
-0.07859981060028076,
-0.18968921899795532,
0.0023779571056365967,
-0.28886735439300537,
0.29599303007125854,
0.3794747292995453,
-0.7468221187591553,
-0.1953006386756897,
-0.136057049036026,
0.21824334561824799,
-0.05445532128214836,
0.3325710892677307,
0.476938396692276,
-0.16429097950458527,
0.061888448894023895,
-0.15943007171154022,
0.3354215621948242,
0.09808214008808136,
-0.1592281460762024,
0.3896035850048065,
0.227847158908844,
0.3264620900154114,
0.060937248170375824,
0.780042290687561,
0.17509901523590088,
0.06923036277294159,
0.791624903678894,
-0.11108056455850601,
0.5752268433570862,
0.0023918822407722473,
-0.07905071973800659,
-0.03094378300011158,
0.005561500787734985,
0.25186747312545776,
-0.020580429583787918,
0.08734140545129776,
0.22880442440509796,
-0.2748055160045624,
0.02566739171743393,
-0.45479828119277954,
-0.3668736219406128,
-0.09909150749444962,
-0.3697861135005951,
0.18997639417648315,
0.29197418689727783,
0.014922477304935455,
0.3236948847770691,
0.031018726527690887,
-0.028593391180038452,
0.17240244150161743,
0.2947464883327484,
0.09045650064945221,
-0.053509004414081573,
0.2781216502189636,
-0.3023497760295868,
0.24050980806350708,
0.02657005563378334,
0.3423612713813782,
0.01787162572145462,
0.04848051071166992,
0.15417063236236572,
-0.005205858498811722,
0.7199457287788391,
-0.46442392468452454,
0.08338242024183273,
-0.00687967985868454,
-0.03712727874517441,
-0.47244736552238464,
-0.0012834593653678894,
-0.07487747073173523,
-0.2266874760389328,
0.01047716848552227,
0.2533005475997925,
-0.22590604424476624,
0.19044244289398193,
-0.05110438913106918,
0.3973706066608429,
-0.17276588082313538,
-0.19124577939510345,
-0.1609068512916565,
-0.4423466920852661,
-0.6523942351341248,
-0.011323276907205582,
-0.1585259735584259,
-0.027555618435144424,
-0.16477762162685394,
-0.06408654153347015,
-0.2947767972946167,
-0.19021818041801453,
-0.03887821361422539,
0.006805893033742905,
0.29857903718948364,
-0.08822435140609741,
0.30518245697021484,
-0.08555183559656143,
-0.2297862470149994,
0.035054661333560944,
0.5147709846496582,
-0.25981616973876953,
0.0632161945104599,
-0.09653063118457794,
0.17264553904533386,
-0.18614068627357483,
0.23835207521915436,
-0.2720459997653961,
-0.04531688615679741,
-0.012638414278626442,
-0.12573757767677307,
-0.2310205101966858,
0.15392112731933594,
0.03929457813501358,
-0.1186891570687294,
-0.017362121492624283,
-0.4597603678703308,
0.3925238251686096,
0.23810544610023499,
-0.2529767155647278,
0.36579760909080505,
0.20136073231697083,
-0.0065704043954610825,
-0.10129580646753311,
-0.21526092290878296,
0.8302180171012878,
-0.15037332475185394,
0.0004799715243279934,
0.37152746319770813,
-0.22883260250091553,
0.8163238763809204,
-0.22247251868247986,
0.11131596565246582,
-0.28908684849739075,
-0.024958282709121704,
-0.013726752251386642,
-0.20753812789916992,
0.3729343116283417,
0.0571354478597641,
0.029257386922836304,
0.5030311346054077,
0.19831380248069763,
0.33793461322784424,
-0.02359740622341633,
0.2682618498802185,
-0.5539904832839966,
0.14578692615032196,
0.11562010645866394,
0.06870642304420471,
-0.19639432430267334,
0.5111642479896545,
-0.3626146912574768,
0.025105148553848267,
0.05581595003604889,
-0.22672230005264282,
-0.28628525137901306,
0.12603993713855743,
-0.23268723487854004,
0.05179512873291969,
-0.22364859282970428,
-0.35063669085502625,
0.05366629362106323,
0.26686203479766846,
0.27505505084991455,
0.09998270124197006,
-0.3159371018409729,
0.2718591094017029,
-0.008354384452104568,
0.1102471724152565,
-0.15593841671943665,
-0.038566719740629196,
0.34684181213378906,
-0.0582793727517128,
-0.3416522145271301,
0.0797380656003952,
0.0031204447150230408,
0.014583058655261993,
-0.20686353743076324,
0.3075658977031708,
0.24814152717590332,
-0.2663498520851135,
-0.006178967654705048,
0.04791128635406494,
0.1266941875219345,
-0.29152774810791016,
0.04638916626572609,
0.04053577780723572,
0.003281928598880768,
-0.08029823750257492,
-0.17102815210819244,
-0.03798861801624298,
-0.21374152600765228,
0.42696675658226013,
0.3727192282676697,
-0.20382460951805115,
0.22856712341308594,
-0.1379031538963318,
-0.012349843978881836,
-0.18978923559188843,
-0.04974912852048874,
0.007876954972743988,
-0.631647527217865,
0.1799447387456894,
-0.08776035904884338,
0.062606081366539,
-0.012328758835792542,
0.04658084735274315,
-0.20004403591156006,
0.1123727560043335,
0.34073132276535034,
-0.3149610757827759,
-0.10191359370946884,
0.11778560280799866,
-0.03888557478785515,
0.2257883995771408,
0.1739884614944458,
0.00833817943930626,
0.06029904633760452,
-0.04827520251274109,
-0.2224801480770111,
0.27033740282058716,
0.04836977273225784,
0.0789923369884491,
0.1420193314552307,
0.15323840081691742,
0.04476863890886307,
-0.08593630790710449,
-0.002475690096616745,
0.40233704447746277,
-0.25664255023002625,
-0.11677418649196625,
-0.21074959635734558,
0.15899868309497833,
0.1412411332130432,
0.039815403521060944,
-0.07992599904537201,
-0.29554906487464905,
0.12508037686347961,
-0.13172921538352966,
0.20728720724582672,
0.13931582868099213,
0.037830669432878494,
0.18092530965805054,
0.38294583559036255,
0.2226572334766388,
-0.3227071762084961,
0.3181180953979492,
-0.2156737744808197,
0.2466837465763092,
0.15195871889591217,
0.09853754937648773,
0.04613366350531578,
-0.005873352289199829,
-0.6403781175613403,
-0.19823893904685974,
0.44193118810653687,
-0.042542964220047,
0.23206639289855957,
-0.1612709015607834,
-0.16718676686286926,
-0.13045716285705566,
0.3307163119316101,
0.13601133227348328,
-0.23888751864433289,
-0.1434718817472458,
0.22633109986782074,
0.1216958612203598,
-0.42446476221084595,
0.21524475514888763,
0.1985204964876175,
0.11134827136993408,
0.0895836353302002,
0.3676212430000305,
0.208948016166687,
-0.35960084199905396,
0.15728330612182617,
0.04800531640648842,
0.37507280707359314,
-0.015705574303865433,
0.11848786473274231,
0.18122299015522003,
0.02617727965116501,
-0.10318832844495773,
0.1472712606191635,
0.1758260875940323,
0.2063864916563034,
0.38087958097457886,
-0.219530388712883,
0.3925727903842926,
0.0021174652501940727,
0.2967345714569092,
-0.12503156065940857,
-0.5571512579917908,
0.16872408986091614,
0.18739324808120728,
0.0000950843095779419,
0.14579840004444122,
-0.15930011868476868,
0.1501261591911316,
0.2620437443256378,
0.006724890321493149,
-0.06324338167905807,
0.40212881565093994,
-0.17260031402111053,
-0.11353641748428345,
0.046118974685668945,
-0.3625096082687378,
-0.10057780146598816,
0.06700372695922852,
-0.005961926653981209,
-0.29443737864494324,
0.14441528916358948,
0.006212905049324036,
-0.373476505279541,
-0.6411138772964478,
0.042947426438331604,
0.16518014669418335,
-0.047020331025123596,
-0.18265575170516968,
0.339445024728775,
0.44687262177467346,
-0.19586603343486786,
0.02994125336408615,
0.07394196093082428,
0.18784376978874207,
-0.08967714756727219,
0.07475844025611877,
0.13029402494430542,
0.14307191967964172,
0.19030801951885223,
-0.23119033873081207,
0.23301804065704346,
0.14993837475776672,
0.32816675305366516,
0.21827858686447144,
0.05204307660460472,
-0.14313210546970367,
0.15947288274765015,
0.1622869074344635,
-0.011386482045054436,
-0.749902069568634,
0.4834504723548889,
-0.2554844319820404,
0.18496349453926086,
-0.09736264497041702,
0.21558181941509247,
-0.5099029541015625,
0.02828528732061386,
0.11054357886314392,
-0.06194987893104553,
0.13551944494247437,
-0.39428308606147766,
0.042394209653139114,
-0.21335691213607788,
-0.11386314779520035,
0.4100411534309387,
0.13606250286102295,
-0.21335655450820923,
-0.16879506409168243,
-0.9531342387199402,
0.1928333193063736,
-0.2658545672893524,
-0.027966007590293884,
-0.04838553071022034,
0.09340043365955353,
-0.07775864005088806,
0.05531098321080208,
-0.03260784596204758,
0.32570120692253113,
0.057320162653923035,
-0.09225987643003464,
-0.12892767786979675,
-0.5944647192955017,
-0.34304141998291016,
-0.18914808332920074,
0.12749820947647095,
-0.49789005517959595,
0.13270707428455353,
-0.19912007451057434,
-0.04400785639882088,
0.028628505766391754,
-0.28754645586013794,
0.3838685154914856,
-0.3174600303173065,
0.6405035257339478,
0.2289232313632965,
0.07723298668861389,
0.04616371542215347,
-0.21179914474487305,
-0.2055487334728241,
-0.05769563093781471,
0.052016474306583405,
-0.027581822127103806,
-0.07901852577924728,
0.12690278887748718,
-0.28830626606941223,
0.02583504468202591,
-0.3596808910369873,
0.2276507318019867,
0.28331783413887024,
0.09933806210756302,
-0.12846073508262634,
-0.05225582420825958,
-0.17022886872291565,
0.21268415451049805,
0.05820707231760025,
0.3733420968055725,
-0.1478005051612854,
0.3342348337173462,
-0.2732306718826294,
-0.3394051790237427,
0.6084706783294678,
-0.2736005187034607,
-0.11045720428228378,
0.0777568370103836,
0.266414612531662,
-0.07986637204885483,
-0.13438695669174194,
-0.39953282475471497,
0.09995570778846741,
0.5296890139579773,
0.0031348317861557007,
0.0805291160941124,
-0.021647579967975616,
-0.14950191974639893,
0.07379290461540222,
0.026999875903129578,
0.1340329349040985,
0.29092511534690857,
-0.16196060180664062,
0.5082401633262634,
-0.1925857663154602
] |
https://github.com/huggingface/datasets/issues/6259 | Thanks for reporting this issue! We should be able to avoid this by making our `glob` patterns more precise. In the meantime, you can load the dataset by directly assigning splits to the data files:
```python
from datasets import load_dataset
ds = load_dataset("parquet", data_files={"train": "testing123/train/output_train.parquet", "validation": "testing123/val/output_val.parquet"})
``` | Duplicated Rows When Loading Parquet Files from Root Directory with Subdirectories | ### Describe the bug
When parquet files are saved in "train" and "val" subdirectories under a root directory, and datasets are then loaded using `load_dataset("parquet", data_dir="root_directory")`, the resulting dataset has duplicated rows for both the training and validation sets.
### Steps to reproduce the bug
1. Create a root directory, e.g., "testing123".
2. Under "testing123", create two subdirectories: "train" and "val".
3. Create and save a parquet file with 3 unique rows in the "train" subdirectory.
4. Create and save a parquet file with 4 unique rows in the "val" subdirectory.
5. Load the datasets from the root directory using `load_dataset("parquet", data_dir="testing123")`
6. Iterate through the datasets and print the rows
Here's a collab reproducing these steps:
https://colab.research.google.com/drive/11NEdImnQ3OqJlwKSHRMhr7jCBesNdLY4?usp=sharing
### Expected behavior
- Training set should contain 3 unique rows.
- Validation set should contain 4 unique rows.
### Environment info
- `datasets` version: 2.14.5
- Platform: Linux-5.15.120+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.17.2
- PyArrow version: 9.0.0
- Pandas version: 1.5.3 | 48 | Duplicated Rows When Loading Parquet Files from Root Directory with Subdirectories
### Describe the bug
When parquet files are saved in "train" and "val" subdirectories under a root directory, and datasets are then loaded using `load_dataset("parquet", data_dir="root_directory")`, the resulting dataset has duplicated rows for both the training and validation sets.
### Steps to reproduce the bug
1. Create a root directory, e.g., "testing123".
2. Under "testing123", create two subdirectories: "train" and "val".
3. Create and save a parquet file with 3 unique rows in the "train" subdirectory.
4. Create and save a parquet file with 4 unique rows in the "val" subdirectory.
5. Load the datasets from the root directory using `load_dataset("parquet", data_dir="testing123")`
6. Iterate through the datasets and print the rows
Here's a collab reproducing these steps:
https://colab.research.google.com/drive/11NEdImnQ3OqJlwKSHRMhr7jCBesNdLY4?usp=sharing
### Expected behavior
- Training set should contain 3 unique rows.
- Validation set should contain 4 unique rows.
### Environment info
- `datasets` version: 2.14.5
- Platform: Linux-5.15.120+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.17.2
- PyArrow version: 9.0.0
- Pandas version: 1.5.3
Thanks for reporting this issue! We should be able to avoid this by making our `glob` patterns more precise. In the meantime, you can load the dataset by directly assigning splits to the data files:
```python
from datasets import load_dataset
ds = load_dataset("parquet", data_files={"train": "testing123/train/output_train.parquet", "validation": "testing123/val/output_val.parquet"})
``` | [
0.07662573456764221,
-0.0835937038064003,
0.09032228589057922,
0.7221016883850098,
0.19889137148857117,
0.22331413626670837,
0.21559706330299377,
0.19769978523254395,
-0.14783155918121338,
0.04660504311323166,
0.019547127187252045,
0.2700917422771454,
-0.021230950951576233,
0.1860109567642212,
0.1538056880235672,
0.023287547752261162,
0.09361353516578674,
-0.14934909343719482,
-0.02024160698056221,
0.0014722496271133423,
-0.11385448276996613,
0.17662310600280762,
-0.0368182510137558,
-0.10961262136697769,
-0.5691543817520142,
0.060923874378204346,
-0.3677496910095215,
0.46481025218963623,
-0.04680933803319931,
-0.2637596130371094,
0.3947998583316803,
-0.19325628876686096,
-0.04132094979286194,
0.45542195439338684,
-0.0001095176994567737,
0.10039093345403671,
0.007274959236383438,
-0.02122439071536064,
-0.2243548333644867,
-0.20958290994167328,
-0.026955224573612213,
-0.1543753445148468,
0.3334336280822754,
-0.26089853048324585,
-0.17808479070663452,
-0.4840853214263916,
-0.2254619151353836,
0.08794425427913666,
0.18728943169116974,
0.08703689277172089,
0.16943061351776123,
-0.015625443309545517,
-0.14413918554782867,
0.22810035943984985,
0.34772247076034546,
0.17182347178459167,
0.03927028924226761,
0.6021259427070618,
0.1602078676223755,
-0.021319158375263214,
0.08661125600337982,
0.08262627571821213,
0.21541094779968262,
-0.07138778269290924,
0.133067786693573,
0.2685393691062927,
0.23711708188056946,
0.0473109595477581,
-0.088571697473526,
0.1840844750404358,
0.09784647077322006,
-0.4417923390865326,
-0.20975497364997864,
-0.4602929949760437,
0.2863762378692627,
-0.36100926995277405,
0.08403772115707397,
0.5416231751441956,
0.19305461645126343,
0.05469156429171562,
0.17942260205745697,
0.003085024654865265,
-0.021465115249156952,
-0.1944301724433899,
-0.04208666831254959,
0.010540317744016647,
0.17495331168174744,
-0.06902320683002472,
-0.012253081426024437,
-0.010560314171016216,
-0.04440917819738388,
-0.37668678164482117,
-0.1635206639766693,
0.13317632675170898,
-0.4460117816925049,
-0.11186027526855469,
-0.24267353117465973,
-0.07521069049835205,
-0.04608094319701195,
0.24000726640224457,
0.20307888090610504,
-0.18460965156555176,
0.16211768984794617,
0.15909059345722198,
0.4836537837982178,
0.21103447675704956,
-0.3949893116950989,
0.4127553105354309,
-0.015238195657730103,
0.16756053268909454,
-0.2746146321296692,
0.055691637098789215,
0.0712389349937439,
-0.07139395922422409,
0.026400558650493622,
-0.14373530447483063,
0.34548962116241455,
-0.14070183038711548,
-0.33232712745666504,
0.24822357296943665,
-0.5657114386558533,
-0.12926355004310608,
0.10811400413513184,
0.0823964774608612,
0.08067160844802856,
0.14907562732696533,
-0.10286420583724976,
0.3081285059452057,
-0.35301339626312256,
-0.11885951459407806,
-0.3529728055000305,
0.27448219060897827,
-0.3046337366104126,
0.004597563296556473,
0.11545587331056595,
-0.28203439712524414,
0.11732661724090576,
0.6057761311531067,
-0.010881040245294571,
-0.38675642013549805,
0.21186894178390503,
-0.29075467586517334,
-0.20092767477035522,
0.20399770140647888,
-0.03233661130070686,
-0.01893780753016472,
0.11144664883613586,
-0.08739718049764633,
-0.025646686553955078,
-0.038940321654081345,
-0.3010715842247009,
-0.21258628368377686,
0.04206519573926926,
0.22151990234851837,
-0.0002910196781158447,
0.14042043685913086,
-0.49938520789146423,
0.08019787073135376,
0.16840675473213196,
0.03263375908136368,
-0.11038543283939362,
-0.265292763710022,
-0.08148853480815887,
-0.221269890666008,
0.123654305934906,
0.27239012718200684,
-0.24753867089748383,
0.060244426131248474,
0.13578568398952484,
-0.0026209764182567596,
0.22231841087341309,
0.551384687423706,
-0.16340726613998413,
0.35957881808280945,
-0.26670190691947937,
0.2871883809566498,
0.1769701987504959,
-0.12149721384048462,
-0.04487045481801033,
0.12089726328849792,
-0.20202875137329102,
0.27302640676498413,
0.2018374800682068,
-0.09525588154792786,
0.33621519804000854,
-0.191642627120018,
0.016177017241716385,
0.2018398493528366,
-0.009522903710603714,
-0.05856844782829285,
-0.46126818656921387,
-0.15285703539848328,
0.23615065217018127,
0.06999285519123077,
-0.30907270312309265,
-0.2850581705570221,
0.16590410470962524,
-0.2723163366317749,
0.2836032807826996,
-0.3082815110683441,
-0.05768277496099472,
0.10138869285583496,
0.17047560214996338,
0.46894943714141846,
0.17191839218139648,
-0.015431851148605347,
-0.49496328830718994,
0.23542669415473938,
-0.1400263011455536,
-0.1279776692390442,
0.027830073609948158,
-0.17159759998321533,
-0.14706428349018097,
-0.17214801907539368,
-0.3644988238811493,
-0.23927167057991028,
0.13277769088745117,
0.16997522115707397,
-0.02969798445701599,
-0.20452579855918884,
-0.10802005976438522,
0.2476876825094223,
-0.41165634989738464,
0.2574779987335205,
-0.3211025595664978,
0.7534313201904297,
-0.07983231544494629,
-0.3014858365058899,
0.1763327270746231,
0.17819666862487793,
0.3111236095428467,
-0.30470749735832214,
-0.003905847668647766,
0.3642284572124481,
0.2780022919178009,
0.11713060736656189,
-0.013469245284795761,
0.037449948489665985,
0.23253019154071808,
-0.038981638848781586,
-0.15544027090072632,
-0.05404691398143768,
0.11108401417732239,
-0.009383857250213623,
-0.40810802578926086,
0.3998832702636719,
-0.05333029478788376,
-0.09837940335273743,
0.026053406298160553,
-0.12178722023963928,
0.06872657686471939,
-0.05200563743710518,
0.07075818628072739,
-0.23784473538398743,
0.12053729593753815,
0.18029126524925232,
-0.044459156692028046,
0.3674255609512329,
-0.397379606962204,
0.0738542228937149,
0.06037468835711479,
-0.2121776044368744,
-0.09475912898778915,
-0.10074831545352936,
0.1579401195049286,
-0.20153933763504028,
-0.02942327782511711,
0.611026406288147,
0.36362096667289734,
0.2105455845594406,
0.13011351227760315,
0.24485723674297333,
-0.21746540069580078,
-0.06989648938179016,
0.1341078281402588,
-0.13738131523132324,
0.01088278740644455,
0.22728519141674042,
0.05687222629785538,
0.10961945354938507,
-0.5065833330154419,
0.3146957457065582,
0.27430564165115356,
0.13975992798805237,
-0.3243860602378845,
0.0846329927444458,
-0.4364926815032959,
0.26531100273132324,
-0.5782896876335144,
0.17539189755916595,
0.028845179826021194,
-0.00648488849401474,
0.15181994438171387,
0.3566747009754181,
-0.12008097767829895,
0.10432752221822739,
-0.0006416216492652893,
0.28610432147979736,
-0.16154177486896515,
-0.09511317312717438,
-0.09219874441623688,
0.17780649662017822,
-0.33129051327705383,
0.1237403154373169,
0.22379712760448456,
0.2825009524822235,
0.22637687623500824,
0.04064463824033737,
-0.1357031762599945,
-0.5004898309707642,
-0.20405298471450806,
0.12824532389640808,
-0.12954269349575043,
0.21062465012073517,
0.03587432578206062,
-0.03214041143655777,
0.016962699592113495,
-0.3683328628540039,
0.07813899964094162,
0.09252004325389862,
-0.2783012092113495,
0.022580042481422424,
0.18628612160682678,
0.09241648018360138,
-0.12982147932052612,
-0.590656578540802,
-0.10979253053665161,
-0.053921155631542206,
-0.009603636339306831,
0.05232253670692444,
0.03993096202611923,
-0.304887592792511,
-0.22025834023952484,
-0.20226866006851196,
-0.07127566635608673,
-0.008506542071700096,
-0.32570165395736694,
-0.18150362372398376,
0.11807160079479218,
-0.03411848843097687,
-0.24301256239414215,
-0.16976642608642578,
-0.2313176989555359,
-0.02110605128109455,
0.13054600358009338,
-0.4184255003929138,
-0.1613808423280716,
0.0037705134600400925,
-0.08891192078590393,
-0.012027946300804615,
0.015771249309182167,
0.38885414600372314,
0.0047951191663742065,
-0.07347770780324936,
-0.01788690686225891,
-0.008529148995876312,
0.03184835612773895,
0.4229677617549896,
0.10960888862609863,
-0.2586670219898224,
0.23252835869789124,
0.12880638241767883,
0.5157038569450378,
0.46915215253829956,
0.03463837504386902,
0.3865024149417877,
-0.1563420444726944,
0.4943152666091919,
-0.1747741401195526,
-0.198556587100029,
-0.012448970228433609,
-0.13996276259422302,
-0.18490254878997803,
0.5216007232666016,
0.035119764506816864,
-0.0269603468477726,
0.19277921319007874,
0.09556659311056137,
-0.19887402653694153,
-0.29926902055740356,
-0.09629454463720322,
-0.12133853137493134,
0.2155712991952896,
-0.02702159807085991,
-0.0008964613080024719,
0.29800543189048767,
0.09850023686885834,
0.06855383515357971,
0.15546631813049316,
-0.054677799344062805,
0.08063569664955139,
-0.008795522153377533,
-0.16223950684070587,
0.045466214418411255,
-0.0518784373998642,
0.15522712469100952,
-0.004301721230149269,
0.09608423709869385,
-0.06607924401760101,
0.22820472717285156,
-0.007685340940952301,
0.7724935412406921,
-0.17496630549430847,
0.3251890540122986,
0.05269630253314972,
-0.23779118061065674,
-0.2265177220106125,
-0.34536951780319214,
-0.15788084268569946,
-0.30014777183532715,
0.30781376361846924,
0.5969663262367249,
-0.45916426181793213,
0.05697859451174736,
0.31733232736587524,
0.16391512751579285,
-0.24861857295036316,
0.024531185626983643,
-0.22479364275932312,
-0.11358050256967545,
-0.17395254969596863,
0.24855223298072815,
0.1074654757976532,
0.30155688524246216,
0.08747489005327225,
0.13911545276641846,
-0.14276252686977386,
-0.09543860703706741,
0.06318654865026474,
0.21600942313671112,
0.45006486773490906,
-0.037285760045051575,
0.2842335104942322,
0.23165641725063324,
0.05448037385940552,
0.4213762879371643,
0.8700153827667236,
-0.3226706087589264,
-0.27766746282577515,
-0.00810901541262865,
-0.274377703666687,
0.25811755657196045,
0.12584376335144043,
-0.02661241590976715,
-0.1832558512687683,
-0.4260804355144501,
-0.24938657879829407,
-0.2352353185415268,
-0.04006927087903023,
0.25141358375549316,
-0.03541287034749985,
-0.026787899434566498,
-0.3654949963092804,
0.2803760766983032,
0.12956097722053528,
-0.14415210485458374,
0.023548221215605736,
0.2309311479330063,
-0.23980847001075745,
0.37631022930145264,
-0.08521166443824768,
0.7228431105613708,
0.014956205151975155,
0.08782920986413956,
0.3706333041191101,
-0.5962051153182983,
0.12145625054836273,
-0.38514530658721924,
-0.00016712956130504608,
-0.36100339889526367,
-0.4003515839576721,
0.11266640573740005,
-0.1559053659439087,
0.011543606407940388,
0.3001477122306824,
-0.05646323040127754,
0.29108500480651855,
0.03785105049610138,
0.07452885806560516,
-0.1857602894306183,
0.23567330837249756,
0.22869357466697693,
0.05874832347035408,
-0.3665176331996918,
0.11296889185905457,
0.23355022072792053,
-0.21098239719867706,
0.09168262779712677,
0.0709126740694046,
0.08704234659671783,
-0.26364681124687195,
-0.07479798793792725,
0.1694444864988327,
0.06621469557285309,
0.2727369964122772,
0.07770206779241562,
-0.5844210386276245,
-0.14544382691383362,
0.398223876953125,
-0.1823890507221222,
-0.041074492037296295,
0.14996881783008575,
-0.03402789682149887,
0.12395697832107544,
0.40229445695877075,
-0.17364943027496338,
-0.23567050695419312,
0.35086947679519653,
0.12338149547576904,
0.0032570213079452515,
-0.3114544749259949,
-0.026891564950346947,
-0.18772286176681519,
-0.060945212841033936,
0.2664411962032318,
-0.1191844493150711,
-0.4275117814540863,
0.07574398815631866,
-0.10073179006576538,
0.1244427040219307,
-0.34309953451156616,
0.13668905198574066,
-0.03441355749964714,
-0.31493037939071655,
0.026768801733851433,
-0.130497545003891,
-0.3058830499649048,
-0.18740016222000122,
0.12760552763938904,
0.31752103567123413,
0.3269703984260559,
0.4246103763580322,
0.12793439626693726,
-0.03254997357726097,
-0.2408158928155899,
0.1952957808971405,
0.29596367478370667,
-0.3165093660354614,
0.4189196825027466,
-0.14776886999607086,
-0.037639692425727844,
0.15904808044433594,
-0.1316196620464325,
0.242477685213089,
0.026001591235399246,
-0.09714286029338837,
-0.24668923020362854,
-0.008254844695329666,
-0.014164082705974579,
0.009640440344810486,
0.4236770272254944,
0.2842674255371094,
0.07780034095048904,
-0.1512123942375183,
0.07671824842691422,
-0.30525094270706177,
0.4363348186016083,
-0.16430440545082092,
0.2668249011039734,
0.03183017298579216,
-0.10824868828058243,
0.08834336698055267,
0.12329798936843872,
0.2011672854423523,
-0.08600475639104843,
0.06283099949359894,
-0.1779959797859192,
-0.2487916350364685,
0.06586281955242157,
0.014733690768480301,
0.5396245718002319,
-0.15990880131721497,
-0.06793835759162903,
0.016282308846712112,
-0.20159567892551422,
0.348407506942749,
-0.0100240558385849,
0.13781416416168213,
-0.07477660477161407,
0.6602575182914734,
-0.18492484092712402,
-0.2972937524318695,
-0.0944594293832779,
-0.35909444093704224,
-0.07395301759243011,
0.2630707323551178,
-0.026896273717284203,
-0.17767919600009918,
-0.04717276990413666,
-0.3540194630622864,
-0.14651919901371002,
0.12607300281524658,
0.0035188309848308563,
0.08751881122589111,
-0.03623650223016739,
-0.257671594619751,
0.12033812701702118,
0.49557065963745117,
0.2680560350418091,
-0.13241755962371826,
-0.32448092103004456,
0.12330746650695801,
0.12084709852933884,
-0.27625757455825806,
-0.41447073221206665,
0.21199971437454224,
0.07744595408439636,
-0.09819880872964859,
0.3209611177444458,
0.08244799822568893,
-0.07926567643880844,
-0.38893237709999084,
0.04661471024155617,
0.33210986852645874,
0.017455432564020157,
0.5136189460754395,
0.37631794810295105,
-0.18598106503486633,
-0.1594509780406952,
0.21756674349308014,
-0.053513988852500916,
0.022170301526784897,
0.3088223338127136,
0.10950508713722229,
0.13906145095825195,
0.01306135393679142,
-0.06020277738571167,
0.04819636046886444,
-0.12168142944574356,
-0.04259401932358742,
0.22569918632507324,
-0.03740190714597702,
-0.07853449136018753,
0.1766350418329239,
0.11070950329303741,
0.08876540511846542,
-0.2807445526123047,
-0.3292073607444763,
0.13388670980930328,
-0.370535671710968,
0.05977708473801613,
0.1279236078262329,
-0.1102546975016594,
-0.04665253311395645,
0.3400024175643921,
-0.14596156775951385,
0.021460071206092834,
-0.0010354407131671906,
0.18012480437755585,
-0.098002590239048,
-0.21596190333366394,
0.0821649432182312,
0.15972302854061127,
0.15793189406394958,
-0.2001250833272934,
0.3046768009662628,
0.029900209978222847,
-0.3289182484149933,
0.12824580073356628,
0.2032664567232132,
0.35025277733802795,
0.13112613558769226,
0.21010155975818634,
-0.2641376554965973,
-0.07255680859088898,
0.1384005844593048,
0.12286093831062317,
0.10134364664554596,
-0.20179098844528198,
0.13421767950057983,
0.20137062668800354,
0.12244970351457596,
-0.11658087372779846,
-0.01906677521765232,
0.21871057152748108,
-0.036152079701423645,
-0.5985640287399292,
0.4406931400299072,
0.0870145857334137,
-0.034223176538944244,
-0.08677579462528229,
0.15815973281860352,
-0.3483394980430603,
-0.24584758281707764,
0.09339848160743713,
0.24198123812675476,
0.13260780274868011,
0.11243368685245514,
0.09761221706867218,
0.1985730230808258,
0.5095680356025696,
0.27039146423339844,
-0.5906999111175537,
-0.2699832022190094,
-0.04223274439573288,
-0.7529016733169556,
0.031573373824357986,
-0.46167877316474915,
0.07824255526065826,
0.20884861052036285,
0.254600465297699,
-0.1449100524187088,
0.08043175935745239,
-0.013052180409431458,
0.5820174813270569,
-0.3062317669391632,
0.2604880928993225,
-0.49829307198524475,
-0.09053006768226624,
0.07147794961929321,
-0.22800305485725403,
-0.11416469514369965,
-0.10286751389503479,
0.17460262775421143,
-0.22957967221736908,
0.030431635677814484,
0.33792948722839355,
-0.2637341022491455,
-0.14012739062309265,
-0.0057001058012247086,
0.3165283501148224,
0.15372176468372345,
0.17294752597808838,
0.04992828518152237,
-0.049824561923742294,
-0.24178248643875122,
-0.10612024366855621,
-0.2798885107040405,
0.32508450746536255,
-0.1059807687997818,
0.2625240087509155,
-0.24130898714065552,
-0.2866632342338562,
-0.1814168244600296,
-0.07562017440795898,
0.20329095423221588,
-0.09934672713279724,
-0.16107749938964844,
0.19035814702510834,
0.005291871726512909,
0.2477458417415619,
0.01975143700838089,
0.3004971742630005,
-0.0687519907951355,
0.15358510613441467,
0.11137785017490387,
-0.5665576457977295,
0.4221187233924866,
-0.4030977487564087,
-0.07430993020534515,
-0.31025367975234985,
0.27252399921417236,
0.10525833815336227,
0.09339789301156998,
-0.10483653843402863,
0.02419343590736389,
0.2961050570011139,
0.024528149515390396,
-0.17148086428642273,
0.16753104329109192,
0.06799430400133133,
-0.0668107122182846,
-0.020330779254436493,
-0.21575993299484253,
0.23425446450710297,
-0.1178046315908432,
0.41593223810195923,
-0.2742935121059418
] |
https://github.com/huggingface/datasets/issues/6257 | how is your dataset structured? (file types, how many commits and files are you trying to push, etc) | HfHubHTTPError - exceeded our hourly quotas for action: commit | ### Describe the bug
I try to upload a very large dataset of images, and get the following error:
```
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future)
2710 try:
2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params)
-> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit")
2713 except RepositoryNotFoundError as e:
2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE)
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name)
297 raise BadRequestError(message, response=response) from e
299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
300 # as well (request id and/or server error message)
--> 301 raise HfHubHTTPError(str(e), response=response) from e
HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd)
You have exceeded our hourly quotas for action: commit. We invite you to retry later.
```
this makes it much less convenient to host large datasets on HF hub.
### Steps to reproduce the bug
Upload a very large dataset of images
### Expected behavior
the upload to work well
### Environment info
- `datasets` version: 2.13.1
- Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 18 | HfHubHTTPError - exceeded our hourly quotas for action: commit
### Describe the bug
I try to upload a very large dataset of images, and get the following error:
```
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future)
2710 try:
2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params)
-> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit")
2713 except RepositoryNotFoundError as e:
2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE)
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name)
297 raise BadRequestError(message, response=response) from e
299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
300 # as well (request id and/or server error message)
--> 301 raise HfHubHTTPError(str(e), response=response) from e
HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd)
You have exceeded our hourly quotas for action: commit. We invite you to retry later.
```
this makes it much less convenient to host large datasets on HF hub.
### Steps to reproduce the bug
Upload a very large dataset of images
### Expected behavior
the upload to work well
### Environment info
- `datasets` version: 2.13.1
- Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
how is your dataset structured? (file types, how many commits and files are you trying to push, etc) | [
-0.03922600299119949,
-0.22926321625709534,
-0.018464691936969757,
0.09591218829154968,
0.08189208805561066,
-0.20637744665145874,
-0.14135736227035522,
0.3770289123058319,
0.12479234486818314,
0.24446263909339905,
-0.03737182170152664,
-0.36246365308761597,
-0.03629541024565697,
0.3728710412979126,
0.00027113407850265503,
0.056022193282842636,
-0.07388336956501007,
-0.1386488527059555,
-0.14726004004478455,
-0.058082208037376404,
-0.12920372188091278,
0.024919377639889717,
0.10035337507724762,
-0.009165547788143158,
-0.24890807271003723,
-0.07494562119245529,
-0.13089516758918762,
0.3392219841480255,
-0.04449485242366791,
-0.23743587732315063,
-0.188465416431427,
-0.06125325709581375,
0.19550004601478577,
0.7011910080909729,
-0.00011578419071156532,
-0.2127181440591812,
0.11654181778430939,
-0.13366785645484924,
-0.3797215223312378,
0.13287308812141418,
-0.27204087376594543,
-0.44667091965675354,
-0.3890724182128906,
-0.08353042602539062,
0.34497296810150146,
0.02559848129749298,
0.09355920553207397,
0.15550746023654938,
0.4926735758781433,
0.30635538697242737,
0.19585925340652466,
0.16698074340820312,
0.26776593923568726,
-0.052974771708250046,
0.08566669374704361,
0.3213253319263458,
-0.11928069591522217,
0.23478955030441284,
0.15960103273391724,
-0.10395848751068115,
-0.18438264727592468,
0.04409747198224068,
0.1409730613231659,
0.2764884829521179,
0.0571487620472908,
-0.17513391375541687,
-0.059487711638212204,
-0.40561819076538086,
0.17392852902412415,
0.13492920994758606,
-0.029169943183660507,
0.06389424949884415,
-0.3407580852508545,
-0.16054891049861908,
-0.08632458746433258,
-0.2531357407569885,
-0.020789850503206253,
0.5100002288818359,
-0.19830641150474548,
-0.05352349579334259,
0.15014062821865082,
-0.14865070581436157,
-0.11206286400556564,
0.1480044573545456,
0.12771114706993103,
-0.2809560000896454,
-0.061425305902957916,
0.06653985381126404,
0.33579394221305847,
-0.2753249406814575,
-0.27286040782928467,
-0.12204062193632126,
0.1495521068572998,
0.10772504657506943,
-0.3929975628852844,
0.021746836602687836,
0.1330159604549408,
-0.29510051012039185,
0.4897311329841614,
0.10660943388938904,
-0.12935581803321838,
-0.016932513564825058,
-0.3208959102630615,
0.032063812017440796,
0.121296226978302,
0.14975276589393616,
-0.21000507473945618,
0.19576424360275269,
0.16999156773090363,
0.5435855388641357,
0.1535455733537674,
0.07679973542690277,
0.13968980312347412,
-0.1434740573167801,
-0.06671933829784393,
-0.001779351383447647,
0.2585814893245697,
-0.1549941748380661,
-0.24031972885131836,
0.3444884419441223,
-0.32838383316993713,
0.00014524534344673157,
-0.2144918292760849,
0.3158576786518097,
-0.15544626116752625,
-0.03331604599952698,
0.02284281700849533,
-0.049090415239334106,
-0.25854891538619995,
-0.05692530795931816,
-0.22858303785324097,
0.09602242708206177,
0.12650242447853088,
0.3918883800506592,
-0.034341488033533096,
-0.2185489982366562,
-0.10253313183784485,
0.1733456403017044,
0.5023322701454163,
-0.1336892694234848,
0.1451408863067627,
-0.35244253277778625,
0.04250609129667282,
0.4721531271934509,
0.1380055546760559,
0.12319492548704147,
0.22404056787490845,
-0.022822007536888123,
0.057533204555511475,
0.07481109350919724,
-0.21896056830883026,
-0.24561969935894012,
-0.24908769130706787,
0.20031297206878662,
0.2568315267562866,
-0.05258288234472275,
-0.5403794646263123,
-0.17315837740898132,
-0.02840069681406021,
0.445170134305954,
0.1808648258447647,
0.10408864915370941,
0.23719358444213867,
0.019198719412088394,
-0.09037350118160248,
0.7094290852546692,
0.08677156269550323,
0.029196999967098236,
0.22653236985206604,
0.0884530171751976,
0.2720140218734741,
0.46015164256095886,
0.06428559124469757,
0.07076866924762726,
-0.24426448345184326,
0.1216324120759964,
-0.263165146112442,
-0.46013638377189636,
-0.2602365016937256,
0.24159756302833557,
-0.11280649900436401,
-0.12364444136619568,
0.19079601764678955,
-0.17990127205848694,
0.10859622061252594,
-0.06396321952342987,
0.20574656128883362,
0.0013929661363363266,
-0.018268944695591927,
0.17702293395996094,
-0.28543365001678467,
-0.319198876619339,
-0.4759348928928375,
0.03781243413686752,
0.3087984621524811,
-0.1792442798614502,
0.1399078518152237,
-0.1423048973083496,
0.32259589433670044,
-0.2663198411464691,
0.15788908302783966,
0.1678985357284546,
0.19404208660125732,
0.17653611302375793,
0.009913478046655655,
0.19216999411582947,
-0.07552097737789154,
0.0758974701166153,
-0.4540722072124481,
0.3462643623352051,
-0.08657941222190857,
-0.11746147274971008,
-0.3407190442085266,
0.09062083065509796,
-0.0749184638261795,
0.10005161911249161,
0.13355159759521484,
-0.11790616065263748,
-0.173429936170578,
0.06446188688278198,
-0.0032659098505973816,
0.5088728070259094,
-0.41525787115097046,
0.14637047052383423,
0.021891873329877853,
0.3286122679710388,
-0.3136644959449768,
-0.2070441097021103,
0.36336997151374817,
0.03026111237704754,
0.3607824146747589,
-0.05442742630839348,
-0.12119836360216141,
0.14375120401382446,
0.10165219753980637,
-0.0066095441579818726,
0.3608674705028534,
0.05527011305093765,
0.261090487241745,
0.16604766249656677,
-0.11103561520576477,
0.12147236615419388,
0.09632126986980438,
-0.017379723489284515,
0.20144543051719666,
0.07045070827007294,
0.03590826690196991,
0.23348374664783478,
0.09374064207077026,
0.03929280489683151,
0.12446552515029907,
-0.008078493177890778,
0.16918405890464783,
0.07647381722927094,
0.1752385050058365,
0.16078276932239532,
-0.07737331092357635,
-0.24250133335590363,
0.0029684975743293762,
-0.012142237275838852,
0.33237311244010925,
-0.12043040990829468,
0.18067792057991028,
0.328388512134552,
0.12202049791812897,
-0.017704971134662628,
0.33870524168014526,
-0.11203920841217041,
0.1869756579399109,
0.026026464998722076,
-0.32968583703041077,
-0.15460050106048584,
0.16861605644226074,
-0.005092643201351166,
-0.09992334246635437,
0.0816827043890953,
0.1725511997938156,
0.11157546937465668,
0.4531727433204651,
0.03129773214459419,
-0.4522339105606079,
-0.3825279474258423,
-0.0601767860352993,
0.3549085259437561,
-0.2842601537704468,
-0.04980272799730301,
-0.13266688585281372,
-0.38012781739234924,
0.12320871651172638,
0.12310630828142166,
-0.29788529872894287,
-0.27548307180404663,
-0.046061400324106216,
-0.04115542396903038,
-0.14750313758850098,
0.10702652484178543,
0.12669923901557922,
0.21168267726898193,
0.15993347764015198,
0.16018496453762054,
-0.10532467067241669,
0.3856981098651886,
-0.14931517839431763,
0.032542165368795395,
0.21433505415916443,
-0.3596545457839966,
0.4731161594390869,
0.08446922153234482,
-0.22801585495471954,
-0.4387301802635193,
-0.2738674283027649,
0.15429040789604187,
0.015199946239590645,
-0.014121468178927898,
-0.07054135948419571,
0.2634546756744385,
-0.12819091975688934,
-0.05073706805706024,
0.11006432771682739,
0.2665122151374817,
-0.19686251878738403,
0.03672236204147339,
-0.1581520289182663,
0.20569415390491486,
0.025727562606334686,
0.1806449592113495,
0.002848127856850624,
-0.5456024408340454,
0.48847496509552,
0.37093400955200195,
0.38944491744041443,
0.25513532757759094,
0.11641842126846313,
0.3021426200866699,
-0.17415396869182587,
-0.18310341238975525,
-0.35467469692230225,
-0.06863348186016083,
0.02997373230755329,
-0.08016054332256317,
-0.5644927024841309,
-0.03218431770801544,
0.07882282137870789,
-0.06392741203308105,
-0.33797767758369446,
-0.5265474319458008,
-0.7257620692253113,
-0.26766449213027954,
-0.008892089128494263,
-0.40521836280822754,
0.07526044547557831,
0.15644320845603943,
-0.30289310216903687,
-0.23579519987106323,
0.11320239305496216,
-0.22291165590286255,
0.08793161809444427,
0.5071728825569153,
0.04862765595316887,
-0.108443982899189,
0.10472054779529572,
0.34337979555130005,
0.5526601672172546,
0.3254212737083435,
0.23907314240932465,
0.7045985460281372,
0.07251809537410736,
0.21483315527439117,
0.010455867275595665,
-0.28779336810112,
0.06705185025930405,
-0.05999762564897537,
0.11802755296230316,
-0.028380244970321655,
0.07168003916740417,
0.21695683896541595,
-0.0019327178597450256,
-0.3126767873764038,
-0.06495577841997147,
-0.2717238664627075,
0.05930590629577637,
0.1762244701385498,
0.09906280040740967,
-0.18891331553459167,
-0.3360629081726074,
-0.1245478093624115,
0.1154116690158844,
0.20638146996498108,
0.2540435492992401,
0.25517991185188293,
0.018525056540966034,
-0.07399054616689682,
0.062748983502388,
-0.44735682010650635,
0.41882404685020447,
0.046540889889001846,
0.23943354189395905,
-0.18597209453582764,
0.0891786441206932,
0.1601487696170807,
-0.3259357511997223,
0.44826561212539673,
0.005541512742638588,
0.05920752137899399,
-0.12186089158058167,
-0.18128979206085205,
-0.22827044129371643,
0.07176916301250458,
-0.04208577424287796,
0.022466059774160385,
0.1611088514328003,
0.26410040259361267,
-0.5085721611976624,
0.01713572070002556,
0.21544525027275085,
-0.16589666903018951,
-0.18903443217277527,
-0.010125473141670227,
-0.19497105479240417,
-0.622818648815155,
-0.6844595074653625,
-0.009863078594207764,
0.2667158544063568,
0.04039658233523369,
0.32651668787002563,
-0.20706894993782043,
0.3672209680080414,
-0.16921687126159668,
-0.16307203471660614,
-0.4771134853363037,
-0.10173088312149048,
0.3535187542438507,
0.05951046943664551,
-0.16237883269786835,
-0.2520103454589844,
0.44207271933555603,
0.36674103140830994,
0.03166494145989418,
-0.014095421880483627,
0.18272994458675385,
0.02132631093263626,
-0.0082940012216568,
0.4976402819156647,
0.23377388715744019,
0.35757023096084595,
0.24187703430652618,
0.7080681920051575,
-0.26728537678718567,
0.12636929750442505,
0.3933710753917694,
-0.30172812938690186,
-0.08463631570339203,
-0.08676169067621231,
0.32155776023864746,
-0.14686545729637146,
0.18656229972839355,
0.13872116804122925,
0.6318668723106384,
0.2069743424654007,
0.04735500365495682,
0.20719248056411743,
0.9926201105117798,
-0.22762537002563477,
0.3066854476928711,
0.20236292481422424,
-0.480747789144516,
0.08049513399600983,
-0.11324825137853622,
-0.08260489255189896,
-0.22656536102294922,
-0.07526226341724396,
0.06582765281200409,
-0.07612831890583038,
0.11942757666110992,
-0.390076220035553,
-0.11413949728012085,
0.08593680709600449,
-0.199289932847023,
0.15196669101715088,
0.03403313457965851,
0.21271011233329773,
-0.7284248471260071,
-0.3583454489707947,
-0.2975483238697052,
0.2217995971441269,
-0.10947996377944946,
0.15481624007225037,
-0.11082036793231964,
-0.2075425237417221,
-0.07256276905536652,
-0.09619642794132233,
-0.3818748891353607,
-0.014505825936794281,
-0.28309398889541626,
0.09244835376739502,
-0.04397812485694885,
0.07994592189788818,
-0.3188781142234802,
-0.4688585698604584,
-0.050479549914598465,
-0.08293884247541428,
-0.07337206602096558,
0.023265236988663673,
-0.24811118841171265,
0.017322000116109848,
-0.15197069942951202,
-0.11623881757259369,
0.3919682800769806,
-0.2416692078113556,
-0.13508519530296326,
-0.006745288148522377,
0.14796017110347748,
-0.15620222687721252,
-0.1646512895822525,
0.2805403470993042,
-0.10281718522310257,
-0.12806004285812378,
0.17148742079734802,
-0.009953290224075317,
-0.35467708110809326,
-0.05906018614768982,
0.08444413542747498,
0.03668372333049774,
-0.012588594108819962,
0.06764665246009827,
0.23693187534809113,
-0.11116684973239899,
-0.2015523910522461,
0.43185678124427795,
0.22813642024993896,
-0.037650562822818756,
0.3274925649166107,
0.25509750843048096,
-0.08769898861646652,
-0.13847512006759644,
0.08776158094406128,
-0.19514726102352142,
-0.6272436380386353,
0.3812766969203949,
-0.16536974906921387,
-0.008063718676567078,
-0.08826582133769989,
0.28043216466903687,
0.11090394854545593,
-0.19256439805030823,
0.04807320237159729,
-0.15697181224822998,
-0.30605313181877136,
0.08428485691547394,
-0.32574835419654846,
-0.021907363086938858,
-0.03552452102303505,
0.3191626965999603,
0.1652882695198059,
0.29886388778686523,
-0.2986494302749634,
0.11831703782081604,
-0.45201605558395386,
0.07126571238040924,
0.08386394381523132,
-0.2374521791934967,
0.3404344916343689,
-0.054994724690914154,
0.08649681508541107,
0.37029290199279785,
-0.31458133459091187,
-0.19112658500671387,
-0.3273641765117645,
0.13787303864955902,
0.2669082581996918,
-0.03857552632689476,
0.003003966063261032,
-0.2137058526277542,
-0.12576085329055786,
0.06633616983890533,
0.10003326833248138,
0.13165584206581116,
-0.173875093460083,
-0.2728877663612366,
0.3541199862957001,
-0.16573195159435272,
0.19263458251953125,
0.039808303117752075,
0.24262426793575287,
0.3977923095226288,
0.10083401203155518,
-0.028696518391370773,
-0.027778537943959236,
-0.10723405331373215,
-0.13773472607135773,
0.20800568163394928,
0.25270816683769226,
-0.014085810631513596,
0.3801650404930115,
-0.3233279585838318,
-0.23705947399139404,
-0.1796332746744156,
0.3303544223308563,
-0.16505800187587738,
-0.2299230396747589,
-0.11001914739608765,
0.030669763684272766,
0.18830463290214539,
-0.02183164656162262,
-0.11893628537654877,
0.06465412676334381,
-0.2728828191757202,
-0.03182113170623779,
0.2662625312805176,
0.13989117741584778,
-0.11474204063415527,
0.09319412708282471,
0.29010555148124695,
0.09768159687519073,
-0.09525488317012787,
-0.26165950298309326,
0.018306974321603775,
-0.227411687374115,
0.04246367886662483,
0.3349103033542633,
-0.15798483788967133,
0.39265111088752747,
-0.19156552851200104,
-0.010989602655172348,
0.0829450935125351,
0.018899748101830482,
0.021324891597032547,
0.23087593913078308,
-0.5445398688316345,
0.06017226725816727,
0.2613981068134308,
0.20838281512260437,
0.22360475361347198,
0.010317087173461914,
0.4503357410430908,
0.21157683432102203,
-0.10709411650896072,
-0.009049952030181885,
0.16127289831638336,
-0.06346004456281662,
0.4210626482963562,
0.1879047453403473,
-0.08920332044363022,
-0.2776825428009033,
0.029767312109470367,
0.10429389774799347,
-0.23662817478179932,
0.433072954416275,
-0.012476146221160889,
-0.2813512682914734,
-0.1508825272321701,
-0.2780050039291382,
0.1833304762840271,
0.316398561000824,
-0.13957536220550537,
0.04246625304222107,
0.44325172901153564,
0.022460544481873512,
-0.2528306841850281,
0.4939727187156677,
0.6692550778388977,
0.18015868961811066,
0.08514272421598434,
0.2735516130924225,
0.43182873725891113,
0.13582324981689453,
0.020515404641628265,
0.024260420352220535,
0.05667167156934738,
0.12727883458137512,
0.10307414084672928,
0.07697907835245132,
-0.27716881036758423,
-0.12457792460918427,
-0.08750005066394806,
-0.06723810732364655,
-0.1865215301513672,
0.4790487587451935,
-0.15038283169269562,
-0.05136967450380325,
-0.11689019203186035,
-0.09441719949245453,
-0.3943907618522644,
0.1214756965637207,
0.019778016954660416,
-0.4564698338508606,
0.17648692429065704,
-0.26114585995674133,
0.06262421607971191,
-0.46211332082748413,
0.48338812589645386,
0.28896522521972656,
-0.09703560918569565,
-0.28911107778549194,
0.17044715583324432,
-0.1316971778869629,
0.25289180874824524,
-0.32445600628852844,
-0.021369613707065582,
0.06431575119495392,
0.20506848394870758,
-0.0891370102763176,
-0.1103254109621048,
0.4810141324996948,
-0.35096657276153564,
-0.05086002126336098,
0.09580790996551514,
-0.2468879669904709,
-0.0769418329000473,
0.20355072617530823,
-0.09724371135234833,
-0.03800024837255478,
-0.38257062435150146,
0.5132514834403992,
-0.15933077037334442,
0.09428784996271133,
0.037323422729969025,
-0.3444976210594177,
0.02365323156118393,
-0.41660526394844055,
0.4529227018356323,
0.24288424849510193,
0.031932175159454346,
-0.3447103798389435,
-0.4273967146873474,
0.13396817445755005,
-0.17312604188919067,
-0.1972462236881256,
-0.16759222745895386,
-0.035295747220516205,
0.47980475425720215,
0.09993910044431686,
-0.3038891851902008,
-0.17113393545150757,
0.69660884141922,
-0.07010780274868011,
-0.005081254988908768,
0.0382784828543663,
0.26715636253356934,
0.054250240325927734,
-0.19340768456459045,
-0.034320004284381866,
0.10745611786842346,
0.28181886672973633,
0.06024613231420517,
-0.4368166923522949,
-0.45407986640930176,
0.4860836863517761,
-0.11445537954568863,
-0.18978090584278107,
0.03003193438053131,
0.3980982303619385,
0.06103218346834183,
-0.1634429544210434,
-0.14517106115818024,
0.07098531723022461,
0.24128669500350952,
0.3146839737892151,
-0.3342404365539551,
0.4785138964653015,
-0.31949710845947266,
-0.23119468986988068,
0.04196011275053024,
0.21646401286125183,
-0.06503764539957047,
-0.29471954703330994,
0.5019763112068176,
-0.03680211305618286
] |
https://github.com/huggingface/datasets/issues/6257 | I succeeded in uploading it after several attempts with an hour gap between each attempt (inconvenient but worked). The final dataset is [here](https://huggingface.co/datasets/yuvalkirstain/pickapic_v2), code and context to the dataset can be found [here](https://github.com/yuvalkirstain/PickScore/).
I can close the issue if this behavior is intended, as most users probably do not need to upload large-scale datasets. | HfHubHTTPError - exceeded our hourly quotas for action: commit | ### Describe the bug
I try to upload a very large dataset of images, and get the following error:
```
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future)
2710 try:
2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params)
-> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit")
2713 except RepositoryNotFoundError as e:
2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE)
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name)
297 raise BadRequestError(message, response=response) from e
299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
300 # as well (request id and/or server error message)
--> 301 raise HfHubHTTPError(str(e), response=response) from e
HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd)
You have exceeded our hourly quotas for action: commit. We invite you to retry later.
```
this makes it much less convenient to host large datasets on HF hub.
### Steps to reproduce the bug
Upload a very large dataset of images
### Expected behavior
the upload to work well
### Environment info
- `datasets` version: 2.13.1
- Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 54 | HfHubHTTPError - exceeded our hourly quotas for action: commit
### Describe the bug
I try to upload a very large dataset of images, and get the following error:
```
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future)
2710 try:
2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params)
-> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit")
2713 except RepositoryNotFoundError as e:
2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE)
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name)
297 raise BadRequestError(message, response=response) from e
299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
300 # as well (request id and/or server error message)
--> 301 raise HfHubHTTPError(str(e), response=response) from e
HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd)
You have exceeded our hourly quotas for action: commit. We invite you to retry later.
```
this makes it much less convenient to host large datasets on HF hub.
### Steps to reproduce the bug
Upload a very large dataset of images
### Expected behavior
the upload to work well
### Environment info
- `datasets` version: 2.13.1
- Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
I succeeded in uploading it after several attempts with an hour gap between each attempt (inconvenient but worked). The final dataset is [here](https://huggingface.co/datasets/yuvalkirstain/pickapic_v2), code and context to the dataset can be found [here](https://github.com/yuvalkirstain/PickScore/).
I can close the issue if this behavior is intended, as most users probably do not need to upload large-scale datasets. | [
-0.03922600299119949,
-0.22926321625709534,
-0.018464691936969757,
0.09591218829154968,
0.08189208805561066,
-0.20637744665145874,
-0.14135736227035522,
0.3770289123058319,
0.12479234486818314,
0.24446263909339905,
-0.03737182170152664,
-0.36246365308761597,
-0.03629541024565697,
0.3728710412979126,
0.00027113407850265503,
0.056022193282842636,
-0.07388336956501007,
-0.1386488527059555,
-0.14726004004478455,
-0.058082208037376404,
-0.12920372188091278,
0.024919377639889717,
0.10035337507724762,
-0.009165547788143158,
-0.24890807271003723,
-0.07494562119245529,
-0.13089516758918762,
0.3392219841480255,
-0.04449485242366791,
-0.23743587732315063,
-0.188465416431427,
-0.06125325709581375,
0.19550004601478577,
0.7011910080909729,
-0.00011578419071156532,
-0.2127181440591812,
0.11654181778430939,
-0.13366785645484924,
-0.3797215223312378,
0.13287308812141418,
-0.27204087376594543,
-0.44667091965675354,
-0.3890724182128906,
-0.08353042602539062,
0.34497296810150146,
0.02559848129749298,
0.09355920553207397,
0.15550746023654938,
0.4926735758781433,
0.30635538697242737,
0.19585925340652466,
0.16698074340820312,
0.26776593923568726,
-0.052974771708250046,
0.08566669374704361,
0.3213253319263458,
-0.11928069591522217,
0.23478955030441284,
0.15960103273391724,
-0.10395848751068115,
-0.18438264727592468,
0.04409747198224068,
0.1409730613231659,
0.2764884829521179,
0.0571487620472908,
-0.17513391375541687,
-0.059487711638212204,
-0.40561819076538086,
0.17392852902412415,
0.13492920994758606,
-0.029169943183660507,
0.06389424949884415,
-0.3407580852508545,
-0.16054891049861908,
-0.08632458746433258,
-0.2531357407569885,
-0.020789850503206253,
0.5100002288818359,
-0.19830641150474548,
-0.05352349579334259,
0.15014062821865082,
-0.14865070581436157,
-0.11206286400556564,
0.1480044573545456,
0.12771114706993103,
-0.2809560000896454,
-0.061425305902957916,
0.06653985381126404,
0.33579394221305847,
-0.2753249406814575,
-0.27286040782928467,
-0.12204062193632126,
0.1495521068572998,
0.10772504657506943,
-0.3929975628852844,
0.021746836602687836,
0.1330159604549408,
-0.29510051012039185,
0.4897311329841614,
0.10660943388938904,
-0.12935581803321838,
-0.016932513564825058,
-0.3208959102630615,
0.032063812017440796,
0.121296226978302,
0.14975276589393616,
-0.21000507473945618,
0.19576424360275269,
0.16999156773090363,
0.5435855388641357,
0.1535455733537674,
0.07679973542690277,
0.13968980312347412,
-0.1434740573167801,
-0.06671933829784393,
-0.001779351383447647,
0.2585814893245697,
-0.1549941748380661,
-0.24031972885131836,
0.3444884419441223,
-0.32838383316993713,
0.00014524534344673157,
-0.2144918292760849,
0.3158576786518097,
-0.15544626116752625,
-0.03331604599952698,
0.02284281700849533,
-0.049090415239334106,
-0.25854891538619995,
-0.05692530795931816,
-0.22858303785324097,
0.09602242708206177,
0.12650242447853088,
0.3918883800506592,
-0.034341488033533096,
-0.2185489982366562,
-0.10253313183784485,
0.1733456403017044,
0.5023322701454163,
-0.1336892694234848,
0.1451408863067627,
-0.35244253277778625,
0.04250609129667282,
0.4721531271934509,
0.1380055546760559,
0.12319492548704147,
0.22404056787490845,
-0.022822007536888123,
0.057533204555511475,
0.07481109350919724,
-0.21896056830883026,
-0.24561969935894012,
-0.24908769130706787,
0.20031297206878662,
0.2568315267562866,
-0.05258288234472275,
-0.5403794646263123,
-0.17315837740898132,
-0.02840069681406021,
0.445170134305954,
0.1808648258447647,
0.10408864915370941,
0.23719358444213867,
0.019198719412088394,
-0.09037350118160248,
0.7094290852546692,
0.08677156269550323,
0.029196999967098236,
0.22653236985206604,
0.0884530171751976,
0.2720140218734741,
0.46015164256095886,
0.06428559124469757,
0.07076866924762726,
-0.24426448345184326,
0.1216324120759964,
-0.263165146112442,
-0.46013638377189636,
-0.2602365016937256,
0.24159756302833557,
-0.11280649900436401,
-0.12364444136619568,
0.19079601764678955,
-0.17990127205848694,
0.10859622061252594,
-0.06396321952342987,
0.20574656128883362,
0.0013929661363363266,
-0.018268944695591927,
0.17702293395996094,
-0.28543365001678467,
-0.319198876619339,
-0.4759348928928375,
0.03781243413686752,
0.3087984621524811,
-0.1792442798614502,
0.1399078518152237,
-0.1423048973083496,
0.32259589433670044,
-0.2663198411464691,
0.15788908302783966,
0.1678985357284546,
0.19404208660125732,
0.17653611302375793,
0.009913478046655655,
0.19216999411582947,
-0.07552097737789154,
0.0758974701166153,
-0.4540722072124481,
0.3462643623352051,
-0.08657941222190857,
-0.11746147274971008,
-0.3407190442085266,
0.09062083065509796,
-0.0749184638261795,
0.10005161911249161,
0.13355159759521484,
-0.11790616065263748,
-0.173429936170578,
0.06446188688278198,
-0.0032659098505973816,
0.5088728070259094,
-0.41525787115097046,
0.14637047052383423,
0.021891873329877853,
0.3286122679710388,
-0.3136644959449768,
-0.2070441097021103,
0.36336997151374817,
0.03026111237704754,
0.3607824146747589,
-0.05442742630839348,
-0.12119836360216141,
0.14375120401382446,
0.10165219753980637,
-0.0066095441579818726,
0.3608674705028534,
0.05527011305093765,
0.261090487241745,
0.16604766249656677,
-0.11103561520576477,
0.12147236615419388,
0.09632126986980438,
-0.017379723489284515,
0.20144543051719666,
0.07045070827007294,
0.03590826690196991,
0.23348374664783478,
0.09374064207077026,
0.03929280489683151,
0.12446552515029907,
-0.008078493177890778,
0.16918405890464783,
0.07647381722927094,
0.1752385050058365,
0.16078276932239532,
-0.07737331092357635,
-0.24250133335590363,
0.0029684975743293762,
-0.012142237275838852,
0.33237311244010925,
-0.12043040990829468,
0.18067792057991028,
0.328388512134552,
0.12202049791812897,
-0.017704971134662628,
0.33870524168014526,
-0.11203920841217041,
0.1869756579399109,
0.026026464998722076,
-0.32968583703041077,
-0.15460050106048584,
0.16861605644226074,
-0.005092643201351166,
-0.09992334246635437,
0.0816827043890953,
0.1725511997938156,
0.11157546937465668,
0.4531727433204651,
0.03129773214459419,
-0.4522339105606079,
-0.3825279474258423,
-0.0601767860352993,
0.3549085259437561,
-0.2842601537704468,
-0.04980272799730301,
-0.13266688585281372,
-0.38012781739234924,
0.12320871651172638,
0.12310630828142166,
-0.29788529872894287,
-0.27548307180404663,
-0.046061400324106216,
-0.04115542396903038,
-0.14750313758850098,
0.10702652484178543,
0.12669923901557922,
0.21168267726898193,
0.15993347764015198,
0.16018496453762054,
-0.10532467067241669,
0.3856981098651886,
-0.14931517839431763,
0.032542165368795395,
0.21433505415916443,
-0.3596545457839966,
0.4731161594390869,
0.08446922153234482,
-0.22801585495471954,
-0.4387301802635193,
-0.2738674283027649,
0.15429040789604187,
0.015199946239590645,
-0.014121468178927898,
-0.07054135948419571,
0.2634546756744385,
-0.12819091975688934,
-0.05073706805706024,
0.11006432771682739,
0.2665122151374817,
-0.19686251878738403,
0.03672236204147339,
-0.1581520289182663,
0.20569415390491486,
0.025727562606334686,
0.1806449592113495,
0.002848127856850624,
-0.5456024408340454,
0.48847496509552,
0.37093400955200195,
0.38944491744041443,
0.25513532757759094,
0.11641842126846313,
0.3021426200866699,
-0.17415396869182587,
-0.18310341238975525,
-0.35467469692230225,
-0.06863348186016083,
0.02997373230755329,
-0.08016054332256317,
-0.5644927024841309,
-0.03218431770801544,
0.07882282137870789,
-0.06392741203308105,
-0.33797767758369446,
-0.5265474319458008,
-0.7257620692253113,
-0.26766449213027954,
-0.008892089128494263,
-0.40521836280822754,
0.07526044547557831,
0.15644320845603943,
-0.30289310216903687,
-0.23579519987106323,
0.11320239305496216,
-0.22291165590286255,
0.08793161809444427,
0.5071728825569153,
0.04862765595316887,
-0.108443982899189,
0.10472054779529572,
0.34337979555130005,
0.5526601672172546,
0.3254212737083435,
0.23907314240932465,
0.7045985460281372,
0.07251809537410736,
0.21483315527439117,
0.010455867275595665,
-0.28779336810112,
0.06705185025930405,
-0.05999762564897537,
0.11802755296230316,
-0.028380244970321655,
0.07168003916740417,
0.21695683896541595,
-0.0019327178597450256,
-0.3126767873764038,
-0.06495577841997147,
-0.2717238664627075,
0.05930590629577637,
0.1762244701385498,
0.09906280040740967,
-0.18891331553459167,
-0.3360629081726074,
-0.1245478093624115,
0.1154116690158844,
0.20638146996498108,
0.2540435492992401,
0.25517991185188293,
0.018525056540966034,
-0.07399054616689682,
0.062748983502388,
-0.44735682010650635,
0.41882404685020447,
0.046540889889001846,
0.23943354189395905,
-0.18597209453582764,
0.0891786441206932,
0.1601487696170807,
-0.3259357511997223,
0.44826561212539673,
0.005541512742638588,
0.05920752137899399,
-0.12186089158058167,
-0.18128979206085205,
-0.22827044129371643,
0.07176916301250458,
-0.04208577424287796,
0.022466059774160385,
0.1611088514328003,
0.26410040259361267,
-0.5085721611976624,
0.01713572070002556,
0.21544525027275085,
-0.16589666903018951,
-0.18903443217277527,
-0.010125473141670227,
-0.19497105479240417,
-0.622818648815155,
-0.6844595074653625,
-0.009863078594207764,
0.2667158544063568,
0.04039658233523369,
0.32651668787002563,
-0.20706894993782043,
0.3672209680080414,
-0.16921687126159668,
-0.16307203471660614,
-0.4771134853363037,
-0.10173088312149048,
0.3535187542438507,
0.05951046943664551,
-0.16237883269786835,
-0.2520103454589844,
0.44207271933555603,
0.36674103140830994,
0.03166494145989418,
-0.014095421880483627,
0.18272994458675385,
0.02132631093263626,
-0.0082940012216568,
0.4976402819156647,
0.23377388715744019,
0.35757023096084595,
0.24187703430652618,
0.7080681920051575,
-0.26728537678718567,
0.12636929750442505,
0.3933710753917694,
-0.30172812938690186,
-0.08463631570339203,
-0.08676169067621231,
0.32155776023864746,
-0.14686545729637146,
0.18656229972839355,
0.13872116804122925,
0.6318668723106384,
0.2069743424654007,
0.04735500365495682,
0.20719248056411743,
0.9926201105117798,
-0.22762537002563477,
0.3066854476928711,
0.20236292481422424,
-0.480747789144516,
0.08049513399600983,
-0.11324825137853622,
-0.08260489255189896,
-0.22656536102294922,
-0.07526226341724396,
0.06582765281200409,
-0.07612831890583038,
0.11942757666110992,
-0.390076220035553,
-0.11413949728012085,
0.08593680709600449,
-0.199289932847023,
0.15196669101715088,
0.03403313457965851,
0.21271011233329773,
-0.7284248471260071,
-0.3583454489707947,
-0.2975483238697052,
0.2217995971441269,
-0.10947996377944946,
0.15481624007225037,
-0.11082036793231964,
-0.2075425237417221,
-0.07256276905536652,
-0.09619642794132233,
-0.3818748891353607,
-0.014505825936794281,
-0.28309398889541626,
0.09244835376739502,
-0.04397812485694885,
0.07994592189788818,
-0.3188781142234802,
-0.4688585698604584,
-0.050479549914598465,
-0.08293884247541428,
-0.07337206602096558,
0.023265236988663673,
-0.24811118841171265,
0.017322000116109848,
-0.15197069942951202,
-0.11623881757259369,
0.3919682800769806,
-0.2416692078113556,
-0.13508519530296326,
-0.006745288148522377,
0.14796017110347748,
-0.15620222687721252,
-0.1646512895822525,
0.2805403470993042,
-0.10281718522310257,
-0.12806004285812378,
0.17148742079734802,
-0.009953290224075317,
-0.35467708110809326,
-0.05906018614768982,
0.08444413542747498,
0.03668372333049774,
-0.012588594108819962,
0.06764665246009827,
0.23693187534809113,
-0.11116684973239899,
-0.2015523910522461,
0.43185678124427795,
0.22813642024993896,
-0.037650562822818756,
0.3274925649166107,
0.25509750843048096,
-0.08769898861646652,
-0.13847512006759644,
0.08776158094406128,
-0.19514726102352142,
-0.6272436380386353,
0.3812766969203949,
-0.16536974906921387,
-0.008063718676567078,
-0.08826582133769989,
0.28043216466903687,
0.11090394854545593,
-0.19256439805030823,
0.04807320237159729,
-0.15697181224822998,
-0.30605313181877136,
0.08428485691547394,
-0.32574835419654846,
-0.021907363086938858,
-0.03552452102303505,
0.3191626965999603,
0.1652882695198059,
0.29886388778686523,
-0.2986494302749634,
0.11831703782081604,
-0.45201605558395386,
0.07126571238040924,
0.08386394381523132,
-0.2374521791934967,
0.3404344916343689,
-0.054994724690914154,
0.08649681508541107,
0.37029290199279785,
-0.31458133459091187,
-0.19112658500671387,
-0.3273641765117645,
0.13787303864955902,
0.2669082581996918,
-0.03857552632689476,
0.003003966063261032,
-0.2137058526277542,
-0.12576085329055786,
0.06633616983890533,
0.10003326833248138,
0.13165584206581116,
-0.173875093460083,
-0.2728877663612366,
0.3541199862957001,
-0.16573195159435272,
0.19263458251953125,
0.039808303117752075,
0.24262426793575287,
0.3977923095226288,
0.10083401203155518,
-0.028696518391370773,
-0.027778537943959236,
-0.10723405331373215,
-0.13773472607135773,
0.20800568163394928,
0.25270816683769226,
-0.014085810631513596,
0.3801650404930115,
-0.3233279585838318,
-0.23705947399139404,
-0.1796332746744156,
0.3303544223308563,
-0.16505800187587738,
-0.2299230396747589,
-0.11001914739608765,
0.030669763684272766,
0.18830463290214539,
-0.02183164656162262,
-0.11893628537654877,
0.06465412676334381,
-0.2728828191757202,
-0.03182113170623779,
0.2662625312805176,
0.13989117741584778,
-0.11474204063415527,
0.09319412708282471,
0.29010555148124695,
0.09768159687519073,
-0.09525488317012787,
-0.26165950298309326,
0.018306974321603775,
-0.227411687374115,
0.04246367886662483,
0.3349103033542633,
-0.15798483788967133,
0.39265111088752747,
-0.19156552851200104,
-0.010989602655172348,
0.0829450935125351,
0.018899748101830482,
0.021324891597032547,
0.23087593913078308,
-0.5445398688316345,
0.06017226725816727,
0.2613981068134308,
0.20838281512260437,
0.22360475361347198,
0.010317087173461914,
0.4503357410430908,
0.21157683432102203,
-0.10709411650896072,
-0.009049952030181885,
0.16127289831638336,
-0.06346004456281662,
0.4210626482963562,
0.1879047453403473,
-0.08920332044363022,
-0.2776825428009033,
0.029767312109470367,
0.10429389774799347,
-0.23662817478179932,
0.433072954416275,
-0.012476146221160889,
-0.2813512682914734,
-0.1508825272321701,
-0.2780050039291382,
0.1833304762840271,
0.316398561000824,
-0.13957536220550537,
0.04246625304222107,
0.44325172901153564,
0.022460544481873512,
-0.2528306841850281,
0.4939727187156677,
0.6692550778388977,
0.18015868961811066,
0.08514272421598434,
0.2735516130924225,
0.43182873725891113,
0.13582324981689453,
0.020515404641628265,
0.024260420352220535,
0.05667167156934738,
0.12727883458137512,
0.10307414084672928,
0.07697907835245132,
-0.27716881036758423,
-0.12457792460918427,
-0.08750005066394806,
-0.06723810732364655,
-0.1865215301513672,
0.4790487587451935,
-0.15038283169269562,
-0.05136967450380325,
-0.11689019203186035,
-0.09441719949245453,
-0.3943907618522644,
0.1214756965637207,
0.019778016954660416,
-0.4564698338508606,
0.17648692429065704,
-0.26114585995674133,
0.06262421607971191,
-0.46211332082748413,
0.48338812589645386,
0.28896522521972656,
-0.09703560918569565,
-0.28911107778549194,
0.17044715583324432,
-0.1316971778869629,
0.25289180874824524,
-0.32445600628852844,
-0.021369613707065582,
0.06431575119495392,
0.20506848394870758,
-0.0891370102763176,
-0.1103254109621048,
0.4810141324996948,
-0.35096657276153564,
-0.05086002126336098,
0.09580790996551514,
-0.2468879669904709,
-0.0769418329000473,
0.20355072617530823,
-0.09724371135234833,
-0.03800024837255478,
-0.38257062435150146,
0.5132514834403992,
-0.15933077037334442,
0.09428784996271133,
0.037323422729969025,
-0.3444976210594177,
0.02365323156118393,
-0.41660526394844055,
0.4529227018356323,
0.24288424849510193,
0.031932175159454346,
-0.3447103798389435,
-0.4273967146873474,
0.13396817445755005,
-0.17312604188919067,
-0.1972462236881256,
-0.16759222745895386,
-0.035295747220516205,
0.47980475425720215,
0.09993910044431686,
-0.3038891851902008,
-0.17113393545150757,
0.69660884141922,
-0.07010780274868011,
-0.005081254988908768,
0.0382784828543663,
0.26715636253356934,
0.054250240325927734,
-0.19340768456459045,
-0.034320004284381866,
0.10745611786842346,
0.28181886672973633,
0.06024613231420517,
-0.4368166923522949,
-0.45407986640930176,
0.4860836863517761,
-0.11445537954568863,
-0.18978090584278107,
0.03003193438053131,
0.3980982303619385,
0.06103218346834183,
-0.1634429544210434,
-0.14517106115818024,
0.07098531723022461,
0.24128669500350952,
0.3146839737892151,
-0.3342404365539551,
0.4785138964653015,
-0.31949710845947266,
-0.23119468986988068,
0.04196011275053024,
0.21646401286125183,
-0.06503764539957047,
-0.29471954703330994,
0.5019763112068176,
-0.03680211305618286
] |
https://github.com/huggingface/datasets/issues/6257 | We could fix this by creating a single commit for all the (Parquet) shards in `push_to_hub` instead of one commit per shard, as we currently do.
@Wauplin Any updates on the 2-step commit process suggested by you that we need to implement this? | HfHubHTTPError - exceeded our hourly quotas for action: commit | ### Describe the bug
I try to upload a very large dataset of images, and get the following error:
```
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future)
2710 try:
2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params)
-> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit")
2713 except RepositoryNotFoundError as e:
2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE)
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name)
297 raise BadRequestError(message, response=response) from e
299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
300 # as well (request id and/or server error message)
--> 301 raise HfHubHTTPError(str(e), response=response) from e
HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd)
You have exceeded our hourly quotas for action: commit. We invite you to retry later.
```
this makes it much less convenient to host large datasets on HF hub.
### Steps to reproduce the bug
Upload a very large dataset of images
### Expected behavior
the upload to work well
### Environment info
- `datasets` version: 2.13.1
- Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 43 | HfHubHTTPError - exceeded our hourly quotas for action: commit
### Describe the bug
I try to upload a very large dataset of images, and get the following error:
```
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future)
2710 try:
2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params)
-> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit")
2713 except RepositoryNotFoundError as e:
2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE)
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name)
297 raise BadRequestError(message, response=response) from e
299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
300 # as well (request id and/or server error message)
--> 301 raise HfHubHTTPError(str(e), response=response) from e
HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd)
You have exceeded our hourly quotas for action: commit. We invite you to retry later.
```
this makes it much less convenient to host large datasets on HF hub.
### Steps to reproduce the bug
Upload a very large dataset of images
### Expected behavior
the upload to work well
### Environment info
- `datasets` version: 2.13.1
- Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
We could fix this by creating a single commit for all the (Parquet) shards in `push_to_hub` instead of one commit per shard, as we currently do.
@Wauplin Any updates on the 2-step commit process suggested by you that we need to implement this? | [
-0.03922600299119949,
-0.22926321625709534,
-0.018464691936969757,
0.09591218829154968,
0.08189208805561066,
-0.20637744665145874,
-0.14135736227035522,
0.3770289123058319,
0.12479234486818314,
0.24446263909339905,
-0.03737182170152664,
-0.36246365308761597,
-0.03629541024565697,
0.3728710412979126,
0.00027113407850265503,
0.056022193282842636,
-0.07388336956501007,
-0.1386488527059555,
-0.14726004004478455,
-0.058082208037376404,
-0.12920372188091278,
0.024919377639889717,
0.10035337507724762,
-0.009165547788143158,
-0.24890807271003723,
-0.07494562119245529,
-0.13089516758918762,
0.3392219841480255,
-0.04449485242366791,
-0.23743587732315063,
-0.188465416431427,
-0.06125325709581375,
0.19550004601478577,
0.7011910080909729,
-0.00011578419071156532,
-0.2127181440591812,
0.11654181778430939,
-0.13366785645484924,
-0.3797215223312378,
0.13287308812141418,
-0.27204087376594543,
-0.44667091965675354,
-0.3890724182128906,
-0.08353042602539062,
0.34497296810150146,
0.02559848129749298,
0.09355920553207397,
0.15550746023654938,
0.4926735758781433,
0.30635538697242737,
0.19585925340652466,
0.16698074340820312,
0.26776593923568726,
-0.052974771708250046,
0.08566669374704361,
0.3213253319263458,
-0.11928069591522217,
0.23478955030441284,
0.15960103273391724,
-0.10395848751068115,
-0.18438264727592468,
0.04409747198224068,
0.1409730613231659,
0.2764884829521179,
0.0571487620472908,
-0.17513391375541687,
-0.059487711638212204,
-0.40561819076538086,
0.17392852902412415,
0.13492920994758606,
-0.029169943183660507,
0.06389424949884415,
-0.3407580852508545,
-0.16054891049861908,
-0.08632458746433258,
-0.2531357407569885,
-0.020789850503206253,
0.5100002288818359,
-0.19830641150474548,
-0.05352349579334259,
0.15014062821865082,
-0.14865070581436157,
-0.11206286400556564,
0.1480044573545456,
0.12771114706993103,
-0.2809560000896454,
-0.061425305902957916,
0.06653985381126404,
0.33579394221305847,
-0.2753249406814575,
-0.27286040782928467,
-0.12204062193632126,
0.1495521068572998,
0.10772504657506943,
-0.3929975628852844,
0.021746836602687836,
0.1330159604549408,
-0.29510051012039185,
0.4897311329841614,
0.10660943388938904,
-0.12935581803321838,
-0.016932513564825058,
-0.3208959102630615,
0.032063812017440796,
0.121296226978302,
0.14975276589393616,
-0.21000507473945618,
0.19576424360275269,
0.16999156773090363,
0.5435855388641357,
0.1535455733537674,
0.07679973542690277,
0.13968980312347412,
-0.1434740573167801,
-0.06671933829784393,
-0.001779351383447647,
0.2585814893245697,
-0.1549941748380661,
-0.24031972885131836,
0.3444884419441223,
-0.32838383316993713,
0.00014524534344673157,
-0.2144918292760849,
0.3158576786518097,
-0.15544626116752625,
-0.03331604599952698,
0.02284281700849533,
-0.049090415239334106,
-0.25854891538619995,
-0.05692530795931816,
-0.22858303785324097,
0.09602242708206177,
0.12650242447853088,
0.3918883800506592,
-0.034341488033533096,
-0.2185489982366562,
-0.10253313183784485,
0.1733456403017044,
0.5023322701454163,
-0.1336892694234848,
0.1451408863067627,
-0.35244253277778625,
0.04250609129667282,
0.4721531271934509,
0.1380055546760559,
0.12319492548704147,
0.22404056787490845,
-0.022822007536888123,
0.057533204555511475,
0.07481109350919724,
-0.21896056830883026,
-0.24561969935894012,
-0.24908769130706787,
0.20031297206878662,
0.2568315267562866,
-0.05258288234472275,
-0.5403794646263123,
-0.17315837740898132,
-0.02840069681406021,
0.445170134305954,
0.1808648258447647,
0.10408864915370941,
0.23719358444213867,
0.019198719412088394,
-0.09037350118160248,
0.7094290852546692,
0.08677156269550323,
0.029196999967098236,
0.22653236985206604,
0.0884530171751976,
0.2720140218734741,
0.46015164256095886,
0.06428559124469757,
0.07076866924762726,
-0.24426448345184326,
0.1216324120759964,
-0.263165146112442,
-0.46013638377189636,
-0.2602365016937256,
0.24159756302833557,
-0.11280649900436401,
-0.12364444136619568,
0.19079601764678955,
-0.17990127205848694,
0.10859622061252594,
-0.06396321952342987,
0.20574656128883362,
0.0013929661363363266,
-0.018268944695591927,
0.17702293395996094,
-0.28543365001678467,
-0.319198876619339,
-0.4759348928928375,
0.03781243413686752,
0.3087984621524811,
-0.1792442798614502,
0.1399078518152237,
-0.1423048973083496,
0.32259589433670044,
-0.2663198411464691,
0.15788908302783966,
0.1678985357284546,
0.19404208660125732,
0.17653611302375793,
0.009913478046655655,
0.19216999411582947,
-0.07552097737789154,
0.0758974701166153,
-0.4540722072124481,
0.3462643623352051,
-0.08657941222190857,
-0.11746147274971008,
-0.3407190442085266,
0.09062083065509796,
-0.0749184638261795,
0.10005161911249161,
0.13355159759521484,
-0.11790616065263748,
-0.173429936170578,
0.06446188688278198,
-0.0032659098505973816,
0.5088728070259094,
-0.41525787115097046,
0.14637047052383423,
0.021891873329877853,
0.3286122679710388,
-0.3136644959449768,
-0.2070441097021103,
0.36336997151374817,
0.03026111237704754,
0.3607824146747589,
-0.05442742630839348,
-0.12119836360216141,
0.14375120401382446,
0.10165219753980637,
-0.0066095441579818726,
0.3608674705028534,
0.05527011305093765,
0.261090487241745,
0.16604766249656677,
-0.11103561520576477,
0.12147236615419388,
0.09632126986980438,
-0.017379723489284515,
0.20144543051719666,
0.07045070827007294,
0.03590826690196991,
0.23348374664783478,
0.09374064207077026,
0.03929280489683151,
0.12446552515029907,
-0.008078493177890778,
0.16918405890464783,
0.07647381722927094,
0.1752385050058365,
0.16078276932239532,
-0.07737331092357635,
-0.24250133335590363,
0.0029684975743293762,
-0.012142237275838852,
0.33237311244010925,
-0.12043040990829468,
0.18067792057991028,
0.328388512134552,
0.12202049791812897,
-0.017704971134662628,
0.33870524168014526,
-0.11203920841217041,
0.1869756579399109,
0.026026464998722076,
-0.32968583703041077,
-0.15460050106048584,
0.16861605644226074,
-0.005092643201351166,
-0.09992334246635437,
0.0816827043890953,
0.1725511997938156,
0.11157546937465668,
0.4531727433204651,
0.03129773214459419,
-0.4522339105606079,
-0.3825279474258423,
-0.0601767860352993,
0.3549085259437561,
-0.2842601537704468,
-0.04980272799730301,
-0.13266688585281372,
-0.38012781739234924,
0.12320871651172638,
0.12310630828142166,
-0.29788529872894287,
-0.27548307180404663,
-0.046061400324106216,
-0.04115542396903038,
-0.14750313758850098,
0.10702652484178543,
0.12669923901557922,
0.21168267726898193,
0.15993347764015198,
0.16018496453762054,
-0.10532467067241669,
0.3856981098651886,
-0.14931517839431763,
0.032542165368795395,
0.21433505415916443,
-0.3596545457839966,
0.4731161594390869,
0.08446922153234482,
-0.22801585495471954,
-0.4387301802635193,
-0.2738674283027649,
0.15429040789604187,
0.015199946239590645,
-0.014121468178927898,
-0.07054135948419571,
0.2634546756744385,
-0.12819091975688934,
-0.05073706805706024,
0.11006432771682739,
0.2665122151374817,
-0.19686251878738403,
0.03672236204147339,
-0.1581520289182663,
0.20569415390491486,
0.025727562606334686,
0.1806449592113495,
0.002848127856850624,
-0.5456024408340454,
0.48847496509552,
0.37093400955200195,
0.38944491744041443,
0.25513532757759094,
0.11641842126846313,
0.3021426200866699,
-0.17415396869182587,
-0.18310341238975525,
-0.35467469692230225,
-0.06863348186016083,
0.02997373230755329,
-0.08016054332256317,
-0.5644927024841309,
-0.03218431770801544,
0.07882282137870789,
-0.06392741203308105,
-0.33797767758369446,
-0.5265474319458008,
-0.7257620692253113,
-0.26766449213027954,
-0.008892089128494263,
-0.40521836280822754,
0.07526044547557831,
0.15644320845603943,
-0.30289310216903687,
-0.23579519987106323,
0.11320239305496216,
-0.22291165590286255,
0.08793161809444427,
0.5071728825569153,
0.04862765595316887,
-0.108443982899189,
0.10472054779529572,
0.34337979555130005,
0.5526601672172546,
0.3254212737083435,
0.23907314240932465,
0.7045985460281372,
0.07251809537410736,
0.21483315527439117,
0.010455867275595665,
-0.28779336810112,
0.06705185025930405,
-0.05999762564897537,
0.11802755296230316,
-0.028380244970321655,
0.07168003916740417,
0.21695683896541595,
-0.0019327178597450256,
-0.3126767873764038,
-0.06495577841997147,
-0.2717238664627075,
0.05930590629577637,
0.1762244701385498,
0.09906280040740967,
-0.18891331553459167,
-0.3360629081726074,
-0.1245478093624115,
0.1154116690158844,
0.20638146996498108,
0.2540435492992401,
0.25517991185188293,
0.018525056540966034,
-0.07399054616689682,
0.062748983502388,
-0.44735682010650635,
0.41882404685020447,
0.046540889889001846,
0.23943354189395905,
-0.18597209453582764,
0.0891786441206932,
0.1601487696170807,
-0.3259357511997223,
0.44826561212539673,
0.005541512742638588,
0.05920752137899399,
-0.12186089158058167,
-0.18128979206085205,
-0.22827044129371643,
0.07176916301250458,
-0.04208577424287796,
0.022466059774160385,
0.1611088514328003,
0.26410040259361267,
-0.5085721611976624,
0.01713572070002556,
0.21544525027275085,
-0.16589666903018951,
-0.18903443217277527,
-0.010125473141670227,
-0.19497105479240417,
-0.622818648815155,
-0.6844595074653625,
-0.009863078594207764,
0.2667158544063568,
0.04039658233523369,
0.32651668787002563,
-0.20706894993782043,
0.3672209680080414,
-0.16921687126159668,
-0.16307203471660614,
-0.4771134853363037,
-0.10173088312149048,
0.3535187542438507,
0.05951046943664551,
-0.16237883269786835,
-0.2520103454589844,
0.44207271933555603,
0.36674103140830994,
0.03166494145989418,
-0.014095421880483627,
0.18272994458675385,
0.02132631093263626,
-0.0082940012216568,
0.4976402819156647,
0.23377388715744019,
0.35757023096084595,
0.24187703430652618,
0.7080681920051575,
-0.26728537678718567,
0.12636929750442505,
0.3933710753917694,
-0.30172812938690186,
-0.08463631570339203,
-0.08676169067621231,
0.32155776023864746,
-0.14686545729637146,
0.18656229972839355,
0.13872116804122925,
0.6318668723106384,
0.2069743424654007,
0.04735500365495682,
0.20719248056411743,
0.9926201105117798,
-0.22762537002563477,
0.3066854476928711,
0.20236292481422424,
-0.480747789144516,
0.08049513399600983,
-0.11324825137853622,
-0.08260489255189896,
-0.22656536102294922,
-0.07526226341724396,
0.06582765281200409,
-0.07612831890583038,
0.11942757666110992,
-0.390076220035553,
-0.11413949728012085,
0.08593680709600449,
-0.199289932847023,
0.15196669101715088,
0.03403313457965851,
0.21271011233329773,
-0.7284248471260071,
-0.3583454489707947,
-0.2975483238697052,
0.2217995971441269,
-0.10947996377944946,
0.15481624007225037,
-0.11082036793231964,
-0.2075425237417221,
-0.07256276905536652,
-0.09619642794132233,
-0.3818748891353607,
-0.014505825936794281,
-0.28309398889541626,
0.09244835376739502,
-0.04397812485694885,
0.07994592189788818,
-0.3188781142234802,
-0.4688585698604584,
-0.050479549914598465,
-0.08293884247541428,
-0.07337206602096558,
0.023265236988663673,
-0.24811118841171265,
0.017322000116109848,
-0.15197069942951202,
-0.11623881757259369,
0.3919682800769806,
-0.2416692078113556,
-0.13508519530296326,
-0.006745288148522377,
0.14796017110347748,
-0.15620222687721252,
-0.1646512895822525,
0.2805403470993042,
-0.10281718522310257,
-0.12806004285812378,
0.17148742079734802,
-0.009953290224075317,
-0.35467708110809326,
-0.05906018614768982,
0.08444413542747498,
0.03668372333049774,
-0.012588594108819962,
0.06764665246009827,
0.23693187534809113,
-0.11116684973239899,
-0.2015523910522461,
0.43185678124427795,
0.22813642024993896,
-0.037650562822818756,
0.3274925649166107,
0.25509750843048096,
-0.08769898861646652,
-0.13847512006759644,
0.08776158094406128,
-0.19514726102352142,
-0.6272436380386353,
0.3812766969203949,
-0.16536974906921387,
-0.008063718676567078,
-0.08826582133769989,
0.28043216466903687,
0.11090394854545593,
-0.19256439805030823,
0.04807320237159729,
-0.15697181224822998,
-0.30605313181877136,
0.08428485691547394,
-0.32574835419654846,
-0.021907363086938858,
-0.03552452102303505,
0.3191626965999603,
0.1652882695198059,
0.29886388778686523,
-0.2986494302749634,
0.11831703782081604,
-0.45201605558395386,
0.07126571238040924,
0.08386394381523132,
-0.2374521791934967,
0.3404344916343689,
-0.054994724690914154,
0.08649681508541107,
0.37029290199279785,
-0.31458133459091187,
-0.19112658500671387,
-0.3273641765117645,
0.13787303864955902,
0.2669082581996918,
-0.03857552632689476,
0.003003966063261032,
-0.2137058526277542,
-0.12576085329055786,
0.06633616983890533,
0.10003326833248138,
0.13165584206581116,
-0.173875093460083,
-0.2728877663612366,
0.3541199862957001,
-0.16573195159435272,
0.19263458251953125,
0.039808303117752075,
0.24262426793575287,
0.3977923095226288,
0.10083401203155518,
-0.028696518391370773,
-0.027778537943959236,
-0.10723405331373215,
-0.13773472607135773,
0.20800568163394928,
0.25270816683769226,
-0.014085810631513596,
0.3801650404930115,
-0.3233279585838318,
-0.23705947399139404,
-0.1796332746744156,
0.3303544223308563,
-0.16505800187587738,
-0.2299230396747589,
-0.11001914739608765,
0.030669763684272766,
0.18830463290214539,
-0.02183164656162262,
-0.11893628537654877,
0.06465412676334381,
-0.2728828191757202,
-0.03182113170623779,
0.2662625312805176,
0.13989117741584778,
-0.11474204063415527,
0.09319412708282471,
0.29010555148124695,
0.09768159687519073,
-0.09525488317012787,
-0.26165950298309326,
0.018306974321603775,
-0.227411687374115,
0.04246367886662483,
0.3349103033542633,
-0.15798483788967133,
0.39265111088752747,
-0.19156552851200104,
-0.010989602655172348,
0.0829450935125351,
0.018899748101830482,
0.021324891597032547,
0.23087593913078308,
-0.5445398688316345,
0.06017226725816727,
0.2613981068134308,
0.20838281512260437,
0.22360475361347198,
0.010317087173461914,
0.4503357410430908,
0.21157683432102203,
-0.10709411650896072,
-0.009049952030181885,
0.16127289831638336,
-0.06346004456281662,
0.4210626482963562,
0.1879047453403473,
-0.08920332044363022,
-0.2776825428009033,
0.029767312109470367,
0.10429389774799347,
-0.23662817478179932,
0.433072954416275,
-0.012476146221160889,
-0.2813512682914734,
-0.1508825272321701,
-0.2780050039291382,
0.1833304762840271,
0.316398561000824,
-0.13957536220550537,
0.04246625304222107,
0.44325172901153564,
0.022460544481873512,
-0.2528306841850281,
0.4939727187156677,
0.6692550778388977,
0.18015868961811066,
0.08514272421598434,
0.2735516130924225,
0.43182873725891113,
0.13582324981689453,
0.020515404641628265,
0.024260420352220535,
0.05667167156934738,
0.12727883458137512,
0.10307414084672928,
0.07697907835245132,
-0.27716881036758423,
-0.12457792460918427,
-0.08750005066394806,
-0.06723810732364655,
-0.1865215301513672,
0.4790487587451935,
-0.15038283169269562,
-0.05136967450380325,
-0.11689019203186035,
-0.09441719949245453,
-0.3943907618522644,
0.1214756965637207,
0.019778016954660416,
-0.4564698338508606,
0.17648692429065704,
-0.26114585995674133,
0.06262421607971191,
-0.46211332082748413,
0.48338812589645386,
0.28896522521972656,
-0.09703560918569565,
-0.28911107778549194,
0.17044715583324432,
-0.1316971778869629,
0.25289180874824524,
-0.32445600628852844,
-0.021369613707065582,
0.06431575119495392,
0.20506848394870758,
-0.0891370102763176,
-0.1103254109621048,
0.4810141324996948,
-0.35096657276153564,
-0.05086002126336098,
0.09580790996551514,
-0.2468879669904709,
-0.0769418329000473,
0.20355072617530823,
-0.09724371135234833,
-0.03800024837255478,
-0.38257062435150146,
0.5132514834403992,
-0.15933077037334442,
0.09428784996271133,
0.037323422729969025,
-0.3444976210594177,
0.02365323156118393,
-0.41660526394844055,
0.4529227018356323,
0.24288424849510193,
0.031932175159454346,
-0.3447103798389435,
-0.4273967146873474,
0.13396817445755005,
-0.17312604188919067,
-0.1972462236881256,
-0.16759222745895386,
-0.035295747220516205,
0.47980475425720215,
0.09993910044431686,
-0.3038891851902008,
-0.17113393545150757,
0.69660884141922,
-0.07010780274868011,
-0.005081254988908768,
0.0382784828543663,
0.26715636253356934,
0.054250240325927734,
-0.19340768456459045,
-0.034320004284381866,
0.10745611786842346,
0.28181886672973633,
0.06024613231420517,
-0.4368166923522949,
-0.45407986640930176,
0.4860836863517761,
-0.11445537954568863,
-0.18978090584278107,
0.03003193438053131,
0.3980982303619385,
0.06103218346834183,
-0.1634429544210434,
-0.14517106115818024,
0.07098531723022461,
0.24128669500350952,
0.3146839737892151,
-0.3342404365539551,
0.4785138964653015,
-0.31949710845947266,
-0.23119468986988068,
0.04196011275053024,
0.21646401286125183,
-0.06503764539957047,
-0.29471954703330994,
0.5019763112068176,
-0.03680211305618286
] |
https://github.com/huggingface/datasets/issues/6257 | > Any updates on the 2-step commit process suggested by you that we need to implement this?
Re-prioritizing this, sorry. Will let you know but probably can be done this week. | HfHubHTTPError - exceeded our hourly quotas for action: commit | ### Describe the bug
I try to upload a very large dataset of images, and get the following error:
```
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future)
2710 try:
2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params)
-> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit")
2713 except RepositoryNotFoundError as e:
2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE)
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name)
297 raise BadRequestError(message, response=response) from e
299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
300 # as well (request id and/or server error message)
--> 301 raise HfHubHTTPError(str(e), response=response) from e
HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd)
You have exceeded our hourly quotas for action: commit. We invite you to retry later.
```
this makes it much less convenient to host large datasets on HF hub.
### Steps to reproduce the bug
Upload a very large dataset of images
### Expected behavior
the upload to work well
### Environment info
- `datasets` version: 2.13.1
- Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 31 | HfHubHTTPError - exceeded our hourly quotas for action: commit
### Describe the bug
I try to upload a very large dataset of images, and get the following error:
```
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future)
2710 try:
2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params)
-> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit")
2713 except RepositoryNotFoundError as e:
2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE)
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name)
297 raise BadRequestError(message, response=response) from e
299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
300 # as well (request id and/or server error message)
--> 301 raise HfHubHTTPError(str(e), response=response) from e
HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd)
You have exceeded our hourly quotas for action: commit. We invite you to retry later.
```
this makes it much less convenient to host large datasets on HF hub.
### Steps to reproduce the bug
Upload a very large dataset of images
### Expected behavior
the upload to work well
### Environment info
- `datasets` version: 2.13.1
- Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
> Any updates on the 2-step commit process suggested by you that we need to implement this?
Re-prioritizing this, sorry. Will let you know but probably can be done this week. | [
-0.03922600299119949,
-0.22926321625709534,
-0.018464691936969757,
0.09591218829154968,
0.08189208805561066,
-0.20637744665145874,
-0.14135736227035522,
0.3770289123058319,
0.12479234486818314,
0.24446263909339905,
-0.03737182170152664,
-0.36246365308761597,
-0.03629541024565697,
0.3728710412979126,
0.00027113407850265503,
0.056022193282842636,
-0.07388336956501007,
-0.1386488527059555,
-0.14726004004478455,
-0.058082208037376404,
-0.12920372188091278,
0.024919377639889717,
0.10035337507724762,
-0.009165547788143158,
-0.24890807271003723,
-0.07494562119245529,
-0.13089516758918762,
0.3392219841480255,
-0.04449485242366791,
-0.23743587732315063,
-0.188465416431427,
-0.06125325709581375,
0.19550004601478577,
0.7011910080909729,
-0.00011578419071156532,
-0.2127181440591812,
0.11654181778430939,
-0.13366785645484924,
-0.3797215223312378,
0.13287308812141418,
-0.27204087376594543,
-0.44667091965675354,
-0.3890724182128906,
-0.08353042602539062,
0.34497296810150146,
0.02559848129749298,
0.09355920553207397,
0.15550746023654938,
0.4926735758781433,
0.30635538697242737,
0.19585925340652466,
0.16698074340820312,
0.26776593923568726,
-0.052974771708250046,
0.08566669374704361,
0.3213253319263458,
-0.11928069591522217,
0.23478955030441284,
0.15960103273391724,
-0.10395848751068115,
-0.18438264727592468,
0.04409747198224068,
0.1409730613231659,
0.2764884829521179,
0.0571487620472908,
-0.17513391375541687,
-0.059487711638212204,
-0.40561819076538086,
0.17392852902412415,
0.13492920994758606,
-0.029169943183660507,
0.06389424949884415,
-0.3407580852508545,
-0.16054891049861908,
-0.08632458746433258,
-0.2531357407569885,
-0.020789850503206253,
0.5100002288818359,
-0.19830641150474548,
-0.05352349579334259,
0.15014062821865082,
-0.14865070581436157,
-0.11206286400556564,
0.1480044573545456,
0.12771114706993103,
-0.2809560000896454,
-0.061425305902957916,
0.06653985381126404,
0.33579394221305847,
-0.2753249406814575,
-0.27286040782928467,
-0.12204062193632126,
0.1495521068572998,
0.10772504657506943,
-0.3929975628852844,
0.021746836602687836,
0.1330159604549408,
-0.29510051012039185,
0.4897311329841614,
0.10660943388938904,
-0.12935581803321838,
-0.016932513564825058,
-0.3208959102630615,
0.032063812017440796,
0.121296226978302,
0.14975276589393616,
-0.21000507473945618,
0.19576424360275269,
0.16999156773090363,
0.5435855388641357,
0.1535455733537674,
0.07679973542690277,
0.13968980312347412,
-0.1434740573167801,
-0.06671933829784393,
-0.001779351383447647,
0.2585814893245697,
-0.1549941748380661,
-0.24031972885131836,
0.3444884419441223,
-0.32838383316993713,
0.00014524534344673157,
-0.2144918292760849,
0.3158576786518097,
-0.15544626116752625,
-0.03331604599952698,
0.02284281700849533,
-0.049090415239334106,
-0.25854891538619995,
-0.05692530795931816,
-0.22858303785324097,
0.09602242708206177,
0.12650242447853088,
0.3918883800506592,
-0.034341488033533096,
-0.2185489982366562,
-0.10253313183784485,
0.1733456403017044,
0.5023322701454163,
-0.1336892694234848,
0.1451408863067627,
-0.35244253277778625,
0.04250609129667282,
0.4721531271934509,
0.1380055546760559,
0.12319492548704147,
0.22404056787490845,
-0.022822007536888123,
0.057533204555511475,
0.07481109350919724,
-0.21896056830883026,
-0.24561969935894012,
-0.24908769130706787,
0.20031297206878662,
0.2568315267562866,
-0.05258288234472275,
-0.5403794646263123,
-0.17315837740898132,
-0.02840069681406021,
0.445170134305954,
0.1808648258447647,
0.10408864915370941,
0.23719358444213867,
0.019198719412088394,
-0.09037350118160248,
0.7094290852546692,
0.08677156269550323,
0.029196999967098236,
0.22653236985206604,
0.0884530171751976,
0.2720140218734741,
0.46015164256095886,
0.06428559124469757,
0.07076866924762726,
-0.24426448345184326,
0.1216324120759964,
-0.263165146112442,
-0.46013638377189636,
-0.2602365016937256,
0.24159756302833557,
-0.11280649900436401,
-0.12364444136619568,
0.19079601764678955,
-0.17990127205848694,
0.10859622061252594,
-0.06396321952342987,
0.20574656128883362,
0.0013929661363363266,
-0.018268944695591927,
0.17702293395996094,
-0.28543365001678467,
-0.319198876619339,
-0.4759348928928375,
0.03781243413686752,
0.3087984621524811,
-0.1792442798614502,
0.1399078518152237,
-0.1423048973083496,
0.32259589433670044,
-0.2663198411464691,
0.15788908302783966,
0.1678985357284546,
0.19404208660125732,
0.17653611302375793,
0.009913478046655655,
0.19216999411582947,
-0.07552097737789154,
0.0758974701166153,
-0.4540722072124481,
0.3462643623352051,
-0.08657941222190857,
-0.11746147274971008,
-0.3407190442085266,
0.09062083065509796,
-0.0749184638261795,
0.10005161911249161,
0.13355159759521484,
-0.11790616065263748,
-0.173429936170578,
0.06446188688278198,
-0.0032659098505973816,
0.5088728070259094,
-0.41525787115097046,
0.14637047052383423,
0.021891873329877853,
0.3286122679710388,
-0.3136644959449768,
-0.2070441097021103,
0.36336997151374817,
0.03026111237704754,
0.3607824146747589,
-0.05442742630839348,
-0.12119836360216141,
0.14375120401382446,
0.10165219753980637,
-0.0066095441579818726,
0.3608674705028534,
0.05527011305093765,
0.261090487241745,
0.16604766249656677,
-0.11103561520576477,
0.12147236615419388,
0.09632126986980438,
-0.017379723489284515,
0.20144543051719666,
0.07045070827007294,
0.03590826690196991,
0.23348374664783478,
0.09374064207077026,
0.03929280489683151,
0.12446552515029907,
-0.008078493177890778,
0.16918405890464783,
0.07647381722927094,
0.1752385050058365,
0.16078276932239532,
-0.07737331092357635,
-0.24250133335590363,
0.0029684975743293762,
-0.012142237275838852,
0.33237311244010925,
-0.12043040990829468,
0.18067792057991028,
0.328388512134552,
0.12202049791812897,
-0.017704971134662628,
0.33870524168014526,
-0.11203920841217041,
0.1869756579399109,
0.026026464998722076,
-0.32968583703041077,
-0.15460050106048584,
0.16861605644226074,
-0.005092643201351166,
-0.09992334246635437,
0.0816827043890953,
0.1725511997938156,
0.11157546937465668,
0.4531727433204651,
0.03129773214459419,
-0.4522339105606079,
-0.3825279474258423,
-0.0601767860352993,
0.3549085259437561,
-0.2842601537704468,
-0.04980272799730301,
-0.13266688585281372,
-0.38012781739234924,
0.12320871651172638,
0.12310630828142166,
-0.29788529872894287,
-0.27548307180404663,
-0.046061400324106216,
-0.04115542396903038,
-0.14750313758850098,
0.10702652484178543,
0.12669923901557922,
0.21168267726898193,
0.15993347764015198,
0.16018496453762054,
-0.10532467067241669,
0.3856981098651886,
-0.14931517839431763,
0.032542165368795395,
0.21433505415916443,
-0.3596545457839966,
0.4731161594390869,
0.08446922153234482,
-0.22801585495471954,
-0.4387301802635193,
-0.2738674283027649,
0.15429040789604187,
0.015199946239590645,
-0.014121468178927898,
-0.07054135948419571,
0.2634546756744385,
-0.12819091975688934,
-0.05073706805706024,
0.11006432771682739,
0.2665122151374817,
-0.19686251878738403,
0.03672236204147339,
-0.1581520289182663,
0.20569415390491486,
0.025727562606334686,
0.1806449592113495,
0.002848127856850624,
-0.5456024408340454,
0.48847496509552,
0.37093400955200195,
0.38944491744041443,
0.25513532757759094,
0.11641842126846313,
0.3021426200866699,
-0.17415396869182587,
-0.18310341238975525,
-0.35467469692230225,
-0.06863348186016083,
0.02997373230755329,
-0.08016054332256317,
-0.5644927024841309,
-0.03218431770801544,
0.07882282137870789,
-0.06392741203308105,
-0.33797767758369446,
-0.5265474319458008,
-0.7257620692253113,
-0.26766449213027954,
-0.008892089128494263,
-0.40521836280822754,
0.07526044547557831,
0.15644320845603943,
-0.30289310216903687,
-0.23579519987106323,
0.11320239305496216,
-0.22291165590286255,
0.08793161809444427,
0.5071728825569153,
0.04862765595316887,
-0.108443982899189,
0.10472054779529572,
0.34337979555130005,
0.5526601672172546,
0.3254212737083435,
0.23907314240932465,
0.7045985460281372,
0.07251809537410736,
0.21483315527439117,
0.010455867275595665,
-0.28779336810112,
0.06705185025930405,
-0.05999762564897537,
0.11802755296230316,
-0.028380244970321655,
0.07168003916740417,
0.21695683896541595,
-0.0019327178597450256,
-0.3126767873764038,
-0.06495577841997147,
-0.2717238664627075,
0.05930590629577637,
0.1762244701385498,
0.09906280040740967,
-0.18891331553459167,
-0.3360629081726074,
-0.1245478093624115,
0.1154116690158844,
0.20638146996498108,
0.2540435492992401,
0.25517991185188293,
0.018525056540966034,
-0.07399054616689682,
0.062748983502388,
-0.44735682010650635,
0.41882404685020447,
0.046540889889001846,
0.23943354189395905,
-0.18597209453582764,
0.0891786441206932,
0.1601487696170807,
-0.3259357511997223,
0.44826561212539673,
0.005541512742638588,
0.05920752137899399,
-0.12186089158058167,
-0.18128979206085205,
-0.22827044129371643,
0.07176916301250458,
-0.04208577424287796,
0.022466059774160385,
0.1611088514328003,
0.26410040259361267,
-0.5085721611976624,
0.01713572070002556,
0.21544525027275085,
-0.16589666903018951,
-0.18903443217277527,
-0.010125473141670227,
-0.19497105479240417,
-0.622818648815155,
-0.6844595074653625,
-0.009863078594207764,
0.2667158544063568,
0.04039658233523369,
0.32651668787002563,
-0.20706894993782043,
0.3672209680080414,
-0.16921687126159668,
-0.16307203471660614,
-0.4771134853363037,
-0.10173088312149048,
0.3535187542438507,
0.05951046943664551,
-0.16237883269786835,
-0.2520103454589844,
0.44207271933555603,
0.36674103140830994,
0.03166494145989418,
-0.014095421880483627,
0.18272994458675385,
0.02132631093263626,
-0.0082940012216568,
0.4976402819156647,
0.23377388715744019,
0.35757023096084595,
0.24187703430652618,
0.7080681920051575,
-0.26728537678718567,
0.12636929750442505,
0.3933710753917694,
-0.30172812938690186,
-0.08463631570339203,
-0.08676169067621231,
0.32155776023864746,
-0.14686545729637146,
0.18656229972839355,
0.13872116804122925,
0.6318668723106384,
0.2069743424654007,
0.04735500365495682,
0.20719248056411743,
0.9926201105117798,
-0.22762537002563477,
0.3066854476928711,
0.20236292481422424,
-0.480747789144516,
0.08049513399600983,
-0.11324825137853622,
-0.08260489255189896,
-0.22656536102294922,
-0.07526226341724396,
0.06582765281200409,
-0.07612831890583038,
0.11942757666110992,
-0.390076220035553,
-0.11413949728012085,
0.08593680709600449,
-0.199289932847023,
0.15196669101715088,
0.03403313457965851,
0.21271011233329773,
-0.7284248471260071,
-0.3583454489707947,
-0.2975483238697052,
0.2217995971441269,
-0.10947996377944946,
0.15481624007225037,
-0.11082036793231964,
-0.2075425237417221,
-0.07256276905536652,
-0.09619642794132233,
-0.3818748891353607,
-0.014505825936794281,
-0.28309398889541626,
0.09244835376739502,
-0.04397812485694885,
0.07994592189788818,
-0.3188781142234802,
-0.4688585698604584,
-0.050479549914598465,
-0.08293884247541428,
-0.07337206602096558,
0.023265236988663673,
-0.24811118841171265,
0.017322000116109848,
-0.15197069942951202,
-0.11623881757259369,
0.3919682800769806,
-0.2416692078113556,
-0.13508519530296326,
-0.006745288148522377,
0.14796017110347748,
-0.15620222687721252,
-0.1646512895822525,
0.2805403470993042,
-0.10281718522310257,
-0.12806004285812378,
0.17148742079734802,
-0.009953290224075317,
-0.35467708110809326,
-0.05906018614768982,
0.08444413542747498,
0.03668372333049774,
-0.012588594108819962,
0.06764665246009827,
0.23693187534809113,
-0.11116684973239899,
-0.2015523910522461,
0.43185678124427795,
0.22813642024993896,
-0.037650562822818756,
0.3274925649166107,
0.25509750843048096,
-0.08769898861646652,
-0.13847512006759644,
0.08776158094406128,
-0.19514726102352142,
-0.6272436380386353,
0.3812766969203949,
-0.16536974906921387,
-0.008063718676567078,
-0.08826582133769989,
0.28043216466903687,
0.11090394854545593,
-0.19256439805030823,
0.04807320237159729,
-0.15697181224822998,
-0.30605313181877136,
0.08428485691547394,
-0.32574835419654846,
-0.021907363086938858,
-0.03552452102303505,
0.3191626965999603,
0.1652882695198059,
0.29886388778686523,
-0.2986494302749634,
0.11831703782081604,
-0.45201605558395386,
0.07126571238040924,
0.08386394381523132,
-0.2374521791934967,
0.3404344916343689,
-0.054994724690914154,
0.08649681508541107,
0.37029290199279785,
-0.31458133459091187,
-0.19112658500671387,
-0.3273641765117645,
0.13787303864955902,
0.2669082581996918,
-0.03857552632689476,
0.003003966063261032,
-0.2137058526277542,
-0.12576085329055786,
0.06633616983890533,
0.10003326833248138,
0.13165584206581116,
-0.173875093460083,
-0.2728877663612366,
0.3541199862957001,
-0.16573195159435272,
0.19263458251953125,
0.039808303117752075,
0.24262426793575287,
0.3977923095226288,
0.10083401203155518,
-0.028696518391370773,
-0.027778537943959236,
-0.10723405331373215,
-0.13773472607135773,
0.20800568163394928,
0.25270816683769226,
-0.014085810631513596,
0.3801650404930115,
-0.3233279585838318,
-0.23705947399139404,
-0.1796332746744156,
0.3303544223308563,
-0.16505800187587738,
-0.2299230396747589,
-0.11001914739608765,
0.030669763684272766,
0.18830463290214539,
-0.02183164656162262,
-0.11893628537654877,
0.06465412676334381,
-0.2728828191757202,
-0.03182113170623779,
0.2662625312805176,
0.13989117741584778,
-0.11474204063415527,
0.09319412708282471,
0.29010555148124695,
0.09768159687519073,
-0.09525488317012787,
-0.26165950298309326,
0.018306974321603775,
-0.227411687374115,
0.04246367886662483,
0.3349103033542633,
-0.15798483788967133,
0.39265111088752747,
-0.19156552851200104,
-0.010989602655172348,
0.0829450935125351,
0.018899748101830482,
0.021324891597032547,
0.23087593913078308,
-0.5445398688316345,
0.06017226725816727,
0.2613981068134308,
0.20838281512260437,
0.22360475361347198,
0.010317087173461914,
0.4503357410430908,
0.21157683432102203,
-0.10709411650896072,
-0.009049952030181885,
0.16127289831638336,
-0.06346004456281662,
0.4210626482963562,
0.1879047453403473,
-0.08920332044363022,
-0.2776825428009033,
0.029767312109470367,
0.10429389774799347,
-0.23662817478179932,
0.433072954416275,
-0.012476146221160889,
-0.2813512682914734,
-0.1508825272321701,
-0.2780050039291382,
0.1833304762840271,
0.316398561000824,
-0.13957536220550537,
0.04246625304222107,
0.44325172901153564,
0.022460544481873512,
-0.2528306841850281,
0.4939727187156677,
0.6692550778388977,
0.18015868961811066,
0.08514272421598434,
0.2735516130924225,
0.43182873725891113,
0.13582324981689453,
0.020515404641628265,
0.024260420352220535,
0.05667167156934738,
0.12727883458137512,
0.10307414084672928,
0.07697907835245132,
-0.27716881036758423,
-0.12457792460918427,
-0.08750005066394806,
-0.06723810732364655,
-0.1865215301513672,
0.4790487587451935,
-0.15038283169269562,
-0.05136967450380325,
-0.11689019203186035,
-0.09441719949245453,
-0.3943907618522644,
0.1214756965637207,
0.019778016954660416,
-0.4564698338508606,
0.17648692429065704,
-0.26114585995674133,
0.06262421607971191,
-0.46211332082748413,
0.48338812589645386,
0.28896522521972656,
-0.09703560918569565,
-0.28911107778549194,
0.17044715583324432,
-0.1316971778869629,
0.25289180874824524,
-0.32445600628852844,
-0.021369613707065582,
0.06431575119495392,
0.20506848394870758,
-0.0891370102763176,
-0.1103254109621048,
0.4810141324996948,
-0.35096657276153564,
-0.05086002126336098,
0.09580790996551514,
-0.2468879669904709,
-0.0769418329000473,
0.20355072617530823,
-0.09724371135234833,
-0.03800024837255478,
-0.38257062435150146,
0.5132514834403992,
-0.15933077037334442,
0.09428784996271133,
0.037323422729969025,
-0.3444976210594177,
0.02365323156118393,
-0.41660526394844055,
0.4529227018356323,
0.24288424849510193,
0.031932175159454346,
-0.3447103798389435,
-0.4273967146873474,
0.13396817445755005,
-0.17312604188919067,
-0.1972462236881256,
-0.16759222745895386,
-0.035295747220516205,
0.47980475425720215,
0.09993910044431686,
-0.3038891851902008,
-0.17113393545150757,
0.69660884141922,
-0.07010780274868011,
-0.005081254988908768,
0.0382784828543663,
0.26715636253356934,
0.054250240325927734,
-0.19340768456459045,
-0.034320004284381866,
0.10745611786842346,
0.28181886672973633,
0.06024613231420517,
-0.4368166923522949,
-0.45407986640930176,
0.4860836863517761,
-0.11445537954568863,
-0.18978090584278107,
0.03003193438053131,
0.3980982303619385,
0.06103218346834183,
-0.1634429544210434,
-0.14517106115818024,
0.07098531723022461,
0.24128669500350952,
0.3146839737892151,
-0.3342404365539551,
0.4785138964653015,
-0.31949710845947266,
-0.23119468986988068,
0.04196011275053024,
0.21646401286125183,
-0.06503764539957047,
-0.29471954703330994,
0.5019763112068176,
-0.03680211305618286
] |
https://github.com/huggingface/datasets/issues/6256 | Can you share the error message?
Also, it would help if you could check whether `huggingface_hub`'s download behaves the same:
```python
from huggingface_hub import snapshot_download
snapshot_download("trec", repo_type="dataset", cache_dir='/path/to/my/dir)
```
In the next major release, we aim to switch to `huggingface_hub` for file download/caching, but we could align the `cache_dir`'s `umask` behavior earlier than this if their solution works for your use case. | load_dataset() function's cache_dir does not seems to work | ### Describe the bug
datasets version: 2.14.5
when trying to run the following command
trec = load_dataset('trec', split='train[:1000]', cache_dir='/path/to/my/dir')
I keep getting error saying the command does not have permission to the default cache directory on my macbook pro machine.
It seems the cache_dir parameter cannot change the dataset saving directory from the default
what ever explained in the https://huggingface.co/docs/datasets/cache does not seem to work
### Steps to reproduce the bug
datasets version: 2.14.5
when trying to run the following command
trec = load_dataset('trec', split='train[:1000]', cache_dir='/path/to/my/dir')
I keep getting error saying the command does not have permission to the default cache directory on my macbook pro machine.
It seems the cache_dir parameter cannot change the dataset saving directory from the default
what ever explained in the https://huggingface.co/docs/datasets/cache does not seem to work
### Expected behavior
the dataset should be saved to the cache_dir points to
### Environment info
datasets version: 2.14.5
macos X: Ventura 13.4.1 (c) | 62 | load_dataset() function's cache_dir does not seems to work
### Describe the bug
datasets version: 2.14.5
when trying to run the following command
trec = load_dataset('trec', split='train[:1000]', cache_dir='/path/to/my/dir')
I keep getting error saying the command does not have permission to the default cache directory on my macbook pro machine.
It seems the cache_dir parameter cannot change the dataset saving directory from the default
what ever explained in the https://huggingface.co/docs/datasets/cache does not seem to work
### Steps to reproduce the bug
datasets version: 2.14.5
when trying to run the following command
trec = load_dataset('trec', split='train[:1000]', cache_dir='/path/to/my/dir')
I keep getting error saying the command does not have permission to the default cache directory on my macbook pro machine.
It seems the cache_dir parameter cannot change the dataset saving directory from the default
what ever explained in the https://huggingface.co/docs/datasets/cache does not seem to work
### Expected behavior
the dataset should be saved to the cache_dir points to
### Environment info
datasets version: 2.14.5
macos X: Ventura 13.4.1 (c)
Can you share the error message?
Also, it would help if you could check whether `huggingface_hub`'s download behaves the same:
```python
from huggingface_hub import snapshot_download
snapshot_download("trec", repo_type="dataset", cache_dir='/path/to/my/dir)
```
In the next major release, we aim to switch to `huggingface_hub` for file download/caching, but we could align the `cache_dir`'s `umask` behavior earlier than this if their solution works for your use case. | [
-0.2581050992012024,
-0.31126868724823,
0.074449323117733,
0.35234326124191284,
0.2933734655380249,
0.11308468878269196,
0.23795555531978607,
0.019046060740947723,
0.20983633399009705,
0.013005431741476059,
-0.3450019359588623,
0.17233601212501526,
0.018657244741916656,
0.042720481753349304,
0.06186319887638092,
-0.11040812730789185,
0.12522564828395844,
-0.13575530052185059,
-0.3344816267490387,
0.00714460015296936,
-0.24537992477416992,
0.4090818166732788,
-0.0133189857006073,
0.05023200809955597,
-0.4005635380744934,
-0.08760154992341995,
0.011666439473628998,
0.38054171204566956,
0.02658316120505333,
-0.2523784637451172,
0.46780744194984436,
0.156691312789917,
0.23613643646240234,
0.5669078826904297,
-0.00011838809587061405,
-0.018161989748477936,
0.1497229039669037,
-0.20076555013656616,
-0.32672882080078125,
-0.5200163125991821,
-0.1447199285030365,
-0.17951709032058716,
0.18336692452430725,
-0.07279433310031891,
-0.07698298990726471,
0.1868424117565155,
0.12436261028051376,
-0.3054988384246826,
0.2457370162010193,
0.32684940099716187,
0.17341181635856628,
0.12721246480941772,
-0.1931668519973755,
-0.008813876658678055,
0.022146889939904213,
0.27344760298728943,
-0.2763907313346863,
0.32226118445396423,
-0.11186474561691284,
0.12234975397586823,
0.12291912734508514,
0.3522660732269287,
0.016749687492847443,
0.14386878907680511,
0.6033944487571716,
0.16343699395656586,
-0.2114502489566803,
-0.10140896588563919,
0.07724002003669739,
-0.02977578341960907,
0.5337926149368286,
-0.5563806891441345,
-0.4781959354877472,
-0.17725324630737305,
-0.05061773583292961,
-0.3592386841773987,
0.4418335258960724,
0.25568416714668274,
-0.10866912454366684,
0.25217705965042114,
-0.2959795892238617,
-0.22056615352630615,
-0.01185619831085205,
0.08021212369203568,
0.16931435465812683,
-0.2743481695652008,
-0.36253678798675537,
0.014934545382857323,
0.28285878896713257,
-0.04463404789566994,
0.03587169200181961,
-0.11056239902973175,
0.0631711333990097,
0.14634472131729126,
-0.22500145435333252,
0.34000495076179504,
-0.03075386956334114,
0.5757457613945007,
0.023231588304042816,
0.4137752056121826,
-0.0449686199426651,
0.08094240725040436,
-0.20012977719306946,
0.18892981112003326,
-0.03928279131650925,
0.5295827388763428,
0.044269364327192307,
0.055645860731601715,
0.10951955616474152,
0.3083063066005707,
-0.10877565294504166,
-0.2726359963417053,
0.1811414361000061,
-0.08047765493392944,
-0.009959831833839417,
-0.2968348264694214,
0.13612379133701324,
-0.06703439354896545,
-0.088849276304245,
-0.051992885768413544,
0.1127857193350792,
-0.12819935381412506,
0.34695467352867126,
0.6503781676292419,
-0.14071694016456604,
0.09651212394237518,
-0.05413612350821495,
0.3155164122581482,
-0.16388565301895142,
0.2470489740371704,
-0.34869691729545593,
0.010488022118806839,
-0.14727666974067688,
0.31846287846565247,
0.3198312520980835,
-0.3363025188446045,
0.35480859875679016,
-0.008769981563091278,
0.26394546031951904,
-0.18222105503082275,
-0.08293194323778152,
-0.13179776072502136,
0.1973462998867035,
0.30053019523620605,
0.043604254722595215,
0.25547364354133606,
0.12895864248275757,
0.18858328461647034,
-0.17732810974121094,
0.027021139860153198,
-0.4462255835533142,
-0.3852580189704895,
0.3145618438720703,
0.009612019173800945,
-0.10053163766860962,
0.07493744790554047,
-0.4065150022506714,
-0.09389035403728485,
0.06500035524368286,
-0.011674068868160248,
0.09460186958312988,
0.13369029760360718,
-0.3388449251651764,
-0.3089025616645813,
0.37083539366722107,
0.46504560112953186,
0.057813405990600586,
-0.27357473969459534,
-0.047632135450839996,
-0.025946198031306267,
0.08955921977758408,
0.27620548009872437,
-0.018882926553487778,
0.1192999854683876,
-0.34276753664016724,
0.018492862582206726,
0.14092692732810974,
-0.5586467385292053,
-0.5562969446182251,
-0.09479930251836777,
0.005363009870052338,
0.12013634294271469,
0.05371589586138725,
0.08164422959089279,
-0.2363596260547638,
-0.005492754280567169,
0.026506414636969566,
0.25033140182495117,
0.1834832727909088,
0.12084139138460159,
-0.1474321335554123,
-0.26989227533340454,
-0.08542697131633759,
0.1643916368484497,
-0.09317262470722198,
0.26382312178611755,
-0.04890182241797447,
0.06469771265983582,
0.24497050046920776,
0.038018181920051575,
0.1206013560295105,
0.34720322489738464,
0.1850990653038025,
0.2217126339673996,
-0.0041769519448280334,
-0.004889205098152161,
-0.36157193779945374,
0.2552705705165863,
0.06454670429229736,
-0.17235258221626282,
-0.13940104842185974,
-0.14506317675113678,
-0.19652491807937622,
-0.12688317894935608,
-0.2627584934234619,
-0.25705116987228394,
-0.03469853103160858,
0.16834624111652374,
0.3639240264892578,
0.0664711594581604,
-0.2766155004501343,
0.8225780129432678,
-0.09821294248104095,
0.24224552512168884,
-0.3345186412334442,
0.1620052456855774,
0.04408983141183853,
-0.1080021858215332,
-0.2792510688304901,
0.15149836242198944,
0.08066368103027344,
-0.19375601410865784,
-0.1741131693124771,
0.6213037371635437,
0.1397934854030609,
0.119456946849823,
-0.24073685705661774,
-0.1946481317281723,
0.11994627863168716,
-0.07932743430137634,
-0.13335877656936646,
-0.07419323921203613,
0.041593972593545914,
0.19397689402103424,
-0.29980939626693726,
0.27554482221603394,
-0.34921297430992126,
0.09477897733449936,
-0.029077604413032532,
-0.07186047732830048,
0.11923744529485703,
0.033663973212242126,
0.10187830775976181,
-0.19260114431381226,
0.2935394048690796,
-0.06232161447405815,
0.45733028650283813,
-0.1939181536436081,
-0.07518129795789719,
-0.013720955699682236,
0.19977600872516632,
0.18704667687416077,
0.20014126598834991,
0.1260872632265091,
0.0027475543320178986,
-0.009405627846717834,
0.21581943333148956,
0.22674396634101868,
0.5709225535392761,
0.0837952196598053,
0.15077517926692963,
0.15582683682441711,
0.16141508519649506,
-0.16547220945358276,
0.1000673919916153,
-0.12103430926799774,
-0.1446433961391449,
-0.07855508476495743,
0.07250934839248657,
-0.23642531037330627,
-0.28132015466690063,
0.19328291714191437,
-0.042992010712623596,
0.22141607105731964,
-0.2794468402862549,
0.09517356008291245,
-0.27068597078323364,
0.01712048053741455,
-0.037967827171087265,
-0.21658122539520264,
-0.2944089472293854,
-0.13240160048007965,
-0.1485024392604828,
0.40946605801582336,
0.24315735697746277,
0.12910449504852295,
0.03612743318080902,
0.2265380471944809,
-0.033575624227523804,
-0.29359179735183716,
-0.4492676854133606,
0.12563388049602509,
-0.0423426516354084,
-0.10206976532936096,
0.04287554323673248,
-0.0758388340473175,
0.048494838178157806,
-0.47945165634155273,
0.0793580412864685,
-0.32229456305503845,
0.12302477657794952,
0.162514328956604,
-0.06775243580341339,
0.10389910638332367,
0.10849699378013611,
0.12416614592075348,
-0.24220910668373108,
0.09654287993907928,
0.29791808128356934,
-0.19943711161613464,
-0.17344650626182556,
-0.05991288647055626,
0.20784637331962585,
0.19241707026958466,
-0.1916060745716095,
-0.031117450445890427,
-0.32402777671813965,
-0.38591820001602173,
0.6227326393127441,
0.1762837916612625,
0.0896691381931305,
0.17441990971565247,
0.037436343729496,
0.034447044134140015,
-0.22987110912799835,
0.17379391193389893,
-0.40850499272346497,
-0.7183335423469543,
0.28852832317352295,
-0.3915141820907593,
-0.30759915709495544,
0.07043192535638809,
0.3401883840560913,
0.294339120388031,
-0.005739003419876099,
-0.4036320745944977,
-0.391205757856369,
-0.14189165830612183,
0.4348532557487488,
-0.0162049550563097,
0.38211628794670105,
0.19887366890907288,
-0.1442175656557083,
0.10362716019153595,
-0.013166740536689758,
-0.32437777519226074,
0.1340918391942978,
-0.05629463866353035,
0.22929680347442627,
0.12046047300100327,
0.09268426150083542,
-0.06436819583177567,
0.5942729711532593,
0.2847226858139038,
0.008675634860992432,
0.4843878746032715,
-0.07032723724842072,
0.6491823196411133,
-0.2880297899246216,
-0.3947768807411194,
0.05264272913336754,
0.08345773816108704,
-0.019714590162038803,
0.17864660918712616,
0.3657158315181732,
0.27223119139671326,
-0.1432514786720276,
-0.05545571446418762,
-0.10446081310510635,
-0.2758181095123291,
-0.10024600476026535,
0.1636885702610016,
0.10997339338064194,
0.030570991337299347,
0.2456861138343811,
-0.27721017599105835,
-0.2708328068256378,
0.11649128794670105,
0.4980066418647766,
0.046613749116659164,
0.20294877886772156,
-0.15836161375045776,
0.006935968995094299,
-0.5945864319801331,
0.22036580741405487,
0.037730421870946884,
0.049566272646188736,
-0.25126510858535767,
0.0058278292417526245,
0.11307036876678467,
0.011206123977899551,
0.6605103611946106,
-0.19185741245746613,
0.021130822598934174,
-0.2390384078025818,
-0.17628565430641174,
-0.3642621338367462,
0.013596408069133759,
0.21934299170970917,
0.2773420512676239,
-0.0037431223317980766,
0.39632123708724976,
-0.1741575300693512,
-0.3611487150192261,
-0.21188747882843018,
0.12979573011398315,
-0.080547034740448,
-0.17776823043823242,
-0.2820947766304016,
-0.30890756845474243,
-0.25650984048843384,
0.01756436377763748,
-0.0026670917868614197,
0.11290916800498962,
0.14151322841644287,
0.1877966970205307,
-0.008226027712225914,
-0.0476413369178772,
0.04064874351024628,
-0.06247428059577942,
0.6031104326248169,
-0.031751878559589386,
0.003678053617477417,
0.45156633853912354,
-0.07493247091770172,
0.2561470568180084,
0.6423028707504272,
-0.4763541519641876,
-0.07085167616605759,
0.0715765729546547,
0.17522002756595612,
0.005584318190813065,
0.29583364725112915,
-0.2667684257030487,
-0.05735558643937111,
0.043958880007267,
0.08878724277019501,
-0.2958938181400299,
0.1387479603290558,
0.12572084367275238,
0.1310654878616333,
-0.031974539160728455,
-0.46280214190483093,
0.4034750461578369,
0.19847077131271362,
0.05245232582092285,
0.2625387907028198,
0.27070432901382446,
-0.26237165927886963,
0.04304121807217598,
-0.16012755036354065,
0.7959003448486328,
0.034786708652973175,
0.40687301754951477,
0.21588285267353058,
0.08665476739406586,
0.506889820098877,
-0.3628154397010803,
0.21007603406906128,
-0.19999171793460846,
-0.11508693546056747,
-0.13894601166248322,
-0.14121532440185547,
-0.12341340631246567,
-0.12461194396018982,
-0.1847967952489853,
0.22119244933128357,
-0.11618299782276154,
0.2577837109565735,
-0.1599515974521637,
0.03344377875328064,
-0.44247305393218994,
-0.3739112317562103,
-0.31481507420539856,
0.14348596334457397,
-0.05498993769288063,
0.372867226600647,
-0.07012826204299927,
0.005933646112680435,
-0.12549039721488953,
0.05450454354286194,
-0.1841227412223816,
0.03862425684928894,
-0.3722672462463379,
0.23963864147663116,
0.12115299701690674,
-0.12110939621925354,
-0.17262892425060272,
0.42778974771499634,
0.5090804100036621,
-0.05233967304229736,
-0.298013836145401,
0.18254554271697998,
-0.26907113194465637,
0.07150772958993912,
-0.2746410369873047,
-0.1467619687318802,
0.16593308746814728,
-0.012228131294250488,
-0.031003668904304504,
-0.26202112436294556,
-0.14616616070270538,
-0.32088589668273926,
0.004224270582199097,
0.08747918158769608,
-0.08178528398275375,
-0.2556113600730896,
-0.22144357860088348,
0.051985520869493484,
0.1854998767375946,
-0.16570046544075012,
0.05908520147204399,
0.19756677746772766,
-0.07492595165967941,
0.20242053270339966,
-0.22406728565692902,
-0.18408203125,
-0.16730043292045593,
0.6219519376754761,
-0.2661125063896179,
-0.1537262499332428,
0.30528488755226135,
0.14893335103988647,
-0.17145758867263794,
-0.04434193670749664,
-0.005449309945106506,
0.260270893573761,
-0.4832684397697449,
0.25096452236175537,
-0.013760674744844437,
-0.004792541265487671,
-0.10218565165996552,
0.20474298298358917,
0.21248099207878113,
-0.19363906979560852,
-0.03470776602625847,
-0.20372863113880157,
-0.4801196753978729,
0.032908398658037186,
-0.024509450420737267,
0.09454882144927979,
0.20023220777511597,
-0.20804756879806519,
0.19669276475906372,
-0.15416309237480164,
-0.2304517924785614,
0.18948903679847717,
-0.11900675296783447,
-0.2702963650226593,
0.18636853992938995,
-0.12083924561738968,
0.5659863352775574,
-0.13537421822547913,
-0.06214631348848343,
0.15854647755622864,
-0.44723355770111084,
-0.1183093935251236,
-0.2739558815956116,
0.19448432326316833,
0.06643559038639069,
-0.1253216415643692,
-0.10018155723810196,
-0.05966164916753769,
-0.019004713743925095,
-0.3093090355396271,
0.2189219743013382,
0.5026923418045044,
-0.014462001621723175,
0.014592759311199188,
0.04703358933329582,
0.060166917741298676,
-0.19844461977481842,
-0.07121136784553528,
-0.0010982677340507507,
0.11187104880809784,
-0.0454786978662014,
0.08940555900335312,
-0.24089673161506653,
-0.004509910941123962,
-0.16752316057682037,
0.06768225133419037,
0.2366119772195816,
-0.00975723285228014,
0.10821063816547394,
-0.2252608835697174,
-0.010344825685024261,
-0.03670056164264679,
0.3974909484386444,
0.04313162341713905,
-0.03427688404917717,
-0.07526244223117828,
0.13763585686683655,
0.09357963502407074,
-0.08977161347866058,
-0.10656184703111649,
0.1254744678735733,
0.11466450989246368,
0.04290264844894409,
0.37487462162971497,
0.1797802597284317,
-0.054617881774902344,
-0.0505741611123085,
0.10426918417215347,
0.4575490951538086,
-0.11533887684345245,
0.16916076838970184,
0.14371046423912048,
0.04741716384887695,
0.3574941158294678,
0.5218391418457031,
0.3056982457637787,
0.13558588922023773,
0.4947168827056885,
-0.21312883496284485,
0.3982052206993103,
-0.08073214441537857,
0.026185322552919388,
0.05177588760852814,
-0.48532944917678833,
0.04992764815688133,
0.013758666813373566,
-0.05714714527130127,
0.09980036318302155,
-0.3375198543071747,
0.6451195478439331,
-0.5413051247596741,
-0.2073165476322174,
-0.31559520959854126,
0.15630823373794556,
-0.1828736662864685,
-0.27577537298202515,
0.12078330665826797,
-0.11022747308015823,
-0.020562931895256042,
-0.004602856934070587,
-0.07857289910316467,
-0.383120596408844,
0.3991578221321106,
0.07708287239074707,
0.06038424372673035,
-0.16666914522647858,
-0.17465507984161377,
0.13228000700473785,
0.07840452343225479,
-0.030173052102327347,
0.24821364879608154,
-0.04012370482087135,
-0.2691996991634369,
-0.0347176194190979,
0.22767923772335052,
0.38663649559020996,
0.19232121109962463,
0.2767924964427948,
0.14753594994544983,
0.19533413648605347,
0.07084572315216064,
-0.0790327712893486,
0.1816847324371338,
0.02816155180335045,
-0.07108821719884872,
0.12013250589370728,
0.13638997077941895,
-0.12137502431869507,
0.08527399599552155,
-0.1579127013683319,
0.3120083212852478,
-0.12114724516868591,
0.3646562993526459,
-0.27426308393478394,
-0.015547551214694977,
-0.1719929277896881,
0.1404501497745514,
-0.3799973428249359,
0.2922922372817993,
0.3277743458747864,
-0.04544486477971077,
0.11458592116832733,
-0.17813193798065186,
0.023544222116470337,
0.2019064575433731,
0.4574872553348541,
0.23771080374717712,
-0.0216691792011261,
-0.2966698110103607,
-0.11907701194286346,
-0.5034635066986084,
0.08535826206207275,
0.04636872187256813,
0.15767137706279755,
-0.08153113722801208,
0.05128493905067444,
-0.1874062865972519,
-0.016356319189071655,
0.12272658944129944,
-0.19021812081336975,
0.16461439430713654,
0.10586462914943695,
-0.27293843030929565,
0.025966309010982513,
-0.07626326382160187,
0.046993039548397064,
0.21035119891166687,
-0.30800583958625793,
0.10268501937389374,
-0.09936799108982086,
-0.057028498500585556,
-0.03667958080768585,
0.0872303694486618,
-0.09079429507255554,
-0.05643318220973015,
0.3712511658668518,
0.007381947711110115,
-0.08397959172725677,
0.11586420238018036,
-0.14964771270751953,
-0.31464260816574097,
-0.21927323937416077,
-0.08973090350627899,
-0.09503531455993652,
-0.1886812448501587,
0.38184502720832825,
-0.49805885553359985,
-0.28960901498794556,
-0.6131471395492554,
0.3333662748336792,
0.40867283940315247,
-0.19485068321228027,
0.09788389503955841,
0.1649603545665741,
-0.21121874451637268,
0.13055090606212616,
0.4530850946903229,
0.4417312741279602,
-0.24403157830238342,
0.39956921339035034,
-0.42796850204467773,
-0.1760706603527069,
0.6724547743797302,
-0.42449113726615906,
-0.22379621863365173,
0.1215759739279747,
0.3016717731952667,
0.4477996528148651,
-0.578620433807373,
-0.5906685590744019,
0.19401904940605164,
0.12157131731510162,
-0.023403115570545197,
-0.2819162607192993,
0.11342095583677292,
-0.34545791149139404,
0.08686048537492752,
-0.06774970144033432,
0.336294561624527,
0.26403918862342834,
-0.37927111983299255,
0.29931896924972534,
-0.10964560508728027
] |
https://github.com/huggingface/datasets/issues/6252 | Indeed, it makes sense to do this by default.
In the meantime, you can use `.with_transform` to transpose the images when accessing them:
```python
import PIL.ImageOps
def exif_transpose_transform(batch):
batch["image"] = [PIL.ImageOps.exif_transpose(image) for image in batch["image"]]
return batch
dataset = dataset.with_transform(exif_transpose_transform)
``` | exif_transpose not done to Image (PIL problem) | ### Feature request
I noticed that some of my images loaded using PIL have some metadata related to exif that can rotate them when loading.
Since the dataset.features.Image uses PIL for loading, the loaded image may be rotated (width and height will be inverted) thus for tasks as object detection and layoutLM this can create some inconsistencies (between input bboxes and input images).
For now there is no option in datasets.features.Image to specify that. We need to do the following when preparing examples (when preparing images for training, test or inference):
```
from PIL import Image, ImageOps
pil = ImageOps.exif_transpose(pil)
```
reference: https://stackoverflow.com/a/63950647/5720150
Is it possible to add this by default to the datasets.feature.Image ? or to add the option to do the ImageOps.exif_transpose?
Thank you
### Motivation
Prevent having inverted data related to exif metadata that may affect object detection tasks
### Your contribution
Changing in datasets.featrues.Image I can help with that. | 41 | exif_transpose not done to Image (PIL problem)
### Feature request
I noticed that some of my images loaded using PIL have some metadata related to exif that can rotate them when loading.
Since the dataset.features.Image uses PIL for loading, the loaded image may be rotated (width and height will be inverted) thus for tasks as object detection and layoutLM this can create some inconsistencies (between input bboxes and input images).
For now there is no option in datasets.features.Image to specify that. We need to do the following when preparing examples (when preparing images for training, test or inference):
```
from PIL import Image, ImageOps
pil = ImageOps.exif_transpose(pil)
```
reference: https://stackoverflow.com/a/63950647/5720150
Is it possible to add this by default to the datasets.feature.Image ? or to add the option to do the ImageOps.exif_transpose?
Thank you
### Motivation
Prevent having inverted data related to exif metadata that may affect object detection tasks
### Your contribution
Changing in datasets.featrues.Image I can help with that.
Indeed, it makes sense to do this by default.
In the meantime, you can use `.with_transform` to transpose the images when accessing them:
```python
import PIL.ImageOps
def exif_transpose_transform(batch):
batch["image"] = [PIL.ImageOps.exif_transpose(image) for image in batch["image"]]
return batch
dataset = dataset.with_transform(exif_transpose_transform)
``` | [
-0.20519578456878662,
-0.5333442687988281,
-0.02346695214509964,
-0.1588098257780075,
0.04967682063579559,
-0.08434915542602539,
0.47783219814300537,
-0.1194605603814125,
-0.10909018665552139,
0.23618438839912415,
0.25112542510032654,
0.2896171510219574,
0.05245703086256981,
0.3568755090236664,
-0.1476718783378601,
-0.30024439096450806,
0.09628055989742279,
0.5326493382453918,
0.02143484726548195,
-0.02202315628528595,
-0.5311463475227356,
0.13339759409427643,
-0.28459277749061584,
-0.010084763169288635,
-0.04592328891158104,
0.2733686864376068,
-0.08271580189466476,
-0.12493455410003662,
-0.036062512546777725,
0.034005410969257355,
0.014946594834327698,
0.200188547372818,
0.24737073481082916,
0.010356247425079346,
-0.00012026062904624268,
-0.23689988255500793,
0.05547371506690979,
-0.2817556858062744,
0.028213344514369965,
-0.12420108914375305,
-0.48302003741264343,
-0.3233521580696106,
-0.0098649263381958,
-0.49319714307785034,
-0.10760832577943802,
-0.6942189335823059,
0.2950485348701477,
0.19078510999679565,
-0.07937618345022202,
-0.07561562955379486,
0.10988543182611465,
-0.04047277569770813,
0.14065493643283844,
0.35167887806892395,
0.2479386329650879,
0.6745394468307495,
-0.15548452734947205,
-0.27043914794921875,
-0.26775747537612915,
-0.1728612780570984,
0.18976864218711853,
0.3233799934387207,
0.13080814480781555,
-0.22372764348983765,
0.05289430543780327,
0.2115916609764099,
0.3859253227710724,
-0.3347164988517761,
-0.13867954909801483,
0.014400644227862358,
0.08188989758491516,
-0.05464453250169754,
-0.47756248712539673,
-0.341863214969635,
0.3852645456790924,
-0.39086705446243286,
0.1601444035768509,
0.2888753414154053,
0.12132194638252258,
-0.07219672203063965,
-0.0884745717048645,
-0.03526405990123749,
-0.06716074794530869,
0.19461704790592194,
-0.37280887365341187,
0.03000796213746071,
-0.01600741595029831,
0.05960562452673912,
0.10188229382038116,
-0.08987484872341156,
0.5598542094230652,
-0.02004820667207241,
0.18338343501091003,
0.09460949897766113,
0.0487479604780674,
0.02018067240715027,
-0.10612833499908447,
-0.15818440914154053,
-0.24379654228687286,
0.017957501113414764,
-0.17673292756080627,
-0.12031225860118866,
-0.12176131457090378,
0.26452121138572693,
-0.002445036545395851,
0.41286391019821167,
0.23304922878742218,
0.512451708316803,
0.06433258950710297,
0.24008077383041382,
0.06073443591594696,
-0.11003924906253815,
0.049509163945913315,
-0.22701913118362427,
0.42401576042175293,
0.0694294422864914,
0.3882383108139038,
-0.04889386147260666,
-0.13729806244373322,
-0.5334616899490356,
-0.1383063644170761,
-0.054981861263513565,
0.11032643914222717,
-0.21174436807632446,
0.2758938670158386,
0.5470244288444519,
0.6436519622802734,
0.2018815577030182,
-0.02270340919494629,
-0.04121078550815582,
-0.06810342520475388,
-0.009817225858569145,
-0.34601035714149475,
0.09471093863248825,
-0.05203254520893097,
0.02951088920235634,
0.12587007880210876,
-0.0972592681646347,
0.11344623565673828,
0.15131011605262756,
0.1598956435918808,
-0.006986562162637711,
0.46643680334091187,
0.2858146131038666,
-0.038467466831207275,
-0.045303456485271454,
-0.03619733080267906,
0.4388222098350525,
-0.3025742471218109,
0.47176992893218994,
-0.4828087091445923,
0.048086099326610565,
-0.05598585307598114,
0.10857211798429489,
-0.21431894600391388,
0.052909910678863525,
-0.3405597507953644,
0.12448245286941528,
-0.046022217720746994,
-0.2959241271018982,
0.24052947759628296,
-0.3115716874599457,
-0.11404827237129211,
0.09645344316959381,
0.2760752737522125,
-0.07398147881031036,
-0.019637182354927063,
-0.0766395777463913,
-0.14764246344566345,
-0.41274020075798035,
0.1388099193572998,
0.029368318617343903,
0.06518638879060745,
0.1161557137966156,
-0.22059746086597443,
-0.32282960414886475,
-0.16993820667266846,
-0.05123715102672577,
-0.04885074496269226,
-0.33517640829086304,
-0.05576770007610321,
0.2829490005970001,
-0.1526249498128891,
0.5063356757164001,
-0.18101081252098083,
-0.19591376185417175,
-0.40340620279312134,
0.6804328560829163,
-0.17381243407726288,
0.34622159600257874,
0.08127789199352264,
-0.06274089217185974,
0.2742455005645752,
0.23375511169433594,
0.0002215108834207058,
0.3635721802711487,
-0.07900311797857285,
0.45030683279037476,
-0.2013811469078064,
-0.11248555779457092,
0.014409564435482025,
-0.12906873226165771,
0.11602369695901871,
-0.10476314276456833,
0.1590360552072525,
0.1601276397705078,
-0.03592613339424133,
-0.17875084280967712,
-0.020296797156333923,
0.1368681639432907,
-0.11477340757846832,
-0.13726435601711273,
0.21794015169143677,
0.0013578534126281738,
-0.2692611515522003,
0.060637783259153366,
0.04686373472213745,
-0.1452571451663971,
-0.2059168517589569,
-0.06411554664373398,
-0.08614781498908997,
0.13418635725975037,
-0.48329681158065796,
0.01285962387919426,
-0.22521202266216278,
0.0723983645439148,
0.25266432762145996,
0.07546424865722656,
-0.46655482053756714,
0.04849269986152649,
-0.01948832906782627,
-0.10851180553436279,
-0.22109445929527283,
0.47257402539253235,
0.23395946621894836,
0.4493333697319031,
-0.19769524037837982,
0.21810293197631836,
0.4602830111980438,
-0.7592915296554565,
-0.16716241836547852,
0.11093959212303162,
0.0585583932697773,
0.006943412125110626,
-0.26263323426246643,
0.30190756916999817,
-0.26570725440979004,
0.18841227889060974,
0.147395521402359,
-0.021932445466518402,
-0.17039048671722412,
-0.05623392388224602,
-0.6490026712417603,
-0.33644038438796997,
-0.13620206713676453,
-0.00852028839290142,
-0.5677667260169983,
0.06525071710348129,
-0.1981983780860901,
-0.3291018605232239,
0.29449403285980225,
0.039509549736976624,
0.11681544035673141,
0.29720339179039,
0.07072358578443527,
0.22252562642097473,
0.12477761507034302,
-0.05475422739982605,
0.1999495029449463,
0.16670016944408417,
-0.1086769700050354,
0.13608242571353912,
-0.14110374450683594,
0.1395382285118103,
0.2432105392217636,
-0.00539398193359375,
0.17687009274959564,
-0.14266914129257202,
0.38864749670028687,
0.31735992431640625,
-0.21190249919891357,
-0.2780209183692932,
0.014362342655658722,
-0.019057270139455795,
-0.16086558997631073,
-0.11293052136898041,
-0.13305145502090454,
-0.06288483738899231,
-0.009347135201096535,
0.08128604292869568,
0.12211060523986816,
-0.11710041761398315,
0.07436596602201462,
0.25060316920280457,
-0.228768453001976,
0.3490632176399231,
-0.16709989309310913,
0.1689971387386322,
0.15146496891975403,
-0.6976388692855835,
-0.18974298238754272,
0.3135639429092407,
0.05062928423285484,
-0.012926548719406128,
-0.16130343079566956,
-0.18695983290672302,
0.2678554654121399,
-0.36520805954933167,
0.23103109002113342,
-0.5831190347671509,
-0.7220376133918762,
0.15112726390361786,
0.11705035716295242,
-0.11044873297214508,
0.02270798198878765,
-0.09936437010765076,
0.22418305277824402,
-0.20937468111515045,
0.3342954218387604,
-0.3772426247596741,
-0.23135244846343994,
-0.025533154606819153,
-0.0579012930393219,
0.20777134597301483,
-0.4232048988342285,
0.20060555636882782,
0.09932778030633926,
-0.2710796296596527,
0.23943187296390533,
0.17704474925994873,
0.0594320073723793,
0.17396755516529083,
0.2365867793560028,
-0.4709309935569763,
0.15409524738788605,
-0.10460500419139862,
0.17220105230808258,
-0.24818095564842224,
0.364033043384552,
0.03003527596592903,
0.027358539402484894,
-0.2596188485622406,
-0.18317686021327972,
-0.15575814247131348,
0.7976149916648865,
-0.21829521656036377,
-0.5247381925582886,
-0.13921277225017548,
0.2587803602218628,
-0.1523621380329132,
0.2864343822002411,
0.020017972216010094,
0.2853127419948578,
0.13824498653411865,
-0.0057156383991241455,
-0.34301310777664185,
0.059148043394088745,
0.26973938941955566,
0.34864386916160583,
-0.0885477215051651,
-0.3000543713569641,
-0.025700397789478302,
0.16447535157203674,
-0.4438043236732483,
-0.28439438343048096,
0.3077819347381592,
0.025380490347743034,
0.20523130893707275,
-0.12393487989902496,
-0.2520504593849182,
-0.21311834454536438,
0.167771577835083,
0.04940690100193024,
-0.06981535255908966,
0.0012523196637630463,
-0.4750879108905792,
-0.3100716173648834,
0.1865827739238739,
-0.5229252576828003,
-0.0860651507973671,
-0.08605396002531052,
0.19401612877845764,
0.5698375701904297,
-0.310253381729126,
-0.17987394332885742,
-0.3809588551521301,
-0.08962693810462952,
-0.12748892605304718,
0.2427358627319336,
0.29789239168167114,
0.031147968024015427,
-0.4107484817504883,
-0.7419508695602417,
0.2037138044834137,
-0.036202311515808105,
-0.1084548830986023,
0.2937358617782593,
0.04111456871032715,
-0.2502923309803009,
0.1365131139755249,
0.00340455025434494,
0.7152536511421204,
0.18523602187633514,
-0.19962674379348755,
-0.07281504571437836,
-0.32990577816963196,
-0.006242334842681885,
-0.2098410278558731,
-0.004090800881385803,
-0.28066086769104004,
-0.056908220052719116,
0.48715534806251526,
-0.1114930808544159,
-0.118889719247818,
0.5526161193847656,
0.1086045354604721,
-0.12150091677904129,
-0.6058031320571899,
-0.04902016744017601,
-0.46754252910614014,
0.09443783015012741,
-0.17808754742145538,
0.239106684923172,
0.11905349791049957,
-0.10060125589370728,
0.030953027307987213,
-0.4621773660182953,
0.16213497519493103,
-0.01810583472251892,
0.2679658830165863,
0.1478937566280365,
0.0058143846690654755,
0.17465215921401978,
0.0907103419303894,
-0.1639234721660614,
0.23104821145534515,
0.02968892827630043,
-0.04129417985677719,
-0.3062156140804291,
0.19708943367004395,
-0.030399970710277557,
0.18486717343330383,
0.06562890112400055,
0.06606487929821014,
-0.03323642909526825,
-0.29508906602859497,
0.1506965607404709,
-0.4419465661048889,
0.10788268595933914,
0.30935096740722656,
-0.015611592680215836,
0.09881523251533508,
-0.32032883167266846,
0.42025935649871826,
0.30832573771476746,
0.13635924458503723,
0.09367044270038605,
0.009045666083693504,
-0.3588482737541199,
0.18588337302207947,
0.2576002776622772,
0.7814757823944092,
-0.17635536193847656,
-0.09757740795612335,
0.2669057250022888,
0.20187240839004517,
0.6276807188987732,
-0.11591052263975143,
0.26553088426589966,
-0.0359191820025444,
-0.7131326794624329,
-0.06720003485679626,
-0.10551396757364273,
0.3420725464820862,
0.16487078368663788,
0.007510267198085785,
0.06134771928191185,
-0.12811988592147827,
-0.5139174461364746,
0.08031275868415833,
0.3878245949745178,
-0.13675518333911896,
-0.5281403064727783,
-0.2652127742767334,
-0.020840512588620186,
0.2454868108034134,
0.28292495012283325,
0.07146903872489929,
-0.035618409514427185,
0.13335633277893066,
0.11389383673667908,
0.007570669054985046,
0.18593111634254456,
-0.027165483683347702,
0.1756603866815567,
-0.2793194651603699,
-0.01808100938796997,
-0.061637841165065765,
0.17517149448394775,
0.2259981781244278,
-0.04216139391064644,
0.184456467628479,
0.18716372549533844,
0.5663059949874878,
0.14421433210372925,
-0.20607900619506836,
0.13630491495132446,
0.3014218807220459,
-0.0006491541862487793,
0.13040828704833984,
-0.02054143324494362,
0.03847020864486694,
0.02759968489408493,
-0.30203890800476074,
-0.13744083046913147,
0.13476291298866272,
0.07528454810380936,
-0.2027527391910553,
0.2606067359447479,
0.10778070241212845,
0.008364111185073853,
0.029354700818657875,
0.0811220109462738,
-0.027307238429784775,
0.4404038190841675,
-0.2044374793767929,
-0.4499737024307251,
-0.00933852419257164,
0.035694293677806854,
0.18470627069473267,
-0.009180136024951935,
0.3907061219215393,
-0.2077728509902954,
0.20063069462776184,
0.04747878015041351,
0.23510277271270752,
-0.14225396513938904,
-0.5349560379981995,
0.012466058135032654,
0.1896214336156845,
-0.04098190367221832,
-0.08700317144393921,
-0.033754926174879074,
0.013479337096214294,
0.015238126739859581,
-0.04897525534033775,
-0.13235972821712494,
0.1131429448723793,
0.08039507269859314,
-0.05942476540803909,
0.3493908941745758,
0.13401103019714355,
0.3816739320755005,
0.05040416121482849,
-0.3641202449798584,
-0.18665620684623718,
0.04305354505777359,
0.019385866820812225,
0.3127455413341522,
0.4014536440372467,
0.40379437804222107,
-0.039648376405239105,
0.11394806206226349,
0.18844038248062134,
-0.17143861949443817,
0.08105942606925964,
-0.007982518523931503,
-0.15002338588237762,
0.16612671315670013,
0.16128642857074738,
-0.07010583579540253,
0.13561181724071503,
-0.3244466185569763,
-0.17387168109416962,
-0.23117302358150482,
-0.2518753707408905,
0.1823262870311737,
-0.1537778675556183,
0.25081801414489746,
-0.4647705852985382,
0.02947341278195381,
0.12576860189437866,
0.2728137969970703,
0.011468686163425446,
-0.21113461256027222,
-0.04242926090955734,
0.4866272211074829,
-0.24372272193431854,
0.17554685473442078,
-0.26692771911621094,
-0.16996702551841736,
-0.42972531914711,
0.19814148545265198,
0.20740246772766113,
0.29925668239593506,
0.3532024323940277,
-0.01140059158205986,
0.20532459020614624,
0.10758784413337708,
-0.40157267451286316,
-0.014925502240657806,
0.1628551185131073,
0.12682557106018066,
-0.2816767394542694,
0.1741403043270111,
0.4255480468273163,
0.17890030145645142,
0.1667821854352951,
0.12464450299739838,
0.04565635323524475,
0.3947436809539795,
0.25032952427864075,
-0.1458211988210678,
0.0782846063375473,
-0.2506108582019806,
0.23947647213935852,
0.48066043853759766,
-0.24825601279735565,
0.48031482100486755,
0.11789117753505707,
0.2585889995098114,
0.05959451571106911,
-0.04219314083456993,
0.10242155194282532,
0.3192194104194641,
-0.011815812438726425,
0.22440041601657867,
0.20833806693553925,
-0.3308725953102112,
0.019000714644789696,
0.1198129653930664,
0.15017536282539368,
0.40526264905929565,
0.03130468353629112,
0.00023220106959342957,
-0.37954840064048767,
0.06608615815639496,
-0.09337978065013885,
0.1396310180425644,
0.11192235350608826,
0.09809013456106186,
-0.10490594804286957,
0.03118911385536194,
-0.1789398193359375,
-0.35534554719924927,
0.11156558245420456,
-0.06713488698005676,
0.16378900408744812,
0.04819289222359657,
0.1592000275850296,
-0.08749806880950928,
-0.2058512270450592,
0.20985375344753265,
0.4439515471458435,
-0.20913460850715637,
0.01746022142469883,
-0.09698671102523804,
-0.048703763633966446,
0.30032995343208313,
0.6410515308380127,
-0.14324158430099487,
0.4686102271080017,
0.26210373640060425,
-0.08939169347286224,
0.11918185651302338,
-0.06069594621658325,
0.017866507172584534,
0.04066197946667671,
0.33456555008888245,
0.3330591917037964,
0.0991545096039772,
0.12471691519021988,
-0.09755145758390427,
-0.020299062132835388,
-0.008703120052814484,
0.1548236608505249,
-0.2762265205383301,
0.1450791358947754,
0.0848916620016098,
0.06622495502233505,
0.12155783176422119,
0.014182401821017265,
0.0913526862859726,
-0.4275415241718292,
0.0313231386244297,
-0.07996783405542374,
0.09504643827676773,
0.2790636420249939,
0.0026853978633880615,
0.0732794851064682,
-0.2809070348739624,
0.4985194206237793,
0.06288732588291168,
-0.07786484807729721,
0.0902746319770813,
-0.3865091800689697,
0.07266280055046082,
0.38507208228111267,
-0.1226465106010437,
0.2165437638759613,
0.025683023035526276,
0.13678765296936035,
0.07907062768936157,
0.2753274142742157,
-0.23472005128860474,
0.3011491298675537,
0.3951032757759094,
-0.042020343244075775,
-0.09333361685276031,
0.029393460601568222,
0.03933767229318619,
-0.13603198528289795,
-0.2364179491996765,
0.104927197098732,
-0.14529763162136078,
0.0009873732924461365,
-0.18712736666202545,
0.1542544960975647,
-0.19078081846237183,
0.18104404211044312,
0.45654064416885376,
0.30610302090644836,
0.1725223958492279,
-0.3152974843978882,
0.22345678508281708,
0.03921910375356674,
-0.29459863901138306,
-0.4119574725627899,
0.07119783014059067,
0.10598555207252502,
0.43516480922698975,
-0.13793036341667175,
-0.3033502995967865,
-0.30002135038375854,
0.14372988045215607,
0.06946982443332672,
-0.3230399489402771,
-0.38080406188964844,
0.47222137451171875,
-0.09906037896871567,
-0.3441258370876312,
0.20788118243217468,
0.09572124481201172,
0.13002774119377136,
-0.243315190076828,
-0.22705480456352234,
-0.25693464279174805,
0.039005935192108154,
-0.30355748534202576,
-0.09388449043035507,
0.05972423404455185,
-0.06949283182621002,
-0.17016632854938507,
0.32895344495773315,
0.0029401928186416626,
0.12231811881065369,
0.31863799691200256,
-0.22407543659210205,
-0.0891834944486618,
0.2885221838951111,
-0.08424180746078491,
0.038777634501457214,
-0.13333623111248016,
0.03787374496459961,
-0.1219513937830925,
-0.09129343926906586,
-0.0661383867263794,
-0.0015757903456687927
] |
https://github.com/huggingface/datasets/issues/6252 | This operation sets some `Image` attributes to `None` (`.format`, `.filename`, etc.), causing our tests to fail, so I think we should wait for Datasets 3.0 to make this change. In version 3.0, storing image paths will be replaced by embedding image bytes, so there will be fewer instances where we use the `.filename` attribute. | exif_transpose not done to Image (PIL problem) | ### Feature request
I noticed that some of my images loaded using PIL have some metadata related to exif that can rotate them when loading.
Since the dataset.features.Image uses PIL for loading, the loaded image may be rotated (width and height will be inverted) thus for tasks as object detection and layoutLM this can create some inconsistencies (between input bboxes and input images).
For now there is no option in datasets.features.Image to specify that. We need to do the following when preparing examples (when preparing images for training, test or inference):
```
from PIL import Image, ImageOps
pil = ImageOps.exif_transpose(pil)
```
reference: https://stackoverflow.com/a/63950647/5720150
Is it possible to add this by default to the datasets.feature.Image ? or to add the option to do the ImageOps.exif_transpose?
Thank you
### Motivation
Prevent having inverted data related to exif metadata that may affect object detection tasks
### Your contribution
Changing in datasets.featrues.Image I can help with that. | 54 | exif_transpose not done to Image (PIL problem)
### Feature request
I noticed that some of my images loaded using PIL have some metadata related to exif that can rotate them when loading.
Since the dataset.features.Image uses PIL for loading, the loaded image may be rotated (width and height will be inverted) thus for tasks as object detection and layoutLM this can create some inconsistencies (between input bboxes and input images).
For now there is no option in datasets.features.Image to specify that. We need to do the following when preparing examples (when preparing images for training, test or inference):
```
from PIL import Image, ImageOps
pil = ImageOps.exif_transpose(pil)
```
reference: https://stackoverflow.com/a/63950647/5720150
Is it possible to add this by default to the datasets.feature.Image ? or to add the option to do the ImageOps.exif_transpose?
Thank you
### Motivation
Prevent having inverted data related to exif metadata that may affect object detection tasks
### Your contribution
Changing in datasets.featrues.Image I can help with that.
This operation sets some `Image` attributes to `None` (`.format`, `.filename`, etc.), causing our tests to fail, so I think we should wait for Datasets 3.0 to make this change. In version 3.0, storing image paths will be replaced by embedding image bytes, so there will be fewer instances where we use the `.filename` attribute. | [
-0.23128995299339294,
-0.4324098229408264,
-0.013056017458438873,
-0.1380266398191452,
0.02748856693506241,
-0.08289014548063278,
0.439321905374527,
-0.12239617109298706,
-0.18614964187145233,
0.2433623969554901,
0.29795029759407043,
0.31367823481559753,
-0.007348254323005676,
0.44504255056381226,
-0.1284453272819519,
-0.2543371617794037,
0.1648741513490677,
0.563980758190155,
0.11102531850337982,
0.004340693354606628,
-0.548331081867218,
0.10944049060344696,
-0.2775646448135376,
-0.04033000022172928,
-0.05911997705698013,
0.30271023511886597,
-0.061628833413124084,
-0.1486092507839203,
-0.16690832376480103,
-0.017927207052707672,
-0.012964792549610138,
0.24745699763298035,
0.27948978543281555,
0.03236328437924385,
-0.00012279859220143408,
-0.2674679756164551,
0.1357288956642151,
-0.2543587386608124,
-0.04697207361459732,
-0.18627941608428955,
-0.6228402256965637,
-0.2775118947029114,
0.04589037597179413,
-0.4801602065563202,
-0.04493046924471855,
-0.6149306893348694,
0.288482129573822,
0.15781563520431519,
-0.1241016834974289,
-0.042623765766620636,
0.07922078669071198,
0.0010001584887504578,
0.0716317743062973,
0.32442906498908997,
0.3978458642959595,
0.7414015531539917,
-0.22490063309669495,
-0.2549622058868408,
-0.26094475388526917,
-0.195089191198349,
0.20180447399616241,
0.37387579679489136,
0.14390990138053894,
-0.14150786399841309,
0.15103356540203094,
0.21776482462882996,
0.303688645362854,
-0.32817018032073975,
-0.1262226700782776,
0.07873319089412689,
0.20849061012268066,
-0.07764165848493576,
-0.5413472056388855,
-0.364422082901001,
0.4432039260864258,
-0.46020323038101196,
0.2636728882789612,
0.19274400174617767,
0.13459450006484985,
-0.06445221602916718,
-0.119234099984169,
-0.11116435378789902,
-0.08726490288972855,
0.17318202555179596,
-0.36902737617492676,
0.007996320724487305,
-0.048450615257024765,
0.04741394892334938,
0.12905877828598022,
-0.07581862062215805,
0.6154273152351379,
-0.033319614827632904,
0.1580689698457718,
0.056293416768312454,
0.04461820423603058,
-0.04983380064368248,
-0.11741778254508972,
-0.10670550167560577,
-0.24396035075187683,
0.0217285193502903,
-0.21079567074775696,
-0.1746203899383545,
-0.14005640149116516,
0.27116653323173523,
0.009170960634946823,
0.35013777017593384,
0.31071317195892334,
0.5189491510391235,
0.050542574375867844,
0.25218749046325684,
0.09660778194665909,
-0.12650179862976074,
0.02432020753622055,
-0.1903427392244339,
0.3361344337463379,
0.056165024638175964,
0.35801368951797485,
-0.09177075326442719,
-0.15264803171157837,
-0.5087077021598816,
-0.07289406657218933,
-0.07030531764030457,
0.12926454842090607,
-0.21552279591560364,
0.27836012840270996,
0.5468803644180298,
0.5368836522102356,
0.17241999506950378,
-0.020879805088043213,
-0.05685585364699364,
-0.04830440133810043,
0.033977050334215164,
-0.325356662273407,
0.14407142996788025,
-0.0712796151638031,
0.054320987313985825,
0.11679791659116745,
-0.11330463737249374,
0.12082810699939728,
0.23110339045524597,
0.14798422157764435,
-0.06319290399551392,
0.4718204140663147,
0.33664369583129883,
-0.08702047914266586,
-0.0417216494679451,
-0.126493439078331,
0.37033969163894653,
-0.28902512788772583,
0.4334072768688202,
-0.45641300082206726,
0.05228006839752197,
-0.10252770781517029,
0.07672625035047531,
-0.31496262550354004,
0.015949802473187447,
-0.3878961205482483,
0.1280571073293686,
-0.14912113547325134,
-0.3305705785751343,
0.25851377844810486,
-0.3525847792625427,
-0.12448200583457947,
0.09909113496541977,
0.27589839696884155,
0.028452862054109573,
-0.03882582485675812,
-0.04785621166229248,
-0.1876465231180191,
-0.3909834623336792,
0.1156785860657692,
0.04691851884126663,
0.05642551928758621,
0.03390337526798248,
-0.22185541689395905,
-0.3066442608833313,
-0.13199570775032043,
-0.10055500268936157,
0.02319229766726494,
-0.2661353647708893,
-0.06899832934141159,
0.22153793275356293,
-0.09509092569351196,
0.4281480610370636,
-0.2040652483701706,
-0.21675989031791687,
-0.44419559836387634,
0.6002863049507141,
-0.19662876427173615,
0.2643360197544098,
0.12098336964845657,
-0.10780291259288788,
0.2226797491312027,
0.21872887015342712,
-0.06533797085285187,
0.33119502663612366,
-0.0478183813393116,
0.4067304730415344,
-0.24305938184261322,
-0.15715810656547546,
0.02998870611190796,
-0.09029638767242432,
0.21480891108512878,
-0.099664106965065,
0.09320822358131409,
0.11435961723327637,
-0.10755160450935364,
-0.1507789045572281,
0.053480930626392365,
0.06048044189810753,
-0.15929138660430908,
-0.1754014939069748,
0.2980121076107025,
-0.006980717182159424,
-0.2588263750076294,
0.06473974883556366,
-0.008005037903785706,
-0.1396416425704956,
-0.23006413877010345,
-0.05682181566953659,
-0.21628735959529877,
0.13367260992527008,
-0.45929691195487976,
0.0356224849820137,
-0.19845068454742432,
0.030057303607463837,
0.29450756311416626,
0.09137372672557831,
-0.41242480278015137,
0.07286415994167328,
-0.045214004814624786,
-0.11349700391292572,
-0.17938697338104248,
0.4849588871002197,
0.253449022769928,
0.5198776721954346,
-0.08467657119035721,
0.25973764061927795,
0.433543860912323,
-0.6875718235969543,
-0.19165922701358795,
-0.0386115126311779,
0.02727946639060974,
0.048862189054489136,
-0.3234565258026123,
0.22836658358573914,
-0.29904404282569885,
0.13111338019371033,
0.17343401908874512,
-0.07376305758953094,
-0.18503940105438232,
-0.07926881313323975,
-0.6395624279975891,
-0.40054547786712646,
-0.10603993386030197,
0.07996037602424622,
-0.5170193314552307,
0.10948257893323898,
-0.21539521217346191,
-0.30458900332450867,
0.41128674149513245,
0.03987020254135132,
0.03883330523967743,
0.3539886772632599,
0.06868532299995422,
0.15521755814552307,
0.19471468031406403,
0.13613246381282806,
0.25588691234588623,
0.15005701780319214,
-0.024067115038633347,
0.13190273940563202,
-0.17912819981575012,
0.11431113630533218,
0.284898042678833,
-0.004414714872837067,
0.26694753766059875,
-0.09292927384376526,
0.32221075892448425,
0.31864598393440247,
-0.23485559225082397,
-0.33870548009872437,
0.08311344683170319,
-0.03554506599903107,
-0.19872865080833435,
-0.13371936976909637,
-0.20098906755447388,
-0.11087317764759064,
-0.02284478396177292,
0.14313188195228577,
0.03989064320921898,
-0.12780511379241943,
0.11193627119064331,
0.266621857881546,
-0.2922563850879669,
0.3133287727832794,
-0.14477792382240295,
0.16570138931274414,
0.10021280497312546,
-0.6916912198066711,
-0.214686781167984,
0.32222241163253784,
0.06662063300609589,
-0.03208695352077484,
-0.12944847345352173,
-0.18130168318748474,
0.2559479773044586,
-0.41528668999671936,
0.2627887725830078,
-0.6507415771484375,
-0.743960440158844,
0.19502480328083038,
0.07136377692222595,
-0.0768294483423233,
0.15895403921604156,
-0.15521682798862457,
0.19205625355243683,
-0.14664579927921295,
0.31231698393821716,
-0.36840716004371643,
-0.20500899851322174,
-0.06155087798833847,
-0.008423995226621628,
0.19448207318782806,
-0.42896324396133423,
0.15372008085250854,
0.15273138880729675,
-0.27591103315353394,
0.30421558022499084,
0.14112593233585358,
0.0780852660536766,
0.23227739334106445,
0.2650711238384247,
-0.3958713412284851,
0.03898821026086807,
-0.10611820220947266,
0.1558586061000824,
-0.3573225140571594,
0.36532530188560486,
0.06931276619434357,
0.04755253344774246,
-0.1966320127248764,
-0.13468733429908752,
-0.13585828244686127,
0.7987844944000244,
-0.23070141673088074,
-0.5608483552932739,
-0.11069696396589279,
0.2635226845741272,
-0.12567302584648132,
0.2656533122062683,
0.05124739184975624,
0.2967382073402405,
0.11098623275756836,
-0.03433925658464432,
-0.3205050826072693,
0.009212039411067963,
0.3148277997970581,
0.3488452732563019,
-0.035898275673389435,
-0.29222825169563293,
0.02518603950738907,
0.2049676477909088,
-0.40116065740585327,
-0.1886633336544037,
0.32944267988204956,
0.05756514519453049,
0.29001110792160034,
-0.08757679164409637,
-0.18269088864326477,
-0.210784912109375,
0.1803244650363922,
0.03619667887687683,
-0.03336482495069504,
-0.029089076444506645,
-0.42973190546035767,
-0.32736629247665405,
0.23783089220523834,
-0.40666431188583374,
-0.04653959348797798,
-0.0673048198223114,
0.13483482599258423,
0.5772168636322021,
-0.30404865741729736,
-0.1812574863433838,
-0.3614335358142853,
-0.07326658815145493,
-0.12106101214885712,
0.28042489290237427,
0.3574099540710449,
-0.007402580231428146,
-0.4372662901878357,
-0.7192859649658203,
0.1776672601699829,
-0.07646409422159195,
-0.09675236791372299,
0.32247936725616455,
0.005143590271472931,
-0.26174089312553406,
0.122104711830616,
0.026910889893770218,
0.7792683839797974,
0.03520509600639343,
-0.22004330158233643,
-0.0709005743265152,
-0.30791640281677246,
-0.01692495122551918,
-0.1308927834033966,
-0.02824406325817108,
-0.33174583315849304,
-0.13184122741222382,
0.5483132004737854,
-0.09768573939800262,
-0.19778920710086823,
0.5684729814529419,
0.10218313336372375,
-0.010490044951438904,
-0.5903844833374023,
0.0017962157726287842,
-0.42191511392593384,
0.10141297429800034,
-0.20074668526649475,
0.2660132050514221,
0.05058326944708824,
-0.05081764608621597,
0.028123393654823303,
-0.4155416488647461,
0.17878146469593048,
-0.040085915476083755,
0.26787620782852173,
0.07408411800861359,
0.02956286072731018,
0.17239977419376373,
0.14034168422222137,
-0.1700085997581482,
0.3045565187931061,
0.02346743457019329,
-0.0649108737707138,
-0.33420175313949585,
0.1781373918056488,
-0.07483971863985062,
0.24698415398597717,
0.1498175859451294,
0.07467187941074371,
-0.0025608576834201813,
-0.3416758179664612,
0.17733168601989746,
-0.47575074434280396,
0.10950441658496857,
0.31870025396347046,
-0.0011735446751117706,
0.1405954658985138,
-0.2894693911075592,
0.3683984875679016,
0.40318796038627625,
0.12018750607967377,
0.103594109416008,
0.0702921599149704,
-0.37730127573013306,
0.11187794804573059,
0.28761687874794006,
0.7907405495643616,
-0.15781494975090027,
-0.039113786071538925,
0.23789861798286438,
0.10441054403781891,
0.6697016954421997,
-0.13115522265434265,
0.18286094069480896,
-0.029198765754699707,
-0.7573148012161255,
-0.10513012111186981,
-0.1327524185180664,
0.4698093831539154,
0.15116681158542633,
0.05010212957859039,
0.09787963330745697,
0.013043224811553955,
-0.4078184962272644,
0.08262047916650772,
0.4517390727996826,
-0.16100841760635376,
-0.5511215329170227,
-0.25266703963279724,
-0.044288214296102524,
0.2647086977958679,
0.19025829434394836,
0.10120690613985062,
-0.013501834124326706,
0.15574733912944794,
0.10548443347215652,
0.027747437357902527,
0.13688907027244568,
-0.014141034334897995,
0.047589752823114395,
-0.24399133026599884,
-0.11627338081598282,
0.05626027286052704,
0.20666161179542542,
0.22161324322223663,
-0.06902080774307251,
0.1112028956413269,
0.19167950749397278,
0.549571692943573,
0.18158188462257385,
-0.19964566826820374,
0.032007161527872086,
0.33758822083473206,
-0.027579426765441895,
0.17770686745643616,
-0.05205227807164192,
0.009532365947961807,
-0.004710458219051361,
-0.18286660313606262,
-0.19839328527450562,
0.15526479482650757,
0.06142960116267204,
-0.16837146878242493,
0.18187782168388367,
0.13811534643173218,
-0.0004471689462661743,
0.021016379818320274,
0.042824648320674896,
-0.04659217223525047,
0.42042213678359985,
-0.24050121009349823,
-0.4342094957828522,
-0.014044348150491714,
0.05464855581521988,
0.07359786331653595,
0.04981738328933716,
0.3566759526729584,
-0.17375177145004272,
0.17657659947872162,
0.015120089054107666,
0.28823935985565186,
-0.09956492483615875,
-0.48636412620544434,
0.004896864295005798,
0.21400251984596252,
-0.08481471985578537,
-0.11558972299098969,
-0.07285939902067184,
0.022281890735030174,
0.014562977477908134,
-0.019611559808254242,
-0.10669632256031036,
0.1339285969734192,
0.10686253011226654,
-0.12297598272562027,
0.3502751290798187,
0.14361609518527985,
0.29392948746681213,
0.08957492560148239,
-0.425289124250412,
-0.16048690676689148,
0.09270919859409332,
0.01797981560230255,
0.3497745096683502,
0.4269556701183319,
0.4031696319580078,
-0.0035287141799926758,
-0.005027830600738525,
0.16491387784481049,
-0.19385406374931335,
0.07467296719551086,
0.022966135293245316,
-0.1635284721851349,
0.1803840696811676,
0.19316744804382324,
-0.07454102486371994,
0.20924469828605652,
-0.3191465139389038,
-0.23208528757095337,
-0.25436532497406006,
-0.25158369541168213,
0.1553659737110138,
-0.17964039742946625,
0.28393760323524475,
-0.4799991846084595,
0.015590698458254337,
0.12726813554763794,
0.26258498430252075,
0.018584296107292175,
-0.1424880027770996,
-0.12786728143692017,
0.5424121618270874,
-0.21784982085227966,
0.18040704727172852,
-0.23255489766597748,
-0.11636720597743988,
-0.49342161417007446,
0.17839351296424866,
0.17101004719734192,
0.32487812638282776,
0.32276904582977295,
0.037418805062770844,
0.2536962628364563,
0.1529301255941391,
-0.42693689465522766,
-0.05088397115468979,
0.25542137026786804,
0.09658738970756531,
-0.23234553635120392,
0.12262466549873352,
0.3939310312271118,
0.18587307631969452,
0.1606767475605011,
0.17063608765602112,
0.06918542832136154,
0.4234382212162018,
0.3169461190700531,
-0.14554443955421448,
0.05616212636232376,
-0.21211427450180054,
0.27799099683761597,
0.4568912982940674,
-0.28573423624038696,
0.4707123041152954,
0.15906041860580444,
0.2840271294116974,
0.03712084889411926,
0.06600844860076904,
0.13390232622623444,
0.27442455291748047,
0.015711739659309387,
0.30966293811798096,
0.2043514996767044,
-0.3324553370475769,
0.07095503807067871,
0.10747487843036652,
0.19423584640026093,
0.37116241455078125,
0.08367432653903961,
0.046979356557130814,
-0.37648943066596985,
0.08121736347675323,
-0.08359117805957794,
0.10025222599506378,
0.1505853533744812,
0.058591701090335846,
-0.191963791847229,
-0.006370231509208679,
-0.14855071902275085,
-0.30181097984313965,
0.050006553530693054,
-0.08341256529092789,
0.22266505658626556,
0.10160835087299347,
0.1827736794948578,
-0.1358497440814972,
-0.08648315072059631,
0.17106032371520996,
0.422177791595459,
-0.23616193234920502,
0.027211518958210945,
-0.1681840419769287,
-0.04275469854474068,
0.33118271827697754,
0.6036573648452759,
-0.14291974902153015,
0.3411591649055481,
0.31868404150009155,
-0.1707969307899475,
0.08531389385461807,
-0.11298833787441254,
0.04100219905376434,
0.047579143196344376,
0.23083725571632385,
0.38674575090408325,
0.11701679974794388,
0.11030115187168121,
-0.06925570219755173,
-0.03547503054141998,
-0.04008519649505615,
0.08449631929397583,
-0.35638880729675293,
0.14050163328647614,
0.14732061326503754,
0.07607204467058182,
0.18349438905715942,
0.07652458548545837,
0.09833081811666489,
-0.3653915524482727,
0.0878097265958786,
-0.09393955767154694,
0.07073706388473511,
0.28911107778549194,
-0.007599746808409691,
0.05194016546010971,
-0.2268688678741455,
0.4888683259487152,
-0.0368039570748806,
-0.06420555710792542,
0.06484369933605194,
-0.4001370668411255,
0.03903527557849884,
0.4077482223510742,
-0.1576068103313446,
0.2472110390663147,
-0.0005270317196846008,
0.10247573256492615,
0.059913843870162964,
0.2606903314590454,
-0.1604587435722351,
0.2737051844596863,
0.32549306750297546,
-0.03923196345567703,
-0.11029373109340668,
0.06095413491129875,
0.07853327691555023,
-0.15764905512332916,
-0.2491290271282196,
0.13522614538669586,
-0.12346960604190826,
-0.06911157071590424,
-0.20394571125507355,
0.1611320674419403,
-0.19737528264522552,
0.14220751821994781,
0.46253496408462524,
0.31164461374282837,
0.16463571786880493,
-0.2951996326446533,
0.1537019908428192,
0.05224820226430893,
-0.24328753352165222,
-0.39391955733299255,
0.151495561003685,
0.0600520521402359,
0.4380483329296112,
-0.15834349393844604,
-0.2312360405921936,
-0.3262039124965668,
0.1191728413105011,
0.0050622522830963135,
-0.20331357419490814,
-0.3833627700805664,
0.5167758464813232,
-0.0897781178355217,
-0.29318976402282715,
0.16482985019683838,
0.04997069388628006,
0.11478425562381744,
-0.25937920808792114,
-0.23298940062522888,
-0.2644330859184265,
0.018219612538814545,
-0.3073466718196869,
-0.10798848420381546,
0.1212717592716217,
-0.08418947458267212,
-0.10374793410301208,
0.25930818915367126,
-0.07993517071008682,
0.11673624813556671,
0.3049684166908264,
-0.1935645341873169,
-0.15481893718242645,
0.3313462436199188,
-0.10866552591323853,
0.059266120195388794,
-0.13349924981594086,
0.1458962857723236,
-0.13918381929397583,
-0.11548510193824768,
-0.08049048483371735,
0.0017353147268295288
] |
https://github.com/huggingface/datasets/issues/6246 | I think it's an issue with the code.
Specifically:
```python
dataset = dataset['train'].add_column("/workspace/data", new_column)
```
Now `dataset` is the train set with a new column.
To fix this, you can do:
```python
dataset['train'] = dataset['train'].add_column("/workspace/data", new_column)
``` | Add new column to dataset | ### Describe the bug
```
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>()
----> 1 dataset['train']['/workspace/data']
3 frames
[/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns)
518 def _check_valid_column_key(key: str, columns: List[str]) -> None:
519 if key not in columns:
--> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}")
521
522
KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']"
```
### Steps to reproduce the bug
please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
### Expected behavior
add column to the dataset
### Environment info
colab pro | 37 | Add new column to dataset
### Describe the bug
```
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>()
----> 1 dataset['train']['/workspace/data']
3 frames
[/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns)
518 def _check_valid_column_key(key: str, columns: List[str]) -> None:
519 if key not in columns:
--> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}")
521
522
KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']"
```
### Steps to reproduce the bug
please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
### Expected behavior
add column to the dataset
### Environment info
colab pro
I think it's an issue with the code.
Specifically:
```python
dataset = dataset['train'].add_column("/workspace/data", new_column)
```
Now `dataset` is the train set with a new column.
To fix this, you can do:
```python
dataset['train'] = dataset['train'].add_column("/workspace/data", new_column)
``` | [
-0.052789218723773956,
-0.019655153155326843,
0.050946254283189774,
0.018657661974430084,
0.31316566467285156,
0.2104775607585907,
0.6760562062263489,
0.4645121693611145,
0.15509802103042603,
0.10611668229103088,
0.08632168173789978,
0.4922831058502197,
-0.18300923705101013,
0.1822669804096222,
0.10658084601163864,
-0.28283798694610596,
0.16043849289417267,
0.1671319156885147,
0.01813826709985733,
0.16099759936332703,
-0.3586295247077942,
-0.0035882852971553802,
-0.27809983491897583,
0.14510011672973633,
-0.3173186779022217,
-0.07029764354228973,
-0.3582690954208374,
-0.0847245529294014,
-0.09089891612529755,
-0.3469127416610718,
0.16413500905036926,
-0.308307945728302,
0.022769752889871597,
0.5675225257873535,
-0.00011127939797006547,
0.07313506305217743,
0.0561026930809021,
0.06838767975568771,
-0.21398231387138367,
-0.2745474576950073,
-0.39139872789382935,
-0.28904181718826294,
-0.055154137313365936,
-0.33562177419662476,
-0.15214839577674866,
0.012183021754026413,
-0.2705199122428894,
-0.007411055266857147,
0.16649971902370453,
0.47387149930000305,
0.2714310884475708,
0.3378114104270935,
-0.05368563160300255,
-0.09513472020626068,
0.14396663010120392,
0.06860180199146271,
-0.2650863230228424,
0.2696225941181183,
0.02041095308959484,
-0.1521744430065155,
0.19730308651924133,
0.4152069687843323,
0.11075270175933838,
-0.03632055222988129,
0.2671802043914795,
0.34386059641838074,
-0.18586060404777527,
-0.24254462122917175,
0.004734126850962639,
0.10427607595920563,
0.20270615816116333,
-0.28406786918640137,
-0.18028157949447632,
-0.2121741771697998,
0.19645798206329346,
-0.5508670210838318,
0.2621631324291229,
0.10162433236837387,
-0.018894899636507034,
0.01144984271377325,
-0.0795970931649208,
0.0631379559636116,
-0.1570993810892105,
0.07281999289989471,
-0.012761898338794708,
0.3050301671028137,
-0.007999738678336143,
0.09897257387638092,
-0.09235377609729767,
0.0849822610616684,
-0.11044850945472717,
-0.16194741427898407,
-0.10344941914081573,
0.12455157190561295,
-0.22157323360443115,
-0.33656832575798035,
-0.08327820897102356,
-0.05425039678812027,
-0.05318359285593033,
-0.0852571576833725,
-0.18455982208251953,
-0.26710009574890137,
0.06642599403858185,
0.15524354577064514,
0.16193662583827972,
0.10267311334609985,
-0.23061072826385498,
0.5886750221252441,
0.17775101959705353,
0.19528977572917938,
-0.13318563997745514,
-0.25827711820602417,
0.212348073720932,
-0.04911569505929947,
0.5472078919410706,
0.06730754673480988,
0.36913058161735535,
0.07195831835269928,
-0.22009707987308502,
0.28790560364723206,
-0.23276525735855103,
-0.17514458298683167,
0.11901650577783585,
0.4325392246246338,
0.16376915574073792,
-0.09492316097021103,
0.01757330447435379,
0.07401478290557861,
-0.09151352196931839,
0.045389145612716675,
-0.2095552235841751,
0.3484058082103729,
-0.09513923525810242,
-0.15097591280937195,
-0.09184376895427704,
-0.13086089491844177,
0.014306887984275818,
0.29557618498802185,
0.014936957508325577,
-0.17874015867710114,
-0.21286973357200623,
-0.2942226231098175,
0.18862825632095337,
0.2347244918346405,
-0.32835716009140015,
0.14031687378883362,
0.21237584948539734,
-0.3132808208465576,
-0.058649078011512756,
0.25336748361587524,
-0.34755250811576843,
-0.1908840835094452,
-0.4901152551174164,
0.2115909606218338,
-0.04523497074842453,
-0.12719561159610748,
-0.17571765184402466,
-0.14906300604343414,
0.32368898391723633,
-0.14764583110809326,
0.23173566162586212,
-0.2244754433631897,
-0.26091468334198,
-0.24305640161037445,
-0.04157516360282898,
0.19225797057151794,
-0.28043127059936523,
0.06032972037792206,
0.11562042683362961,
0.16592618823051453,
0.1489792764186859,
0.08220550417900085,
-0.11487593501806259,
0.4138810336589813,
-0.2262895405292511,
-0.08790509402751923,
0.2598167955875397,
-0.06712579727172852,
-0.35396528244018555,
0.05306204780936241,
-0.24170660972595215,
0.21375992894172668,
-0.0805736854672432,
0.24175375699996948,
0.1398920863866806,
0.028454843908548355,
0.13285985589027405,
0.09904339909553528,
0.0471714586019516,
0.08916141092777252,
-0.17566505074501038,
0.140131875872612,
0.21409684419631958,
-0.029378417879343033,
0.12882272899150848,
0.0728646069765091,
-0.03225646913051605,
0.11165459454059601,
0.02102472633123398,
-0.1976420283317566,
-0.2215411514043808,
-0.0023498227819800377,
0.5794558525085449,
-0.12775370478630066,
0.025734584778547287,
-0.13322177529335022,
-0.3293592035770416,
0.11430785804986954,
0.5191652178764343,
-0.031490761786699295,
-0.3722222149372101,
-0.12183958292007446,
-0.35413631796836853,
0.16783678531646729,
-0.27503934502601624,
-0.26637497544288635,
0.14623457193374634,
0.1466650664806366,
0.0038495510816574097,
0.011973194777965546,
-0.342307984828949,
0.3490411937236786,
-0.09388217329978943,
0.1777944713830948,
0.02268664911389351,
0.3287726640701294,
-0.2886846661567688,
-0.000456150621175766,
-0.20685327053070068,
0.1689361184835434,
0.11020947992801666,
-0.1462748944759369,
-0.1855834424495697,
0.4447663724422455,
0.18207350373268127,
-0.0912722647190094,
-0.5074167847633362,
0.008060388267040253,
0.25394102931022644,
0.22855336964130402,
-0.2445187121629715,
-0.11192191392183304,
0.1593160182237625,
0.17968159914016724,
-0.30139100551605225,
0.5166142582893372,
-0.045307282358407974,
0.04338609799742699,
-0.1742522120475769,
0.034072160720825195,
0.02719409018754959,
-0.1275392472743988,
-0.049810804426670074,
-0.3316277861595154,
0.05494821071624756,
-0.11637896299362183,
-0.17050674557685852,
0.05329994857311249,
-0.4129118323326111,
0.031074434518814087,
0.5919798612594604,
0.012604691088199615,
0.1462322622537613,
0.18497975170612335,
-0.0324070043861866,
0.12700705230236053,
0.053372062742710114,
0.5279636979103088,
0.4246496260166168,
0.06836934387683868,
-0.2642010450363159,
0.20088320970535278,
-0.3648347556591034,
-0.11860114336013794,
0.07861416786909103,
0.11946339160203934,
0.054913442581892014,
0.1677074283361435,
0.3081199824810028,
0.13327310979366302,
-0.14989367127418518,
-0.0821896493434906,
0.06992090493440628,
0.44579991698265076,
-0.42555394768714905,
0.3505680561065674,
-0.251088947057724,
-0.20369061827659607,
-0.2269594669342041,
-0.017867524176836014,
0.34670525789260864,
-0.3532876968383789,
-0.017779413610696793,
0.05670750141143799,
-0.06090853363275528,
0.0724751204252243,
-0.3581940531730652,
0.016847044229507446,
0.11594734340906143,
-0.13752853870391846,
-0.007982887327671051,
-0.1206275224685669,
-0.12603598833084106,
0.06933083385229111,
0.361881285905838,
-0.2777278423309326,
0.38317856192588806,
0.002056337893009186,
-0.10001076757907867,
-0.1187794879078865,
-0.5022153258323669,
0.04320146143436432,
-0.35115954279899597,
0.20292523503303528,
0.14673471450805664,
0.278632789850235,
-0.2855725884437561,
-0.32407844066619873,
0.35675695538520813,
0.039755262434482574,
-0.24900799989700317,
0.2317691445350647,
0.10696020722389221,
0.06117278337478638,
-0.2462371438741684,
-0.4250853359699249,
-0.014255589805543423,
-0.022539660334587097,
-0.11468358337879181,
-0.041548918932676315,
0.19738413393497467,
0.22158977389335632,
0.19418662786483765,
0.01638135313987732,
-0.08368624746799469,
-0.10650043934583664,
-0.2820452153682709,
-0.06395885348320007,
0.36778724193573,
-0.09448030591011047,
-0.3669707775115967,
-0.08428962528705597,
-0.3886845111846924,
0.05063240975141525,
-0.23593270778656006,
-0.4964030385017395,
-0.5462881922721863,
-0.27615201473236084,
0.39570724964141846,
-0.031499553471803665,
0.06740257143974304,
0.166297048330307,
-0.05546741932630539,
-0.0553843192756176,
-0.15096738934516907,
-0.2351125180721283,
-0.11724059283733368,
0.28994300961494446,
0.12682677805423737,
-0.014014558866620064,
0.7016931176185608,
0.08587712794542313,
0.3071584701538086,
0.017686523497104645,
-0.28564146161079407,
0.3742866814136505,
-0.3491329550743103,
0.417340487241745,
-0.3297930359840393,
-0.6001448631286621,
0.09614452719688416,
-0.05962027609348297,
-0.008560627698898315,
-0.004421994090080261,
-0.196571484208107,
-0.06919865310192108,
-0.043334487825632095,
0.07229916751384735,
-0.05957978963851929,
-0.17555773258209229,
0.3120882213115692,
-0.1951678991317749,
0.24539291858673096,
0.059844955801963806,
0.2612709403038025,
-0.2368609607219696,
-0.07545161992311478,
0.01071387529373169,
0.1026228815317154,
0.18938890099525452,
-0.3127770721912384,
-0.21099060773849487,
-0.485355406999588,
-0.3509693145751953,
0.08985960483551025,
0.300609290599823,
0.4962630867958069,
0.10066506266593933,
-0.09238104522228241,
0.13480009138584137,
0.06137636676430702,
0.5039546489715576,
-0.23185962438583374,
-0.2246059626340866,
0.20369967818260193,
-0.1383667141199112,
-0.24247844517230988,
-0.22479015588760376,
-0.32147538661956787,
0.05703391134738922,
-0.05304770544171333,
0.8322482109069824,
-0.10952022671699524,
0.14638018608093262,
0.49046197533607483,
0.1495511829853058,
-0.18325866758823395,
-0.15793827176094055,
-0.29685282707214355,
-0.17072580754756927,
-0.3751976788043976,
0.369728684425354,
-0.016537122428417206,
0.21125639975070953,
0.08121294528245926,
0.05209916830062866,
0.11576095223426819,
-0.09778748452663422,
-0.1190992221236229,
0.29055267572402954,
0.08504609763622284,
0.2653825879096985,
0.24802659451961517,
-0.11432447284460068,
0.092378631234169,
0.11505811661481857,
0.30361875891685486,
-0.13151364028453827,
-0.13776904344558716,
-0.06095963716506958,
-0.29790598154067993,
0.23027056455612183,
0.09844668209552765,
-0.00005034357309341431,
0.2137615978717804,
-0.27068501710891724,
0.1121247336268425,
-0.14019335806369781,
-0.005009591579437256,
0.4631224572658539,
0.15114423632621765,
-0.30630069971084595,
-0.43030017614364624,
0.15075016021728516,
-0.0676010251045227,
0.04467940330505371,
0.11274908483028412,
0.13436876237392426,
-0.19124162197113037,
0.5324610471725464,
0.07772897183895111,
0.7261466383934021,
0.017101004719734192,
0.11826641857624054,
0.5060240030288696,
-0.33479198813438416,
0.5263318419456482,
0.13733960688114166,
0.1351986527442932,
-0.3693051040172577,
-0.3847391903400421,
-0.06831632554531097,
-0.1542353630065918,
0.12921583652496338,
-0.4114209711551666,
-0.3212537169456482,
0.15499740839004517,
-0.2671644687652588,
0.5375363826751709,
-0.03308222442865372,
-0.03041878342628479,
-0.00810985453426838,
-0.15962976217269897,
-0.14864644408226013,
0.18730029463768005,
-0.061583828181028366,
0.033024538308382034,
-0.05133812874555588,
0.007475115358829498,
-0.18175742030143738,
-0.42401307821273804,
-0.3281340003013611,
-0.062092557549476624,
0.08099211007356644,
0.13127827644348145,
0.16235783696174622,
-0.6208377480506897,
0.16389653086662292,
0.2262948751449585,
0.22314570844173431,
0.1667822301387787,
0.09612644463777542,
0.119953453540802,
0.23810571432113647,
0.2790747284889221,
0.041655283421278,
-0.1562330722808838,
0.17828309535980225,
0.058593377470970154,
-0.21659386157989502,
0.12048545479774475,
0.039764050394296646,
-0.5176620483398438,
0.08459502458572388,
0.27347856760025024,
0.17743636667728424,
-0.35407984256744385,
-0.3486301600933075,
-0.23764654994010925,
0.06140029430389404,
-0.502522349357605,
0.18020330369472504,
-0.1447455883026123,
-0.024459270760416985,
0.34577345848083496,
-0.06724637001752853,
-0.32170891761779785,
-0.08423224091529846,
0.28549349308013916,
0.10580585151910782,
0.2778933048248291,
0.67848140001297,
0.0460466668009758,
-0.16274422407150269,
-0.17968395352363586,
0.3253130316734314,
0.33091533184051514,
-0.27283763885498047,
0.058820731937885284,
-0.021602772176265717,
0.30490246415138245,
-0.0693010613322258,
0.24070364236831665,
0.009071032516658306,
0.027320420369505882,
-0.07760943472385406,
-0.3391144275665283,
-0.20136195421218872,
0.10274524986743927,
-0.011613098904490471,
0.1448437124490738,
-0.03714314103126526,
0.4142480492591858,
-0.17448411881923676,
0.06690149009227753,
-0.3550536036491394,
-0.04204621538519859,
-0.2193756401538849,
0.20901769399642944,
0.41288745403289795,
0.18302220106124878,
-0.007793363183736801,
-0.2416645586490631,
0.2005217969417572,
0.4061143696308136,
0.15207192301750183,
-0.2961967885494232,
-0.19363845884799957,
0.049186237156391144,
0.07092335820198059,
-0.061933599412441254,
-0.25046804547309875,
-0.016654834151268005,
0.011258881539106369,
-0.13982540369033813,
0.04920307546854019,
0.07203011214733124,
-0.12863940000534058,
0.3083786368370056,
-0.12941992282867432,
-0.02935783937573433,
0.17603573203086853,
-0.11130497604608536,
-0.282798171043396,
0.11975367367267609,
0.26063406467437744,
0.1211996003985405,
0.07662695646286011,
0.14426910877227783,
-0.29860734939575195,
0.09767106920480728,
-0.2882680892944336,
0.1589602380990982,
0.31246739625930786,
-0.3211638331413269,
0.14096656441688538,
0.09921354055404663,
0.11601145565509796,
0.09596722573041916,
-0.37015560269355774,
0.08172079920768738,
0.21847441792488098,
0.22824938595294952,
-0.3312194347381592,
-0.14747487008571625,
0.17882104218006134,
0.09526461362838745,
0.17035332322120667,
0.36637604236602783,
0.08380117267370224,
0.22137151658535004,
-0.2482539713382721,
0.07126985490322113,
0.09842193871736526,
-0.17094358801841736,
0.15796209871768951,
0.7830811142921448,
-0.043671853840351105,
0.053651295602321625,
0.45829886198043823,
-0.02548963762819767,
-0.07779645174741745,
0.3126167356967926,
0.06442886590957642,
-0.004530584439635277,
0.3520772457122803,
-0.028801117092370987,
0.10740906745195389,
-0.23091602325439453,
0.3338985741138458,
-0.08633354306221008,
-0.00695505365729332,
-0.13776516914367676,
0.18184775114059448,
0.018585456535220146,
-0.09871044754981995,
-0.06420090049505234,
-0.18243038654327393,
0.06695427000522614,
-0.2770524024963379,
0.10360740125179291,
-0.21677497029304504,
-0.00792696326971054,
-0.06963101029396057,
0.0842251107096672,
-0.10749742388725281,
-0.03969954699277878,
0.27074503898620605,
0.07955610752105713,
-0.24140393733978271,
-0.09299971163272858,
0.0007834248244762421,
0.21899817883968353,
0.16387704014778137,
-0.2709284722805023,
0.2180735021829605,
0.1875295788049698,
0.14426837861537933,
0.20751650631427765,
0.08927669376134872,
0.48400190472602844,
0.1896270364522934,
0.2593028247356415,
0.13424812257289886,
-0.09187991917133331,
-0.12120921909809113,
0.21967408061027527,
0.22538840770721436,
0.01296541653573513,
0.20417417585849762,
0.2527497112751007,
0.19629013538360596,
-0.18300126492977142,
0.39606428146362305,
0.17481376230716705,
0.31507906317710876,
-0.2760730981826782,
0.2581934630870819,
-0.03602508455514908,
-0.22376999258995056,
-0.10137981176376343,
0.06052551046013832,
0.0003789365291595459,
0.03900819271802902,
0.08427892625331879,
0.16202004253864288,
0.14472870528697968,
-0.029282357543706894,
0.10736814141273499,
0.22719328105449677,
0.28460004925727844,
0.4248197376728058,
-0.18037135899066925,
-0.33928051590919495,
-0.08768463134765625,
-0.6053999662399292,
-0.0034274160861968994,
-0.3668937087059021,
-0.23867082595825195,
-0.10318727791309357,
0.07756990194320679,
0.11543229967355728,
0.11902813613414764,
0.3233505189418793,
-0.21807628870010376,
-0.26484543085098267,
0.32144883275032043,
-0.21574667096138,
-0.20577585697174072,
0.37216824293136597,
0.011793239042162895,
-0.14567258954048157,
-0.16372214257717133,
0.2469942569732666,
-0.03057754598557949,
0.13441917300224304,
0.030745122581720352,
-0.05379399284720421,
-0.17106926441192627,
-0.09257684648036957,
0.4124283790588379,
0.18439297378063202,
0.3730853796005249,
-0.04526158794760704,
-0.005421116948127747,
-0.16101616621017456,
-0.2688508629798889,
-0.22639203071594238,
0.27804920077323914,
0.07519568502902985,
0.6442686915397644,
0.22818554937839508,
-0.33450672030448914,
-0.19241422414779663,
0.319513738155365,
-0.04657052084803581,
-0.15844210982322693,
-0.07152055203914642,
0.1523037999868393,
-0.10240621119737625,
-0.07031148672103882,
0.022857218980789185,
0.21589377522468567,
-0.048064738512039185,
0.25755125284194946,
-0.15480004251003265,
-0.5117995142936707,
0.2991017699241638,
-0.48855212330818176,
-0.37971484661102295,
-0.04287713021039963,
-0.054556265473365784,
-0.052407585084438324,
-0.06459400802850723,
-0.3534693121910095,
-0.17242136597633362,
0.2622516453266144,
-0.18998965620994568,
-0.2331571727991104,
0.22971729934215546,
0.13211937248706818,
0.3854864835739136,
0.04413590580224991,
0.5017343163490295,
-0.2660331428050995,
-0.18313944339752197,
0.024492666125297546,
-0.1809867024421692
] |
https://github.com/huggingface/datasets/issues/6246 | > I think it's an issue with the code.
>
> Specifically:
>
> ```python
> dataset = dataset['train'].add_column("/workspace/data", new_column)
> ```
>
> Now `dataset` is the train set with a new column. To fix this, you can do:
>
> ```python
> dataset['train'] = dataset['train'].add_column("/workspace/data", new_column)
> ```
Thanks for your response, but i can not access mask images, please let me know why the problem still persists. Here is the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing | Add new column to dataset | ### Describe the bug
```
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>()
----> 1 dataset['train']['/workspace/data']
3 frames
[/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns)
518 def _check_valid_column_key(key: str, columns: List[str]) -> None:
519 if key not in columns:
--> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}")
521
522
KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']"
```
### Steps to reproduce the bug
please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
### Expected behavior
add column to the dataset
### Environment info
colab pro | 77 | Add new column to dataset
### Describe the bug
```
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>()
----> 1 dataset['train']['/workspace/data']
3 frames
[/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns)
518 def _check_valid_column_key(key: str, columns: List[str]) -> None:
519 if key not in columns:
--> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}")
521
522
KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']"
```
### Steps to reproduce the bug
please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
### Expected behavior
add column to the dataset
### Environment info
colab pro
> I think it's an issue with the code.
>
> Specifically:
>
> ```python
> dataset = dataset['train'].add_column("/workspace/data", new_column)
> ```
>
> Now `dataset` is the train set with a new column. To fix this, you can do:
>
> ```python
> dataset['train'] = dataset['train'].add_column("/workspace/data", new_column)
> ```
Thanks for your response, but i can not access mask images, please let me know why the problem still persists. Here is the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing | [
-0.06994634866714478,
-0.01698148250579834,
0.05168754979968071,
0.024547219276428223,
0.3096671402454376,
0.20680584013462067,
0.6639566421508789,
0.47558239102363586,
0.14351102709770203,
0.09803667664527893,
0.09017430245876312,
0.5036664605140686,
-0.2043507993221283,
0.1888449490070343,
0.10687108337879181,
-0.272789865732193,
0.1591367870569229,
0.17576830089092255,
0.0036346111446619034,
0.14868372678756714,
-0.3609651029109955,
-0.0033779777586460114,
-0.27276208996772766,
0.14087975025177002,
-0.3100627064704895,
-0.07387096434831619,
-0.3598881661891937,
-0.09726984798908234,
-0.09797858446836472,
-0.34451019763946533,
0.16080662608146667,
-0.30124133825302124,
0.011273905634880066,
0.5431525111198425,
-0.0001111167948693037,
0.07577911764383316,
0.06317763030529022,
0.0788303092122078,
-0.22209404408931732,
-0.2675083577632904,
-0.3984820544719696,
-0.28542450070381165,
-0.06442424654960632,
-0.33490121364593506,
-0.1564890593290329,
0.01601535826921463,
-0.25607895851135254,
-0.006406798958778381,
0.17694291472434998,
0.4810732901096344,
0.2726932168006897,
0.33843064308166504,
-0.03950142860412598,
-0.10136064887046814,
0.1733171045780182,
0.07284288108348846,
-0.26631003618240356,
0.27999642491340637,
0.015127038583159447,
-0.15754204988479614,
0.19044730067253113,
0.4187110364437103,
0.11096768081188202,
-0.04736093431711197,
0.2759990394115448,
0.33475446701049805,
-0.17744547128677368,
-0.24479737877845764,
-0.0038497827481478453,
0.09983442723751068,
0.20921370387077332,
-0.27713650465011597,
-0.18207840621471405,
-0.20950499176979065,
0.20441526174545288,
-0.5507596731185913,
0.2737117409706116,
0.08262547850608826,
-0.017866507172584534,
0.016177158802747726,
-0.09415868669748306,
0.06077711656689644,
-0.14572516083717346,
0.07114638388156891,
0.0019634366035461426,
0.29841411113739014,
-0.0042681582272052765,
0.09585213661193848,
-0.08935108780860901,
0.09108419716358185,
-0.10371633619070053,
-0.15583296120166779,
-0.11135927587747574,
0.12369758635759354,
-0.22592496871948242,
-0.33268338441848755,
-0.06474120914936066,
-0.06026572361588478,
-0.039698999375104904,
-0.09020725637674332,
-0.19089050590991974,
-0.27159738540649414,
0.07514385879039764,
0.1479765772819519,
0.15669047832489014,
0.09966886043548584,
-0.22143664956092834,
0.5803969502449036,
0.18261244893074036,
0.20122992992401123,
-0.13029125332832336,
-0.247658371925354,
0.20107099413871765,
-0.051601726561784744,
0.5542947053909302,
0.06903691589832306,
0.35435110330581665,
0.07325254380702972,
-0.21364274621009827,
0.29195889830589294,
-0.23728196322917938,
-0.16554003953933716,
0.12149027734994888,
0.44172272086143494,
0.16371506452560425,
-0.1020551398396492,
0.01524035632610321,
0.06111938878893852,
-0.0953691154718399,
0.03789924830198288,
-0.20792800188064575,
0.3423495292663574,
-0.09783682972192764,
-0.14934085309505463,
-0.09332863241434097,
-0.1233627200126648,
0.0032869428396224976,
0.2885351777076721,
0.02502366527915001,
-0.1726629137992859,
-0.21760651469230652,
-0.2963199019432068,
0.1807665079832077,
0.23482541739940643,
-0.34144023060798645,
0.13099488615989685,
0.2026471495628357,
-0.30859795212745667,
-0.06350516527891159,
0.2561972737312317,
-0.3404390215873718,
-0.2005612999200821,
-0.47628939151763916,
0.21546918153762817,
-0.04237493872642517,
-0.11702434718608856,
-0.17704397439956665,
-0.1391165852546692,
0.3230685889720917,
-0.15498408675193787,
0.24160584807395935,
-0.23289261758327484,
-0.2597287893295288,
-0.24619287252426147,
-0.018469076603651047,
0.1908741295337677,
-0.2805098295211792,
0.04809565842151642,
0.11270691454410553,
0.16383767127990723,
0.14946961402893066,
0.07360303401947021,
-0.11925985664129257,
0.4058694839477539,
-0.23676198720932007,
-0.09047622978687286,
0.2656302750110626,
-0.05680754780769348,
-0.35811424255371094,
0.03986956551671028,
-0.24405132234096527,
0.21243496239185333,
-0.07999886572360992,
0.23836475610733032,
0.14349791407585144,
0.034714315086603165,
0.13090115785598755,
0.08966691792011261,
0.03898600488901138,
0.0903160572052002,
-0.18007734417915344,
0.12874141335487366,
0.20607328414916992,
-0.02494063600897789,
0.14632469415664673,
0.05433955788612366,
-0.028829310089349747,
0.11082782596349716,
0.015656769275665283,
-0.19964006543159485,
-0.213570237159729,
-0.00720370514318347,
0.5796184539794922,
-0.1340913474559784,
0.026095591485500336,
-0.13318179547786713,
-0.3279677629470825,
0.11428509652614594,
0.5116996765136719,
-0.0340670607984066,
-0.3632259666919708,
-0.1312745064496994,
-0.35086575150489807,
0.16815820336341858,
-0.2673575282096863,
-0.2718449831008911,
0.14789524674415588,
0.14710883796215057,
0.0018488019704818726,
0.008599452674388885,
-0.34308725595474243,
0.35610947012901306,
-0.1058344766497612,
0.17306512594223022,
0.02670259028673172,
0.3186081349849701,
-0.28891226649284363,
-0.008121250197291374,
-0.2018355131149292,
0.1717437505722046,
0.09842823445796967,
-0.15116870403289795,
-0.19035883247852325,
0.43999016284942627,
0.1785673201084137,
-0.09892091155052185,
-0.5182084441184998,
0.010658256709575653,
0.249871164560318,
0.22330279648303986,
-0.25015196204185486,
-0.11671777069568634,
0.14812718331813812,
0.18095017969608307,
-0.3031300902366638,
0.5028241276741028,
-0.03246093541383743,
0.030540335923433304,
-0.1727861613035202,
0.028354905545711517,
0.027179285883903503,
-0.12281734496355057,
-0.04703904688358307,
-0.32838302850723267,
0.05127676948904991,
-0.12741044163703918,
-0.1628686636686325,
0.05087084323167801,
-0.40919703245162964,
0.037984441965818405,
0.6027970314025879,
0.010999202728271484,
0.1506970226764679,
0.18817798793315887,
-0.032359566539525986,
0.12393703311681747,
0.05702555924654007,
0.52402263879776,
0.4192124009132385,
0.06891937553882599,
-0.2633025646209717,
0.20191103219985962,
-0.3649621307849884,
-0.1243896558880806,
0.09122533351182938,
0.11017514765262604,
0.058422740548849106,
0.17146994173526764,
0.30915433168411255,
0.12997029721736908,
-0.15304386615753174,
-0.08798027038574219,
0.09053530544042587,
0.44771137833595276,
-0.4338911175727844,
0.3359406590461731,
-0.25483524799346924,
-0.21741437911987305,
-0.22584852576255798,
0.008643105626106262,
0.3512217700481415,
-0.35223180055618286,
-0.005005367565900087,
0.0573681965470314,
-0.07017980515956879,
0.08571969717741013,
-0.33969050645828247,
0.028602465987205505,
0.11210322380065918,
-0.13640862703323364,
-0.003706693649291992,
-0.12743781507015228,
-0.13572241365909576,
0.07212987542152405,
0.36012035608291626,
-0.28507471084594727,
0.3943300247192383,
-0.013423271477222443,
-0.10768838226795197,
-0.11012567579746246,
-0.5093991160392761,
0.04343711957335472,
-0.3449028432369232,
0.20743794739246368,
0.15750518441200256,
0.26390933990478516,
-0.3074399530887604,
-0.3309241235256195,
0.35585230588912964,
0.03925429284572601,
-0.26098987460136414,
0.22146707773208618,
0.10167082399129868,
0.06562848389148712,
-0.2521211504936218,
-0.4354960024356842,
-0.007990112528204918,
-0.028020191937685013,
-0.11360333859920502,
-0.0610671266913414,
0.1945694535970688,
0.2293432354927063,
0.1945948302745819,
0.03228548541665077,
-0.08119050413370132,
-0.09321827441453934,
-0.278987854719162,
-0.06871910393238068,
0.3722061216831207,
-0.09132027626037598,
-0.36259225010871887,
-0.08667026460170746,
-0.3983381390571594,
0.04944874718785286,
-0.23136156797409058,
-0.5054722428321838,
-0.5465421080589294,
-0.27148929238319397,
0.40336841344833374,
-0.027381656691432,
0.046892039477825165,
0.17289535701274872,
-0.0523403100669384,
-0.0551283173263073,
-0.1476215273141861,
-0.23490120470523834,
-0.11655330657958984,
0.2836051285266876,
0.1343645453453064,
-0.013890465721487999,
0.7048264145851135,
0.08214038610458374,
0.3126571774482727,
0.021647728979587555,
-0.2754150331020355,
0.36590200662612915,
-0.3487206697463989,
0.41280579566955566,
-0.3344641923904419,
-0.6009692549705505,
0.11919767409563065,
-0.06764651834964752,
-0.021701104938983917,
-0.01621350273489952,
-0.20355065166950226,
-0.07828269898891449,
-0.04165294021368027,
0.062196485698223114,
-0.04759591445326805,
-0.1859200894832611,
0.3255768418312073,
-0.19636112451553345,
0.2402413785457611,
0.0457606166601181,
0.26372867822647095,
-0.22529810667037964,
-0.07749894261360168,
0.01705947518348694,
0.11328426003456116,
0.18273283541202545,
-0.3156764805316925,
-0.20963823795318604,
-0.476606160402298,
-0.347708523273468,
0.0938202291727066,
0.3056453466415405,
0.4916844367980957,
0.08842761814594269,
-0.0897693932056427,
0.13616494834423065,
0.04723573103547096,
0.5245482921600342,
-0.22496916353702545,
-0.21692395210266113,
0.20671644806861877,
-0.13150213658809662,
-0.22073900699615479,
-0.22528161108493805,
-0.31169024109840393,
0.04440702497959137,
-0.045855142176151276,
0.8267596960067749,
-0.11259357631206512,
0.15112459659576416,
0.49303099513053894,
0.14605937898159027,
-0.18138137459754944,
-0.16144153475761414,
-0.2850798964500427,
-0.16130498051643372,
-0.3820328414440155,
0.37903496623039246,
-0.016250871121883392,
0.2125663459300995,
0.08222991973161697,
0.03731168806552887,
0.11964467912912369,
-0.10218478739261627,
-0.12859436869621277,
0.2891249656677246,
0.08758470416069031,
0.26449549198150635,
0.26225370168685913,
-0.11927327513694763,
0.09034522622823715,
0.12349224835634232,
0.295780211687088,
-0.13091959059238434,
-0.14684468507766724,
-0.06802882254123688,
-0.29487165808677673,
0.2281200885772705,
0.09112366288900375,
-0.005492981523275375,
0.20593507587909698,
-0.2704507112503052,
0.11107443273067474,
-0.12842345237731934,
0.01147935539484024,
0.45773589611053467,
0.1557128131389618,
-0.3066454827785492,
-0.42808812856674194,
0.13438735902309418,
-0.05728205665946007,
0.04288673400878906,
0.11508540064096451,
0.1281699538230896,
-0.19719867408275604,
0.533376157283783,
0.08468488603830338,
0.7255327105522156,
0.0209097471088171,
0.12317542731761932,
0.5053428411483765,
-0.3421940803527832,
0.54243403673172,
0.11643843352794647,
0.14329864084720612,
-0.3569936752319336,
-0.39931342005729675,
-0.05851196125149727,
-0.14546120166778564,
0.12778297066688538,
-0.41158556938171387,
-0.31615278124809265,
0.15579047799110413,
-0.2508295774459839,
0.550149142742157,
-0.04604790359735489,
-0.0434623546898365,
-0.007723800837993622,
-0.1620560884475708,
-0.13925106823444366,
0.18844567239284515,
-0.06571498513221741,
0.024996116757392883,
-0.052696648985147476,
0.008345618844032288,
-0.16924834251403809,
-0.4266044497489929,
-0.3344424366950989,
-0.06089922785758972,
0.07896716147661209,
0.12605516612529755,
0.15801887214183807,
-0.6092536449432373,
0.16334836184978485,
0.21925485134124756,
0.21780778467655182,
0.17069874703884125,
0.09744071960449219,
0.1220925822854042,
0.24136482179164886,
0.29484066367149353,
0.04612166807055473,
-0.16135407984256744,
0.19799846410751343,
0.05785839259624481,
-0.21558481454849243,
0.11897903680801392,
0.03699548542499542,
-0.5160165429115295,
0.09716643393039703,
0.26018187403678894,
0.17893660068511963,
-0.3527070879936218,
-0.33450958132743835,
-0.23533408343791962,
0.06145092844963074,
-0.5060548186302185,
0.1830763816833496,
-0.14579683542251587,
-0.028432153165340424,
0.35454607009887695,
-0.07230225205421448,
-0.32273173332214355,
-0.08449065685272217,
0.288077175617218,
0.09650769084692001,
0.2725662589073181,
0.6818491220474243,
0.03904654085636139,
-0.16372810304164886,
-0.18005505204200745,
0.3254121243953705,
0.34418556094169617,
-0.2766347825527191,
0.060026898980140686,
-0.029221875593066216,
0.2972220778465271,
-0.07162077724933624,
0.23874136805534363,
0.023407652974128723,
0.03879432752728462,
-0.06892287731170654,
-0.3446986973285675,
-0.21588830649852753,
0.10741852223873138,
-0.01189449056982994,
0.15260866284370422,
-0.02646626904606819,
0.4153154194355011,
-0.1688527762889862,
0.0701446458697319,
-0.35546875,
-0.05219608172774315,
-0.23045885562896729,
0.20769177377223969,
0.414375901222229,
0.18766924738883972,
-0.008658599108457565,
-0.2500278651714325,
0.1961267590522766,
0.41334378719329834,
0.1484106332063675,
-0.29549071192741394,
-0.18972164392471313,
0.05061439424753189,
0.0632220208644867,
-0.06055828928947449,
-0.2473747879266739,
-0.025881923735141754,
0.015744417905807495,
-0.13852745294570923,
0.051860958337783813,
0.05872252583503723,
-0.12945064902305603,
0.30478447675704956,
-0.12682847678661346,
-0.024121999740600586,
0.18056149780750275,
-0.11003348231315613,
-0.27379080653190613,
0.11754381656646729,
0.24812965095043182,
0.11697152256965637,
0.07863529771566391,
0.1413789838552475,
-0.29352590441703796,
0.0945507287979126,
-0.290853887796402,
0.15708813071250916,
0.31437385082244873,
-0.3072400689125061,
0.12536922097206116,
0.09884089231491089,
0.10444995015859604,
0.09546670317649841,
-0.37057143449783325,
0.07145991176366806,
0.23545318841934204,
0.2289353460073471,
-0.3383494019508362,
-0.14695335924625397,
0.1690065562725067,
0.10040886700153351,
0.16580843925476074,
0.357480525970459,
0.06978398561477661,
0.22171059250831604,
-0.2411380112171173,
0.07966158539056778,
0.09110032767057419,
-0.16592903435230255,
0.15857163071632385,
0.7928944230079651,
-0.047788843512535095,
0.05845550820231438,
0.4559325873851776,
-0.029896825551986694,
-0.07583892345428467,
0.3213726282119751,
0.049142204225063324,
-0.0017013568431138992,
0.3556442856788635,
-0.00938166119158268,
0.12054751813411713,
-0.2187030166387558,
0.332274854183197,
-0.07849171757698059,
-0.008038714528083801,
-0.13312293589115143,
0.19209347665309906,
0.011380968615412712,
-0.08110737800598145,
-0.08064296841621399,
-0.17015357315540314,
0.07642622292041779,
-0.2758796811103821,
0.1090472936630249,
-0.23466962575912476,
0.0009804517030715942,
-0.08090684562921524,
0.09178681671619415,
-0.11150965839624405,
-0.037658631801605225,
0.2836325168609619,
0.08622653037309647,
-0.2426750808954239,
-0.08708909898996353,
0.003177841193974018,
0.21742701530456543,
0.17197781801223755,
-0.27736759185791016,
0.21785512566566467,
0.19283980131149292,
0.14736320078372955,
0.20330381393432617,
0.08920428156852722,
0.48061540722846985,
0.18815669417381287,
0.26660388708114624,
0.12930813431739807,
-0.08027961850166321,
-0.11657150089740753,
0.2035364955663681,
0.23421414196491241,
0.020292755216360092,
0.1994432508945465,
0.24855419993400574,
0.19410493969917297,
-0.18341995775699615,
0.4089444577693939,
0.1728585660457611,
0.3041800260543823,
-0.2851804494857788,
0.25778090953826904,
-0.010687091387808323,
-0.22828400135040283,
-0.10466073453426361,
0.06546112895011902,
0.014064766466617584,
0.04535200819373131,
0.09677264094352722,
0.16247659921646118,
0.14431026577949524,
-0.028648491948843002,
0.10766157507896423,
0.2285161316394806,
0.29220569133758545,
0.4216744303703308,
-0.1933942437171936,
-0.3425138294696808,
-0.08275603502988815,
-0.606086790561676,
-0.009921647608280182,
-0.35785484313964844,
-0.23485791683197021,
-0.09731251001358032,
0.06079859286546707,
0.12219586223363876,
0.11075478792190552,
0.31950750946998596,
-0.21984551846981049,
-0.2535553276538849,
0.3149563670158386,
-0.21315819025039673,
-0.2062157243490219,
0.3572937846183777,
0.01185842789709568,
-0.13791844248771667,
-0.16706278920173645,
0.25964176654815674,
-0.01684815064072609,
0.12994953989982605,
0.03131597116589546,
-0.06532624363899231,
-0.16266964375972748,
-0.09488868713378906,
0.4100531041622162,
0.18441623449325562,
0.36829185485839844,
-0.051238954067230225,
0.005279764533042908,
-0.15363934636116028,
-0.27297165989875793,
-0.22625529766082764,
0.28738516569137573,
0.06630535423755646,
0.6313127279281616,
0.22932478785514832,
-0.32912757992744446,
-0.18876031041145325,
0.3149445056915283,
-0.046455614268779755,
-0.16234779357910156,
-0.07272204011678696,
0.15440402925014496,
-0.09896605461835861,
-0.07641171663999557,
0.02354178950190544,
0.22268541157245636,
-0.047291334718465805,
0.24382804334163666,
-0.16015948355197906,
-0.5221006274223328,
0.29849836230278015,
-0.49134379625320435,
-0.37090229988098145,
-0.0488152839243412,
-0.04683418571949005,
-0.04662816971540451,
-0.07776646316051483,
-0.3695102035999298,
-0.18554973602294922,
0.26529747247695923,
-0.1908552646636963,
-0.2281314581632614,
0.23663702607154846,
0.14694565534591675,
0.39545372128486633,
0.03842896223068237,
0.5098839998245239,
-0.26574498414993286,
-0.17951101064682007,
0.024576865136623383,
-0.1935163289308548
] |
https://github.com/huggingface/datasets/issues/6246 | I think there is a slight misunderstanding.
```python
new_column = ["mask"] * len(dataset["train"])
dataset['train'] = dataset['train'].add_column("/workspace/data", new_column)
```
adds a column with the string `mask` to your dataset.
If you're trying to load the images `"mask_{idx}.png"` in your dataset, you could try:
```
from datasets import Image
dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/workspace/data/mask_{idx}.png", with_indices=True).cast_column("mask", Image())
```
What this does is that it adds a column to your dataset name `mask` with the path to the mask, then it cast the column as an `Image` feature.
This [link](https://huggingface.co/docs/datasets/v2.5.1/en/image_load) explains how to load images.
Hope this helps! | Add new column to dataset | ### Describe the bug
```
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>()
----> 1 dataset['train']['/workspace/data']
3 frames
[/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns)
518 def _check_valid_column_key(key: str, columns: List[str]) -> None:
519 if key not in columns:
--> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}")
521
522
KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']"
```
### Steps to reproduce the bug
please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
### Expected behavior
add column to the dataset
### Environment info
colab pro | 96 | Add new column to dataset
### Describe the bug
```
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>()
----> 1 dataset['train']['/workspace/data']
3 frames
[/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns)
518 def _check_valid_column_key(key: str, columns: List[str]) -> None:
519 if key not in columns:
--> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}")
521
522
KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']"
```
### Steps to reproduce the bug
please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
### Expected behavior
add column to the dataset
### Environment info
colab pro
I think there is a slight misunderstanding.
```python
new_column = ["mask"] * len(dataset["train"])
dataset['train'] = dataset['train'].add_column("/workspace/data", new_column)
```
adds a column with the string `mask` to your dataset.
If you're trying to load the images `"mask_{idx}.png"` in your dataset, you could try:
```
from datasets import Image
dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/workspace/data/mask_{idx}.png", with_indices=True).cast_column("mask", Image())
```
What this does is that it adds a column to your dataset name `mask` with the path to the mask, then it cast the column as an `Image` feature.
This [link](https://huggingface.co/docs/datasets/v2.5.1/en/image_load) explains how to load images.
Hope this helps! | [
-0.09843655675649643,
-0.027869805693626404,
0.023789644241333008,
0.10551737248897552,
0.2503960132598877,
0.15773145854473114,
0.7520943880081177,
0.3964082598686218,
0.21604499220848083,
0.17301049828529358,
-0.00021330267190933228,
0.3614157438278198,
-0.1275089979171753,
0.19663101434707642,
0.047064170241355896,
-0.23026564717292786,
0.1408960223197937,
0.21156278252601624,
-0.020872589200735092,
0.125968337059021,
-0.4232836961746216,
0.06605023145675659,
-0.2834787964820862,
0.11583121120929718,
-0.26077261567115784,
-0.11618831753730774,
-0.254772424697876,
0.012642954476177692,
-0.0897945910692215,
-0.2628174126148224,
0.16242511570453644,
-0.2960415780544281,
0.09672805666923523,
0.49660298228263855,
-0.00011242501204833388,
0.07615765929222107,
0.14915630221366882,
0.00601109117269516,
-0.2533586025238037,
-0.3009191155433655,
-0.3715279698371887,
-0.2664937973022461,
0.027782142162322998,
-0.36002373695373535,
-0.1479581743478775,
0.049583468586206436,
-0.1418287605047226,
-0.03189653903245926,
0.22036951780319214,
0.4018021523952484,
0.2593834698200226,
0.3465615510940552,
-0.12177740782499313,
-0.06338721513748169,
0.23739147186279297,
0.0706314817070961,
-0.2511523962020874,
0.2833723723888397,
-0.010572846978902817,
-0.21011513471603394,
0.23146215081214905,
0.5428184270858765,
-0.009755365550518036,
0.0627133846282959,
0.3027549684047699,
0.40680617094039917,
-0.1827307939529419,
-0.3425203859806061,
0.09254759550094604,
0.06228327751159668,
0.11730454117059708,
-0.16094529628753662,
-0.14501921832561493,
-0.23922130465507507,
0.1387965977191925,
-0.45422032475471497,
0.24990470707416534,
0.1413242071866989,
-0.027635250240564346,
-0.025385292246937752,
-0.140816792845726,
0.14142902195453644,
-0.07773159444332123,
0.11172157526016235,
-0.08059818297624588,
0.2351090908050537,
-0.05479477345943451,
0.19304238259792328,
-0.08014386892318726,
-0.004024833906441927,
-0.05021369829773903,
-0.26490750908851624,
-0.06581060588359833,
0.11652590334415436,
-0.19071510434150696,
-0.15071386098861694,
-0.10214024782180786,
-0.06362771987915039,
-0.11134319007396698,
-0.10493588447570801,
-0.18540655076503754,
-0.2655167877674103,
0.052753325551748276,
0.17249557375907898,
0.037552013993263245,
0.07910483330488205,
-0.28464987874031067,
0.5109261274337769,
0.2143833041191101,
0.24309882521629333,
-0.09385322779417038,
-0.2906540632247925,
0.08134959638118744,
-0.0935409665107727,
0.42132365703582764,
0.071724072098732,
0.34515148401260376,
0.07213336229324341,
-0.37295106053352356,
0.22080063819885254,
-0.18399354815483093,
-0.17006419599056244,
0.0703245997428894,
0.45774632692337036,
0.1573743224143982,
-0.19440704584121704,
0.09548252820968628,
-0.01580190286040306,
-0.1732170283794403,
0.14141657948493958,
-0.21525004506111145,
0.2877621650695801,
-0.1326580047607422,
-0.18044275045394897,
-0.07952762395143509,
-0.22329698503017426,
0.04808551073074341,
0.16495220363140106,
0.10955601930618286,
-0.06539840251207352,
-0.16508671641349792,
-0.33048999309539795,
0.274213045835495,
0.34950876235961914,
-0.25256291031837463,
0.11673971265554428,
0.3122645318508148,
-0.35015401244163513,
-0.07186906784772873,
0.3042438328266144,
-0.43684083223342896,
-0.06888505816459656,
-0.42409229278564453,
0.1853354126214981,
0.009319059550762177,
-0.044146087020635605,
-0.3560723066329956,
-0.15820519626140594,
0.2687581777572632,
-0.22517812252044678,
0.2172272503376007,
-0.2180710881948471,
-0.2670351564884186,
-0.24364310503005981,
0.04175296425819397,
0.281291663646698,
-0.37426602840423584,
0.023852944374084473,
0.15951187908649445,
0.17472770810127258,
0.18247392773628235,
0.06894370168447495,
-0.15010815858840942,
0.23282158374786377,
-0.2888552248477936,
-0.0893336832523346,
0.14297617971897125,
-0.14897236227989197,
-0.3612373471260071,
0.043113622814416885,
-0.19069644808769226,
0.20977258682250977,
0.01240217313170433,
0.25715768337249756,
0.2562100887298584,
0.0007279291749000549,
0.1386229693889618,
0.18183352053165436,
0.04459629952907562,
0.09632734954357147,
-0.1267949938774109,
0.08125778287649155,
0.20224297046661377,
0.019964948296546936,
0.15585079789161682,
0.09356959164142609,
0.060012757778167725,
0.0012772232294082642,
-0.01771131530404091,
-0.19880259037017822,
-0.2314339131116867,
-0.06567168235778809,
0.4967235028743744,
-0.16034550964832306,
0.0061427876353263855,
-0.005128979682922363,
-0.3929474353790283,
0.1227584034204483,
0.4279010593891144,
-0.032822202891111374,
-0.5049504637718201,
-0.10034205764532089,
-0.3124951720237732,
0.0798441544175148,
-0.2877466082572937,
-0.2919386029243469,
0.11590025573968887,
0.2316587269306183,
-0.14758974313735962,
-0.04551408439874649,
-0.28818994760513306,
0.44196438789367676,
-0.03428347036242485,
0.162095844745636,
-0.03733503073453903,
0.371155321598053,
-0.277383416891098,
0.0008210726082324982,
-0.18686842918395996,
0.1291239708662033,
0.11370649933815002,
-0.19600866734981537,
-0.20388035476207733,
0.3768894672393799,
0.18394730985164642,
-0.01413055881857872,
-0.43785208463668823,
-0.096742182970047,
0.32237541675567627,
0.1427900344133377,
-0.17356449365615845,
0.0101579949259758,
0.23004037141799927,
0.19056937098503113,
-0.39629364013671875,
0.509854257106781,
-0.08075760304927826,
0.09943599253892899,
-0.16235589981079102,
-0.0630495473742485,
0.10396090149879456,
-0.06769013404846191,
-0.0936112254858017,
-0.3394116163253784,
-0.06410474330186844,
0.06544005870819092,
-0.16268855333328247,
0.10994420200586319,
-0.3007335662841797,
0.04515368863940239,
0.5824902057647705,
0.0824088305234909,
0.0880448967218399,
0.21111802756786346,
-0.03754405304789543,
0.08417968451976776,
0.20255358517169952,
0.4361765384674072,
0.45323532819747925,
0.10936858505010605,
-0.31651490926742554,
0.10542166978120804,
-0.32758447527885437,
-0.11618778109550476,
0.11717347800731659,
0.1578885316848755,
0.06125197187066078,
0.12662221491336823,
0.30869603157043457,
0.11656087636947632,
-0.22284117341041565,
-0.19102755188941956,
0.051474377512931824,
0.34560468792915344,
-0.3799387216567993,
0.3847709000110626,
-0.19355511665344238,
-0.39337435364723206,
-0.10181344300508499,
0.021823562681674957,
0.3401748538017273,
-0.28897324204444885,
-0.03757660835981369,
0.09473578631877899,
-0.059628233313560486,
0.09760937094688416,
-0.329253613948822,
0.13207384943962097,
0.11935345828533173,
-0.15277540683746338,
-0.05885458365082741,
-0.10909181833267212,
-0.1692115217447281,
0.06498169898986816,
0.3230825662612915,
-0.28652605414390564,
0.3802269995212555,
-0.0721501037478447,
-0.03420421481132507,
-0.09804313629865646,
-0.5584730505943298,
0.0972890704870224,
-0.3547922670841217,
0.266254723072052,
0.07052439451217651,
0.3416842520236969,
-0.3372158408164978,
-0.3781072199344635,
0.3411186933517456,
0.08841787278652191,
-0.2507825791835785,
0.15304571390151978,
0.01507582888007164,
0.044196829199790955,
-0.2153257429599762,
-0.3796856999397278,
-0.10565868020057678,
-0.09562414139509201,
-0.15497331321239471,
0.10782455652952194,
0.22372020781040192,
0.38082894682884216,
0.20467188954353333,
-0.03118376061320305,
-0.04391506686806679,
-0.02974826842546463,
-0.300176203250885,
-0.14359185099601746,
0.34148094058036804,
-0.12072323262691498,
-0.3278108537197113,
-0.09605302661657333,
-0.368247389793396,
0.01813100092113018,
-0.11622430384159088,
-0.5285729765892029,
-0.5836848020553589,
-0.2363974153995514,
0.30599266290664673,
0.06990733742713928,
0.1193462535738945,
0.13141950964927673,
-0.03628818690776825,
-0.09238377213478088,
-0.18391692638397217,
-0.285169780254364,
-0.1532180905342102,
0.24703554809093475,
0.1592867076396942,
0.03537117689847946,
0.6832751035690308,
0.028708264231681824,
0.25545427203178406,
0.05812250077724457,
-0.23391221463680267,
0.5037752389907837,
-0.2936149537563324,
0.4797566533088684,
-0.3711704611778259,
-0.5933815240859985,
0.11256285756826401,
-0.023045368492603302,
0.006085216999053955,
0.07889329642057419,
-0.17020902037620544,
-0.07510679960250854,
-0.08416914194822311,
0.07781953364610672,
-0.21138408780097961,
-0.1525069773197174,
0.29207175970077515,
-0.08465422689914703,
0.163243368268013,
0.09504809230566025,
0.23674505949020386,
-0.3100596070289612,
-0.11068634688854218,
-0.004043195396661758,
0.1329212188720703,
0.23904094099998474,
-0.28536635637283325,
-0.16180387139320374,
-0.33608224987983704,
-0.3567129969596863,
0.14855870604515076,
0.27210795879364014,
0.49703124165534973,
0.039200618863105774,
-0.08145995438098907,
0.19281795620918274,
0.017592482268810272,
0.5805027484893799,
-0.19223791360855103,
-0.1337185651063919,
0.16825902462005615,
-0.11902162432670593,
-0.33533602952957153,
-0.22636738419532776,
-0.2692290246486664,
-0.04463852569460869,
-0.0893780067563057,
0.8916622996330261,
-0.16663648188114166,
0.1275635063648224,
0.5167893171310425,
0.09162817895412445,
-0.23215696215629578,
-0.10737250745296478,
-0.3311842978000641,
-0.22465366125106812,
-0.4805814027786255,
0.21103614568710327,
0.02519870549440384,
0.25215551257133484,
0.11413025856018066,
0.024184972047805786,
0.07343950122594833,
-0.16994671523571014,
-0.09970901906490326,
0.3408190608024597,
0.15024611353874207,
0.41687485575675964,
0.2215023636817932,
0.0046366238966584206,
0.09506328403949738,
0.10260605067014694,
0.4204934537410736,
-0.24401092529296875,
-0.12877951562404633,
0.011610887944698334,
-0.21956124901771545,
0.13836964964866638,
0.21422861516475677,
-0.04599825665354729,
0.13803672790527344,
-0.31682586669921875,
0.14595669507980347,
-0.13816535472869873,
0.06872755289077759,
0.3734489381313324,
0.10525399446487427,
-0.2076130509376526,
-0.44680190086364746,
0.20322221517562866,
-0.020017262548208237,
-0.0034542083740234375,
0.1675988733768463,
0.09614704549312592,
-0.2650715410709381,
0.5956900715827942,
0.14492055773735046,
0.7944976091384888,
-0.0275387205183506,
0.2585579752922058,
0.397083580493927,
-0.2373325228691101,
0.4586600363254547,
0.14689353108406067,
0.15112757682800293,
-0.33476269245147705,
-0.43744489550590515,
-0.09262020885944366,
-0.13283734023571014,
0.08851353824138641,
-0.4267325699329376,
-0.2372995764017105,
0.16968151926994324,
-0.22315548360347748,
0.5881698727607727,
-0.025151703506708145,
-0.12222563475370407,
-0.08431199193000793,
-0.24392662942409515,
-0.10753905773162842,
0.17967858910560608,
0.006804209668189287,
0.08403345197439194,
-0.10813511908054352,
0.021032139658927917,
-0.1529158055782318,
-0.33667638897895813,
-0.19940580427646637,
0.00024659186601638794,
0.05595029145479202,
0.21616870164871216,
0.12392770498991013,
-0.6684547066688538,
-0.031895894557237625,
0.2241324484348297,
0.17538383603096008,
0.11716848611831665,
0.08976316452026367,
0.12798698246479034,
0.17287176847457886,
0.29128628969192505,
-0.11804705858230591,
-0.16776059567928314,
0.2577275335788727,
0.05818880349397659,
-0.15223076939582825,
0.014183949679136276,
0.053792037069797516,
-0.4898192584514618,
0.06383150815963745,
0.35479506850242615,
0.17870604991912842,
-0.26938480138778687,
-0.4187087118625641,
-0.2736782431602478,
0.05151784420013428,
-0.4892409145832062,
0.16437679529190063,
-0.1287180483341217,
-0.00865454226732254,
0.3788793087005615,
0.0009814291261136532,
-0.3534318804740906,
-0.04837115854024887,
0.36510127782821655,
0.029691874980926514,
0.2639751434326172,
0.5877189636230469,
-0.02081148326396942,
-0.21285907924175262,
-0.12814882397651672,
0.2741938829421997,
0.31388911604881287,
-0.22831934690475464,
0.16331017017364502,
0.025361109524965286,
0.22044043242931366,
-0.08723694086074829,
0.37620681524276733,
0.04421544447541237,
0.0036311857402324677,
-0.08088308572769165,
-0.47111746668815613,
-0.197073832154274,
0.22288936376571655,
-0.1155695915222168,
0.1918681114912033,
0.09612490981817245,
0.3353720009326935,
-0.11579453945159912,
0.003634808585047722,
-0.353437602519989,
0.024769209325313568,
-0.20730942487716675,
0.28587496280670166,
0.40829113125801086,
0.21264192461967468,
0.04999581724405289,
-0.13958978652954102,
0.16719093918800354,
0.46335509419441223,
0.09679371863603592,
-0.2757468819618225,
-0.15531733632087708,
0.07830564677715302,
0.06610183417797089,
-0.21811461448669434,
-0.2527592182159424,
-0.11330994963645935,
-0.0021239779889583588,
-0.1744212806224823,
0.13359786570072174,
0.09662013500928879,
-0.14239484071731567,
0.09920341521501541,
-0.1734829992055893,
-0.063004270195961,
0.15399432182312012,
-0.04227790981531143,
-0.3247448801994324,
0.17746201157569885,
0.27624693512916565,
0.08397547155618668,
-0.0414419025182724,
0.15083353221416473,
-0.19938614964485168,
0.10483834892511368,
-0.239821195602417,
0.16010627150535583,
0.3398760259151459,
-0.29671502113342285,
0.16317057609558105,
0.06644032895565033,
0.12399780750274658,
0.03305225074291229,
-0.32846468687057495,
0.05059885233640671,
0.22540460526943207,
0.20112057030200958,
-0.3627895414829254,
-0.12754124402999878,
0.07314620912075043,
0.11265577375888824,
0.19434481859207153,
0.3498837947845459,
0.1062382385134697,
0.2700153589248657,
-0.19072288274765015,
0.06356853246688843,
0.2406729757785797,
-0.18148173391819,
0.02070324495434761,
0.7016682028770447,
-0.06938809156417847,
0.16778233647346497,
0.5441940426826477,
-0.017257006838917732,
-0.06171725317835808,
0.3963850736618042,
0.045365266501903534,
0.1021338477730751,
0.349130779504776,
0.04483965411782265,
0.04818930849432945,
-0.33739322423934937,
0.44690123200416565,
-0.03477044403553009,
0.05050170049071312,
-0.11781738698482513,
0.20727694034576416,
-0.1000499427318573,
-0.05623593181371689,
0.004212930798530579,
-0.15650829672813416,
0.12202535569667816,
-0.25528329610824585,
0.021489467471837997,
-0.2946487069129944,
-0.062250614166259766,
-0.04809548705816269,
0.11191718280315399,
-0.10015532374382019,
-0.11094948649406433,
0.31841617822647095,
0.14318343997001648,
-0.2644209861755371,
-0.008933715522289276,
-0.15546546876430511,
0.22421251237392426,
0.11623238027095795,
-0.2254287600517273,
0.34876543283462524,
0.2621774971485138,
0.26834699511528015,
0.25610271096229553,
0.16438543796539307,
0.4980663061141968,
0.1816633641719818,
0.2801206707954407,
0.05745388939976692,
-0.01293260045349598,
-0.14237895607948303,
0.05139622837305069,
0.26287004351615906,
0.020858876407146454,
0.2669663429260254,
0.211467906832695,
0.22020456194877625,
-0.22614364326000214,
0.4193172752857208,
0.18200023472309113,
0.14373330771923065,
-0.2306220531463623,
0.18515846133232117,
-0.05663250759243965,
-0.23503383994102478,
-0.11288368701934814,
-0.04127887636423111,
-0.08047033846378326,
0.10094275325536728,
0.13996079564094543,
0.04235750064253807,
0.20398622751235962,
0.037192922085523605,
0.09849952161312103,
0.1806216835975647,
0.2375432401895523,
0.3467561602592468,
-0.08004029095172882,
-0.36847442388534546,
-0.05083370953798294,
-0.629751443862915,
0.026467494666576385,
-0.31744733452796936,
-0.2641269266605377,
-0.11076700687408447,
0.0812787339091301,
0.10501638799905777,
0.13666434586048126,
0.29594364762306213,
-0.2321045994758606,
-0.03502830117940903,
0.23977398872375488,
-0.22871865332126617,
-0.22781094908714294,
0.45061904191970825,
0.01858449913561344,
-0.18089959025382996,
-0.2744101881980896,
0.2307572364807129,
-0.07696176320314407,
0.14295357465744019,
-0.06789618730545044,
-0.10220689326524734,
-0.17307522892951965,
-0.1679474115371704,
0.48820891976356506,
0.12183252722024918,
0.417694091796875,
-0.10162593424320221,
0.04433564096689224,
-0.08582906424999237,
-0.27304309606552124,
-0.15008029341697693,
0.18637773394584656,
0.16490930318832397,
0.7188292145729065,
0.19409143924713135,
-0.3547030985355377,
-0.19736185669898987,
0.3189633786678314,
-0.05677104368805885,
-0.07365590333938599,
-0.16492091119289398,
0.17796024680137634,
-0.16538532078266144,
-0.16775181889533997,
-0.04938412457704544,
0.25156962871551514,
-0.00781569629907608,
0.23322847485542297,
-0.20482182502746582,
-0.5980265736579895,
0.3587513267993927,
-0.530933678150177,
-0.45873984694480896,
0.0066538043320178986,
-0.06415458768606186,
-0.1198786124587059,
-0.06895139813423157,
-0.31605327129364014,
-0.06914203613996506,
0.2190975546836853,
-0.21180538833141327,
-0.30729690194129944,
0.28084152936935425,
0.21219657361507416,
0.4032336175441742,
0.00675751268863678,
0.4012174904346466,
-0.1586325764656067,
-0.19154393672943115,
-0.0683598667383194,
-0.22721953690052032
] |
https://github.com/huggingface/datasets/issues/6246 | > I think there is a slight misunderstanding.
>
> ```python
> new_column = ["mask"] * len(dataset["train"])
> dataset['train'] = dataset['train'].add_column("/workspace/data", new_column)
> ```
>
> adds a column with the string `mask` to your dataset. If you're trying to load the images `"mask_{idx}.png"` in your dataset, you could try:
>
> ```
> from datasets import Image
>
> dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/workspace/data/mask_{idx}.png", with_indices=True).cast_column("mask", Image())
> ```
>
> What this does is that it adds a column to your dataset name `mask` with the path to the mask, then it cast the column as an `Image` feature.
>
> This [link](https://huggingface.co/docs/datasets/v2.5.1/en/image_load) explains how to load images.
>
> Hope this helps!
Thank you very much, this is really helpful...
i made some changes for it to work:
```
dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/content/data/mask_{idx}.png"}, with_indices=True).cast_column("mask", Image())
```
Thanks Again @Dref360 | Add new column to dataset | ### Describe the bug
```
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>()
----> 1 dataset['train']['/workspace/data']
3 frames
[/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns)
518 def _check_valid_column_key(key: str, columns: List[str]) -> None:
519 if key not in columns:
--> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}")
521
522
KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']"
```
### Steps to reproduce the bug
please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
### Expected behavior
add column to the dataset
### Environment info
colab pro | 146 | Add new column to dataset
### Describe the bug
```
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>()
----> 1 dataset['train']['/workspace/data']
3 frames
[/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns)
518 def _check_valid_column_key(key: str, columns: List[str]) -> None:
519 if key not in columns:
--> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}")
521
522
KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']"
```
### Steps to reproduce the bug
please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
### Expected behavior
add column to the dataset
### Environment info
colab pro
> I think there is a slight misunderstanding.
>
> ```python
> new_column = ["mask"] * len(dataset["train"])
> dataset['train'] = dataset['train'].add_column("/workspace/data", new_column)
> ```
>
> adds a column with the string `mask` to your dataset. If you're trying to load the images `"mask_{idx}.png"` in your dataset, you could try:
>
> ```
> from datasets import Image
>
> dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/workspace/data/mask_{idx}.png", with_indices=True).cast_column("mask", Image())
> ```
>
> What this does is that it adds a column to your dataset name `mask` with the path to the mask, then it cast the column as an `Image` feature.
>
> This [link](https://huggingface.co/docs/datasets/v2.5.1/en/image_load) explains how to load images.
>
> Hope this helps!
Thank you very much, this is really helpful...
i made some changes for it to work:
```
dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/content/data/mask_{idx}.png"}, with_indices=True).cast_column("mask", Image())
```
Thanks Again @Dref360 | [
-0.09255671501159668,
-0.028486624360084534,
0.03623872995376587,
0.011011213064193726,
0.20684005320072174,
0.1633591651916504,
0.7571380734443665,
0.42502832412719727,
0.15506741404533386,
0.17447206377983093,
0.06612684577703476,
0.3907855451107025,
-0.12782692909240723,
0.23206304013729095,
0.08589015901088715,
-0.2312934249639511,
0.1519443839788437,
0.18537643551826477,
-0.002316463738679886,
0.12764185667037964,
-0.40076637268066406,
-0.010378056205809116,
-0.27895933389663696,
0.12886083126068115,
-0.2248915433883667,
-0.15255510807037354,
-0.29449546337127686,
-0.10607648640871048,
-0.12600284814834595,
-0.283196359872818,
0.21258553862571716,
-0.33236390352249146,
0.03490882366895676,
0.5205888748168945,
-0.00011074749636463821,
0.05019224435091019,
0.13168388605117798,
0.05767364799976349,
-0.26367324590682983,
-0.2621154189109802,
-0.39679765701293945,
-0.29420289397239685,
-0.03165183961391449,
-0.31897208094596863,
-0.1837041974067688,
0.07244864106178284,
-0.1853630244731903,
-0.05968429520726204,
0.14938685297966003,
0.41527318954467773,
0.2696693539619446,
0.35324031114578247,
-0.08526279777288437,
-0.10540635883808136,
0.21226443350315094,
0.10738031566143036,
-0.294268399477005,
0.21265211701393127,
-0.08144915103912354,
-0.1794908344745636,
0.24070894718170166,
0.5135630965232849,
0.039431825280189514,
0.011530738323926926,
0.28340035676956177,
0.4219244718551636,
-0.18894942104816437,
-0.28009098768234253,
0.0867132693529129,
0.08411778509616852,
0.12507836520671844,
-0.2445429265499115,
-0.15426161885261536,
-0.21693651378154755,
0.14828944206237793,
-0.5082025527954102,
0.2792900800704956,
0.0901547372341156,
0.01956905424594879,
0.022547874599695206,
-0.07951734960079193,
0.13371939957141876,
-0.07369919121265411,
0.06538588553667068,
-0.06425294280052185,
0.317016065120697,
-0.056891847401857376,
0.14533665776252747,
-0.14956606924533844,
-0.0328201949596405,
-0.0515533871948719,
-0.2588742971420288,
-0.09021739661693573,
0.12249130755662918,
-0.1749749481678009,
-0.26185962557792664,
-0.04903704673051834,
-0.08962151408195496,
-0.04589401185512543,
-0.11300314217805862,
-0.2073950171470642,
-0.29320743680000305,
0.05992261320352554,
0.1537255346775055,
0.046583812683820724,
0.08384674042463303,
-0.22046734392642975,
0.5199174880981445,
0.20840319991111755,
0.1956934779882431,
-0.012080460786819458,
-0.24516868591308594,
0.17302167415618896,
-0.0691169798374176,
0.4626408815383911,
0.09061925113201141,
0.3834514617919922,
0.07143478840589523,
-0.35098597407341003,
0.2800995409488678,
-0.2301100343465805,
-0.2018662989139557,
0.08222781121730804,
0.4157353639602661,
0.16026316583156586,
-0.23451711237430573,
0.043946728110313416,
0.0009238859638571739,
-0.10837730765342712,
0.11288155615329742,
-0.2231113165616989,
0.297025203704834,
-0.10272911936044693,
-0.22190409898757935,
-0.09107199311256409,
-0.1990652233362198,
0.01494675874710083,
0.2325858771800995,
0.07224351912736893,
-0.05600849911570549,
-0.21090516448020935,
-0.2868829369544983,
0.24636004865169525,
0.3168589770793915,
-0.30985987186431885,
0.11336050927639008,
0.2809189558029175,
-0.3544868528842926,
-0.07716020941734314,
0.26226750016212463,
-0.3249788284301758,
-0.09329769760370255,
-0.46111297607421875,
0.211944580078125,
-0.008214917033910751,
-0.08266042172908783,
-0.25656816363334656,
-0.15016824007034302,
0.2943771779537201,
-0.2143627405166626,
0.21770870685577393,
-0.21603500843048096,
-0.2450525164604187,
-0.238831028342247,
0.04184500873088837,
0.20260146260261536,
-0.35428833961486816,
0.04351406544446945,
0.1598568558692932,
0.185175359249115,
0.19849540293216705,
0.0714884102344513,
-0.08972515165805817,
0.2784935235977173,
-0.25071632862091064,
-0.0744863748550415,
0.19173967838287354,
-0.12698379158973694,
-0.375273197889328,
0.011527840048074722,
-0.2253878116607666,
0.16731750965118408,
0.027885306626558304,
0.1890985369682312,
0.207633838057518,
0.004946693778038025,
0.13446491956710815,
0.09587568044662476,
0.020088834688067436,
0.046063050627708435,
-0.15657749772071838,
0.08752764761447906,
0.25443851947784424,
-0.03704515099525452,
0.12265971302986145,
0.06550714373588562,
0.0567493662238121,
0.005829159170389175,
-0.029226213693618774,
-0.17392706871032715,
-0.20372411608695984,
-0.104587122797966,
0.5728790163993835,
-0.19733212888240814,
-0.0031042248010635376,
-0.07740747928619385,
-0.3811737895011902,
0.06274090707302094,
0.4733095169067383,
0.013314484618604183,
-0.4545302093029022,
-0.17015588283538818,
-0.3150085210800171,
0.10424564778804779,
-0.23164716362953186,
-0.32746729254722595,
0.13857030868530273,
0.2294653207063675,
-0.07291769981384277,
-0.08555014431476593,
-0.31848013401031494,
0.38963600993156433,
-0.031538963317871094,
0.1912730485200882,
-0.03821554780006409,
0.29827576875686646,
-0.3140536844730377,
-0.004156339913606644,
-0.15432843565940857,
0.17157703638076782,
0.14395014941692352,
-0.18734532594680786,
-0.18213514983654022,
0.33436301350593567,
0.10912349820137024,
-0.12266940623521805,
-0.4266417324542999,
-0.06947007775306702,
0.3045886158943176,
0.1793995052576065,
-0.19923387467861176,
-0.010210217908024788,
0.1778291016817093,
0.1991008073091507,
-0.41405755281448364,
0.4913994073867798,
-0.05679482966661453,
0.037010662257671356,
-0.2243575006723404,
-0.004331313073635101,
0.14238740503787994,
-0.10147763788700104,
-0.06479030847549438,
-0.35604599118232727,
-0.04202264919877052,
0.008669134229421616,
-0.15825363993644714,
0.08656170219182968,
-0.33504360914230347,
0.11199873685836792,
0.5745647549629211,
0.02684812992811203,
0.12862396240234375,
0.16410326957702637,
-0.029432732611894608,
0.08451405167579651,
0.1517353355884552,
0.498869925737381,
0.41093915700912476,
0.10958540439605713,
-0.26773035526275635,
0.16103780269622803,
-0.37692299485206604,
-0.12907685339450836,
0.08173495531082153,
0.1216733455657959,
-0.0057867132127285,
0.13939864933490753,
0.2726376950740814,
0.1303965449333191,
-0.13603612780570984,
-0.13456104695796967,
0.07405325770378113,
0.38867539167404175,
-0.40145444869995117,
0.33997642993927,
-0.23713526129722595,
-0.32003557682037354,
-0.12025280296802521,
0.009086478501558304,
0.3435260057449341,
-0.3126193583011627,
-0.041871778666973114,
0.0697944387793541,
-0.08136853575706482,
0.12017039954662323,
-0.2850198745727539,
0.06727635115385056,
0.11214520782232285,
-0.14641644060611725,
-0.044353216886520386,
-0.13541263341903687,
-0.15951399505138397,
0.09302670508623123,
0.28953301906585693,
-0.24859188497066498,
0.36374786496162415,
-0.0585394948720932,
-0.027892660349607468,
-0.09843083471059799,
-0.5615350604057312,
0.08069108426570892,
-0.38460874557495117,
0.2791498005390167,
0.093889519572258,
0.2855387330055237,
-0.34480351209640503,
-0.3765459358692169,
0.30550751090049744,
0.049664512276649475,
-0.2877650260925293,
0.16001534461975098,
0.014016479253768921,
0.017230834811925888,
-0.2531391978263855,
-0.42676880955696106,
-0.08372040092945099,
-0.0533984899520874,
-0.15331774950027466,
0.020691610872745514,
0.19109517335891724,
0.3377862572669983,
0.09862181544303894,
0.010274067521095276,
-0.06247842311859131,
-0.05222821235656738,
-0.32330167293548584,
-0.13692188262939453,
0.34294384717941284,
-0.11266223341226578,
-0.3004443049430847,
-0.06078124791383743,
-0.43100523948669434,
0.012466223910450935,
-0.17217737436294556,
-0.4553968906402588,
-0.5342799425125122,
-0.2580251097679138,
0.40152767300605774,
0.0895669013261795,
0.12141960114240646,
0.21931399405002594,
0.002263057976961136,
-0.07990004122257233,
-0.19887933135032654,
-0.3335535526275635,
-0.1533132791519165,
0.28942006826400757,
0.1610524207353592,
0.014898326247930527,
0.7153388857841492,
0.033482909202575684,
0.2974246144294739,
0.12210877239704132,
-0.21929509937763214,
0.405199259519577,
-0.29302147030830383,
0.4649471342563629,
-0.3358691930770874,
-0.588905394077301,
0.16331174969673157,
-0.018928751349449158,
0.0010417774319648743,
0.03685152530670166,
-0.18365880846977234,
-0.026123126968741417,
-0.025651738047599792,
-0.020999450236558914,
-0.17367324233055115,
-0.17930558323860168,
0.26183992624282837,
-0.10254424810409546,
0.2152828574180603,
0.10599200427532196,
0.2406633496284485,
-0.28320157527923584,
-0.07032771408557892,
0.006223808974027634,
0.14485467970371246,
0.19528178870677948,
-0.2886548936367035,
-0.19883543252944946,
-0.34979677200317383,
-0.3796928822994232,
0.13990743458271027,
0.28753793239593506,
0.506688117980957,
0.04201159626245499,
-0.073941171169281,
0.1313936412334442,
0.0799180120229721,
0.5264459848403931,
-0.2825096547603607,
-0.14494256675243378,
0.1803349107503891,
-0.0424860455095768,
-0.2758778929710388,
-0.20104587078094482,
-0.30566224455833435,
0.009606119245290756,
-0.03651466965675354,
0.7941253185272217,
-0.1697278916835785,
0.17256104946136475,
0.5620456337928772,
0.13529086112976074,
-0.19956761598587036,
-0.10074493288993835,
-0.2694759964942932,
-0.20229238271713257,
-0.39951837062835693,
0.3009967803955078,
0.03959009796380997,
0.24291779100894928,
0.16860999166965485,
0.08052685111761093,
0.07138903439044952,
-0.16063156723976135,
-0.08668290078639984,
0.33796265721321106,
0.09845412522554398,
0.36035215854644775,
0.25293126702308655,
-0.04433204606175423,
0.10534443706274033,
0.12007689476013184,
0.38374239206314087,
-0.19614210724830627,
-0.14755979180335999,
-0.029055163264274597,
-0.25504255294799805,
0.23176053166389465,
0.14514373242855072,
-0.0194166898727417,
0.21427813172340393,
-0.3169451951980591,
0.14993777871131897,
-0.12568268179893494,
-0.019151534885168076,
0.3610292375087738,
0.1870882213115692,
-0.230851411819458,
-0.43939024209976196,
0.13815368711948395,
-0.03347386419773102,
-0.01567920297384262,
0.1823447048664093,
0.17645911872386932,
-0.23854583501815796,
0.6045626401901245,
0.08019514381885529,
0.7788422107696533,
0.06370668113231659,
0.15449117124080658,
0.3972700834274292,
-0.2929673492908478,
0.49260538816452026,
0.1381022334098816,
0.16370804607868195,
-0.32886040210723877,
-0.41397789120674133,
-0.07559143751859665,
-0.1375155746936798,
0.148477703332901,
-0.4670550227165222,
-0.30379796028137207,
0.21361401677131653,
-0.23524260520935059,
0.5956843495368958,
-0.0016482025384902954,
-0.10198245197534561,
-0.04906154423952103,
-0.20711155235767365,
-0.046581149101257324,
0.1799919605255127,
-0.012492343783378601,
0.09286075085401535,
-0.07210346311330795,
0.026866350322961807,
-0.1734418272972107,
-0.38125962018966675,
-0.22645775973796844,
-0.02602684125304222,
0.09679031372070312,
0.13350743055343628,
0.13890868425369263,
-0.680884838104248,
0.06198793649673462,
0.1798601597547531,
0.3030183017253876,
0.19474582374095917,
0.09051467478275299,
0.09764888882637024,
0.19294503331184387,
0.33992788195610046,
-0.02401326224207878,
-0.1335776448249817,
0.22334729135036469,
0.07613784074783325,
-0.22214554250240326,
0.04318613186478615,
0.04239342734217644,
-0.45851588249206543,
0.05903947353363037,
0.29193148016929626,
0.12372038513422012,
-0.33414939045906067,
-0.3093997836112976,
-0.23868824541568756,
0.06730011105537415,
-0.5298477411270142,
0.18047499656677246,
-0.10111622512340546,
-0.05848454684019089,
0.3767975866794586,
-0.046919867396354675,
-0.30409103631973267,
-0.09440368413925171,
0.2681766748428345,
0.058047421276569366,
0.31224238872528076,
0.5681074857711792,
-0.04171605780720711,
-0.21454355120658875,
-0.14413300156593323,
0.3148009777069092,
0.3347603380680084,
-0.15701517462730408,
0.08735544979572296,
-0.022011911496520042,
0.22608770430088043,
-0.0755595862865448,
0.3416025638580322,
0.05413166806101799,
0.051650237292051315,
-0.11940072476863861,
-0.4125683307647705,
-0.19926166534423828,
0.15565334260463715,
-0.08486184477806091,
0.1379970759153366,
0.11861492693424225,
0.42309194803237915,
-0.11949305236339569,
0.04834163933992386,
-0.3665109872817993,
-0.04704529419541359,
-0.21177339553833008,
0.2944428026676178,
0.4120742380619049,
0.1899006962776184,
0.0716562569141388,
-0.22260376811027527,
0.18810662627220154,
0.42920932173728943,
0.13553453981876373,
-0.2968461215496063,
-0.17693765461444855,
0.058998703956604004,
0.056768301874399185,
-0.1617414355278015,
-0.2640933394432068,
-0.061997294425964355,
-0.0007275603711605072,
-0.1622769981622696,
0.0865415707230568,
0.09047713875770569,
-0.05915084481239319,
0.1876789629459381,
-0.17255714535713196,
-0.07266438752412796,
0.14769171178340912,
-0.07805429399013519,
-0.28050270676612854,
0.10189297795295715,
0.1849271059036255,
0.08719144016504288,
-0.02764003351330757,
0.14497162401676178,
-0.1863737851381302,
0.08209547400474548,
-0.2735395133495331,
0.17231184244155884,
0.3053733706474304,
-0.2927471101284027,
0.1182689219713211,
0.08198873698711395,
0.14546705782413483,
-0.007722796872258186,
-0.2912047207355499,
0.08307366818189621,
0.27241945266723633,
0.21272248029708862,
-0.3811986446380615,
-0.10995367169380188,
0.15654587745666504,
0.1469275951385498,
0.2506149411201477,
0.3729327321052551,
0.07706637680530548,
0.2632363438606262,
-0.2017633467912674,
0.06214058771729469,
0.15556204319000244,
-0.22746805846691132,
0.0681726485490799,
0.77342689037323,
-0.04786455258727074,
0.13387182354927063,
0.6136798858642578,
-0.03333805501461029,
-0.07700847089290619,
0.42384758591651917,
0.08626781404018402,
0.10537378489971161,
0.3800254762172699,
0.037157222628593445,
0.08284646272659302,
-0.24271884560585022,
0.39812204241752625,
-0.1035441905260086,
0.045308537781238556,
-0.15493060648441315,
0.2544304132461548,
-0.09841978549957275,
-0.10690060257911682,
0.010972671210765839,
-0.1212778314948082,
0.07408396899700165,
-0.2632385790348053,
0.04971511662006378,
-0.23246562480926514,
-0.009408310055732727,
0.02185264229774475,
0.06713023781776428,
-0.08444701135158539,
-0.07412420213222504,
0.3010052442550659,
0.082511305809021,
-0.21682438254356384,
0.026106173172593117,
-0.10308609902858734,
0.2143392264842987,
0.1348598301410675,
-0.22713598608970642,
0.3031119406223297,
0.21979990601539612,
0.1859319657087326,
0.16111668944358826,
0.17815746366977692,
0.5197041034698486,
0.09187327325344086,
0.25330084562301636,
0.1013522744178772,
-0.064945288002491,
-0.18295714259147644,
0.1079409122467041,
0.2497107982635498,
-0.010644260793924332,
0.21775701642036438,
0.20147377252578735,
0.22084465622901917,
-0.21861885488033295,
0.4328291416168213,
0.18675997853279114,
0.1874045729637146,
-0.24796399474143982,
0.21102482080459595,
-0.03365468233823776,
-0.2776378095149994,
-0.10181045532226562,
0.015739966183900833,
-0.02869175374507904,
0.11530959606170654,
0.1784319132566452,
0.08202719688415527,
0.174455925822258,
-0.042882345616817474,
0.11225004494190216,
0.23991891741752625,
0.17791879177093506,
0.3415510058403015,
-0.15399080514907837,
-0.30818697810173035,
-0.04746543616056442,
-0.6207232475280762,
-0.010414764285087585,
-0.3593880832195282,
-0.27514082193374634,
-0.12457256019115448,
0.05086750537157059,
0.12723292410373688,
0.12452375888824463,
0.308743417263031,
-0.24800968170166016,
-0.09199076145887375,
0.21700581908226013,
-0.1904124617576599,
-0.22476215660572052,
0.4000527262687683,
-0.014224579557776451,
-0.12750497460365295,
-0.22627201676368713,
0.2818079888820648,
-0.025793924927711487,
0.14297816157341003,
-0.05189712345600128,
-0.055778034031391144,
-0.13596424460411072,
-0.16055023670196533,
0.4252603352069855,
0.1899939328432083,
0.40464040637016296,
-0.09442441165447235,
0.03456418216228485,
-0.09106466919183731,
-0.22449654340744019,
-0.21668292582035065,
0.2885054349899292,
0.09556880593299866,
0.6563799977302551,
0.19162428379058838,
-0.3792930245399475,
-0.15550728142261505,
0.27987927198410034,
-0.07999233901500702,
-0.05668004974722862,
-0.13743969798088074,
0.20996582508087158,
-0.1788102388381958,
-0.14744752645492554,
-0.017433274537324905,
0.23022222518920898,
-0.024338364601135254,
0.262263685464859,
-0.1483105570077896,
-0.5954046249389648,
0.29922205209732056,
-0.4917709529399872,
-0.4439823031425476,
-0.03506113961338997,
-0.07381823658943176,
-0.05590664967894554,
-0.13441243767738342,
-0.3538931608200073,
-0.13910454511642456,
0.21534636616706848,
-0.22772511839866638,
-0.2659112215042114,
0.19690564274787903,
0.20425403118133545,
0.3888826072216034,
0.031100474298000336,
0.4549468457698822,
-0.17631977796554565,
-0.20692232251167297,
-0.020323149859905243,
-0.2297038584947586
] |
https://github.com/huggingface/datasets/issues/6242 | While this issue may seem specific, it led to a silent problem in my workflow that took days to diagnose. If this feature is not intended to be supported, an error should be raised when encountering this configuration to prevent such issues. | Data alteration when loading dataset with unspecified inner sequence length | ### Describe the bug
When a dataset saved with a specified inner sequence length is loaded without specifying that length, the original data is altered and becomes inconsistent.
### Steps to reproduce the bug
```python
from datasets import Dataset, Features, Value, Sequence, load_dataset
# Repository ID
repo_id = "my_repo_id"
# Define features with a specific length of 3 for each inner sequence
specified_features = Features({"key": Sequence(Sequence(Value("float32"), length=3))})
# Create a dataset with the specified features
data = [
[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],
[[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]],
]
dataset = Dataset.from_dict({"key": data}, features=specified_features)
# Push the dataset to the hub
dataset.push_to_hub(repo_id)
# Define features without specifying the length
unspecified_features = Features({"key": Sequence(Sequence(Value("float32")))})
# Load the dataset from the hub with this new feature definition
dataset = load_dataset(f"qgallouedec/{repo_id}", split="train", features=unspecified_features)
# The obtained data is altered
print(dataset.to_dict()) # {'key': [[[1.0], [2.0]], [[3.0], [4.0]]]}
```
### Expected behavior
```python
print(dataset.to_dict()) # {'key': [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]]}
```
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 42 | Data alteration when loading dataset with unspecified inner sequence length
### Describe the bug
When a dataset saved with a specified inner sequence length is loaded without specifying that length, the original data is altered and becomes inconsistent.
### Steps to reproduce the bug
```python
from datasets import Dataset, Features, Value, Sequence, load_dataset
# Repository ID
repo_id = "my_repo_id"
# Define features with a specific length of 3 for each inner sequence
specified_features = Features({"key": Sequence(Sequence(Value("float32"), length=3))})
# Create a dataset with the specified features
data = [
[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],
[[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]],
]
dataset = Dataset.from_dict({"key": data}, features=specified_features)
# Push the dataset to the hub
dataset.push_to_hub(repo_id)
# Define features without specifying the length
unspecified_features = Features({"key": Sequence(Sequence(Value("float32")))})
# Load the dataset from the hub with this new feature definition
dataset = load_dataset(f"qgallouedec/{repo_id}", split="train", features=unspecified_features)
# The obtained data is altered
print(dataset.to_dict()) # {'key': [[[1.0], [2.0]], [[3.0], [4.0]]]}
```
### Expected behavior
```python
print(dataset.to_dict()) # {'key': [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]]}
```
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
While this issue may seem specific, it led to a silent problem in my workflow that took days to diagnose. If this feature is not intended to be supported, an error should be raised when encountering this configuration to prevent such issues. | [
-0.03762386739253998,
-0.21157673001289368,
-0.10051356256008148,
0.3131217062473297,
0.245096355676651,
-0.11110161989927292,
0.29890602827072144,
0.12334597110748291,
-0.0025643929839134216,
0.268387109041214,
-0.008875593543052673,
0.34870365262031555,
0.08487316220998764,
0.1627754271030426,
-0.05491981655359268,
-0.1566663682460785,
0.20233945548534393,
0.11009404063224792,
0.06671376526355743,
-0.03687305003404617,
-0.2445451319217682,
0.02325277216732502,
-0.1662747859954834,
-0.28404852747917175,
-0.39862576127052307,
0.009097173810005188,
-0.22719630599021912,
0.17490176856517792,
0.12705066800117493,
-0.5676791667938232,
0.11283229291439056,
0.21758794784545898,
-0.06299328058958054,
0.4470181167125702,
-0.00011157251719851047,
-0.01332041621208191,
0.30517902970314026,
-0.23827502131462097,
-0.10837159305810928,
0.1882752776145935,
-0.44619232416152954,
-0.18027839064598083,
0.049948424100875854,
-0.5631025433540344,
0.015780240297317505,
0.139505997300148,
-0.38677629828453064,
-0.12889117002487183,
0.30323338508605957,
0.1602707803249359,
0.25922346115112305,
0.24684718251228333,
-0.22229492664337158,
-0.20819343626499176,
0.3417995572090149,
0.004277128726243973,
0.07768315821886063,
-0.042668748646974564,
0.3685612082481384,
0.21452480554580688,
-0.11750110983848572,
0.16416513919830322,
-0.12697117030620575,
-0.2035185545682907,
0.11842705309391022,
-0.13653625547885895,
0.15187472105026245,
-0.12816496193408966,
-0.013391125947237015,
0.4119406044483185,
0.3155302405357361,
-0.22106364369392395,
-0.18465667963027954,
-0.38908660411834717,
-0.07371087372303009,
-0.4825400114059448,
0.1963544338941574,
-0.024237148463726044,
-0.06921842694282532,
0.12949159741401672,
-0.17596197128295898,
0.09596109390258789,
-0.07080725580453873,
-0.05525341257452965,
-0.14516322314739227,
0.24115730822086334,
0.024608973413705826,
0.135304793715477,
-0.5317091345787048,
-0.0444568432867527,
-0.04466381296515465,
-0.2517932653427124,
-0.011421030387282372,
-0.036748502403497696,
-0.22342440485954285,
-0.0651485025882721,
-0.15026047825813293,
-0.009851742535829544,
0.05930597335100174,
0.19151601195335388,
-0.0011682994663715363,
0.22752153873443604,
-0.11306080222129822,
-0.19523772597312927,
0.06797117739915848,
0.24252144992351532,
-0.15336011350154877,
0.06800070405006409,
-0.10416911542415619,
0.2970235049724579,
-0.10960450768470764,
-0.12364190071821213,
0.25390729308128357,
-0.010788045823574066,
0.38581210374832153,
0.09179265797138214,
0.2785472571849823,
-0.18265636265277863,
-0.31682562828063965,
0.31267786026000977,
-0.2268459051847458,
0.21859128773212433,
-0.11930645257234573,
0.17901310324668884,
-0.26335716247558594,
0.15147051215171814,
-0.12953536212444305,
0.2010958343744278,
-0.20485347509384155,
-0.10473673045635223,
-0.33893176913261414,
-0.24761399626731873,
-0.005082540214061737,
-0.14315028488636017,
-0.10241533815860748,
0.02110367640852928,
0.2593093514442444,
0.2393612563610077,
-0.08534443378448486,
-0.3656781315803528,
-0.3752787411212921,
-0.12160880863666534,
0.18323872983455658,
-0.02112668752670288,
-0.32180604338645935,
0.17154428362846375,
-0.17761558294296265,
-0.04262546822428703,
-0.04579983651638031,
0.11206810921430588,
-0.31701335310935974,
-0.16930291056632996,
-0.10755836963653564,
0.2416410893201828,
-0.4150407910346985,
0.2469882369041443,
0.19838473200798035,
0.05854855850338936,
0.05537628382444382,
-0.10994381457567215,
0.23810960352420807,
-0.10276933014392853,
-0.36186158657073975,
-0.24988916516304016,
0.1694735884666443,
0.34275442361831665,
-0.15079794824123383,
0.028254911303520203,
0.17189562320709229,
0.0849858820438385,
0.059932366013526917,
0.30092597007751465,
-0.043703217059373856,
0.07828675210475922,
-0.25547486543655396,
0.29756712913513184,
0.22271846234798431,
-0.41016271710395813,
-0.5156536102294922,
-0.02620210126042366,
-0.07334993779659271,
0.5407006144523621,
0.017983369529247284,
0.14063076674938202,
0.34632566571235657,
-0.3076474964618683,
0.3310171663761139,
0.22868047654628754,
0.1557728797197342,
-0.00031594932079315186,
-0.49021515250205994,
-0.3330828547477722,
0.09769551455974579,
-0.023663662374019623,
-0.04872579500079155,
0.05522797629237175,
0.10087919235229492,
0.27756792306900024,
0.36100322008132935,
0.06951495260000229,
-0.027144478633999825,
0.32620564103126526,
0.25426849722862244,
0.14381545782089233,
0.15260806679725647,
-0.31671494245529175,
-0.5300517082214355,
0.1533355414867401,
-0.20772388577461243,
-0.11548276245594025,
-0.03052680566906929,
-0.26272326707839966,
-0.5613532066345215,
0.059081628918647766,
-0.2522977590560913,
0.03955753520131111,
0.2237122654914856,
0.0004782453179359436,
0.020649537444114685,
0.04196327179670334,
0.0791640654206276,
0.46876251697540283,
-0.12794113159179688,
0.04965108260512352,
-0.3813524544239044,
0.36133891344070435,
0.06311289966106415,
-0.038069743663072586,
0.04696080833673477,
0.3840290307998657,
0.21278199553489685,
-0.05840074270963669,
-0.21521568298339844,
0.5766288638114929,
0.16584412753582,
0.18238897621631622,
-0.4463309049606323,
-0.006590604782104492,
0.22919905185699463,
-0.22562843561172485,
0.07222362607717514,
0.2737606167793274,
0.23045620322227478,
-0.07913089543581009,
-0.26427456736564636,
0.30136537551879883,
-0.10919591039419174,
0.03129081055521965,
-0.25267574191093445,
-0.22949901223182678,
0.06230592727661133,
-0.08022058010101318,
-0.1580803394317627,
-0.3986606001853943,
0.07854518294334412,
0.36949726939201355,
0.11812631785869598,
0.06051509082317352,
-0.3573071360588074,
0.20526397228240967,
0.49117565155029297,
-0.008707292377948761,
-0.03243660554289818,
0.044941697269678116,
-0.23943188786506653,
-0.19334310293197632,
-0.06047847867012024,
0.06906815618276596,
0.18569177389144897,
0.09688426554203033,
-0.10610805451869965,
0.15683650970458984,
0.07002085447311401,
-0.23863592743873596,
0.03323183208703995,
0.2145845890045166,
0.05805594101548195,
0.4279099106788635,
0.39482006430625916,
0.06868058443069458,
-0.03497126325964928,
-0.05988200008869171,
0.17752410471439362,
0.05870472639799118,
-0.3881440758705139,
0.20744991302490234,
-0.3104993999004364,
-0.027056407183408737,
-0.1324220597743988,
-0.5384059548377991,
-0.35347238183021545,
-0.42508381605148315,
0.05377409607172012,
0.2014879733324051,
-0.1102379783987999,
0.07518919557332993,
0.0693417340517044,
0.13762140274047852,
0.31648072600364685,
-0.2749299108982086,
-0.08695521950721741,
0.009498540312051773,
-0.07725974917411804,
0.05940834432840347,
-0.076530322432518,
0.15054816007614136,
0.18681928515434265,
-0.08478186279535294,
-0.0688902884721756,
-0.018575940281152725,
-0.32575052976608276,
-0.13271179795265198,
0.10942484438419342,
0.4914005994796753,
0.2532424330711365,
-0.07034844905138016,
0.36769402027130127,
0.010507088154554367,
0.08914913982152939,
0.35491514205932617,
-0.11956790089607239,
0.015101179480552673,
0.11863894760608673,
0.1253523826599121,
-0.1836516559123993,
-0.24723270535469055,
-0.062374845147132874,
-0.2676805257797241,
0.16755267977714539,
0.048028603196144104,
0.13484099507331848,
0.08346253633499146,
-0.00889454036951065,
-0.14288897812366486,
0.2335197478532791,
-0.06104914844036102,
-0.37770962715148926,
-0.03788050264120102,
0.26768946647644043,
-0.18129177391529083,
-0.15818902850151062,
-0.12258034199476242,
-0.3702031373977661,
-0.12861992418766022,
0.1566975712776184,
-0.5316901206970215,
-0.2173241376876831,
-0.2773195505142212,
0.32522058486938477,
-0.01892363652586937,
-0.22008655965328217,
0.4215379059314728,
-0.09150518476963043,
-0.008557409048080444,
-0.23228582739830017,
-0.24699288606643677,
0.26848942041397095,
0.08378911018371582,
0.053168702870607376,
-0.20832225680351257,
0.292208194732666,
-0.05577896162867546,
-0.05567942187190056,
0.13677074015140533,
0.03366679325699806,
0.31033724546432495,
-0.13378039002418518,
0.27268296480178833,
-0.5566012263298035,
0.2109200656414032,
-0.16639183461666107,
0.09133627265691757,
-0.2961620092391968,
0.2010294795036316,
-0.12906813621520996,
0.0747222900390625,
0.3005886673927307,
-0.3001928925514221,
-0.03875342383980751,
-0.35328155755996704,
-0.06764727085828781,
-0.07645107805728912,
0.12379314750432968,
0.18417870998382568,
0.1824803650379181,
-0.2630743682384491,
-0.267291784286499,
-0.09144748002290726,
0.09553694725036621,
-0.051628030836582184,
-0.06178166717290878,
-0.654340386390686,
0.07280775904655457,
-0.24940448999404907,
0.22431814670562744,
0.3315720558166504,
0.5079011917114258,
0.1489185392856598,
-0.24150532484054565,
0.08023573458194733,
-0.16404709219932556,
0.31203293800354004,
-0.12317338585853577,
0.22882996499538422,
0.21711096167564392,
-0.07286965847015381,
-0.45202386379241943,
-0.295559287071228,
-0.2555943727493286,
0.06753113865852356,
-0.13662083446979523,
0.6356039643287659,
-0.09981784224510193,
-0.13771095871925354,
0.14910073578357697,
0.3938711881637573,
-0.33096203207969666,
-0.2359936237335205,
-0.11321066319942474,
0.0295887291431427,
-0.152922123670578,
0.009641408920288086,
0.003317900002002716,
0.4042671322822571,
-0.23677033185958862,
0.053406983613967896,
-0.20673184096813202,
0.036758407950401306,
0.16838905215263367,
-0.04503655433654785,
0.6352881193161011,
-0.00375458225607872,
0.17270714044570923,
-0.18252675235271454,
0.0790114551782608,
-0.05097419023513794,
0.40227678418159485,
0.2584437131881714,
-0.19829398393630981,
0.04811003804206848,
-0.3783840537071228,
-0.19375906884670258,
0.4985409677028656,
0.17939183115959167,
0.3209575116634369,
-0.21489694714546204,
0.22898618876934052,
-0.5310864448547363,
0.16818192601203918,
0.26607710123062134,
-0.09389685094356537,
-0.40926650166511536,
-0.16611619293689728,
0.5136657953262329,
-0.20378634333610535,
-0.30131733417510986,
0.11802570521831512,
0.10260286927223206,
-0.31165480613708496,
0.49020931124687195,
0.1375165581703186,
0.8072190880775452,
0.44234922528266907,
0.14744393527507782,
0.6374203562736511,
-0.2809624671936035,
0.1680554747581482,
-0.04631076380610466,
-0.07350296527147293,
-0.4359242618083954,
-0.1687600463628769,
0.06958138942718506,
-0.030604969710111618,
-0.175873801112175,
-0.1356613039970398,
-0.22037440538406372,
0.15768355131149292,
-0.5118867754936218,
0.15827850997447968,
-0.2026832550764084,
-0.08102550357580185,
0.04314391314983368,
0.06272600591182709,
-0.06680803000926971,
0.1536445915699005,
0.03462335094809532,
0.013467613607645035,
-0.1305525004863739,
-0.09165611863136292,
-0.13503921031951904,
-0.18432751297950745,
-0.12167420983314514,
0.02402123063802719,
-0.012317746877670288,
-0.10519770532846451,
0.025937281548976898,
-0.16474218666553497,
-0.0874527096748352,
0.11701188236474991,
0.3674473166465759,
0.2612000107765198,
0.07208175212144852,
0.15244551002979279,
0.08150475472211838,
0.1692919135093689,
0.2478104531764984,
-0.02454688772559166,
0.17669008672237396,
0.04754006862640381,
-0.3665241599082947,
0.17426039278507233,
-0.13100282847881317,
-0.18167048692703247,
-0.1216663345694542,
-0.07263664901256561,
0.15249530971050262,
-0.4706922173500061,
-0.3146999478340149,
0.01686367206275463,
0.24135354161262512,
-0.17374517023563385,
0.1408711075782776,
-0.03224301338195801,
-0.21921975910663605,
0.331658273935318,
-0.04577481746673584,
-0.46951889991760254,
-0.22029095888137817,
0.12668082118034363,
0.2184847891330719,
-0.11733363568782806,
0.7582990527153015,
-0.08497262001037598,
-0.07643252611160278,
-0.30505990982055664,
0.10301527380943298,
0.21488751471042633,
-0.33998388051986694,
0.14642855525016785,
-0.3603995144367218,
0.02519373595714569,
-0.012758325785398483,
0.37057358026504517,
-0.0408456064760685,
0.09845393151044846,
0.1627153754234314,
-0.4231012463569641,
-0.1651633232831955,
0.06569376587867737,
0.07958905398845673,
0.421637624502182,
-0.205453023314476,
-0.008493997156620026,
-0.3448486626148224,
0.10425776988267899,
-0.3727969527244568,
0.21817238628864288,
-0.1532081663608551,
0.42550134658813477,
-0.12410135567188263,
-0.03765135630965233,
0.14810200035572052,
-0.10837629437446594,
0.11943545192480087,
0.28388509154319763,
-0.3120056986808777,
-0.2534451186656952,
-0.46527397632598877,
0.10577940940856934,
-0.1856941282749176,
0.1265752613544464,
-0.15450364351272583,
0.045100413262844086,
0.19755291938781738,
-0.09346812963485718,
0.29466432332992554,
0.34463417530059814,
0.18183349072933197,
0.3426034450531006,
0.590131402015686,
0.31272467970848083,
-0.1540893018245697,
0.1412191092967987,
0.16427721083164215,
0.21333320438861847,
-0.06207059323787689,
0.20492681860923767,
-0.5333970785140991,
0.03448103368282318,
-0.17018112540245056,
0.09161825478076935,
-0.1441010683774948,
0.209937185049057,
0.19654402136802673,
-0.1482793390750885,
0.2947983741760254,
0.19170773029327393,
0.10887491703033447,
0.23007091879844666,
-0.33398693799972534,
-0.46367329359054565,
0.023783821612596512,
0.3208945691585541,
-0.02684994786977768,
-0.0638166218996048,
0.30176693201065063,
0.10045473277568817,
0.15574634075164795,
0.3603702783584595,
0.4097428321838379,
-0.034865595400333405,
-0.019502978771924973,
0.15389804542064667,
0.3405124843120575,
0.04982532188296318,
0.24739141762256622,
0.5187152624130249,
-0.00831480324268341,
0.035604335367679596,
0.11278531700372696,
-0.06034738942980766,
0.15154799818992615,
0.909450352191925,
0.17128886282444,
0.2706592381000519,
0.5867571830749512,
-0.09698432683944702,
0.1376994252204895,
-0.14702603220939636,
-0.135825976729393,
0.276013046503067,
0.004606861621141434,
0.28067758679389954,
0.08880680799484253,
0.02530841901898384,
-0.05788198113441467,
-0.3497850298881531,
-0.3827778398990631,
-0.06608988344669342,
-0.22138270735740662,
-0.2839818000793457,
-0.241354301571846,
-0.1320669800043106,
-0.16921508312225342,
-0.09871157258749008,
-0.15379226207733154,
0.10723260790109634,
0.31230974197387695,
0.056500159204006195,
0.024089841172099113,
0.009709948673844337,
-0.032171111553907394,
0.10941354930400848,
0.2738724648952484,
-0.25380590558052063,
0.19425341486930847,
0.48143747448921204,
-0.029120326042175293,
0.5495584607124329,
0.048935048282146454,
0.24616138637065887,
0.14099115133285522,
-0.08978457003831863,
0.10767948627471924,
0.07229600101709366,
-0.07139230519533157,
0.1309155523777008,
0.018852293491363525,
-0.00519581139087677,
-0.07944495975971222,
0.2618563175201416,
0.2554006278514862,
-0.22070135176181793,
0.32192179560661316,
0.21981115639209747,
0.2600365877151489,
-0.39067748188972473,
0.25110650062561035,
-0.0724865198135376,
0.015270143747329712,
-0.1968049257993698,
-0.20358088612556458,
0.00004769861698150635,
-0.05035197362303734,
0.35316482186317444,
0.10576577484607697,
0.34275442361831665,
0.17320987582206726,
0.13834166526794434,
-0.40069273114204407,
0.37547993659973145,
0.2050495743751526,
-0.10882751643657684,
-0.0394967682659626,
-0.23054161667823792,
-0.398821622133255,
0.1633843183517456,
-0.0385395847260952,
-0.21865786612033844,
0.19939516484737396,
0.2106451690196991,
-0.2858720123767853,
-0.009464768692851067,
-0.16133113205432892,
-0.044386375695466995,
-0.1716078519821167,
0.36800941824913025,
-0.4502546787261963,
-0.01932590641081333,
-0.007847268134355545,
-0.11243367940187454,
0.030638858675956726,
-0.41434499621391296,
0.1531209945678711,
-0.035009242594242096,
0.1411447376012802,
0.12532511353492737,
-0.06156259402632713,
0.10441853106021881,
0.30627167224884033,
0.2571069598197937,
0.17870192229747772,
-0.01096685603260994,
-0.09333815425634384,
-0.1742449700832367,
-0.44438913464546204,
-0.2216416895389557,
-0.20308153331279755,
0.07748772203922272,
-0.05572466552257538,
0.6309497952461243,
-0.0060564205050468445,
0.26301413774490356,
0.17373493313789368,
0.2798040509223938,
0.201960027217865,
-0.048542603850364685,
-0.30849385261535645,
0.12854540348052979,
-0.11424848437309265,
0.31263861060142517,
0.25019699335098267,
0.5918394327163696,
0.21614454686641693,
0.40917718410491943,
-0.0024018287658691406,
-0.5305318236351013,
0.5479990839958191,
-0.10865264385938644,
-0.34798142313957214,
-0.11745622754096985,
0.16042523086071014,
0.15761689841747284,
-0.2693198323249817,
-0.37352806329727173,
0.042397499084472656,
0.5018832087516785,
-0.11322817206382751,
-0.1330045461654663,
0.1755761355161667,
-0.13426820933818817,
-0.07715260982513428,
-0.24021880328655243,
0.28913918137550354,
0.1154373437166214,
-0.13666516542434692,
0.028817996382713318,
-0.3779805302619934
] |
https://github.com/huggingface/datasets/issues/6242 | Thanks for reporting! This is a MRE:
```python
import pyarrow as pa
from datasets.table import cast_array_to_feature
from datasets import Sequence, Value
data = [
[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],
[[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]],
]
arr = pa.array(data, pa.list_(pa.list_(pa.float32(), 3)))
cast_array_to_feature(arr, Sequence(Sequence(Value("float32"))))
```
I've opened a PR with a fix. | Data alteration when loading dataset with unspecified inner sequence length | ### Describe the bug
When a dataset saved with a specified inner sequence length is loaded without specifying that length, the original data is altered and becomes inconsistent.
### Steps to reproduce the bug
```python
from datasets import Dataset, Features, Value, Sequence, load_dataset
# Repository ID
repo_id = "my_repo_id"
# Define features with a specific length of 3 for each inner sequence
specified_features = Features({"key": Sequence(Sequence(Value("float32"), length=3))})
# Create a dataset with the specified features
data = [
[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],
[[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]],
]
dataset = Dataset.from_dict({"key": data}, features=specified_features)
# Push the dataset to the hub
dataset.push_to_hub(repo_id)
# Define features without specifying the length
unspecified_features = Features({"key": Sequence(Sequence(Value("float32")))})
# Load the dataset from the hub with this new feature definition
dataset = load_dataset(f"qgallouedec/{repo_id}", split="train", features=unspecified_features)
# The obtained data is altered
print(dataset.to_dict()) # {'key': [[[1.0], [2.0]], [[3.0], [4.0]]]}
```
### Expected behavior
```python
print(dataset.to_dict()) # {'key': [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]]}
```
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 52 | Data alteration when loading dataset with unspecified inner sequence length
### Describe the bug
When a dataset saved with a specified inner sequence length is loaded without specifying that length, the original data is altered and becomes inconsistent.
### Steps to reproduce the bug
```python
from datasets import Dataset, Features, Value, Sequence, load_dataset
# Repository ID
repo_id = "my_repo_id"
# Define features with a specific length of 3 for each inner sequence
specified_features = Features({"key": Sequence(Sequence(Value("float32"), length=3))})
# Create a dataset with the specified features
data = [
[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],
[[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]],
]
dataset = Dataset.from_dict({"key": data}, features=specified_features)
# Push the dataset to the hub
dataset.push_to_hub(repo_id)
# Define features without specifying the length
unspecified_features = Features({"key": Sequence(Sequence(Value("float32")))})
# Load the dataset from the hub with this new feature definition
dataset = load_dataset(f"qgallouedec/{repo_id}", split="train", features=unspecified_features)
# The obtained data is altered
print(dataset.to_dict()) # {'key': [[[1.0], [2.0]], [[3.0], [4.0]]]}
```
### Expected behavior
```python
print(dataset.to_dict()) # {'key': [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]]}
```
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
Thanks for reporting! This is a MRE:
```python
import pyarrow as pa
from datasets.table import cast_array_to_feature
from datasets import Sequence, Value
data = [
[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],
[[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]],
]
arr = pa.array(data, pa.list_(pa.list_(pa.float32(), 3)))
cast_array_to_feature(arr, Sequence(Sequence(Value("float32"))))
```
I've opened a PR with a fix. | [
-0.03762386739253998,
-0.21157673001289368,
-0.10051356256008148,
0.3131217062473297,
0.245096355676651,
-0.11110161989927292,
0.29890602827072144,
0.12334597110748291,
-0.0025643929839134216,
0.268387109041214,
-0.008875593543052673,
0.34870365262031555,
0.08487316220998764,
0.1627754271030426,
-0.05491981655359268,
-0.1566663682460785,
0.20233945548534393,
0.11009404063224792,
0.06671376526355743,
-0.03687305003404617,
-0.2445451319217682,
0.02325277216732502,
-0.1662747859954834,
-0.28404852747917175,
-0.39862576127052307,
0.009097173810005188,
-0.22719630599021912,
0.17490176856517792,
0.12705066800117493,
-0.5676791667938232,
0.11283229291439056,
0.21758794784545898,
-0.06299328058958054,
0.4470181167125702,
-0.00011157251719851047,
-0.01332041621208191,
0.30517902970314026,
-0.23827502131462097,
-0.10837159305810928,
0.1882752776145935,
-0.44619232416152954,
-0.18027839064598083,
0.049948424100875854,
-0.5631025433540344,
0.015780240297317505,
0.139505997300148,
-0.38677629828453064,
-0.12889117002487183,
0.30323338508605957,
0.1602707803249359,
0.25922346115112305,
0.24684718251228333,
-0.22229492664337158,
-0.20819343626499176,
0.3417995572090149,
0.004277128726243973,
0.07768315821886063,
-0.042668748646974564,
0.3685612082481384,
0.21452480554580688,
-0.11750110983848572,
0.16416513919830322,
-0.12697117030620575,
-0.2035185545682907,
0.11842705309391022,
-0.13653625547885895,
0.15187472105026245,
-0.12816496193408966,
-0.013391125947237015,
0.4119406044483185,
0.3155302405357361,
-0.22106364369392395,
-0.18465667963027954,
-0.38908660411834717,
-0.07371087372303009,
-0.4825400114059448,
0.1963544338941574,
-0.024237148463726044,
-0.06921842694282532,
0.12949159741401672,
-0.17596197128295898,
0.09596109390258789,
-0.07080725580453873,
-0.05525341257452965,
-0.14516322314739227,
0.24115730822086334,
0.024608973413705826,
0.135304793715477,
-0.5317091345787048,
-0.0444568432867527,
-0.04466381296515465,
-0.2517932653427124,
-0.011421030387282372,
-0.036748502403497696,
-0.22342440485954285,
-0.0651485025882721,
-0.15026047825813293,
-0.009851742535829544,
0.05930597335100174,
0.19151601195335388,
-0.0011682994663715363,
0.22752153873443604,
-0.11306080222129822,
-0.19523772597312927,
0.06797117739915848,
0.24252144992351532,
-0.15336011350154877,
0.06800070405006409,
-0.10416911542415619,
0.2970235049724579,
-0.10960450768470764,
-0.12364190071821213,
0.25390729308128357,
-0.010788045823574066,
0.38581210374832153,
0.09179265797138214,
0.2785472571849823,
-0.18265636265277863,
-0.31682562828063965,
0.31267786026000977,
-0.2268459051847458,
0.21859128773212433,
-0.11930645257234573,
0.17901310324668884,
-0.26335716247558594,
0.15147051215171814,
-0.12953536212444305,
0.2010958343744278,
-0.20485347509384155,
-0.10473673045635223,
-0.33893176913261414,
-0.24761399626731873,
-0.005082540214061737,
-0.14315028488636017,
-0.10241533815860748,
0.02110367640852928,
0.2593093514442444,
0.2393612563610077,
-0.08534443378448486,
-0.3656781315803528,
-0.3752787411212921,
-0.12160880863666534,
0.18323872983455658,
-0.02112668752670288,
-0.32180604338645935,
0.17154428362846375,
-0.17761558294296265,
-0.04262546822428703,
-0.04579983651638031,
0.11206810921430588,
-0.31701335310935974,
-0.16930291056632996,
-0.10755836963653564,
0.2416410893201828,
-0.4150407910346985,
0.2469882369041443,
0.19838473200798035,
0.05854855850338936,
0.05537628382444382,
-0.10994381457567215,
0.23810960352420807,
-0.10276933014392853,
-0.36186158657073975,
-0.24988916516304016,
0.1694735884666443,
0.34275442361831665,
-0.15079794824123383,
0.028254911303520203,
0.17189562320709229,
0.0849858820438385,
0.059932366013526917,
0.30092597007751465,
-0.043703217059373856,
0.07828675210475922,
-0.25547486543655396,
0.29756712913513184,
0.22271846234798431,
-0.41016271710395813,
-0.5156536102294922,
-0.02620210126042366,
-0.07334993779659271,
0.5407006144523621,
0.017983369529247284,
0.14063076674938202,
0.34632566571235657,
-0.3076474964618683,
0.3310171663761139,
0.22868047654628754,
0.1557728797197342,
-0.00031594932079315186,
-0.49021515250205994,
-0.3330828547477722,
0.09769551455974579,
-0.023663662374019623,
-0.04872579500079155,
0.05522797629237175,
0.10087919235229492,
0.27756792306900024,
0.36100322008132935,
0.06951495260000229,
-0.027144478633999825,
0.32620564103126526,
0.25426849722862244,
0.14381545782089233,
0.15260806679725647,
-0.31671494245529175,
-0.5300517082214355,
0.1533355414867401,
-0.20772388577461243,
-0.11548276245594025,
-0.03052680566906929,
-0.26272326707839966,
-0.5613532066345215,
0.059081628918647766,
-0.2522977590560913,
0.03955753520131111,
0.2237122654914856,
0.0004782453179359436,
0.020649537444114685,
0.04196327179670334,
0.0791640654206276,
0.46876251697540283,
-0.12794113159179688,
0.04965108260512352,
-0.3813524544239044,
0.36133891344070435,
0.06311289966106415,
-0.038069743663072586,
0.04696080833673477,
0.3840290307998657,
0.21278199553489685,
-0.05840074270963669,
-0.21521568298339844,
0.5766288638114929,
0.16584412753582,
0.18238897621631622,
-0.4463309049606323,
-0.006590604782104492,
0.22919905185699463,
-0.22562843561172485,
0.07222362607717514,
0.2737606167793274,
0.23045620322227478,
-0.07913089543581009,
-0.26427456736564636,
0.30136537551879883,
-0.10919591039419174,
0.03129081055521965,
-0.25267574191093445,
-0.22949901223182678,
0.06230592727661133,
-0.08022058010101318,
-0.1580803394317627,
-0.3986606001853943,
0.07854518294334412,
0.36949726939201355,
0.11812631785869598,
0.06051509082317352,
-0.3573071360588074,
0.20526397228240967,
0.49117565155029297,
-0.008707292377948761,
-0.03243660554289818,
0.044941697269678116,
-0.23943188786506653,
-0.19334310293197632,
-0.06047847867012024,
0.06906815618276596,
0.18569177389144897,
0.09688426554203033,
-0.10610805451869965,
0.15683650970458984,
0.07002085447311401,
-0.23863592743873596,
0.03323183208703995,
0.2145845890045166,
0.05805594101548195,
0.4279099106788635,
0.39482006430625916,
0.06868058443069458,
-0.03497126325964928,
-0.05988200008869171,
0.17752410471439362,
0.05870472639799118,
-0.3881440758705139,
0.20744991302490234,
-0.3104993999004364,
-0.027056407183408737,
-0.1324220597743988,
-0.5384059548377991,
-0.35347238183021545,
-0.42508381605148315,
0.05377409607172012,
0.2014879733324051,
-0.1102379783987999,
0.07518919557332993,
0.0693417340517044,
0.13762140274047852,
0.31648072600364685,
-0.2749299108982086,
-0.08695521950721741,
0.009498540312051773,
-0.07725974917411804,
0.05940834432840347,
-0.076530322432518,
0.15054816007614136,
0.18681928515434265,
-0.08478186279535294,
-0.0688902884721756,
-0.018575940281152725,
-0.32575052976608276,
-0.13271179795265198,
0.10942484438419342,
0.4914005994796753,
0.2532424330711365,
-0.07034844905138016,
0.36769402027130127,
0.010507088154554367,
0.08914913982152939,
0.35491514205932617,
-0.11956790089607239,
0.015101179480552673,
0.11863894760608673,
0.1253523826599121,
-0.1836516559123993,
-0.24723270535469055,
-0.062374845147132874,
-0.2676805257797241,
0.16755267977714539,
0.048028603196144104,
0.13484099507331848,
0.08346253633499146,
-0.00889454036951065,
-0.14288897812366486,
0.2335197478532791,
-0.06104914844036102,
-0.37770962715148926,
-0.03788050264120102,
0.26768946647644043,
-0.18129177391529083,
-0.15818902850151062,
-0.12258034199476242,
-0.3702031373977661,
-0.12861992418766022,
0.1566975712776184,
-0.5316901206970215,
-0.2173241376876831,
-0.2773195505142212,
0.32522058486938477,
-0.01892363652586937,
-0.22008655965328217,
0.4215379059314728,
-0.09150518476963043,
-0.008557409048080444,
-0.23228582739830017,
-0.24699288606643677,
0.26848942041397095,
0.08378911018371582,
0.053168702870607376,
-0.20832225680351257,
0.292208194732666,
-0.05577896162867546,
-0.05567942187190056,
0.13677074015140533,
0.03366679325699806,
0.31033724546432495,
-0.13378039002418518,
0.27268296480178833,
-0.5566012263298035,
0.2109200656414032,
-0.16639183461666107,
0.09133627265691757,
-0.2961620092391968,
0.2010294795036316,
-0.12906813621520996,
0.0747222900390625,
0.3005886673927307,
-0.3001928925514221,
-0.03875342383980751,
-0.35328155755996704,
-0.06764727085828781,
-0.07645107805728912,
0.12379314750432968,
0.18417870998382568,
0.1824803650379181,
-0.2630743682384491,
-0.267291784286499,
-0.09144748002290726,
0.09553694725036621,
-0.051628030836582184,
-0.06178166717290878,
-0.654340386390686,
0.07280775904655457,
-0.24940448999404907,
0.22431814670562744,
0.3315720558166504,
0.5079011917114258,
0.1489185392856598,
-0.24150532484054565,
0.08023573458194733,
-0.16404709219932556,
0.31203293800354004,
-0.12317338585853577,
0.22882996499538422,
0.21711096167564392,
-0.07286965847015381,
-0.45202386379241943,
-0.295559287071228,
-0.2555943727493286,
0.06753113865852356,
-0.13662083446979523,
0.6356039643287659,
-0.09981784224510193,
-0.13771095871925354,
0.14910073578357697,
0.3938711881637573,
-0.33096203207969666,
-0.2359936237335205,
-0.11321066319942474,
0.0295887291431427,
-0.152922123670578,
0.009641408920288086,
0.003317900002002716,
0.4042671322822571,
-0.23677033185958862,
0.053406983613967896,
-0.20673184096813202,
0.036758407950401306,
0.16838905215263367,
-0.04503655433654785,
0.6352881193161011,
-0.00375458225607872,
0.17270714044570923,
-0.18252675235271454,
0.0790114551782608,
-0.05097419023513794,
0.40227678418159485,
0.2584437131881714,
-0.19829398393630981,
0.04811003804206848,
-0.3783840537071228,
-0.19375906884670258,
0.4985409677028656,
0.17939183115959167,
0.3209575116634369,
-0.21489694714546204,
0.22898618876934052,
-0.5310864448547363,
0.16818192601203918,
0.26607710123062134,
-0.09389685094356537,
-0.40926650166511536,
-0.16611619293689728,
0.5136657953262329,
-0.20378634333610535,
-0.30131733417510986,
0.11802570521831512,
0.10260286927223206,
-0.31165480613708496,
0.49020931124687195,
0.1375165581703186,
0.8072190880775452,
0.44234922528266907,
0.14744393527507782,
0.6374203562736511,
-0.2809624671936035,
0.1680554747581482,
-0.04631076380610466,
-0.07350296527147293,
-0.4359242618083954,
-0.1687600463628769,
0.06958138942718506,
-0.030604969710111618,
-0.175873801112175,
-0.1356613039970398,
-0.22037440538406372,
0.15768355131149292,
-0.5118867754936218,
0.15827850997447968,
-0.2026832550764084,
-0.08102550357580185,
0.04314391314983368,
0.06272600591182709,
-0.06680803000926971,
0.1536445915699005,
0.03462335094809532,
0.013467613607645035,
-0.1305525004863739,
-0.09165611863136292,
-0.13503921031951904,
-0.18432751297950745,
-0.12167420983314514,
0.02402123063802719,
-0.012317746877670288,
-0.10519770532846451,
0.025937281548976898,
-0.16474218666553497,
-0.0874527096748352,
0.11701188236474991,
0.3674473166465759,
0.2612000107765198,
0.07208175212144852,
0.15244551002979279,
0.08150475472211838,
0.1692919135093689,
0.2478104531764984,
-0.02454688772559166,
0.17669008672237396,
0.04754006862640381,
-0.3665241599082947,
0.17426039278507233,
-0.13100282847881317,
-0.18167048692703247,
-0.1216663345694542,
-0.07263664901256561,
0.15249530971050262,
-0.4706922173500061,
-0.3146999478340149,
0.01686367206275463,
0.24135354161262512,
-0.17374517023563385,
0.1408711075782776,
-0.03224301338195801,
-0.21921975910663605,
0.331658273935318,
-0.04577481746673584,
-0.46951889991760254,
-0.22029095888137817,
0.12668082118034363,
0.2184847891330719,
-0.11733363568782806,
0.7582990527153015,
-0.08497262001037598,
-0.07643252611160278,
-0.30505990982055664,
0.10301527380943298,
0.21488751471042633,
-0.33998388051986694,
0.14642855525016785,
-0.3603995144367218,
0.02519373595714569,
-0.012758325785398483,
0.37057358026504517,
-0.0408456064760685,
0.09845393151044846,
0.1627153754234314,
-0.4231012463569641,
-0.1651633232831955,
0.06569376587867737,
0.07958905398845673,
0.421637624502182,
-0.205453023314476,
-0.008493997156620026,
-0.3448486626148224,
0.10425776988267899,
-0.3727969527244568,
0.21817238628864288,
-0.1532081663608551,
0.42550134658813477,
-0.12410135567188263,
-0.03765135630965233,
0.14810200035572052,
-0.10837629437446594,
0.11943545192480087,
0.28388509154319763,
-0.3120056986808777,
-0.2534451186656952,
-0.46527397632598877,
0.10577940940856934,
-0.1856941282749176,
0.1265752613544464,
-0.15450364351272583,
0.045100413262844086,
0.19755291938781738,
-0.09346812963485718,
0.29466432332992554,
0.34463417530059814,
0.18183349072933197,
0.3426034450531006,
0.590131402015686,
0.31272467970848083,
-0.1540893018245697,
0.1412191092967987,
0.16427721083164215,
0.21333320438861847,
-0.06207059323787689,
0.20492681860923767,
-0.5333970785140991,
0.03448103368282318,
-0.17018112540245056,
0.09161825478076935,
-0.1441010683774948,
0.209937185049057,
0.19654402136802673,
-0.1482793390750885,
0.2947983741760254,
0.19170773029327393,
0.10887491703033447,
0.23007091879844666,
-0.33398693799972534,
-0.46367329359054565,
0.023783821612596512,
0.3208945691585541,
-0.02684994786977768,
-0.0638166218996048,
0.30176693201065063,
0.10045473277568817,
0.15574634075164795,
0.3603702783584595,
0.4097428321838379,
-0.034865595400333405,
-0.019502978771924973,
0.15389804542064667,
0.3405124843120575,
0.04982532188296318,
0.24739141762256622,
0.5187152624130249,
-0.00831480324268341,
0.035604335367679596,
0.11278531700372696,
-0.06034738942980766,
0.15154799818992615,
0.909450352191925,
0.17128886282444,
0.2706592381000519,
0.5867571830749512,
-0.09698432683944702,
0.1376994252204895,
-0.14702603220939636,
-0.135825976729393,
0.276013046503067,
0.004606861621141434,
0.28067758679389954,
0.08880680799484253,
0.02530841901898384,
-0.05788198113441467,
-0.3497850298881531,
-0.3827778398990631,
-0.06608988344669342,
-0.22138270735740662,
-0.2839818000793457,
-0.241354301571846,
-0.1320669800043106,
-0.16921508312225342,
-0.09871157258749008,
-0.15379226207733154,
0.10723260790109634,
0.31230974197387695,
0.056500159204006195,
0.024089841172099113,
0.009709948673844337,
-0.032171111553907394,
0.10941354930400848,
0.2738724648952484,
-0.25380590558052063,
0.19425341486930847,
0.48143747448921204,
-0.029120326042175293,
0.5495584607124329,
0.048935048282146454,
0.24616138637065887,
0.14099115133285522,
-0.08978457003831863,
0.10767948627471924,
0.07229600101709366,
-0.07139230519533157,
0.1309155523777008,
0.018852293491363525,
-0.00519581139087677,
-0.07944495975971222,
0.2618563175201416,
0.2554006278514862,
-0.22070135176181793,
0.32192179560661316,
0.21981115639209747,
0.2600365877151489,
-0.39067748188972473,
0.25110650062561035,
-0.0724865198135376,
0.015270143747329712,
-0.1968049257993698,
-0.20358088612556458,
0.00004769861698150635,
-0.05035197362303734,
0.35316482186317444,
0.10576577484607697,
0.34275442361831665,
0.17320987582206726,
0.13834166526794434,
-0.40069273114204407,
0.37547993659973145,
0.2050495743751526,
-0.10882751643657684,
-0.0394967682659626,
-0.23054161667823792,
-0.398821622133255,
0.1633843183517456,
-0.0385395847260952,
-0.21865786612033844,
0.19939516484737396,
0.2106451690196991,
-0.2858720123767853,
-0.009464768692851067,
-0.16133113205432892,
-0.044386375695466995,
-0.1716078519821167,
0.36800941824913025,
-0.4502546787261963,
-0.01932590641081333,
-0.007847268134355545,
-0.11243367940187454,
0.030638858675956726,
-0.41434499621391296,
0.1531209945678711,
-0.035009242594242096,
0.1411447376012802,
0.12532511353492737,
-0.06156259402632713,
0.10441853106021881,
0.30627167224884033,
0.2571069598197937,
0.17870192229747772,
-0.01096685603260994,
-0.09333815425634384,
-0.1742449700832367,
-0.44438913464546204,
-0.2216416895389557,
-0.20308153331279755,
0.07748772203922272,
-0.05572466552257538,
0.6309497952461243,
-0.0060564205050468445,
0.26301413774490356,
0.17373493313789368,
0.2798040509223938,
0.201960027217865,
-0.048542603850364685,
-0.30849385261535645,
0.12854540348052979,
-0.11424848437309265,
0.31263861060142517,
0.25019699335098267,
0.5918394327163696,
0.21614454686641693,
0.40917718410491943,
-0.0024018287658691406,
-0.5305318236351013,
0.5479990839958191,
-0.10865264385938644,
-0.34798142313957214,
-0.11745622754096985,
0.16042523086071014,
0.15761689841747284,
-0.2693198323249817,
-0.37352806329727173,
0.042397499084472656,
0.5018832087516785,
-0.11322817206382751,
-0.1330045461654663,
0.1755761355161667,
-0.13426820933818817,
-0.07715260982513428,
-0.24021880328655243,
0.28913918137550354,
0.1154373437166214,
-0.13666516542434692,
0.028817996382713318,
-0.3779805302619934
] |
https://github.com/huggingface/datasets/issues/6240 | What type of dataset are you using in this script? `torch.utils.data.Dataset` or `datasets.Dataset`? Please share the `datasets` package version if it's the latter. Otherwise, it's better to move this issue to the `accelerate` repo. | Dataloader stuck on multiple GPUs | ### Describe the bug
I am trying to get CLIP to fine-tuning with my code.
When I tried to run it on multiple GPUs using accelerate, I encountered the following phenomenon.
- Validation dataloader stuck in 2nd epoch only on multi-GPU
Specifically, when the "for inputs in valid_loader:" process is finished, it does not proceed to the next step. train_loader process is completed. Also, both train and valid are working correctly in the first epoch.
The accelerate command at that time is as follows.
`accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...`
- This will not happen when single GPU is used.
`CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...`
- Setting num_workers=0 in dataloader did not change the result.
### Steps to reproduce the bug
1. The codes for fine-tuning the regular CLIP were updated for accelerate.
2. Run the code with the accelerate command as `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` and the above problem will occur.
3. CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` , it works fine.
### Expected behavior
It Should end normally as if it was run on a single GPU.
### Environment info
Since `datasets-cli env` did not work, the environment is described below.
- OS: Ubuntu 22.04 with Docker
- Docker: 24.0.5, build ced0996
- Python: 3.10.12
- torch==2.0.1
- accelerate==0.21.0
- transformers==4.33.1 | 34 | Dataloader stuck on multiple GPUs
### Describe the bug
I am trying to get CLIP to fine-tuning with my code.
When I tried to run it on multiple GPUs using accelerate, I encountered the following phenomenon.
- Validation dataloader stuck in 2nd epoch only on multi-GPU
Specifically, when the "for inputs in valid_loader:" process is finished, it does not proceed to the next step. train_loader process is completed. Also, both train and valid are working correctly in the first epoch.
The accelerate command at that time is as follows.
`accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...`
- This will not happen when single GPU is used.
`CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...`
- Setting num_workers=0 in dataloader did not change the result.
### Steps to reproduce the bug
1. The codes for fine-tuning the regular CLIP were updated for accelerate.
2. Run the code with the accelerate command as `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` and the above problem will occur.
3. CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` , it works fine.
### Expected behavior
It Should end normally as if it was run on a single GPU.
### Environment info
Since `datasets-cli env` did not work, the environment is described below.
- OS: Ubuntu 22.04 with Docker
- Docker: 24.0.5, build ced0996
- Python: 3.10.12
- torch==2.0.1
- accelerate==0.21.0
- transformers==4.33.1
What type of dataset are you using in this script? `torch.utils.data.Dataset` or `datasets.Dataset`? Please share the `datasets` package version if it's the latter. Otherwise, it's better to move this issue to the `accelerate` repo. | [
-0.16673842072486877,
-0.19584006071090698,
0.012823913246393204,
0.01672077551484108,
0.09490471333265305,
-0.1398051530122757,
0.6904860138893127,
0.1713944971561432,
-0.05128742381930351,
0.23313216865062714,
0.16659069061279297,
0.3453610837459564,
0.22014600038528442,
0.2462579607963562,
-0.22419637441635132,
0.04174106568098068,
0.11302103102207184,
-0.02884649857878685,
0.32323190569877625,
-0.04821395128965378,
0.017895594239234924,
0.1554194539785385,
-0.13391627371311188,
-0.20951521396636963,
-0.5053946375846863,
0.003469279035925865,
0.13128790259361267,
-0.12308765202760696,
0.30183321237564087,
0.21875783801078796,
0.07794702053070068,
0.220753014087677,
0.027846351265907288,
0.8040759563446045,
-0.0001249548513442278,
-0.10062626004219055,
0.07546520978212357,
-0.0055760592222213745,
-0.12854726612567902,
-0.18373604118824005,
0.13677220046520233,
-0.09740280359983444,
-0.04559747874736786,
-0.23632682859897614,
-0.09306658804416656,
0.15856531262397766,
-0.07664258778095245,
-0.16785837709903717,
0.5110321640968323,
0.014293547719717026,
0.0805714875459671,
-0.0006938576698303223,
-0.20814858376979828,
-0.23764868080615997,
-0.2960335314273834,
0.006104199215769768,
-0.2037975788116455,
0.09459944069385529,
0.20983631908893585,
-0.47261354327201843,
-0.30537161231040955,
0.13591110706329346,
-0.014193687587976456,
0.1183604896068573,
-0.07856381684541702,
-0.3115444481372833,
-0.1635524332523346,
-0.2840782403945923,
-0.06958577036857605,
0.08852939307689667,
-0.08531266450881958,
0.04838263988494873,
-0.4093613624572754,
-0.27817827463150024,
0.10616818070411682,
-0.21947182714939117,
0.209801584482193,
0.18502512574195862,
-0.2444540560245514,
0.047971051186323166,
-0.01588684320449829,
0.15327566862106323,
-0.1205701008439064,
-0.005274100229144096,
-0.3636278808116913,
0.8097854256629944,
0.03416847810149193,
0.291351854801178,
0.4512142837047577,
0.2997150719165802,
0.15011847019195557,
0.32946884632110596,
0.3138669431209564,
-0.13450029492378235,
-0.9624546766281128,
0.27243679761886597,
0.20120744407176971,
-0.26662516593933105,
-0.27279865741729736,
0.41069096326828003,
0.29746749997138977,
0.09843532741069794,
0.3153627812862396,
0.10939289629459381,
0.06976158916950226,
0.17289209365844727,
0.18409833312034607,
0.1211802139878273,
0.6347211003303528,
0.30831027030944824,
-0.07397504150867462,
0.04583354294300079,
-0.16756778955459595,
-0.14461514353752136,
-0.26997077465057373,
0.281461238861084,
-0.1138438880443573,
-0.0804281234741211,
-0.4192591905593872,
-0.01805872842669487,
-0.0638258308172226,
-0.035099029541015625,
0.16752175986766815,
0.2962166666984558,
0.12816639244556427,
0.40743139386177063,
-0.24812939763069153,
0.1139165610074997,
-0.09451308846473694,
-0.13176709413528442,
-0.09106238186359406,
0.07812679558992386,
-0.18089082837104797,
0.1827174425125122,
0.33512529730796814,
-0.3016502559185028,
-0.011583659797906876,
0.22699329257011414,
0.45392903685569763,
-0.18948310613632202,
0.0021359026432037354,
-0.361733615398407,
-0.20583763718605042,
0.2137085348367691,
0.14081072807312012,
0.43244418501853943,
0.12832240760326385,
-0.08754069358110428,
0.07319994270801544,
0.14500142633914948,
-0.47404199838638306,
0.034193627536296844,
0.1203051283955574,
0.07588405907154083,
-0.15894892811775208,
0.07346471399068832,
-0.28973859548568726,
0.0854763314127922,
0.24339494109153748,
-0.1855035126209259,
0.0035225562751293182,
-0.3127913475036621,
-0.16811896860599518,
-0.2885865569114685,
0.31895509362220764,
0.3047214150428772,
-0.4193737506866455,
-0.09232362359762192,
-0.17671066522598267,
0.0780601054430008,
0.026597173884510994,
0.44088616967201233,
-0.10412691533565521,
0.11537516117095947,
-0.3586560785770416,
0.07179442048072815,
-0.5015072226524353,
-0.4877142310142517,
-0.3611948490142822,
0.33409130573272705,
-0.5733062028884888,
0.2777128517627716,
0.3226391077041626,
-0.2167634814977646,
0.3194143772125244,
-0.373564749956131,
0.2419237494468689,
0.32055917382240295,
0.09135765582323074,
0.012873202562332153,
0.014913715422153473,
0.19768661260604858,
0.24305444955825806,
0.2272779792547226,
0.14547835290431976,
-0.2112407684326172,
-0.12691786885261536,
0.07973331212997437,
0.19800226390361786,
-0.035494375973939896,
-0.031143538653850555,
0.1837432086467743,
0.28380945324897766,
-0.611691415309906,
0.12161831557750702,
0.27121108770370483,
-0.5892843008041382,
0.3642222583293915,
-0.12494103610515594,
-0.10743345320224762,
0.128825843334198,
0.10294155031442642,
-0.00743846595287323,
0.065104641020298,
-0.3016168177127838,
-0.2627914845943451,
-0.02192956954240799,
0.09897957742214203,
-0.03882967308163643,
-0.2814021110534668,
0.06138536334037781,
0.4551224410533905,
-0.34695297479629517,
0.036619093269109726,
0.13295713067054749,
0.37836503982543945,
0.0404064878821373,
-0.2560376822948456,
-0.0885375440120697,
-0.14246082305908203,
0.12863606214523315,
-0.4903488755226135,
-0.08884796500205994,
0.3062683343887329,
0.22653868794441223,
0.290370374917984,
-0.11061113327741623,
0.409015953540802,
0.22522658109664917,
-0.11698447912931442,
-0.2058354616165161,
0.16121375560760498,
-0.12526045739650726,
-0.3544714152812958,
-0.10845988988876343,
0.23743434250354767,
-0.12224437296390533,
0.3064366579055786,
-0.14952516555786133,
0.03305903822183609,
0.1350405216217041,
-0.11815966665744781,
-0.13502854108810425,
0.30471765995025635,
0.38971418142318726,
0.36599376797676086,
0.2700396478176117,
-0.134943425655365,
0.000498548150062561,
0.18703593313694,
0.006807927507907152,
0.29318591952323914,
-0.11287526786327362,
0.07680350542068481,
0.13127994537353516,
-0.026747405529022217,
-0.016374612227082253,
0.05221906304359436,
0.25885871052742004,
0.07575016468763351,
0.015717677772045135,
-0.1899046003818512,
-0.2044409066438675,
-0.23631076514720917,
-0.2399272471666336,
0.18947726488113403,
0.2336270660161972,
0.416761577129364,
-0.005971748381853104,
0.10666625201702118,
0.1472649872303009,
-0.14376866817474365,
0.5182039737701416,
0.2850886881351471,
-0.3827981948852539,
0.18102779984474182,
-0.3291058838367462,
-0.055398210883140564,
-0.16421735286712646,
-0.24797891080379486,
-0.38471657037734985,
-0.15534156560897827,
-0.12938129901885986,
0.3653399348258972,
0.1037215143442154,
0.5127483010292053,
0.4062333405017853,
0.31231459975242615,
0.045515820384025574,
0.1923522651195526,
-0.23299886286258698,
0.0007166862487792969,
-0.02458568476140499,
-0.056924521923065186,
0.53173828125,
-0.07952695339918137,
-0.012471964582800865,
0.3663373589515686,
-0.09328986704349518,
-0.1766272485256195,
-0.40091031789779663,
-0.20777761936187744,
-0.08218082785606384,
0.5632007718086243,
-0.100708968937397,
0.2424219846725464,
0.04193742573261261,
-0.21686358749866486,
0.06331239640712738,
-0.22597113251686096,
0.08499258011579514,
0.027100183069705963,
-0.13508440554141998,
0.23439526557922363,
0.0028605982661247253,
0.16336175799369812,
-0.025075575336813927,
-0.27131301164627075,
0.11969077587127686,
-0.03962266072630882,
0.07637382298707962,
-0.101538747549057,
-0.04400954023003578,
-0.08138921856880188,
0.2897186577320099,
-0.14770562946796417,
-0.03808800131082535,
-0.021491363644599915,
0.1932109147310257,
0.13912872970104218,
-0.168617844581604,
-0.3165206015110016,
0.10065247118473053,
0.2006930261850357,
0.25985100865364075,
-0.19492372870445251,
0.11808338761329651,
0.04245873540639877,
-0.19572848081588745,
-0.07874622195959091,
-0.09136968106031418,
0.32502445578575134,
-0.36572402715682983,
0.04647555947303772,
0.1591726392507553,
-0.36457252502441406,
0.32639890909194946,
0.09613057971000671,
0.1969119757413864,
-0.1633966863155365,
-0.06182635575532913,
0.4343532919883728,
0.4080410897731781,
0.03945139795541763,
-0.05465563014149666,
0.04057783633470535,
0.27897411584854126,
0.0077557009644806385,
0.16109800338745117,
-0.25986334681510925,
0.530337393283844,
-0.13244672119617462,
-0.2155616730451584,
-0.0900651216506958,
-0.28804099559783936,
-0.20336522161960602,
-0.29605069756507874,
0.221658855676651,
-0.2301095426082611,
0.016617558896541595,
0.2770216464996338,
-0.002034885808825493,
-0.023638933897018433,
0.05492916703224182,
0.1664513498544693,
0.019246302545070648,
0.20242522656917572,
0.07454170286655426,
-0.023218393325805664,
0.12454377114772797,
-0.24337279796600342,
-0.36296936869621277,
-0.2805978059768677,
0.17702797055244446,
0.1952531337738037,
-0.09715799987316132,
0.24115823209285736,
0.08193020522594452,
-0.19081170856952667,
0.06608141213655472,
-0.4754810929298401,
0.5832722783088684,
0.02741711400449276,
-0.09645548462867737,
0.17108085751533508,
-0.2605721950531006,
0.28105926513671875,
-0.44568347930908203,
-0.18406438827514648,
0.024310562759637833,
0.30653560161590576,
0.40542876720428467,
-0.08102335035800934,
-0.0400860458612442,
-0.004257889464497566,
-0.14156921207904816,
-0.16226497292518616,
-0.3445190191268921,
-0.15743008255958557,
0.2598879337310791,
-0.060367025434970856,
0.3750549256801605,
-0.11106674373149872,
0.14312101900577545,
-0.40031081438064575,
0.029584549367427826,
-0.10781626403331757,
-0.38773462176322937,
0.06452945619821548,
0.08598249405622482,
0.05104989930987358,
-0.07662057131528854,
0.07587262988090515,
0.1698472648859024,
-0.2691204845905304,
0.29445815086364746,
0.002597864717245102,
0.07834511250257492,
-0.16713953018188477,
0.43685442209243774,
0.03863585367798805,
0.18038907647132874,
0.37011194229125977,
0.029765449464321136,
0.0928921103477478,
0.02281844988465309,
0.23923060297966003,
-0.18196187913417816,
0.11359710246324539,
0.007257029414176941,
0.04863613843917847,
-0.4219307005405426,
-0.19375354051589966,
0.19115310907363892,
0.412192702293396,
0.002349957823753357,
0.7350749969482422,
-0.3698250949382782,
-0.011015016585588455,
-0.06946268677711487,
0.2058827430009842,
0.7653170824050903,
-0.1172294095158577,
0.08991432189941406,
0.05267881602048874,
-0.08094830065965652,
0.2614889442920685,
-0.3479197323322296,
0.11157822608947754,
-0.28400927782058716,
-0.9140560626983643,
-0.052477382123470306,
-0.1355006992816925,
0.19550898671150208,
0.19407060742378235,
0.06898322701454163,
0.16657133400440216,
-0.11481805145740509,
0.13573651015758514,
0.1408727616071701,
0.14623883366584778,
0.3362114131450653,
-0.542715311050415,
-0.1451672911643982,
-0.023552507162094116,
-0.29512354731559753,
0.2487785667181015,
-0.10252636671066284,
0.17169976234436035,
0.05778597295284271,
-0.28796693682670593,
-0.3567580580711365,
0.2625637650489807,
-0.362262487411499,
0.07649901509284973,
-0.05711020901799202,
-0.6386860609054565,
-0.026704702526330948,
-0.1492929756641388,
-0.16243194043636322,
-0.025315551087260246,
0.07952021807432175,
0.28332650661468506,
0.339611291885376,
-0.12576419115066528,
0.16003550589084625,
-0.42115548253059387,
0.5125908851623535,
0.04556439816951752,
0.007883355021476746,
0.15512217581272125,
0.08141428232192993,
-0.16472232341766357,
0.2757714092731476,
0.3368736505508423,
0.008884798735380173,
0.2995493412017822,
-0.0951269119977951,
0.08961822092533112,
0.10223428905010223,
-0.3763176500797272,
0.02992267534136772,
0.17694798111915588,
-0.24253487586975098,
0.2747986316680908,
-0.30480754375457764,
-0.10714851319789886,
-0.09054820984601974,
0.5736894607543945,
-0.016700085252523422,
-0.6833537817001343,
0.33001917600631714,
0.39481422305107117,
0.07634082436561584,
-0.17104247212409973,
-0.11552342772483826,
0.016684718430042267,
-0.32692569494247437,
0.20569708943367004,
-0.2863919138908386,
-0.09399536997079849,
0.23752395808696747,
-0.012785263359546661,
0.1744682788848877,
0.12970852851867676,
-0.1031942218542099,
-0.500705897808075,
-0.11644929647445679,
-0.26954182982444763,
-0.4004708230495453,
-0.08588755875825882,
-0.036092862486839294,
-0.11243870854377747,
0.281177282333374,
0.5257870554924011,
-0.18421247601509094,
-0.05483661964535713,
-0.12829633057117462,
-0.12107871472835541,
0.1136472076177597,
-0.21018175780773163,
-0.02273527719080448,
0.09535949677228928,
0.06423020362854004,
0.32780739665031433,
0.1986977607011795,
-0.16365212202072144,
-0.22718362510204315,
0.1878713220357895,
0.09233947098255157,
0.20568600296974182,
0.18004857003688812,
-0.08483241498470306,
-0.1060275137424469,
-0.12651443481445312,
0.10077247023582458,
0.081438347697258,
0.1469404697418213,
-0.03717992827296257,
0.39073875546455383,
0.2079205960035324,
-0.1824691742658615,
0.1212398111820221,
-0.013263251632452011,
-0.21530188620090485,
0.26963919401168823,
0.33265212178230286,
0.05755234137177467,
0.11151331663131714,
-0.7967783808708191,
-0.1475096046924591,
-0.06402087956666946,
0.10925169289112091,
0.040383003652095795,
-0.33971208333969116,
-0.06531009078025818,
-0.05763300508260727,
0.38952189683914185,
0.4994625747203827,
-0.1558888852596283,
-0.2139655351638794,
0.19320808351039886,
0.045630697160959244,
-0.19954019784927368,
0.13597336411476135,
-0.015594854019582272,
0.24277517199516296,
-0.10990937799215317,
0.4848956763744354,
0.27789849042892456,
-0.18141348659992218,
0.14171800017356873,
0.15365250408649445,
0.002667386084794998,
-0.2808305621147156,
0.401247501373291,
0.08809080719947815,
0.09480876475572586,
0.0108193289488554,
0.054291799664497375,
-0.21808086335659027,
0.01726333051919937,
-0.16749434173107147,
0.07760601490736008,
0.15752558410167694,
0.08998730778694153,
0.006779568735510111,
-0.059030912816524506,
-0.5575777888298035,
-0.47659069299697876,
0.21533648669719696,
-0.2873132824897766,
0.06599042564630508,
-0.10684716701507568,
0.5047534108161926,
-0.2705656588077545,
-0.15864227712154388,
-0.5356208682060242,
0.3018825650215149,
-0.18537181615829468,
0.22272643446922302,
0.08805134892463684,
-0.0097331702709198,
-0.13916563987731934,
-0.042291123420000076,
0.1043134331703186,
0.07345888763666153,
0.5250717997550964,
0.1840907484292984,
-0.08764076232910156,
0.07964945584535599,
-0.4022018015384674,
0.24041017889976501,
0.13610360026359558,
-0.2566491365432739,
0.14649881422519684,
0.2562294900417328,
-0.034824859350919724,
-0.14891023933887482,
-0.033572353422641754,
0.5086110830307007,
0.2099734991788864,
-0.0058906711637973785,
0.13902567327022552,
-0.080161914229393,
0.13630324602127075,
0.028305746614933014,
0.29875820875167847,
0.18429085612297058,
0.3480299115180969,
0.32633352279663086,
0.07721332460641861,
-0.07373715192079544,
-0.002910152543336153,
0.05757734552025795,
0.21807502210140228,
-0.14792488515377045,
0.17648957669734955,
-0.052886225283145905,
0.026463940739631653,
-0.13523662090301514,
0.15271607041358948,
-0.17600059509277344,
0.016566812992095947,
-0.20488962531089783,
-0.02722782827913761,
-0.16863152384757996,
0.01820315048098564,
0.019597534090280533,
-0.06002217158675194,
0.39397934079170227,
0.22403578460216522,
0.15720327198505402,
-0.5053613781929016,
-0.34318163990974426,
-0.5487931966781616,
0.2594868242740631,
0.046391408890485764,
0.010136514902114868,
-0.10954438894987106,
0.3623805642127991,
0.1355774849653244,
-0.16023536026477814,
0.18193137645721436,
-0.3636820912361145,
0.2636670470237732,
0.41483718156814575,
-0.5975210070610046,
0.338379830121994,
-0.34236574172973633,
-0.12334898859262466,
-0.02675538882613182,
-0.07351138442754745,
0.037198424339294434,
0.4117090404033661,
-0.016997184604406357,
0.03973740339279175,
-0.1705620288848877,
0.2013305127620697,
0.1109752357006073,
0.29325687885284424,
-0.08794593065977097,
0.40804821252822876,
0.16778230667114258,
0.26344427466392517,
-0.48741987347602844,
0.18457330763339996,
-0.27100780606269836,
0.1333453208208084,
0.07701342552900314,
0.2776852250099182,
0.015346743166446686,
0.017264261841773987,
-0.41852474212646484,
-0.008938875049352646,
-0.033675748854875565,
-0.371167927980423,
-0.21133050322532654,
0.09517797082662582,
0.12257709354162216,
0.126482293009758,
0.4337815046310425,
0.27734002470970154,
0.2817513644695282,
0.03424713760614395,
-0.564711332321167,
-0.26737937331199646,
0.21741071343421936,
-0.0032458268105983734,
-0.2841179072856903,
-0.27300286293029785,
0.1709427833557129,
-0.40779656171798706,
0.25711941719055176,
-0.3042433559894562,
-0.15645581483840942,
0.20692788064479828,
-0.11690403521060944,
-0.2767297327518463,
0.07443135976791382,
-0.2622711956501007,
-0.062199950218200684,
-0.19777919352054596,
-0.23983150720596313,
0.22361545264720917,
-0.20058655738830566,
0.1097743809223175,
0.05940868705511093
] |
https://github.com/huggingface/datasets/issues/6240 | Very sorry, I thought I had a repo in `accelerate!`
I will close this issue and repo the issue in the appropriate place. | Dataloader stuck on multiple GPUs | ### Describe the bug
I am trying to get CLIP to fine-tuning with my code.
When I tried to run it on multiple GPUs using accelerate, I encountered the following phenomenon.
- Validation dataloader stuck in 2nd epoch only on multi-GPU
Specifically, when the "for inputs in valid_loader:" process is finished, it does not proceed to the next step. train_loader process is completed. Also, both train and valid are working correctly in the first epoch.
The accelerate command at that time is as follows.
`accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...`
- This will not happen when single GPU is used.
`CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...`
- Setting num_workers=0 in dataloader did not change the result.
### Steps to reproduce the bug
1. The codes for fine-tuning the regular CLIP were updated for accelerate.
2. Run the code with the accelerate command as `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` and the above problem will occur.
3. CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` , it works fine.
### Expected behavior
It Should end normally as if it was run on a single GPU.
### Environment info
Since `datasets-cli env` did not work, the environment is described below.
- OS: Ubuntu 22.04 with Docker
- Docker: 24.0.5, build ced0996
- Python: 3.10.12
- torch==2.0.1
- accelerate==0.21.0
- transformers==4.33.1 | 23 | Dataloader stuck on multiple GPUs
### Describe the bug
I am trying to get CLIP to fine-tuning with my code.
When I tried to run it on multiple GPUs using accelerate, I encountered the following phenomenon.
- Validation dataloader stuck in 2nd epoch only on multi-GPU
Specifically, when the "for inputs in valid_loader:" process is finished, it does not proceed to the next step. train_loader process is completed. Also, both train and valid are working correctly in the first epoch.
The accelerate command at that time is as follows.
`accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...`
- This will not happen when single GPU is used.
`CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...`
- Setting num_workers=0 in dataloader did not change the result.
### Steps to reproduce the bug
1. The codes for fine-tuning the regular CLIP were updated for accelerate.
2. Run the code with the accelerate command as `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` and the above problem will occur.
3. CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` , it works fine.
### Expected behavior
It Should end normally as if it was run on a single GPU.
### Environment info
Since `datasets-cli env` did not work, the environment is described below.
- OS: Ubuntu 22.04 with Docker
- Docker: 24.0.5, build ced0996
- Python: 3.10.12
- torch==2.0.1
- accelerate==0.21.0
- transformers==4.33.1
Very sorry, I thought I had a repo in `accelerate!`
I will close this issue and repo the issue in the appropriate place. | [
-0.11724366247653961,
-0.1557527482509613,
0.0050024352967739105,
0.020393963903188705,
0.10015542060136795,
-0.15935344994068146,
0.6699702739715576,
0.13958662748336792,
-0.05459371209144592,
0.24758201837539673,
0.15198692679405212,
0.3250676691532135,
0.2378477156162262,
0.26258647441864014,
-0.2283506691455841,
0.0485825277864933,
0.11879493296146393,
0.010438866913318634,
0.32741454243659973,
-0.06377410143613815,
0.04739028960466385,
0.16197584569454193,
-0.12850093841552734,
-0.1856330931186676,
-0.4866611361503601,
0.021440455690026283,
0.1192854791879654,
-0.1528681218624115,
0.26518598198890686,
0.23110654950141907,
0.08369842171669006,
0.20582719147205353,
0.015408597886562347,
0.8175821304321289,
-0.00012439809506759048,
-0.08402128517627716,
0.04944494366645813,
0.002574339509010315,
-0.11633818596601486,
-0.17295128107070923,
0.11526619642972946,
-0.09360487759113312,
-0.04830718785524368,
-0.2269854098558426,
-0.07133171707391739,
0.1383214145898819,
-0.0853615328669548,
-0.11387933790683746,
0.5315526723861694,
-0.005612686276435852,
0.08391329646110535,
-0.035877831280231476,
-0.19611036777496338,
-0.2227817326784134,
-0.29297083616256714,
0.002218686044216156,
-0.21517688035964966,
0.10008643567562103,
0.18975983560085297,
-0.49378764629364014,
-0.30236876010894775,
0.14000006020069122,
0.032654523849487305,
0.12999886274337769,
-0.09898428618907928,
-0.3067692816257477,
-0.09318579733371735,
-0.26655763387680054,
-0.09999163448810577,
0.10189837217330933,
-0.1322491466999054,
0.08482189476490021,
-0.3997442126274109,
-0.2815263867378235,
0.11650659143924713,
-0.22269997000694275,
0.20607653260231018,
0.18174056708812714,
-0.22678421437740326,
0.06940197944641113,
-0.01924796588718891,
0.13827095925807953,
-0.12385179847478867,
0.0008429773151874542,
-0.4036831259727478,
0.8027615547180176,
0.025074012577533722,
0.28257763385772705,
0.46813833713531494,
0.31981998682022095,
0.13103002309799194,
0.33481451869010925,
0.28658977150917053,
-0.1329258680343628,
-0.9624757766723633,
0.27010732889175415,
0.20568017661571503,
-0.29087015986442566,
-0.2948240637779236,
0.37237271666526794,
0.2994930148124695,
0.07759356498718262,
0.2971634268760681,
0.09549254179000854,
0.07863818854093552,
0.20201367139816284,
0.15492165088653564,
0.09240497648715973,
0.6348975896835327,
0.31756165623664856,
-0.08240725100040436,
0.04172505438327789,
-0.14112432301044464,
-0.11449283361434937,
-0.272499680519104,
0.22652342915534973,
-0.15195471048355103,
-0.0663658007979393,
-0.3943353295326233,
-0.02836458571255207,
-0.10959059745073318,
-0.02708103321492672,
0.17493434250354767,
0.25674501061439514,
0.11719390749931335,
0.4204964339733124,
-0.2600625157356262,
0.11216580867767334,
-0.08943875133991241,
-0.10513809323310852,
-0.10474305599927902,
0.05295306816697121,
-0.18810802698135376,
0.2009258270263672,
0.3349405825138092,
-0.3167276978492737,
-0.020627733319997787,
0.2472396045923233,
0.46936196088790894,
-0.21492747962474823,
0.012033142149448395,
-0.34839391708374023,
-0.24040517210960388,
0.2181382030248642,
0.11521749198436737,
0.4191829562187195,
0.12089729309082031,
-0.1252821981906891,
0.10569894313812256,
0.1170353889465332,
-0.4778401255607605,
0.0293387770652771,
0.13525748252868652,
0.08742253482341766,
-0.17812755703926086,
0.07457146048545837,
-0.2849538028240204,
0.08549794554710388,
0.21878233551979065,
-0.1642356812953949,
0.000506822019815445,
-0.288463294506073,
-0.15526007115840912,
-0.2641121447086334,
0.32190078496932983,
0.270437628030777,
-0.3936300277709961,
-0.09932627528905869,
-0.18691684305667877,
0.08481638133525848,
0.02476888708770275,
0.4413265287876129,
-0.10475032031536102,
0.11770525574684143,
-0.3370443284511566,
0.06344260275363922,
-0.5154420137405396,
-0.4601442217826843,
-0.3692339360713959,
0.3311861455440521,
-0.5665683150291443,
0.2805720269680023,
0.28737905621528625,
-0.23978057503700256,
0.30152180790901184,
-0.36319831013679504,
0.23371517658233643,
0.30290722846984863,
0.0998862087726593,
0.018534302711486816,
0.012960806488990784,
0.1983797550201416,
0.23663678765296936,
0.21459895372390747,
0.12782658636569977,
-0.18124733865261078,
-0.1378527730703354,
0.09948223829269409,
0.19972409307956696,
-0.02101924642920494,
-0.020742395892739296,
0.163442000746727,
0.33440548181533813,
-0.6165640354156494,
0.12510350346565247,
0.26117634773254395,
-0.5622382760047913,
0.3825102150440216,
-0.16577106714248657,
-0.0968824177980423,
0.15805678069591522,
0.12347924709320068,
-0.025921165943145752,
0.07694949954748154,
-0.299150288105011,
-0.2617719769477844,
-0.01077340915799141,
0.05441315844655037,
-0.023393236100673676,
-0.2502785325050354,
0.07335036993026733,
0.4569752812385559,
-0.3572005033493042,
0.032595399767160416,
0.17957711219787598,
0.3990010917186737,
0.04628681391477585,
-0.2550479769706726,
-0.10594076663255692,
-0.13527223467826843,
0.12175720185041428,
-0.4811340868473053,
-0.09167017042636871,
0.27712154388427734,
0.21446722745895386,
0.28054988384246826,
-0.11401773244142532,
0.3919393718242645,
0.24101093411445618,
-0.11732588708400726,
-0.2420017123222351,
0.15091829001903534,
-0.1306031048297882,
-0.36038002371788025,
-0.10151036083698273,
0.21323555707931519,
-0.11426791548728943,
0.32423627376556396,
-0.14953182637691498,
0.05144423246383667,
0.13881616294384003,
-0.11930595338344574,
-0.13948240876197815,
0.3169378638267517,
0.3777673542499542,
0.3551396131515503,
0.24363264441490173,
-0.12131981551647186,
0.042814210057258606,
0.16936510801315308,
-0.008634858764708042,
0.3232731521129608,
-0.13389912247657776,
0.06262759864330292,
0.12438276410102844,
-0.03226371109485626,
-0.04438098520040512,
0.07345014810562134,
0.2515009045600891,
0.05934441462159157,
0.03824647516012192,
-0.1819150596857071,
-0.20337256789207458,
-0.23232856392860413,
-0.2569774091243744,
0.20477065443992615,
0.2785152196884155,
0.3988587260246277,
0.01578756794333458,
0.09928584098815918,
0.14981505274772644,
-0.13115505874156952,
0.5422036647796631,
0.30118948221206665,
-0.35316377878189087,
0.16087254881858826,
-0.3180263340473175,
-0.04451766237616539,
-0.15371763706207275,
-0.2871045768260956,
-0.4155578017234802,
-0.1555471271276474,
-0.11589810252189636,
0.37174150347709656,
0.11782097071409225,
0.4856935143470764,
0.40743130445480347,
0.32448285818099976,
0.016725249588489532,
0.24717405438423157,
-0.2472749948501587,
-0.002728048712015152,
-0.036198750138282776,
-0.05133645609021187,
0.49434590339660645,
-0.08331728726625443,
-0.05416187644004822,
0.3936586380004883,
-0.1271374374628067,
-0.15296325087547302,
-0.4329497218132019,
-0.21854270994663239,
-0.06826882809400558,
0.5580770969390869,
-0.12487806379795074,
0.2596937417984009,
0.00213545560836792,
-0.20057429373264313,
0.06704525649547577,
-0.21729722619056702,
0.06969659775495529,
0.03209710866212845,
-0.12832587957382202,
0.2642310857772827,
-0.022289656102657318,
0.17189955711364746,
-0.042055122554302216,
-0.25262677669525146,
0.18801522254943848,
-0.05320407450199127,
0.06915226578712463,
-0.09299129992723465,
-0.07060538232326508,
-0.07610329240560532,
0.29860734939575195,
-0.18755173683166504,
-0.04329165816307068,
-0.003948144614696503,
0.16481396555900574,
0.12982729077339172,
-0.14726421236991882,
-0.2857147455215454,
0.12361620366573334,
0.1883009523153305,
0.24201658368110657,
-0.21296215057373047,
0.11933261156082153,
0.02942243404686451,
-0.24574771523475647,
-0.0704294741153717,
-0.11721639335155487,
0.3047509491443634,
-0.367959588766098,
0.048377472907304764,
0.18032166361808777,
-0.3813384473323822,
0.3475944697856903,
0.1409258097410202,
0.19993260502815247,
-0.19895140826702118,
-0.09995841234922409,
0.4437267482280731,
0.38576775789260864,
0.02169892191886902,
-0.009415247477591038,
0.03477275371551514,
0.31784114241600037,
-0.004943210631608963,
0.16441664099693298,
-0.2385759949684143,
0.5305526256561279,
-0.116495281457901,
-0.21641023457050323,
-0.08534424751996994,
-0.26028674840927124,
-0.22253203392028809,
-0.29627150297164917,
0.25911983847618103,
-0.1770462542772293,
0.021736249327659607,
0.25048187375068665,
0.021387431770563126,
-0.026929248124361038,
0.08068813383579254,
0.1265304684638977,
0.05239257216453552,
0.19304496049880981,
0.057675402611494064,
-0.029616206884384155,
0.11811273545026779,
-0.23123939335346222,
-0.37317395210266113,
-0.313677579164505,
0.21137461066246033,
0.14852285385131836,
-0.10351282358169556,
0.23008781671524048,
0.08457538485527039,
-0.17450930178165436,
0.08437962830066681,
-0.4789595603942871,
0.5763101577758789,
0.06352159380912781,
-0.10611908882856369,
0.16521769762039185,
-0.2626124620437622,
0.2759630084037781,
-0.47271692752838135,
-0.16318441927433014,
-0.02940721996128559,
0.32764893770217896,
0.4353247582912445,
-0.07985467463731766,
-0.030932413414120674,
-0.012556598521769047,
-0.1570633053779602,
-0.1634199619293213,
-0.36561891436576843,
-0.16788165271282196,
0.27099746465682983,
-0.014932028949260712,
0.3847419321537018,
-0.11387252807617188,
0.15678516030311584,
-0.4044421315193176,
0.028919003903865814,
-0.10664437711238861,
-0.38975900411605835,
0.0581352524459362,
0.07247502356767654,
0.029061906039714813,
-0.04663030803203583,
0.07594750821590424,
0.1801552176475525,
-0.2661116421222687,
0.2513970136642456,
-0.032363876700401306,
0.05335612595081329,
-0.17866306006908417,
0.4372217059135437,
0.03273722156882286,
0.1836107224225998,
0.3642958998680115,
0.03872590512037277,
0.12161998450756073,
0.06302061676979065,
0.22742542624473572,
-0.16645124554634094,
0.11224514245986938,
-0.0000672563910484314,
0.040288958698511124,
-0.387069433927536,
-0.17481257021427155,
0.17774789035320282,
0.40757569670677185,
-0.00022892653942108154,
0.7190523743629456,
-0.3395046293735504,
-0.0005838461220264435,
-0.09531771391630173,
0.1712607592344284,
0.7274919748306274,
-0.11841098964214325,
0.08696644008159637,
0.06152074784040451,
-0.08618519455194473,
0.26745185256004333,
-0.32271111011505127,
0.12081727385520935,
-0.24686112999916077,
-0.9415755867958069,
-0.04520473629236221,
-0.13299867510795593,
0.18390776216983795,
0.19323986768722534,
0.0868147760629654,
0.15032058954238892,
-0.10705691576004028,
0.13151060044765472,
0.15107056498527527,
0.11319600045681,
0.3541988432407379,
-0.5367981195449829,
-0.15948787331581116,
-0.01698620244860649,
-0.28161853551864624,
0.22480779886245728,
-0.08619296550750732,
0.15452635288238525,
0.06253515183925629,
-0.2564101219177246,
-0.32745444774627686,
0.27733859419822693,
-0.3683762848377228,
0.07169599831104279,
-0.024034157395362854,
-0.6043659448623657,
-0.01997945085167885,
-0.17213591933250427,
-0.15950870513916016,
-0.03249124437570572,
0.07250506430864334,
0.2971910238265991,
0.32857072353363037,
-0.1162932962179184,
0.16975942254066467,
-0.420448899269104,
0.47585898637771606,
0.03530479222536087,
-0.001908913254737854,
0.1601586639881134,
0.06110852584242821,
-0.16337981820106506,
0.272683322429657,
0.36188560724258423,
0.0033247964456677437,
0.3336572051048279,
-0.05563260242342949,
0.09828509390354156,
0.1249220222234726,
-0.3741326332092285,
0.035034578293561935,
0.1871783584356308,
-0.25532791018486023,
0.27415773272514343,
-0.3281443119049072,
-0.12331875413656235,
-0.07214073091745377,
0.5404688715934753,
0.01833183690905571,
-0.6753833293914795,
0.3378570079803467,
0.3766228258609772,
0.10230490565299988,
-0.15716178715229034,
-0.1515432596206665,
-0.020674370229244232,
-0.2978171408176422,
0.20047564804553986,
-0.27857404947280884,
-0.08622055500745773,
0.25945186614990234,
-0.0050554703921079636,
0.1847516894340515,
0.1142006441950798,
-0.1015051007270813,
-0.5085141658782959,
-0.09103529900312424,
-0.2860000431537628,
-0.40374132990837097,
-0.08868908882141113,
-0.037255000323057175,
-0.11032967269420624,
0.27012234926223755,
0.5384634733200073,
-0.1830100119113922,
-0.04052770882844925,
-0.13484996557235718,
-0.14101502299308777,
0.07006591558456421,
-0.23736333847045898,
-0.0004493631422519684,
0.08349256217479706,
0.059175536036491394,
0.34802234172821045,
0.20717616379261017,
-0.16487044095993042,
-0.23490460216999054,
0.18804876506328583,
0.1064903736114502,
0.2347068190574646,
0.19384697079658508,
-0.08377175778150558,
-0.10621044039726257,
-0.0816778689622879,
0.08159090578556061,
0.05032798647880554,
0.14545515179634094,
-0.0668974295258522,
0.3822806179523468,
0.2278599590063095,
-0.18105614185333252,
0.13738414645195007,
0.0019831322133541107,
-0.22885391116142273,
0.2801138162612915,
0.3196703791618347,
0.057523906230926514,
0.11029771715402603,
-0.8172018527984619,
-0.1758308708667755,
-0.10069902241230011,
0.10371983051300049,
0.04587816819548607,
-0.34164565801620483,
-0.07848764955997467,
-0.06271746754646301,
0.39074331521987915,
0.488910436630249,
-0.136931911110878,
-0.21837925910949707,
0.21153298020362854,
0.049610547721385956,
-0.17328736186027527,
0.15883441269397736,
0.006826359778642654,
0.2738984525203705,
-0.1257486492395401,
0.4748954176902771,
0.2903292179107666,
-0.1897377222776413,
0.12879493832588196,
0.1778126060962677,
-0.027688685804605484,
-0.27225083112716675,
0.4016856253147125,
0.06008008122444153,
0.07957509905099869,
0.013850230723619461,
0.05288098007440567,
-0.2297554910182953,
0.010414283722639084,
-0.2233411818742752,
0.07077464461326599,
0.07637033611536026,
0.07986104488372803,
0.00630241958424449,
-0.04218024015426636,
-0.5154870748519897,
-0.5159655809402466,
0.2432185560464859,
-0.2951991558074951,
0.05264444276690483,
-0.11128123849630356,
0.5300007462501526,
-0.28933000564575195,
-0.16781407594680786,
-0.5374782085418701,
0.3009355664253235,
-0.18310053646564484,
0.2479991912841797,
0.10882449150085449,
-0.019862331449985504,
-0.12177655845880508,
-0.03497900813817978,
0.11755084246397018,
0.09169044345617294,
0.5416196584701538,
0.1871279925107956,
-0.09412732720375061,
0.05134081095457077,
-0.46314847469329834,
0.2640838921070099,
0.15118741989135742,
-0.24460506439208984,
0.12600035965442657,
0.23408900201320648,
-0.05129547789692879,
-0.17392916977405548,
-0.021920213475823402,
0.4478182792663574,
0.20623931288719177,
0.010597418993711472,
0.14587321877479553,
-0.057080432772636414,
0.15754783153533936,
0.01995350420475006,
0.2979983985424042,
0.2153218686580658,
0.33673179149627686,
0.2998778223991394,
0.07272665202617645,
-0.08139348775148392,
-0.034232474863529205,
0.04155367240309715,
0.2777653634548187,
-0.15815478563308716,
0.18060240149497986,
-0.04441257566213608,
0.055819034576416016,
-0.11731576919555664,
0.15485486388206482,
-0.15391778945922852,
0.022048190236091614,
-0.2293119728565216,
-0.04294741898775101,
-0.17606166005134583,
0.01629006490111351,
0.022070374339818954,
-0.05542759969830513,
0.3921601474285126,
0.22074486315250397,
0.1499326080083847,
-0.493910551071167,
-0.35016965866088867,
-0.5409505367279053,
0.2709447145462036,
0.027081914246082306,
0.0647178515791893,
-0.09944773465394974,
0.37975814938545227,
0.11410702764987946,
-0.17883041501045227,
0.156131774187088,
-0.36492714285850525,
0.23930886387825012,
0.39836233854293823,
-0.6187808513641357,
0.3505204916000366,
-0.31030985713005066,
-0.13477523624897003,
-0.03756367415189743,
-0.03589177876710892,
0.04903724789619446,
0.43892452120780945,
-0.022419799119234085,
0.07943613827228546,
-0.14822019636631012,
0.17515960335731506,
0.14034205675125122,
0.2806166708469391,
-0.07978891581296921,
0.37258341908454895,
0.1959247589111328,
0.2518818974494934,
-0.4450280964374542,
0.17344820499420166,
-0.2541069984436035,
0.08727166056632996,
0.0544082410633564,
0.23982293903827667,
0.0065533071756362915,
0.04283645749092102,
-0.42448967695236206,
-0.010194823145866394,
-0.008710592985153198,
-0.3861621618270874,
-0.21612262725830078,
0.07518266141414642,
0.1438959836959839,
0.1291763037443161,
0.4429571032524109,
0.27620774507522583,
0.2815409004688263,
-0.008249633014202118,
-0.5478869676589966,
-0.244444340467453,
0.18889662623405457,
-0.023098081350326538,
-0.2871108949184418,
-0.24881012737751007,
0.17756375670433044,
-0.39799952507019043,
0.23516486585140228,
-0.29301291704177856,
-0.17691543698310852,
0.21931982040405273,
-0.13632959127426147,
-0.27490147948265076,
0.05310086905956268,
-0.273857444524765,
-0.06475377082824707,
-0.19415539503097534,
-0.2409989833831787,
0.23348569869995117,
-0.20370414853096008,
0.12890946865081787,
0.07799719274044037
] |
https://github.com/huggingface/datasets/issues/6239 | I think this is the same issue as https://github.com/huggingface/datasets/issues/4776. Maybe installing `ffmpeg` can fix it:
```python
add-apt-repository -y ppa:savoury1/ffmpeg4
apt-get -qq install -y ffmpeg
```
However, the best solution is to use a newer version of `datasets`. In the recent releases, we've replaced `torchaudio` with `soundfile`, which is easier to install and faster. | Load local audio data doesn't work | ### Describe the bug
I get a RuntimeError from the following code:
```python
audio_dataset = Dataset.from_dict({"audio": ["/kaggle/input/bengaliai-speech/train_mp3s/000005f3362c.mp3"]}).cast_column("audio", Audio())
audio_dataset[0]
```
### Traceback
<details>
```python
RuntimeError Traceback (most recent call last)
Cell In[33], line 1
----> 1 train_dataset[0]
File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1764, in Dataset.__getitem__(self, key)
1762 def __getitem__(self, key): # noqa: F811
1763 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools)."""
-> 1764 return self._getitem(
1765 key,
1766 )
File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1749, in Dataset._getitem(self, key, decoded, **kwargs)
1747 formatter = get_formatter(format_type, features=self.features, decoded=decoded, **format_kwargs)
1748 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
-> 1749 formatted_output = format_table(
1750 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns
1751 )
1752 return formatted_output
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:532, in format_table(table, key, formatter, format_columns, output_all_columns)
530 python_formatter = PythonFormatter(features=None)
531 if format_columns is None:
--> 532 return formatter(pa_table, query_type=query_type)
533 elif query_type == "column":
534 if key in format_columns:
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:281, in Formatter.__call__(self, pa_table, query_type)
279 def __call__(self, pa_table: pa.Table, query_type: str) -> Union[RowFormat, ColumnFormat, BatchFormat]:
280 if query_type == "row":
--> 281 return self.format_row(pa_table)
282 elif query_type == "column":
283 return self.format_column(pa_table)
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:312, in PythonFormatter.format_row(self, pa_table)
310 row = self.python_arrow_extractor().extract_row(pa_table)
311 if self.decoded:
--> 312 row = self.python_features_decoder.decode_row(row)
313 return row
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:221, in PythonFeaturesDecoder.decode_row(self, row)
220 def decode_row(self, row: dict) -> dict:
--> 221 return self.features.decode_example(row) if self.features else row
File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1386, in Features.decode_example(self, example)
1376 def decode_example(self, example: dict):
1377 """Decode example with custom feature decoding.
1378
1379 Args:
(...)
1383 :obj:`dict[str, Any]`
1384 """
-> 1386 return {
1387 column_name: decode_nested_example(feature, value)
1388 if self._column_requires_decoding[column_name]
1389 else value
1390 for column_name, (feature, value) in zip_dict(
1391 {key: value for key, value in self.items() if key in example}, example
1392 )
1393 }
File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1387, in <dictcomp>(.0)
1376 def decode_example(self, example: dict):
1377 """Decode example with custom feature decoding.
1378
1379 Args:
(...)
1383 :obj:`dict[str, Any]`
1384 """
1386 return {
-> 1387 column_name: decode_nested_example(feature, value)
1388 if self._column_requires_decoding[column_name]
1389 else value
1390 for column_name, (feature, value) in zip_dict(
1391 {key: value for key, value in self.items() if key in example}, example
1392 )
1393 }
File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1087, in decode_nested_example(schema, obj)
1085 # Object with special decoding:
1086 elif isinstance(schema, (Audio, Image)):
-> 1087 return schema.decode_example(obj) if obj is not None else None
1088 return obj
File /opt/conda/lib/python3.10/site-packages/datasets/features/audio.py:103, in Audio.decode_example(self, value)
101 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.")
102 elif path is not None and path.endswith("mp3"):
--> 103 array, sampling_rate = self._decode_mp3(file if file else path)
104 elif path is not None and path.endswith("opus"):
105 if file:
File /opt/conda/lib/python3.10/site-packages/datasets/features/audio.py:241, in Audio._decode_mp3(self, path_or_file)
238 except RuntimeError as err:
239 raise ImportError("To support decoding 'mp3' audio files, please install 'sox'.") from err
--> 241 array, sampling_rate = torchaudio.load(path_or_file, format="mp3")
242 if self.sampling_rate and self.sampling_rate != sampling_rate:
243 if not hasattr(self, "_resampler") or self._resampler.orig_freq != sampling_rate:
File /opt/conda/lib/python3.10/site-packages/torchaudio/backend/sox_io_backend.py:256, in load(filepath, frame_offset, num_frames, normalize, channels_first, format)
254 if ret is not None:
255 return ret
--> 256 return _fallback_load(filepath, frame_offset, num_frames, normalize, channels_first, format)
File /opt/conda/lib/python3.10/site-packages/torchaudio/backend/sox_io_backend.py:30, in _fail_load(filepath, frame_offset, num_frames, normalize, channels_first, format)
22 def _fail_load(
23 filepath: str,
24 frame_offset: int = 0,
(...)
28 format: Optional[str] = None,
29 ) -> Tuple[torch.Tensor, int]:
---> 30 raise RuntimeError("Failed to load audio from {}".format(filepath))
RuntimeError: Failed to load audio from /kaggle/input/bengaliai-speech/train_mp3s/000005f3362c.mp3
```
</details>
### Steps to reproduce the bug
1. - Create a custom dataset using Local files of type mp3.
3. - Try to read the first audio item.
### Expected behavior
Expected output
```python
audio_dataset[0]["audio"]
{'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414,
0. , 0. ], dtype=float32),
'path': 'path/to/audio_1',
'sampling_rate': 16000}
```
### Environment info
N/A | 53 | Load local audio data doesn't work
### Describe the bug
I get a RuntimeError from the following code:
```python
audio_dataset = Dataset.from_dict({"audio": ["/kaggle/input/bengaliai-speech/train_mp3s/000005f3362c.mp3"]}).cast_column("audio", Audio())
audio_dataset[0]
```
### Traceback
<details>
```python
RuntimeError Traceback (most recent call last)
Cell In[33], line 1
----> 1 train_dataset[0]
File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1764, in Dataset.__getitem__(self, key)
1762 def __getitem__(self, key): # noqa: F811
1763 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools)."""
-> 1764 return self._getitem(
1765 key,
1766 )
File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1749, in Dataset._getitem(self, key, decoded, **kwargs)
1747 formatter = get_formatter(format_type, features=self.features, decoded=decoded, **format_kwargs)
1748 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
-> 1749 formatted_output = format_table(
1750 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns
1751 )
1752 return formatted_output
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:532, in format_table(table, key, formatter, format_columns, output_all_columns)
530 python_formatter = PythonFormatter(features=None)
531 if format_columns is None:
--> 532 return formatter(pa_table, query_type=query_type)
533 elif query_type == "column":
534 if key in format_columns:
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:281, in Formatter.__call__(self, pa_table, query_type)
279 def __call__(self, pa_table: pa.Table, query_type: str) -> Union[RowFormat, ColumnFormat, BatchFormat]:
280 if query_type == "row":
--> 281 return self.format_row(pa_table)
282 elif query_type == "column":
283 return self.format_column(pa_table)
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:312, in PythonFormatter.format_row(self, pa_table)
310 row = self.python_arrow_extractor().extract_row(pa_table)
311 if self.decoded:
--> 312 row = self.python_features_decoder.decode_row(row)
313 return row
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:221, in PythonFeaturesDecoder.decode_row(self, row)
220 def decode_row(self, row: dict) -> dict:
--> 221 return self.features.decode_example(row) if self.features else row
File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1386, in Features.decode_example(self, example)
1376 def decode_example(self, example: dict):
1377 """Decode example with custom feature decoding.
1378
1379 Args:
(...)
1383 :obj:`dict[str, Any]`
1384 """
-> 1386 return {
1387 column_name: decode_nested_example(feature, value)
1388 if self._column_requires_decoding[column_name]
1389 else value
1390 for column_name, (feature, value) in zip_dict(
1391 {key: value for key, value in self.items() if key in example}, example
1392 )
1393 }
File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1387, in <dictcomp>(.0)
1376 def decode_example(self, example: dict):
1377 """Decode example with custom feature decoding.
1378
1379 Args:
(...)
1383 :obj:`dict[str, Any]`
1384 """
1386 return {
-> 1387 column_name: decode_nested_example(feature, value)
1388 if self._column_requires_decoding[column_name]
1389 else value
1390 for column_name, (feature, value) in zip_dict(
1391 {key: value for key, value in self.items() if key in example}, example
1392 )
1393 }
File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1087, in decode_nested_example(schema, obj)
1085 # Object with special decoding:
1086 elif isinstance(schema, (Audio, Image)):
-> 1087 return schema.decode_example(obj) if obj is not None else None
1088 return obj
File /opt/conda/lib/python3.10/site-packages/datasets/features/audio.py:103, in Audio.decode_example(self, value)
101 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.")
102 elif path is not None and path.endswith("mp3"):
--> 103 array, sampling_rate = self._decode_mp3(file if file else path)
104 elif path is not None and path.endswith("opus"):
105 if file:
File /opt/conda/lib/python3.10/site-packages/datasets/features/audio.py:241, in Audio._decode_mp3(self, path_or_file)
238 except RuntimeError as err:
239 raise ImportError("To support decoding 'mp3' audio files, please install 'sox'.") from err
--> 241 array, sampling_rate = torchaudio.load(path_or_file, format="mp3")
242 if self.sampling_rate and self.sampling_rate != sampling_rate:
243 if not hasattr(self, "_resampler") or self._resampler.orig_freq != sampling_rate:
File /opt/conda/lib/python3.10/site-packages/torchaudio/backend/sox_io_backend.py:256, in load(filepath, frame_offset, num_frames, normalize, channels_first, format)
254 if ret is not None:
255 return ret
--> 256 return _fallback_load(filepath, frame_offset, num_frames, normalize, channels_first, format)
File /opt/conda/lib/python3.10/site-packages/torchaudio/backend/sox_io_backend.py:30, in _fail_load(filepath, frame_offset, num_frames, normalize, channels_first, format)
22 def _fail_load(
23 filepath: str,
24 frame_offset: int = 0,
(...)
28 format: Optional[str] = None,
29 ) -> Tuple[torch.Tensor, int]:
---> 30 raise RuntimeError("Failed to load audio from {}".format(filepath))
RuntimeError: Failed to load audio from /kaggle/input/bengaliai-speech/train_mp3s/000005f3362c.mp3
```
</details>
### Steps to reproduce the bug
1. - Create a custom dataset using Local files of type mp3.
3. - Try to read the first audio item.
### Expected behavior
Expected output
```python
audio_dataset[0]["audio"]
{'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414,
0. , 0. ], dtype=float32),
'path': 'path/to/audio_1',
'sampling_rate': 16000}
```
### Environment info
N/A
I think this is the same issue as https://github.com/huggingface/datasets/issues/4776. Maybe installing `ffmpeg` can fix it:
```python
add-apt-repository -y ppa:savoury1/ffmpeg4
apt-get -qq install -y ffmpeg
```
However, the best solution is to use a newer version of `datasets`. In the recent releases, we've replaced `torchaudio` with `soundfile`, which is easier to install and faster. | [
-0.43105602264404297,
-0.04621385037899017,
-0.00726998969912529,
0.417654424905777,
0.4488195478916168,
-0.18288666009902954,
0.4197095036506653,
0.24208593368530273,
-0.02707613632082939,
0.2821232080459595,
-0.36705154180526733,
0.6166728734970093,
-0.25378915667533875,
-0.06415022164583206,
-0.09114433079957962,
-0.2677417993545532,
-0.09101824462413788,
0.3724948465824127,
-0.01706060767173767,
-0.046664364635944366,
-0.38315266370773315,
0.08291983604431152,
-0.2947545647621155,
0.2627830505371094,
0.08593343943357468,
0.13351158797740936,
0.054587580263614655,
0.3700858950614929,
-0.09062109887599945,
-0.4266248345375061,
0.19851194322109222,
-0.3919597566127777,
0.31751447916030884,
0.7198067307472229,
-0.00011012828326784074,
0.11049791425466537,
0.4451797604560852,
-0.14939641952514648,
-0.2720611095428467,
-0.1868675947189331,
-0.19765102863311768,
0.05435912311077118,
0.05935998260974884,
-0.07336520403623581,
-0.1618790626525879,
-0.37716129422187805,
-0.4143966734409332,
-0.548907458782196,
0.33712249994277954,
0.3922886848449707,
0.20776882767677307,
0.1560438871383667,
-0.12118057161569595,
0.07156635075807571,
0.1207120269536972,
0.028807515278458595,
0.06928878277540207,
0.4590168595314026,
0.4390574097633362,
-0.02502669021487236,
0.14524716138839722,
0.0703972578048706,
-0.3998229503631592,
0.17201203107833862,
-0.24387453496456146,
0.011215288192033768,
-0.12444707751274109,
0.0270237997174263,
0.310608446598053,
0.26030758023262024,
0.8186072707176208,
-0.27678701281547546,
-0.16093967854976654,
0.16274817287921906,
0.04796234890818596,
-0.41205742955207825,
0.13404366374015808,
0.06346040964126587,
-0.1961328387260437,
0.2131582498550415,
-0.0872129574418068,
0.20899750292301178,
0.0131605863571167,
0.23783361911773682,
0.055024564266204834,
0.3522733747959137,
-0.20301403105258942,
0.11553391814231873,
0.15569454431533813,
-0.03809057176113129,
0.11627447605133057,
0.14992718398571014,
-0.07819786667823792,
0.3869726061820984,
-0.2425539195537567,
0.025520607829093933,
-0.04883291572332382,
-0.19854779541492462,
-0.24125508964061737,
-0.14847704768180847,
0.1764875054359436,
0.2784254550933838,
0.08174765110015869,
0.21459560096263885,
0.25010061264038086,
-0.0640014261007309,
-0.007072042673826218,
0.06449658423662186,
0.19490329921245575,
-0.12743012607097626,
-0.04555082693696022,
-0.12055140733718872,
-0.2724156677722931,
-0.1732049286365509,
-0.014350950717926025,
0.06745351850986481,
0.19406437873840332,
-0.263582706451416,
-0.05696143954992294,
0.10906712710857391,
-0.17491552233695984,
-0.05369816720485687,
0.28908050060272217,
0.4367978274822235,
0.16555504500865936,
0.2568109929561615,
0.23596571385860443,
0.3177416920661926,
0.05889858305454254,
0.004547830671072006,
-0.17757663130760193,
0.05414967983961105,
0.15125282108783722,
-0.23738384246826172,
0.1852133572101593,
-0.07877185940742493,
0.28671517968177795,
-0.054217901080846786,
-0.03006991744041443,
-0.21638233959674835,
-0.25263726711273193,
-0.21255992352962494,
-0.04345077648758888,
0.165278822183609,
-0.2130259871482849,
0.08219289779663086,
0.2923678457736969,
0.004320167005062103,
-0.13340610265731812,
0.3253362476825714,
-0.17786170542240143,
-0.33857086300849915,
-0.24767445027828217,
0.23689591884613037,
0.08956912159919739,
0.21825715899467468,
0.07980053871870041,
-0.16013158857822418,
0.3958355784416199,
-0.42867422103881836,
0.03182389587163925,
-0.20600272715091705,
-0.5423332452774048,
0.0069245845079422,
0.23633500933647156,
0.185862198472023,
-0.5780985355377197,
0.09530599415302277,
0.009989209473133087,
0.09347892552614212,
0.2113381177186966,
0.10630209743976593,
-0.24068941175937653,
0.40716496109962463,
-0.2977222204208374,
-0.059821031987667084,
0.777979850769043,
-0.7053413987159729,
-0.23675785958766937,
0.19308578968048096,
-0.25244075059890747,
-0.07369896024465561,
0.0009489916265010834,
-0.047803740948438644,
0.1566961258649826,
-0.008940089493989944,
0.37964004278182983,
0.49079909920692444,
0.24167102575302124,
0.17887204885482788,
-0.2635040879249573,
-0.06157851219177246,
-0.0773773342370987,
0.35562974214553833,
-0.25920137763023376,
0.12793025374412537,
0.01327785849571228,
-0.0311952643096447,
0.3113447427749634,
0.09367005527019501,
-0.048072341829538345,
0.19475790858268738,
0.2455158680677414,
-0.038289979100227356,
-0.0035543590784072876,
-0.29706254601478577,
0.20474043488502502,
-0.016463398933410645,
0.2022089660167694,
0.020653074607253075,
-0.19487681984901428,
0.014996446669101715,
-0.4230727553367615,
0.15438634157180786,
-0.5034205913543701,
0.09101942181587219,
0.14211265742778778,
0.29577094316482544,
0.2007008045911789,
0.21353277564048767,
-0.27633753418922424,
-0.021073918789625168,
-0.15055376291275024,
-0.22709336876869202,
-0.1775544285774231,
0.14284586906433105,
0.0335281640291214,
-0.2073787897825241,
0.12969768047332764,
0.3469946086406708,
0.16953639686107635,
-0.004567988216876984,
-0.3390706777572632,
0.529650866985321,
0.21179620921611786,
0.11150932312011719,
-0.6780556440353394,
-0.1863761991262436,
0.09330272674560547,
-0.17863842844963074,
0.24537037312984467,
0.20443874597549438,
0.42472898960113525,
-0.04745602607727051,
-0.10882523655891418,
0.2167026400566101,
0.09717187285423279,
0.2064700424671173,
-0.0464102067053318,
-0.13850046694278717,
0.3966694474220276,
0.10360415279865265,
0.060516342520713806,
-0.059444114565849304,
0.027462778612971306,
-0.12214472889900208,
0.4591546356678009,
0.009439844638109207,
-0.21693626046180725,
-0.20336312055587769,
0.4464045464992523,
-0.06297296285629272,
-0.003333529457449913,
0.0039516473188996315,
-0.2721112072467804,
-0.03794409707188606,
0.09982707351446152,
0.010291583836078644,
0.4135347008705139,
0.19738852977752686,
-0.08720868825912476,
-0.08512407541275024,
0.11287957429885864,
-0.12105220556259155,
0.12295826524496078,
0.04607623815536499,
0.13452890515327454,
0.4911322593688965,
0.18211491405963898,
-0.06599725782871246,
-0.4239274859428406,
-0.12206949293613434,
0.030983172357082367,
0.4202660024166107,
-0.3780164420604706,
-0.022315580397844315,
-0.39198559522628784,
-0.12256909906864166,
-0.16584937274456024,
-0.33042100071907043,
0.2594698369503021,
-0.10261517763137817,
-0.09206166863441467,
0.2903534471988678,
-0.25580647587776184,
0.2351938933134079,
-0.0782243013381958,
0.0714101791381836,
0.21736697852611542,
-0.45452451705932617,
-0.04219253361225128,
-0.05285374075174332,
-0.3266993761062622,
0.07811011373996735,
0.33052775263786316,
0.25620269775390625,
0.08500099927186966,
-0.026659902185201645,
-0.09610725939273834,
0.24231842160224915,
0.1388680636882782,
0.03376374393701553,
0.23967134952545166,
0.10985226184129715,
-0.168467178940773,
0.11173366010189056,
-0.027272608131170273,
-0.5124857425689697,
0.3938932418823242,
-0.08818434178829193,
-0.1872171312570572,
0.3798074722290039,
0.17963655292987823,
0.13926413655281067,
-0.14734697341918945,
-0.33098897337913513,
-0.35853251814842224,
-0.5563808679580688,
0.18014943599700928,
-0.00277874618768692,
0.22128868103027344,
0.06944672763347626,
0.18668730556964874,
0.20121510326862335,
0.2047104388475418,
0.23189203441143036,
-0.2746641933917999,
-0.0649259090423584,
0.12414444237947464,
-0.1508578211069107,
-0.11409738659858704,
-0.37662458419799805,
-0.01983765885233879,
0.3121238350868225,
-0.04811535030603409,
-0.27663615345954895,
-0.15826043486595154,
-0.015198304317891598,
-0.19963021576404572,
-0.14752079546451569,
-0.009180527180433273,
0.29888612031936646,
0.12206126749515533,
-0.048690345138311386,
0.04152703285217285,
-0.041638728231191635,
-0.05953449010848999,
0.10351849347352982,
-0.19210191071033478,
0.30080848932266235,
0.6851964592933655,
-0.36166608333587646,
0.09069201350212097,
-0.09080594778060913,
-0.09978480637073517,
0.3524855673313141,
-0.2097637802362442,
0.27901625633239746,
-0.48377180099487305,
-0.24266326427459717,
-0.10330861061811447,
0.23860329389572144,
-0.28139716386795044,
0.19853858649730682,
0.039400387555360794,
-0.23961575329303741,
-0.32475724816322327,
0.004031062126159668,
-0.29565346240997314,
-0.029522623866796494,
0.08070416748523712,
-0.06639052927494049,
-0.044377803802490234,
-0.21154659986495972,
0.25747859477996826,
0.257352739572525,
0.1347096562385559,
0.1213083416223526,
-0.047514017671346664,
0.00765257328748703,
-0.21732358634471893,
-0.5016999244689941,
-0.15804186463356018,
0.02462945692241192,
0.21433088183403015,
0.15866844356060028,
1.0118287801742554,
-0.12915852665901184,
-0.2509196996688843,
0.0420430488884449,
-0.04498739913105965,
0.2698608934879303,
-0.05870571732521057,
0.29528579115867615,
0.42473965883255005,
0.1431543380022049,
-0.1651182323694229,
-0.047191157937049866,
-0.12254101783037186,
-0.02230408415198326,
-0.21152807772159576,
0.4743500053882599,
0.10558518767356873,
-0.17387741804122925,
0.21234795451164246,
0.4090319871902466,
-0.04087412729859352,
-0.172050341963768,
-0.2969178855419159,
-0.25882217288017273,
-0.3582579493522644,
0.1689784973859787,
-0.019283059984445572,
0.4400784969329834,
0.12496680021286011,
-0.04647047445178032,
0.09350030869245529,
-0.10165930539369583,
0.08606613427400589,
0.02728406712412834,
0.29546722769737244,
0.07785415649414062,
0.2291916161775589,
-0.07039527595043182,
-0.12648366391658783,
-0.00802060030400753,
0.4994685649871826,
-0.07477674633264542,
-0.1869741976261139,
0.23002783954143524,
-0.09081123769283295,
0.2639458179473877,
0.1754358857870102,
-0.04526296630501747,
0.006523501127958298,
-0.13604708015918732,
-0.015138126909732819,
-0.23730221390724182,
-0.02757601998746395,
0.18297788500785828,
-0.04955248534679413,
-0.12287243455648422,
-0.3981170654296875,
0.41953185200691223,
-0.11554352194070816,
0.0007593631744384766,
0.4406266212463379,
-0.1268286257982254,
-0.007756661623716354,
0.6022304892539978,
-0.197322279214859,
0.7704953551292419,
-0.013293435797095299,
0.010106753557920456,
0.5773736238479614,
-0.35252147912979126,
-0.12566439807415009,
-0.008896902203559875,
-0.0020845867693424225,
-0.1298925131559372,
0.06602565944194794,
0.08490491658449173,
-0.10569754242897034,
-0.015274599194526672,
0.09619492292404175,
-0.09858743846416473,
0.0435931421816349,
-0.37411463260650635,
0.34023958444595337,
-0.04977922886610031,
0.10296615958213806,
0.14729085564613342,
-0.21926788985729218,
-0.47591376304626465,
0.14007729291915894,
-0.04666546359658241,
0.02189328521490097,
-0.018696650862693787,
-0.046599775552749634,
0.026027977466583252,
-0.2739095687866211,
0.014583706855773926,
0.2154042273759842,
-0.12623560428619385,
0.0770515650510788,
-0.13820350170135498,
-0.5807734727859497,
-0.08516699075698853,
0.23521162569522858,
-0.13014185428619385,
0.35400089621543884,
-0.161158949136734,
-0.011107193306088448,
0.146819606423378,
0.24941906332969666,
-0.047207292169332504,
0.1290939301252365,
-0.023715835064649582,
0.04725345969200134,
-0.16555024683475494,
0.29203668236732483,
-0.016138073056936264,
-0.31754153966903687,
0.4960470497608185,
0.1718880981206894,
0.23590849339962006,
-0.24451488256454468,
-0.4632083475589752,
-0.10398697108030319,
0.18092839419841766,
-0.12683069705963135,
0.1977180540561676,
-0.0997559130191803,
-0.34868547320365906,
0.06420981884002686,
-0.013695843517780304,
-0.2843171954154968,
0.09369255602359772,
0.5871789455413818,
0.20871704816818237,
0.07580727338790894,
0.5467709898948669,
0.12959866225719452,
-0.11623521894216537,
-0.29438167810440063,
0.04872812330722809,
0.09119932353496552,
-0.2808220684528351,
-0.13116884231567383,
0.20424503087997437,
-0.1085851788520813,
-0.006786607205867767,
-0.07136107981204987,
-0.14624910056591034,
-0.03041251003742218,
-0.1879088431596756,
-0.45242995023727417,
-0.5475255846977234,
0.300708532333374,
0.18769508600234985,
0.12335747480392456,
-0.0552046000957489,
0.18747156858444214,
-0.1890203356742859,
-0.0979996994137764,
-0.33903926610946655,
0.08988091349601746,
-0.20513257384300232,
0.11888835579156876,
0.0783991813659668,
0.04173329100012779,
0.1922992318868637,
-0.017901983112096786,
0.23902863264083862,
0.1641259491443634,
-0.14523306488990784,
-0.20245778560638428,
0.17400053143501282,
0.12587645649909973,
0.02582336589694023,
-0.21415390074253082,
-0.3198375701904297,
-0.39663031697273254,
-0.14861972630023956,
-0.07711812108755112,
-0.07426583021879196,
0.322637677192688,
-0.20515675842761993,
-0.09608334302902222,
0.10462663322687149,
0.17940117418766022,
0.09250664710998535,
0.155964657664299,
-0.3433341681957245,
-0.2672949433326721,
0.013603981584310532,
0.07880102097988129,
-0.03827095404267311,
-0.10496336221694946,
-0.017955001443624496,
0.07082696259021759,
0.05669338256120682,
-0.1825963258743286,
0.39957669377326965,
-0.28941044211387634,
0.08356834948062897,
0.0703515112400055,
0.28020012378692627,
0.2687193751335144,
-0.31606391072273254,
-0.11219663172960281,
0.29944074153900146,
0.21199117600917816,
-0.23915894329547882,
-0.2797117829322815,
-0.11559926718473434,
-0.21821686625480652,
-0.03443530201911926,
0.2262309044599533,
0.02744385600090027,
-0.3839786648750305,
0.01052396185696125,
0.04935456067323685,
0.528693675994873,
-0.05215267837047577,
-0.11270155757665634,
0.5190434455871582,
-0.22434352338314056,
-0.029559843242168427,
-0.014609720557928085,
0.14924009144306183,
0.185413658618927,
0.2792894244194031,
-0.4530269503593445,
-0.18875911831855774,
0.04776375740766525,
0.02588786743581295,
-0.1387338936328888,
-0.5190229415893555,
0.013398643583059311,
0.28033125400543213,
-0.08671899139881134,
-0.1189352497458458,
-0.038796935230493546,
0.12214483320713043,
-0.23797845840454102,
0.050200462341308594,
-0.021823693066835403,
-0.11367723345756531,
-0.13389019668102264,
0.14270341396331787,
-0.18161553144454956,
-0.12267428636550903,
-0.11364808678627014,
-0.023535504937171936,
0.04071195051074028,
0.23120790719985962,
-0.1639360785484314,
-0.16583722829818726,
0.0430665984749794,
0.10543721169233322,
-0.24925793707370758,
0.3175181448459625,
-0.17098313570022583,
-0.4465700685977936,
0.3814852833747864,
0.27366673946380615,
0.20239153504371643,
0.23022843897342682,
-0.0326845720410347,
0.33096539974212646,
0.4028680920600891,
-0.10223619639873505,
0.12028679251670837,
-0.053185854107141495,
-0.15940526127815247,
0.03410162031650543,
0.3188708424568176,
-0.009243831038475037,
0.28696388006210327,
0.31668975949287415,
0.2557130455970764,
-0.13198229670524597,
0.04979697987437248,
0.18794375658035278,
0.20461928844451904,
-0.15963433682918549,
0.07476913928985596,
-0.10074849426746368,
-0.21026477217674255,
-0.015056470409035683,
-0.2135024070739746,
-0.2982074022293091,
-0.06684845685958862,
0.3258216381072998,
0.2052667886018753,
0.3248811662197113,
0.0999850481748581,
0.08745455741882324,
-0.09271804988384247,
0.15914830565452576,
0.3260866105556488,
-0.005724898539483547,
-0.1474238485097885,
-0.32613351941108704,
-0.5503901243209839,
0.2048412412405014,
0.04056911543011665,
-0.08492051064968109,
0.035839732736349106,
-0.06596265733242035,
0.4674053490161896,
0.22825869917869568,
-0.17994803190231323,
0.04077932611107826,
-0.14751234650611877,
0.05206027626991272,
-0.21039022505283356,
-0.2956491708755493,
-0.18590541183948517,
0.28499966859817505,
-0.12736904621124268,
-0.7309272289276123,
0.009174578823149204,
-0.13035234808921814,
0.11400071531534195,
-0.14827881753444672,
-0.12934477627277374,
-0.338121235370636,
-0.1245385929942131,
0.20522817969322205,
-0.06846609711647034,
0.22848856449127197,
-0.2502257227897644,
0.19761845469474792,
0.11008492857217789,
-0.11006665974855423,
0.021115805953741074,
0.11272487044334412,
0.024767007678747177,
0.37453317642211914,
0.06186459958553314,
0.22380346059799194,
-0.3705221712589264,
0.21370887756347656,
-0.2222822904586792,
0.15458786487579346,
-0.27553826570510864,
-0.00565439835190773,
-0.09860560297966003,
0.00003248453140258789,
0.016157284379005432,
-0.26866114139556885,
-0.011148117482662201,
0.08863625675439835,
-0.32200944423675537,
-0.2307233363389969,
0.7525492906570435,
-0.1374177783727646,
-0.21351012587547302,
0.0736154168844223,
0.2673860192298889,
-0.1147838607430458,
0.19925326108932495,
-0.42342913150787354,
0.2710135877132416,
0.32752883434295654,
-0.12192674726247787,
-0.14735540747642517,
0.2093283236026764,
-0.1981901079416275,
-0.023129329085350037,
-0.10039784014225006,
0.04456297308206558,
0.1043088361620903,
0.05279179662466049,
-0.2067435383796692,
-0.37986820936203003
] |
https://github.com/huggingface/datasets/issues/6238 | `filter` treats the function's output as a (selection) mask - `True` keeps the sample, and `False` drops it. In your case, `bool(0)` evaluates to `False`, so dropping the first sample is the correct behavior. | `dataset.filter` ALWAYS removes the first item from the dataset when using batched=True | ### Describe the bug
If you call batched=True when calling `filter`, the first item is _always_ filtered out, regardless of the filter condition.
### Steps to reproduce the bug
Here's a minimal example:
```python
def filter_batch_always_true(batch, indices):
print("First index being passed into this filter function: ", indices[0])
return indices # Keep all indices
data = {"value": list(range(10))}
dataset = Dataset.from_dict(data)
filtered_dataset = dataset.filter(filter_batch_always_true, with_indices=True, batched=True)
print("Length of original dataset: ", len(dataset))
print("Length of filtered_dataset: ", len(filtered_dataset))
print("Is equal to original? ", len(filtered_dataset) == len(dataset))
print("First item of filtered dataset: ", filtered_dataset[0])
print("Last item of filtered dataset: ", filtered_dataset[-1])
```
prints:
```
First index being passed into this filter function: 0
Length of original dataset: 10
Length of filtered_dataset: 9
Is equal to original? False
First item of filtered dataset: {'value': 1}
Last item of filtered dataset: {'value': 9}
```
### Expected behavior
Filter should respect the filter condition.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.5-arm64-arm-64bit
- Python version: 3.9.18
- Huggingface_hub version: 0.17.1
- PyArrow version: 10.0.1
- Pandas version: 2.0.2
| 34 | `dataset.filter` ALWAYS removes the first item from the dataset when using batched=True
### Describe the bug
If you call batched=True when calling `filter`, the first item is _always_ filtered out, regardless of the filter condition.
### Steps to reproduce the bug
Here's a minimal example:
```python
def filter_batch_always_true(batch, indices):
print("First index being passed into this filter function: ", indices[0])
return indices # Keep all indices
data = {"value": list(range(10))}
dataset = Dataset.from_dict(data)
filtered_dataset = dataset.filter(filter_batch_always_true, with_indices=True, batched=True)
print("Length of original dataset: ", len(dataset))
print("Length of filtered_dataset: ", len(filtered_dataset))
print("Is equal to original? ", len(filtered_dataset) == len(dataset))
print("First item of filtered dataset: ", filtered_dataset[0])
print("Last item of filtered dataset: ", filtered_dataset[-1])
```
prints:
```
First index being passed into this filter function: 0
Length of original dataset: 10
Length of filtered_dataset: 9
Is equal to original? False
First item of filtered dataset: {'value': 1}
Last item of filtered dataset: {'value': 9}
```
### Expected behavior
Filter should respect the filter condition.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.5-arm64-arm-64bit
- Python version: 3.9.18
- Huggingface_hub version: 0.17.1
- PyArrow version: 10.0.1
- Pandas version: 2.0.2
`filter` treats the function's output as a (selection) mask - `True` keeps the sample, and `False` drops it. In your case, `bool(0)` evaluates to `False`, so dropping the first sample is the correct behavior. | [
-0.24889422953128815,
-0.23401862382888794,
-0.17137563228607178,
-0.16107843816280365,
-0.19181180000305176,
-0.058566316962242126,
0.37126728892326355,
0.14128737151622772,
0.08032993972301483,
0.0980878621339798,
0.05337975174188614,
0.37346380949020386,
0.03651496767997742,
0.2761378884315491,
-0.2480054795742035,
0.18763452768325806,
0.10086792707443237,
0.23912782967090607,
-0.014079775661230087,
-0.21152856945991516,
-0.22336846590042114,
0.06908831745386124,
-0.6098193526268005,
-0.06732437014579773,
0.14530056715011597,
-0.12211229652166367,
0.08609353005886078,
0.06597965210676193,
0.1656590849161148,
-0.30716317892074585,
0.3066212236881256,
0.12884634733200073,
-0.04541899263858795,
0.3314732313156128,
-0.000107955900602974,
-0.1954593062400818,
0.2500598132610321,
0.017284981906414032,
-0.3706717789173126,
-0.3347909450531006,
-0.26458117365837097,
-0.13927224278450012,
0.03467915207147598,
-0.056253425776958466,
-0.06342841684818268,
-0.10719195753335953,
-0.21089862287044525,
-0.18615341186523438,
0.2672824263572693,
0.19038403034210205,
0.24486228823661804,
0.12244656682014465,
-0.18884292244911194,
0.16535113751888275,
0.20388704538345337,
0.2918204069137573,
-0.010426122695207596,
0.0755743533372879,
0.3001244366168976,
-0.1902197003364563,
0.06083488464355469,
0.36709198355674744,
-0.3151409924030304,
0.1357642412185669,
-0.03534616902470589,
0.002496737986803055,
0.20892828702926636,
-0.41153085231781006,
0.11504543572664261,
0.13596519827842712,
0.12997737526893616,
-0.2136247456073761,
-0.4212331771850586,
-0.49710866808891296,
-0.11033788323402405,
-0.25596433877944946,
-0.1371786892414093,
0.027264423668384552,
-0.2759757339954376,
0.09116814285516739,
-0.2643599212169647,
0.12654805183410645,
0.05703303962945938,
0.1852838695049286,
-0.14966093003749847,
0.5681257843971252,
-0.04132726415991783,
0.0851038321852684,
-0.05292747542262077,
-0.11652281880378723,
0.31788307428359985,
-0.41198253631591797,
0.07063554227352142,
0.2639164626598358,
-0.16691523790359497,
-0.03631976619362831,
0.2431163340806961,
0.12211038172245026,
0.06546258926391602,
0.043046798557043076,
-0.22560852766036987,
0.057554423809051514,
0.12980344891548157,
0.18757981061935425,
0.34484541416168213,
0.21036547422409058,
0.24983222782611847,
0.3231707215309143,
0.0771234929561615,
0.06911017000675201,
-0.028071336448192596,
0.12395321577787399,
0.5319718718528748,
0.08205176144838333,
0.22455903887748718,
-0.07672210037708282,
0.23139682412147522,
-0.04563498869538307,
-0.6318860054016113,
0.027272842824459076,
-0.42930495738983154,
-0.031084906309843063,
0.11625495553016663,
0.13951486349105835,
0.020437922328710556,
0.04531820863485336,
-0.031445469707250595,
0.03277618810534477,
-0.26558905839920044,
0.11361132562160492,
-0.2292567640542984,
-0.2388717383146286,
-0.06801451742649078,
-0.24750331044197083,
0.16073869168758392,
-0.4622919261455536,
0.38675203919410706,
0.19954362511634827,
-0.12116869539022446,
0.05485600233078003,
0.10792531818151474,
-0.1018495261669159,
0.4732566177845001,
0.4403570890426636,
-0.05389781296253204,
0.26908034086227417,
0.3086734712123871,
-0.1367894560098648,
-0.031062282621860504,
0.43801426887512207,
-0.32073840498924255,
0.07705090939998627,
0.3636794090270996,
0.2797362208366394,
-0.1826861947774887,
-0.048490289598703384,
-0.302558034658432,
0.31553521752357483,
0.13838161528110504,
0.03669385612010956,
0.0457468144595623,
-0.41000449657440186,
-0.2753738760948181,
-0.277189701795578,
0.2479056715965271,
0.34305042028427124,
-0.7282322645187378,
-0.07487370073795319,
-0.23890498280525208,
-0.09161803126335144,
0.15545886754989624,
-0.00520856911316514,
-0.17381203174591064,
0.26728495955467224,
-0.19566121697425842,
0.07870805263519287,
0.08762887120246887,
-0.35133111476898193,
-0.42120933532714844,
0.27344831824302673,
-0.09735500812530518,
0.5842276215553284,
-0.3195956349372864,
0.03940610587596893,
0.37244918942451477,
-0.16764862835407257,
0.05856522172689438,
0.43317633867263794,
-0.250387042760849,
0.03521893173456192,
-0.15692764520645142,
0.10101734101772308,
0.16020365059375763,
-0.033541031181812286,
0.00899652112275362,
0.17501947283744812,
0.03181585669517517,
-0.37750884890556335,
0.43447786569595337,
0.23392491042613983,
0.14866873621940613,
-0.0004824558272957802,
0.4740329682826996,
0.012113826349377632,
0.2709709703922272,
-0.17970684170722961,
-0.12081509828567505,
0.10541588813066483,
-0.07044991105794907,
-0.35954970121383667,
-0.2018154114484787,
-0.24280217289924622,
-0.09019914269447327,
0.14295527338981628,
-0.26839303970336914,
-0.15662896633148193,
0.12718504667282104,
0.016907047480344772,
-0.011030666530132294,
-0.1252189576625824,
-0.17748123407363892,
0.3348158597946167,
0.009798049926757812,
0.08073754608631134,
-0.103130042552948,
0.0030119717121124268,
0.048654280602931976,
-0.14981819689273834,
-0.0876040831208229,
0.007356753572821617,
0.1993461698293686,
0.046885982155799866,
-0.10959047079086304,
0.4528111219406128,
0.1589166522026062,
-0.27808699011802673,
-0.22913973033428192,
-0.35577842593193054,
0.12007779628038406,
0.017956063151359558,
-0.19319778680801392,
0.43212348222732544,
0.16274888813495636,
0.015416018664836884,
-0.37710466980934143,
0.49204981327056885,
-0.10359296202659607,
0.3054957687854767,
-0.10839573293924332,
-0.053758349269628525,
0.18305668234825134,
-0.004422999918460846,
-0.2933816611766815,
-0.4250050485134125,
-0.005279830656945705,
-0.1713944524526596,
-0.008404947817325592,
-0.02835271880030632,
-0.21698075532913208,
0.2783685624599457,
0.17592230439186096,
-0.10915018618106842,
-0.10144628584384918,
0.08763927221298218,
0.0362699069082737,
-0.08542931824922562,
0.23152877390384674,
0.21019375324249268,
0.37815165519714355,
0.3145725429058075,
-0.04377344623208046,
-0.12471488118171692,
0.071062371134758,
-0.20537352561950684,
0.05931956321001053,
0.24057313799858093,
-0.02768879011273384,
-0.016243571415543556,
0.2297234684228897,
-0.05326037108898163,
-0.13977739214897156,
-0.09366369247436523,
-0.14486372470855713,
0.08427243679761887,
-0.25544875860214233,
0.11770382523536682,
-0.15865494310855865,
-0.2628074586391449,
0.02892480418086052,
-0.2363649606704712,
0.1153671145439148,
-0.2769245207309723,
0.18847423791885376,
0.460145503282547,
-0.16582512855529785,
0.1371368169784546,
-0.030072491616010666,
0.2820846438407898,
0.06902483105659485,
-0.23528672754764557,
-0.18725240230560303,
0.13445712625980377,
-0.4587191939353943,
0.1840103268623352,
-0.1567327231168747,
0.20633426308631897,
0.2525016665458679,
0.2617962956428528,
-0.18585701286792755,
-0.07031166553497314,
-0.12636172771453857,
-0.06346789747476578,
-0.18492354452610016,
0.5481075048446655,
-0.00125214084982872,
0.1432819664478302,
-0.3602161705493927,
-0.0462290421128273,
-0.044325921684503555,
-0.0269196517765522,
-0.16394032537937164,
-0.1173480749130249,
0.10934498906135559,
-0.04876965284347534,
-0.26098954677581787,
-0.050405651330947876,
-0.1850317269563675,
-0.13459649682044983,
-0.3715202212333679,
-0.014248430728912354,
0.11368537694215775,
0.27570024132728577,
0.06867262721061707,
-0.20416051149368286,
-0.14795279502868652,
-0.07800780236721039,
-0.16830888390541077,
-0.3051822781562805,
0.0019361581653356552,
-0.06606265157461166,
-0.2095119208097458,
-0.21747583150863647,
-0.23344595730304718,
-0.2407684326171875,
0.2586956024169922,
-0.2974233627319336,
-0.11955153942108154,
-0.09684145450592041,
0.011653721332550049,
0.14294041693210602,
0.23161983489990234,
0.16093039512634277,
-0.08480300009250641,
-0.04151594266295433,
-0.2933851480484009,
-0.15079833567142487,
0.09109379351139069,
-0.15852084755897522,
0.29839569330215454,
0.19269990921020508,
0.3946687877178192,
0.14570865035057068,
0.5499653220176697,
0.3783032298088074,
0.23492074012756348,
0.16811519861221313,
0.15960048139095306,
0.28306999802589417,
-0.088290274143219,
-0.44411036372184753,
-0.17322991788387299,
0.19523361325263977,
-0.036508891731500626,
0.25803396105766296,
0.08561322093009949,
-0.09292663633823395,
0.0772615298628807,
-0.036725446581840515,
-0.45884042978286743,
-0.13101567327976227,
-0.032839950174093246,
-0.21576346457004547,
0.08218537271022797,
0.20351913571357727,
0.14406733214855194,
-0.04189161956310272,
-0.07187929004430771,
-0.3569279611110687,
0.007386047393083572,
0.2552618086338043,
0.022684797644615173,
-0.06503689289093018,
-0.21863549947738647,
-0.2834621071815491,
0.06090552732348442,
0.14727121591567993,
0.38116592168807983,
0.10560014843940735,
-0.03167885169386864,
0.13299469649791718,
0.05491885542869568,
0.8271779417991638,
-0.07669505476951599,
0.13183487951755524,
0.17996986210346222,
-0.08316770941019058,
-0.40322208404541016,
-0.18382571637630463,
-0.23209279775619507,
0.2332509458065033,
0.3280235230922699,
0.24460509419441223,
-0.061215922236442566,
-0.21476143598556519,
-0.0016143880784511566,
0.046142444014549255,
-0.046205442398786545,
-0.254277765750885,
-0.33238279819488525,
-0.18744578957557678,
-0.09917665272951126,
0.3154143989086151,
0.02437460422515869,
0.21828798949718475,
0.06987696141004562,
-0.3263801336288452,
-0.012127777561545372,
-0.30888015031814575,
0.0701950415968895,
0.13283219933509827,
0.16702449321746826,
0.10529239475727081,
0.15786154568195343,
-0.0568905808031559,
-0.09182102978229523,
0.14093022048473358,
0.19539764523506165,
-0.12278355658054352,
0.01909291371703148,
-0.2154535949230194,
-0.10319258272647858,
0.12829160690307617,
0.22273021936416626,
-0.2387302666902542,
0.10279078781604767,
-0.18978576362133026,
0.11011472344398499,
0.16955536603927612,
-0.15493783354759216,
0.03381625562906265,
0.012614939361810684,
-0.5012175440788269,
-0.40349721908569336,
0.38768962025642395,
-0.040312759578228,
-0.18869587779045105,
0.5253742933273315,
0.16479991376399994,
-0.284343957901001,
0.5282899737358093,
-0.07586228102445602,
0.5236668586730957,
0.3324109613895416,
-0.10603559017181396,
0.2802216410636902,
0.16834667325019836,
0.1396818608045578,
0.43324753642082214,
0.264507532119751,
-0.11519899219274521,
-0.06027824431657791,
0.06720462441444397,
-0.05265636369585991,
0.08121713995933533,
0.06931065768003464,
-0.05797269195318222,
0.257575660943985,
-0.3527909219264984,
0.19100002944469452,
-0.008806290104985237,
0.0507541298866272,
0.27141937613487244,
-0.07864461839199066,
-0.04103368520736694,
0.17031854391098022,
0.26232823729515076,
0.30651792883872986,
-0.04647285118699074,
0.010440126061439514,
0.08141833543777466,
-0.21939781308174133,
-0.03363741189241409,
-0.060500722378492355,
-0.14832037687301636,
0.029470469802618027,
0.15378277003765106,
-0.4034408628940582,
-0.16394901275634766,
-0.15261590480804443,
0.11920641362667084,
0.0992373526096344,
0.0755416676402092,
0.07547857612371445,
0.4938719570636749,
0.5220209956169128,
0.08849320560693741,
-0.2908521294593811,
0.47004953026771545,
0.08033964037895203,
-0.15636327862739563,
-0.03479032218456268,
0.03715145215392113,
-0.19399544596672058,
-0.1312175691127777,
0.32843470573425293,
-0.03614117577672005,
-0.26848700642585754,
-0.1413051337003708,
-0.04302480071783066,
0.34179016947746277,
-0.27650344371795654,
0.15806975960731506,
0.06361404061317444,
-0.008649591356515884,
0.6373588442802429,
-0.15662208199501038,
-0.2525533139705658,
-0.261542946100235,
0.2281813621520996,
0.20349931716918945,
0.07021202892065048,
0.3152417242527008,
-0.09083722531795502,
-0.20503991842269897,
-0.11876021325588226,
0.023346930742263794,
0.2232314646244049,
0.19430792331695557,
0.462062269449234,
-0.06202167645096779,
0.18623757362365723,
0.3372664153575897,
0.23825563490390778,
-0.1828514039516449,
0.03979902341961861,
-0.3138520121574402,
-0.3900842070579529,
-0.006611291319131851,
-0.046062298119068146,
0.2118842750787735,
0.10031512379646301,
0.02330625057220459,
0.25543010234832764,
0.1152508333325386,
0.13061903417110443,
-0.3760187029838562,
-0.13029927015304565,
0.1825428605079651,
0.28704118728637695,
-0.23741024732589722,
0.43197643756866455,
0.03742769733071327,
0.017854444682598114,
0.08635076880455017,
0.045999933034181595,
-0.06229257583618164,
-0.34272995591163635,
-0.1257696896791458,
0.062059931457042694,
0.05739744007587433,
-0.3282439112663269,
0.0023762844502925873,
-0.1561717540025711,
-0.0276250671595335,
-0.17724183201789856,
0.2393205314874649,
0.19601941108703613,
0.10626555234193802,
-0.12165209650993347,
0.1326526701450348,
0.04489371180534363,
0.26380738615989685,
-0.020960083231329918,
-0.35145267844200134,
-0.3841625452041626,
0.1658349633216858,
0.33386528491973877,
0.04195613041520119,
0.05743104964494705,
-0.1955849677324295,
-0.15488193929195404,
-0.19046799838542938,
0.16786743700504303,
0.06857709586620331,
-0.31734025478363037,
-0.04234723001718521,
0.18026545643806458,
0.5173435807228088,
0.06776397675275803,
0.008485082536935806,
-0.055484287440776825,
0.08443526923656464,
0.28875917196273804,
-0.3749617636203766,
-0.05313500389456749,
0.07567816227674484,
0.15674975514411926,
0.17650488018989563,
0.15336564183235168,
-0.1314912885427475,
-0.02476697415113449,
0.17267972230911255,
0.062208689749240875,
0.5118107199668884,
-0.034459542483091354,
0.18599918484687805,
0.40278831124305725,
0.06277398765087128,
0.12396106123924255,
0.3341451585292816,
0.14698204398155212,
-0.0771121084690094,
0.7314276099205017,
0.1031036451458931,
0.4863993525505066,
0.23666086792945862,
-0.00021948572248220444,
-0.2040204405784607,
-0.5224802494049072,
0.14114777743816376,
0.18053637444972992,
-0.5321521759033203,
0.11559197306632996,
0.26281988620758057,
-0.22566494345664978,
-0.1311016082763672,
-0.4015401303768158,
0.14201880991458893,
0.19608503580093384,
-0.16048771142959595,
-0.12461327016353607,
-0.2595081925392151,
-0.14465992152690887,
0.35143372416496277,
-0.10306541621685028,
0.10851407051086426,
-0.34881389141082764,
0.006784539669752121,
-0.10396291315555573,
-0.20315033197402954,
-0.4082777798175812,
-0.33773842453956604,
-0.0688687264919281,
0.06935197860002518,
-0.06841224431991577,
-0.06511874496936798,
-0.12201331555843353,
0.17919792234897614,
0.08704854547977448,
0.04304247349500656,
0.27826306223869324,
0.3544768691062927,
0.16604483127593994,
-0.023361947387456894,
-0.19579456746578217,
-0.24561552703380585,
-0.21630915999412537,
0.16124877333641052,
-0.06360028684139252,
0.16773028671741486,
0.18588462471961975,
0.2943343222141266,
-0.1875593066215515,
0.23203831911087036,
0.4462937116622925,
-0.03292791545391083,
-0.5417749881744385,
0.17894680798053741,
0.026958581060171127,
0.15159854292869568,
-0.29396721720695496,
-0.15026584267616272,
-0.02230887860059738,
0.15727782249450684,
0.42713746428489685,
-0.11471215635538101,
0.21844041347503662,
-0.04773946851491928,
0.13403195142745972,
0.025651998817920685,
-0.2651049494743347,
0.22171980142593384,
0.07272664457559586,
-0.31826502084732056,
0.09886729717254639,
-0.5415880680084229,
-0.13883697986602783,
-0.27672475576400757,
0.10972035676240921,
0.09238044917583466,
0.30062365531921387,
-0.2372274100780487,
0.005122309550642967,
-0.03865364193916321,
0.24862761795520782,
-0.01907409355044365,
0.14475664496421814,
0.05899310111999512,
0.004398338031023741,
-0.4690631926059723,
0.13160812854766846,
-0.012943156063556671,
-0.2867316007614136,
0.2780015468597412,
-0.376638263463974,
0.18886256217956543,
-0.029248643666505814,
-0.06247881427407265,
0.39925894141197205,
-0.12396617978811264,
0.15578274428844452,
0.2245793342590332,
-0.0192982517182827,
0.027017660439014435,
0.21691220998764038,
-0.3537023365497589,
0.1748160421848297,
-0.5481023192405701,
-0.16472351551055908,
-0.04219651222229004,
0.436287522315979,
-0.05440163239836693,
-0.25890257954597473,
-0.003277864307165146,
0.15835992991924286,
0.20392897725105286,
0.03478856757283211,
-0.08519052714109421,
0.12093539535999298,
-0.04098932445049286,
0.141749769449234,
-0.19922278821468353,
0.19804087281227112,
-0.0677240863442421,
0.2648864984512329,
-0.4582960605621338,
-0.41253021359443665,
0.42767345905303955,
-0.9023492932319641,
-0.3148154616355896,
-0.4800780415534973,
0.2379656434059143,
0.08368755877017975,
-0.2632657289505005,
-0.009113028645515442,
-0.10555042326450348,
0.4054349958896637,
-0.26401400566101074,
-0.0671863704919815,
0.15396204590797424,
-0.005946807563304901,
0.2801400125026703,
-0.08854269236326218,
-0.11947228014469147,
0.49561962485313416,
-0.29219627380371094,
0.3800337612628937,
-0.21572479605674744
] |
https://github.com/huggingface/datasets/issues/6237 | [This](https://huggingface.co/docs/datasets/nlp_process#map) is the most performant way to tokenize a dataset (`batched=True, num_proc=None, return_tensors="np"`)
If`tokenizer.is_fast` returns `True`, `num_proc` must be `None/1` to benefit from the fast tokenizers' parallelism (the fast tokenizers are implemented in Rust, and Rust multi-threading doesn't work well with Python multi-processing) | Tokenization with multiple workers is too slow | I am trying to tokenize a few million documents with multiple workers but the tokenization process is taking forever.
Code snippet:
```
raw_datasets.map(
encode_function,
batched=False,
num_proc=args.preprocessing_num_workers,
load_from_cache_file=not args.overwrite_cache,
remove_columns=[name for name in raw_datasets["train"].column_names if name not in ["input_ids", "labels", "attention_mask"]],
desc="Tokenizing data",
)
```
Details:
```
transformers==4.28.0.dev0
datasets==4.28.0.dev0
preprocessing_num_workers==48
```
tokenizer == decapoda-research/llama-7b-hf
| 43 | Tokenization with multiple workers is too slow
I am trying to tokenize a few million documents with multiple workers but the tokenization process is taking forever.
Code snippet:
```
raw_datasets.map(
encode_function,
batched=False,
num_proc=args.preprocessing_num_workers,
load_from_cache_file=not args.overwrite_cache,
remove_columns=[name for name in raw_datasets["train"].column_names if name not in ["input_ids", "labels", "attention_mask"]],
desc="Tokenizing data",
)
```
Details:
```
transformers==4.28.0.dev0
datasets==4.28.0.dev0
preprocessing_num_workers==48
```
tokenizer == decapoda-research/llama-7b-hf
[This](https://huggingface.co/docs/datasets/nlp_process#map) is the most performant way to tokenize a dataset (`batched=True, num_proc=None, return_tensors="np"`)
If`tokenizer.is_fast` returns `True`, `num_proc` must be `None/1` to benefit from the fast tokenizers' parallelism (the fast tokenizers are implemented in Rust, and Rust multi-threading doesn't work well with Python multi-processing) | [
-0.2808173894882202,
0.08872613310813904,
-0.14150390028953552,
-0.0760219395160675,
-0.20636089146137238,
-0.18386691808700562,
0.5079349875450134,
0.36032289266586304,
-0.09700481593608856,
0.15296486020088196,
0.1711222231388092,
0.19517117738723755,
-0.0392419770359993,
-0.24972690641880035,
-0.22024832665920258,
0.07424506545066833,
0.16092075407505035,
0.2093452364206314,
0.36630165576934814,
0.033866576850414276,
-0.03577291965484619,
-0.18352621793746948,
-0.12155164778232574,
0.03140131011605263,
-0.6242526769638062,
-0.22251076996326447,
-0.10834959149360657,
-0.31678321957588196,
-0.04661692678928375,
-0.04747750237584114,
-0.25844019651412964,
0.5239761471748352,
0.12524008750915527,
0.409090131521225,
-0.00010903937072725967,
-0.1431725025177002,
-0.03721442073583603,
0.3216378688812256,
0.08644039928913116,
0.06397393345832825,
0.3225659430027008,
-0.5720373392105103,
-0.1673119217157364,
-0.19881273806095123,
0.12378759682178497,
-0.18419498205184937,
0.359954833984375,
0.19199582934379578,
0.3593953847885132,
-0.09874196350574493,
0.1661321371793747,
0.28107649087905884,
-0.028773069381713867,
0.4907812476158142,
-0.30193814635276794,
-0.031954992562532425,
-0.003259234130382538,
-0.15751396119594574,
0.1770438402891159,
-0.31902948021888733,
-0.08373604714870453,
0.38053077459335327,
-0.3072070777416229,
0.10744474828243256,
0.004253873601555824,
-0.11910176277160645,
0.19089773297309875,
-0.5484812259674072,
0.1231207326054573,
0.09322762489318848,
-0.18081068992614746,
0.06622835248708725,
-0.28170716762542725,
-0.32506805658340454,
-0.12478925287723541,
-0.3573298156261444,
-0.14182302355766296,
0.12856897711753845,
0.12592720985412598,
-0.2274913638830185,
-0.2503741979598999,
-0.0389179065823555,
0.15330469608306885,
0.06794369220733643,
-0.09579949080944061,
0.532005250453949,
-0.013805260881781578,
0.10943078994750977,
0.3739437162876129,
-0.134038507938385,
-0.062101736664772034,
-0.1849452555179596,
0.27832338213920593,
0.15311558544635773,
-0.2874663174152374,
-0.11393891274929047,
0.021331889554858208,
-0.33886367082595825,
0.03377978503704071,
-0.0706479400396347,
-0.3823460042476654,
0.4317745566368103,
0.0217466801404953,
0.1554371863603592,
0.004045750945806503,
-0.03132198750972748,
-0.20765650272369385,
0.20521073043346405,
0.3719114363193512,
-0.23291391134262085,
-0.25204649567604065,
0.054923027753829956,
-0.25757694244384766,
-0.26971396803855896,
-0.12177051603794098,
0.16001848876476288,
-0.21092216670513153,
0.26165854930877686,
-0.052029140293598175,
-0.3215736746788025,
-0.382686972618103,
-0.10082238912582397,
0.1615467220544815,
0.2231130301952362,
-0.2686253786087036,
0.4758654236793518,
-0.2848547101020813,
-0.0770997703075409,
-0.24108152091503143,
-0.021470505744218826,
-0.11999879777431488,
-0.08157855272293091,
-0.13644537329673767,
0.31824201345443726,
0.05433256924152374,
-0.03285042196512222,
0.05421553552150726,
0.1771148145198822,
0.13499298691749573,
-0.2633221745491028,
0.3029826879501343,
-0.3073064982891083,
-0.09562516212463379,
-0.24597127735614777,
0.10147298127412796,
0.3191242516040802,
-0.0929662436246872,
-0.14099560678005219,
-0.22870974242687225,
-0.32448986172676086,
-0.3668581247329712,
-0.1855342984199524,
-0.132875457406044,
0.172623872756958,
0.0477590411901474,
0.10217200219631195,
-0.2831849753856659,
0.1526930034160614,
0.47002676129341125,
0.31996554136276245,
-0.2427113652229309,
-0.11206844449043274,
-0.2563682794570923,
0.03177045285701752,
0.041612714529037476,
0.0645652487874031,
0.6307238936424255,
-0.02717524766921997,
0.2761514484882355,
0.444742351770401,
0.5318412780761719,
0.5160481929779053,
-0.06916308403015137,
0.31529513001441956,
-0.02055681124329567,
0.5571283102035522,
0.16523420810699463,
-0.2174014449119568,
-0.03858749195933342,
0.4062402546405792,
-0.04945392161607742,
-0.31288087368011475,
0.19806857407093048,
-0.07919056713581085,
0.494951456785202,
-0.2406214028596878,
0.1518554538488388,
0.35401424765586853,
0.03563328832387924,
0.5212369561195374,
-0.25356265902519226,
-0.1905035823583603,
0.1500864177942276,
0.050969503819942474,
0.045453354716300964,
-0.37916356325149536,
-0.2642137408256531,
-0.08981593698263168,
0.30442190170288086,
-0.13986581563949585,
0.11589895188808441,
0.163291335105896,
-0.0950518399477005,
0.16713303327560425,
-0.050627630203962326,
0.1616554856300354,
-0.007585152983665466,
-0.06140314042568207,
0.18470270931720734,
0.22531360387802124,
0.10516513884067535,
-0.28021010756492615,
0.147201269865036,
-0.07776184380054474,
-0.2695935070514679,
-0.031357038766145706,
0.14843511581420898,
0.21957939863204956,
-0.15022572875022888,
0.08882910013198853,
-0.036401569843292236,
-0.18439094722270966,
0.11266278475522995,
0.09580019116401672,
0.05402113497257233,
0.06812459975481033,
-0.15110772848129272,
-0.07412704825401306,
0.10298582911491394,
0.2191808819770813,
0.181674063205719,
-0.3020431697368622,
0.2198503464460373,
-0.09112539887428284,
0.00877998024225235,
0.01726110652089119,
0.03513241559267044,
0.6508888006210327,
0.3004583418369293,
0.19000378251075745,
-0.0315479151904583,
0.0216507688164711,
-0.11285888403654099,
-0.00742001086473465,
0.17105796933174133,
0.3863568902015686,
0.14007526636123657,
0.12689989805221558,
-0.008683189749717712,
0.04382895678281784,
0.2737811505794525,
0.04475775361061096,
-0.005328971892595291,
0.12834076583385468,
0.08796396851539612,
-0.098178431391716,
0.17548978328704834,
0.018432481214404106,
-0.19381365180015564,
0.13728854060173035,
0.10451018065214157,
0.16787536442279816,
0.09307052195072174,
-0.15066707134246826,
0.015297863632440567,
-0.21435824036598206,
-0.1322513073682785,
-0.20752659440040588,
-0.14145100116729736,
0.1693619340658188,
0.2980082631111145,
-0.30284157395362854,
0.12292543798685074,
0.004763748496770859,
-0.05301716923713684,
0.01664966344833374,
0.03836676850914955,
0.15755601227283478,
0.07099900394678116,
0.05462261661887169,
-0.21888992190361023,
-0.38795098662376404,
0.4027478098869324,
0.4304497539997101,
0.10988929867744446,
0.04150824248790741,
-0.08334276080131531,
-0.08196443319320679,
-0.18183520436286926,
-0.1592773050069809,
-0.18915370106697083,
-0.18699803948402405,
0.021652348339557648,
0.2396833598613739,
0.062479741871356964,
0.39980918169021606,
0.11275137215852737,
-0.04609419405460358,
-0.2420298010110855,
0.2976602017879486,
-0.10375598818063736,
0.04933156818151474,
-0.08405260741710663,
-0.0012259334325790405,
0.4643706977367401,
0.0052327923476696014,
0.17475317418575287,
0.10420310497283936,
-0.1107625886797905,
-0.3372596800327301,
-0.27344590425491333,
-0.016246749088168144,
0.08422217518091202,
-0.07210999727249146,
0.045202501118183136,
-0.07651546597480774,
-0.32795172929763794,
-0.3856624662876129,
0.06966102123260498,
-0.09331449121236801,
-0.14005661010742188,
0.010229453444480896,
-0.23580102622509003,
-0.1196301281452179,
0.03612235188484192,
-0.015409350395202637,
-0.1655699908733368,
-0.0965479165315628,
0.14204943180084229,
-0.2980204224586487,
0.24715712666511536,
0.01740337535738945,
-0.1359444260597229,
-0.1976286619901657,
-0.10628347098827362,
-0.15814730525016785,
-0.05598171055316925,
-0.2537658214569092,
0.16468912363052368,
0.03918570652604103,
-0.018906723707914352,
-0.2580949664115906,
-0.019230403006076813,
0.1165701150894165,
0.026165537536144257,
-0.026006139814853668,
-0.03927570581436157,
-0.374667227268219,
-0.10415183752775192,
-0.0362698994576931,
-0.022642983123660088,
0.22045288980007172,
0.059567924588918686,
-0.13526314496994019,
0.29189449548721313,
-0.09677747637033463,
-0.23590639233589172,
-0.10296906530857086,
0.028226986527442932,
-0.16141147911548615,
0.2655907869338989,
0.26542583107948303,
0.5574299097061157,
0.20449306070804596,
-0.16185137629508972,
0.12991002202033997,
-0.05496593564748764,
-0.06243027374148369,
0.3746872544288635,
-0.5390961766242981,
0.11842036992311478,
-0.1445012390613556,
0.11895646154880524,
0.3037506341934204,
-0.2156679779291153,
-0.23289678990840912,
0.20237909257411957,
-0.22119952738285065,
-0.27598661184310913,
-0.3286976218223572,
0.2701905369758606,
-0.12756657600402832,
0.2767392694950104,
0.06551612913608551,
-0.06989264488220215,
-0.3117985129356384,
-0.24664297699928284,
-0.047917939722537994,
0.14222806692123413,
0.06549414992332458,
-0.10461251437664032,
-0.38777559995651245,
0.21962736546993256,
-0.6049022078514099,
0.28635120391845703,
0.18098434805870056,
0.38903650641441345,
0.429868221282959,
0.3516627252101898,
0.12473112344741821,
-0.21019645035266876,
0.497639536857605,
0.0061217546463012695,
-0.03162536025047302,
0.049170203506946564,
-0.3125101625919342,
-0.05699247866868973,
-0.11867796629667282,
0.00163954496383667,
0.10323980450630188,
0.5616592168807983,
0.7081109285354614,
-0.45626598596572876,
-0.4951336085796356,
-0.15445509552955627,
-0.12104402482509613,
-0.025681093335151672,
-0.13215425610542297,
-0.30281975865364075,
-0.12708710134029388,
-0.2545420229434967,
0.40945810079574585,
-0.09153098613023758,
0.28013014793395996,
0.08991732448339462,
-0.11809243261814117,
-0.055718980729579926,
-0.30592525005340576,
0.27545875310897827,
0.03665187582373619,
-0.14823207259178162,
0.09525398164987564,
0.09050200134515762,
0.2856394052505493,
0.11131209135055542,
0.058307453989982605,
-0.4519159495830536,
-0.14237190783023834,
-0.3192651867866516,
-0.05666537210345268,
0.18453818559646606,
0.6292322278022766,
0.1765957772731781,
0.21052201092243195,
0.3103383183479309,
-0.09713470935821533,
0.382003515958786,
-0.07882426679134369,
0.5432997345924377,
0.26461124420166016,
0.2348332703113556,
-0.4785143733024597,
-0.18654528260231018,
-0.10158578306436539,
0.3348087966442108,
0.03500653803348541,
0.11906777322292328,
-0.4544447064399719,
-0.03092908300459385,
0.17346879839897156,
0.20318886637687683,
0.6231417655944824,
-0.3063165545463562,
0.01922520250082016,
-0.3884354829788208,
0.1224069744348526,
0.460475891828537,
-0.7485790252685547,
0.38530197739601135,
-0.3703920841217041,
0.050582561641931534,
0.25984933972358704,
0.0479765459895134,
-0.15072126686573029,
0.1079481840133667,
-0.006424225866794586,
0.16119562089443207,
0.18883413076400757,
0.1481163054704666,
-0.46849325299263,
0.6269598007202148,
-0.10885202884674072,
-0.47270628809928894,
0.12242373824119568,
0.11249237507581711,
-0.08259035646915436,
0.09858062118291855,
-0.09490880370140076,
-0.05298980325460434,
0.16199800372123718,
-0.08585787564516068,
0.01502905786037445,
-0.10588718950748444,
-0.014235250651836395,
0.39914649724960327,
0.10506083071231842,
0.3011047840118408,
0.04250265657901764,
0.02135417051613331,
0.21222180128097534,
0.18988797068595886,
0.09200425446033478,
-0.08262123167514801,
-0.2775639295578003,
-0.20988641679286957,
-0.06454703211784363,
-0.3582071363925934,
0.00972764939069748,
-0.053552303463220596,
0.06121741235256195,
-0.32057347893714905,
0.31272223591804504,
-0.11256302893161774,
-0.44771987199783325,
0.2727467715740204,
0.38180986046791077,
0.1936124861240387,
0.34660494327545166,
0.4609842598438263,
-0.20359313488006592,
-0.23305827379226685,
0.13060303032398224,
0.04012897610664368,
-0.2727859318256378,
0.6311033964157104,
-0.10090036690235138,
-0.12830746173858643,
0.12454431504011154,
0.1781613528728485,
-0.04587077349424362,
-0.284498929977417,
0.515043318271637,
-0.0326419323682785,
-0.26100173592567444,
-0.28394824266433716,
0.13355225324630737,
0.22761280834674835,
-0.1262841522693634,
0.10761462152004242,
-0.10529205203056335,
-0.08975064009428024,
0.19773517549037933,
0.3319937586784363,
-0.14843741059303284,
-0.06293445080518723,
0.037048712372779846,
-0.2933886647224426,
-0.11688612401485443,
-0.07658544182777405,
-0.2642039954662323,
0.036121923476457596,
-0.007524527609348297,
0.5641745924949646,
-0.19788014888763428,
0.36155059933662415,
-0.2839072346687317,
0.18559491634368896,
-0.4716774821281433,
0.16807697713375092,
-0.11344867199659348,
-0.3801901936531067,
-0.08889522403478622,
0.2079809159040451,
0.0867377370595932,
0.20410746335983276,
-0.10679621994495392,
-0.20111143589019775,
-0.1193050742149353,
0.12596395611763,
0.1966702789068222,
-0.10419473052024841,
0.2584608495235443,
0.11268267035484314,
-0.19624006748199463,
-0.29456427693367004,
-0.21102243661880493,
-0.14577743411064148,
0.047421835362911224,
-0.14962492883205414,
0.14092297852039337,
0.27023282647132874,
-0.012239322066307068,
-0.12934643030166626,
-0.001596592366695404,
-0.11667216569185257,
-0.011567521840333939,
0.2462814599275589,
0.3029271960258484,
-0.005185507237911224,
0.04922755807638168,
0.04061124101281166,
0.5835629105567932,
-0.07222318649291992,
-0.03746969252824783,
-0.02406037598848343,
-0.09280166774988174,
0.35617974400520325,
0.10283972322940826,
0.2710545063018799,
0.038356512784957886,
-0.3071552813053131,
0.5802704095840454,
0.20874851942062378,
0.014429397881031036,
-0.21295276284217834,
0.2556368112564087,
-0.00912933424115181,
0.014622405171394348,
0.07303124666213989,
0.33560022711753845,
0.029152318835258484,
-0.37081390619277954,
0.02787766233086586,
0.26589739322662354,
-0.5674033761024475,
-0.18434791266918182,
-0.08915545046329498,
-0.19922921061515808,
-0.10080410540103912,
0.4506329596042633,
0.21629594266414642,
0.08179609477519989,
0.07092174142599106,
0.1965932548046112,
0.4665074348449707,
0.181728333234787,
0.26550254225730896,
0.08493459224700928,
0.02912900596857071,
-0.10864151269197464,
0.1895732283592224,
0.27640122175216675,
-0.08565452694892883,
-0.17618420720100403,
0.20122778415679932,
0.0274888277053833,
0.02070516347885132,
-0.020978298038244247,
0.7956939339637756,
-0.15506015717983246,
-0.12824174761772156,
0.058160871267318726,
0.12632131576538086,
-0.03727444261312485,
-0.017297841608524323,
0.029491346329450607,
0.16675204038619995,
-0.2223331183195114,
-0.05137152597308159,
-0.09129594266414642,
0.005765369161963463,
-0.1960185170173645,
0.1105191558599472,
0.4500746428966522,
-0.32651209831237793,
-0.19245487451553345,
-0.15559381246566772,
0.025819091126322746,
-0.40475624799728394,
0.18572476506233215,
0.3384745717048645,
0.26756352186203003,
-0.05774111673235893,
-0.11192407459020615,
-0.40288782119750977,
0.2434469610452652,
-0.09169977158308029,
0.3875623941421509,
-0.08101442456245422,
-0.15033920109272003,
-0.09317409992218018,
-0.05986093729734421,
-0.19344305992126465,
-0.4682844579219818,
0.10221759229898453,
-0.07594406604766846,
0.34214702248573303,
0.011233586817979813,
-0.0010036807507276535,
-0.3327239751815796,
-0.15234220027923584,
0.2943941652774811,
-0.1722400188446045,
0.03807063028216362,
0.28415751457214355,
-0.24561378359794617,
0.13705116510391235,
-0.21663357317447662,
0.12664051353931427,
0.10320013761520386,
0.30114689469337463,
0.27347952127456665,
0.20490242540836334,
-0.337624192237854,
-0.20491458475589752,
-0.38332414627075195,
0.16197317838668823,
0.03140159696340561,
0.11820752918720245,
-0.06026817113161087,
0.37859511375427246,
0.009104933589696884,
-0.04782993718981743,
-0.3544137477874756,
0.2403821051120758,
0.0072951652109622955,
0.10936729609966278,
-0.1861521154642105,
0.5333859920501709,
-0.17256487905979156,
-0.06798462569713593,
0.31138908863067627,
-0.2558402419090271,
0.24316784739494324,
-0.19377131760120392,
0.05243224650621414,
-0.2378513365983963,
0.17246872186660767,
-0.12178913503885269,
-0.0026285876519978046,
0.007765533402562141,
0.2122088521718979,
0.14280641078948975,
-0.026814546436071396,
0.1948133260011673,
0.0050268638879060745,
0.320296972990036,
-0.5110363960266113,
0.11428231000900269,
0.0994255542755127,
-0.21540629863739014,
0.08499987423419952,
0.24801497161388397,
-0.2802979350090027,
0.13970991969108582,
0.04095996916294098,
-0.014083070680499077,
-0.02637384459376335,
0.12532877922058105,
0.11556945741176605,
0.013086449354887009,
-0.16083478927612305,
0.23933351039886475,
0.156129390001297,
-0.011681873351335526,
-0.316851943731308,
-0.2593223452568054,
0.17815889418125153,
-0.4670969247817993,
-0.4298633337020874,
-0.713830828666687,
0.3146629333496094,
0.2915337085723877,
0.27983909845352173,
-0.22865992784500122,
-0.1763642430305481,
0.2498820275068283,
0.13141533732414246,
-0.46698883175849915,
0.17163661122322083,
0.18690313398838043,
-0.29812294244766235,
-0.027584373950958252,
0.026081403717398643,
0.06751279532909393,
-0.053539909422397614,
-0.060423821210861206,
-0.04592468962073326
] |
https://github.com/huggingface/datasets/issues/6236 | Hey! You can implement this yourself, just:
1) Create the dataset with `to_tf_dataset()` with `shuffle=False`
2) Add an `unbatch()` at the end (or use batch_size=1)
3) Add a `shuffle()` to the resulting dataset with your desired buffer size
4) Add a `batch()` at the end again to re-batch your dataset.
Note that the way we construct datasets in `to_tf_dataset()`, we don't actually shuffle the entire dataset in-memory, using `tf.data.Dataset.shuffle()`! Instead, we shuffle an index array and then load from the dataset with that. This means that shuffling with `tf.data.Dataset.shuffle()` will probably be slower and use more memory than our approach - I don't think adding the option for smaller shuffle buffers will actually save you memory on this! | Support buffer shuffle for to_tf_dataset | ### Feature request
I'm using to_tf_dataset to convert a large dataset to tf.data.Dataset and use Keras fit to train model.
Currently, to_tf_dataset only supports full size shuffle, which can be very slow on large dataset.
tf.data.Dataset support buffer shuffle by default.
shuffle(
buffer_size, seed=None, reshuffle_each_iteration=None, name=None
)
### Motivation
I'm very frustrated to find the loading with shuffling large dataset is very slow. It seems impossible to shuffle before training Keras with big dataset.
### Your contribution
NA | 118 | Support buffer shuffle for to_tf_dataset
### Feature request
I'm using to_tf_dataset to convert a large dataset to tf.data.Dataset and use Keras fit to train model.
Currently, to_tf_dataset only supports full size shuffle, which can be very slow on large dataset.
tf.data.Dataset support buffer shuffle by default.
shuffle(
buffer_size, seed=None, reshuffle_each_iteration=None, name=None
)
### Motivation
I'm very frustrated to find the loading with shuffling large dataset is very slow. It seems impossible to shuffle before training Keras with big dataset.
### Your contribution
NA
Hey! You can implement this yourself, just:
1) Create the dataset with `to_tf_dataset()` with `shuffle=False`
2) Add an `unbatch()` at the end (or use batch_size=1)
3) Add a `shuffle()` to the resulting dataset with your desired buffer size
4) Add a `batch()` at the end again to re-batch your dataset.
Note that the way we construct datasets in `to_tf_dataset()`, we don't actually shuffle the entire dataset in-memory, using `tf.data.Dataset.shuffle()`! Instead, we shuffle an index array and then load from the dataset with that. This means that shuffling with `tf.data.Dataset.shuffle()` will probably be slower and use more memory than our approach - I don't think adding the option for smaller shuffle buffers will actually save you memory on this! | [
-0.37784263491630554,
-0.26851511001586914,
-0.005736783146858215,
-0.11381540447473526,
0.3517449200153351,
0.323432594537735,
0.061275798827409744,
0.49831336736679077,
-0.07993004471063614,
0.4037872552871704,
-0.35117051005363464,
0.30224907398223877,
-0.475032776594162,
0.23785407841205597,
0.06919555366039276,
-0.1661602258682251,
0.08834652602672577,
-0.04510882496833801,
-0.0031209588050842285,
0.1437515914440155,
-0.048998069018125534,
-0.21303808689117432,
-0.19734573364257812,
-0.30430397391319275,
0.0714898556470871,
0.23792588710784912,
0.22392259538173676,
0.01926703006029129,
-0.14408105611801147,
-0.015419747680425644,
0.13148298859596252,
0.5505720973014832,
-0.01129838451743126,
0.4440460801124573,
-0.00011650886881398037,
0.1303473711013794,
0.05942929908633232,
-0.13359889388084412,
-0.15656818449497223,
0.12640278041362762,
-0.017093658447265625,
0.019244275987148285,
-0.32154154777526855,
0.013655528426170349,
-0.04994751513004303,
0.13530881702899933,
0.07561534643173218,
-0.013613022863864899,
-0.03772926703095436,
-0.013646099716424942,
0.07880154252052307,
-0.0747571662068367,
-0.11336874216794968,
0.10030123591423035,
0.5062475800514221,
0.3632236421108246,
-0.2298382818698883,
0.10545005649328232,
0.204387366771698,
0.01632928103208542,
-0.05823378264904022,
-0.06947322934865952,
-0.1751859486103058,
0.061879243701696396,
0.29140448570251465,
-0.3090858459472656,
-0.153686985373497,
-0.1376623809337616,
-0.04048946127295494,
0.6020215153694153,
0.2935321629047394,
-0.2430485635995865,
-0.3128352165222168,
-0.4030829668045044,
0.018633496016263962,
-0.0673130601644516,
-0.18798521161079407,
-0.22072696685791016,
-0.16661499440670013,
-0.12144261598587036,
-0.5351449251174927,
-0.36977383494377136,
-0.018099837005138397,
-0.23163774609565735,
0.06738324463367462,
0.3142133355140686,
0.13259173929691315,
0.07874037325382233,
0.33849766850471497,
-0.31337958574295044,
0.42801403999328613,
-0.16219671070575714,
0.030115049332380295,
0.3576453924179077,
-0.6955829858779907,
-0.3228754997253418,
0.026595622301101685,
-0.1650911420583725,
0.46461379528045654,
-0.28172919154167175,
0.14608611166477203,
0.26295918226242065,
0.015151333063840866,
-0.16812537610530853,
-0.06691595166921616,
0.07090288400650024,
-0.4241011440753937,
0.3288739323616028,
0.02049851045012474,
0.01747623085975647,
-0.03350627422332764,
0.048974599689245224,
-0.2716647982597351,
-0.10743169486522675,
-0.08196212351322174,
-0.045242927968502045,
-0.440251886844635,
0.15884003043174744,
-0.058236464858055115,
-0.12283547222614288,
-0.010387107729911804,
-0.0390612818300724,
0.2688978314399719,
0.16887682676315308,
-0.1072307676076889,
0.17596060037612915,
-0.14773774147033691,
-0.2886621057987213,
-0.18045693635940552,
0.06620395183563232,
-0.1546444296836853,
-0.1767745018005371,
-0.1649090051651001,
0.027671344578266144,
0.14283278584480286,
-0.033510252833366394,
-0.09604255855083466,
-0.1337139755487442,
0.08859672397375107,
0.5686755776405334,
-0.24082301557064056,
0.05165306478738785,
0.013818401843309402,
0.16432714462280273,
-0.3179032802581787,
-0.031737569719552994,
-0.14056065678596497,
0.14358913898468018,
-0.2635340392589569,
0.4457414150238037,
-0.4688554108142853,
-0.3249201774597168,
0.28355345129966736,
0.06532011926174164,
-0.06915147602558136,
-0.2960854172706604,
-0.6721097230911255,
0.6092727184295654,
0.03627607598900795,
-0.45583152770996094,
-0.11963408440351486,
-0.17465221881866455,
-0.6774870157241821,
-0.16343259811401367,
0.33663079142570496,
0.08969008177518845,
-0.24910905957221985,
0.036517128348350525,
0.17394056916236877,
-0.19337785243988037,
0.5979792475700378,
0.13421785831451416,
-0.07012533396482468,
0.021337931975722313,
-0.09896750748157501,
-0.3707873821258545,
0.25478267669677734,
0.11546815186738968,
-0.4418039619922638,
0.21861284971237183,
-0.24096134305000305,
0.2786490023136139,
0.19757485389709473,
0.1429911106824875,
0.17444100975990295,
-0.25113236904144287,
0.5204598307609558,
0.5521436929702759,
-0.32681193947792053,
0.3230285048484802,
-0.2802308201789856,
-0.055382877588272095,
0.18124306201934814,
0.5168042182922363,
-0.09080879390239716,
0.1463123857975006,
-0.08854064345359802,
0.41670817136764526,
0.506749153137207,
0.014431995339691639,
-0.04558934271335602,
-0.015257999300956726,
0.0682828277349472,
0.13614636659622192,
-0.134497731924057,
-0.2943505644798279,
-0.0633118599653244,
0.24324552714824677,
0.3649557828903198,
-0.2375948429107666,
0.6755693554878235,
-0.03252117708325386,
0.14563895761966705,
-0.12882687151432037,
0.08694188296794891,
0.1074398010969162,
-0.07661868631839752,
-0.1385413259267807,
0.39162367582321167,
0.24384325742721558,
-0.09586910158395767,
0.05204057693481445,
-0.4479104280471802,
-0.1099124327301979,
-0.00021954625844955444,
0.10026741772890091,
0.5562631487846375,
-0.033736735582351685,
0.0591687336564064,
0.18953529000282288,
-0.3210790753364563,
0.02722606435418129,
-0.15622010827064514,
0.3333827257156372,
0.15408694744110107,
0.01111135259270668,
-0.30541136860847473,
0.3896075189113617,
0.18395139276981354,
0.4076283574104309,
-0.14786668121814728,
-0.2989470660686493,
-0.021334217861294746,
-0.08590895682573318,
0.17174074053764343,
0.4178484380245209,
-0.4294489324092865,
0.2517118453979492,
0.12669582664966583,
-0.4731118083000183,
0.09689157456159592,
0.12083110213279724,
0.11326246708631516,
0.09168712049722672,
0.22447027266025543,
0.03336171805858612,
-0.2585974633693695,
-0.1178487166762352,
-0.4232090711593628,
-0.18067768216133118,
0.35908740758895874,
-0.1260717660188675,
-0.4392516016960144,
0.30475592613220215,
-0.08475210517644882,
-0.055291399359703064,
-0.13974294066429138,
0.27844327688217163,
0.2561228275299072,
0.3330303430557251,
0.1870950162410736,
-0.029446708038449287,
0.30446457862854004,
-0.1378946155309677,
0.12245002388954163,
-0.15523670613765717,
0.2281036674976349,
0.4178524613380432,
0.3019983172416687,
0.1342143416404724,
-0.18553626537322998,
-0.10552388429641724,
0.2554314434528351,
0.3875565826892853,
-0.2266804277896881,
-0.2261727899312973,
-0.2848268151283264,
-0.4616590738296509,
0.044160302728414536,
-0.03849509358406067,
0.2196437567472458,
-0.0559149794280529,
0.17333239316940308,
0.5658190846443176,
0.032142870128154755,
0.12838679552078247,
0.09528384357690811,
0.29988226294517517,
0.07555737346410751,
-0.34909453988075256,
-0.21369615197181702,
0.007351730018854141,
0.08821550011634827,
0.08862683922052383,
0.26306524872779846,
-0.5078929662704468,
0.1409015953540802,
0.08960077911615372,
0.04304247349500656,
0.0359821543097496,
-0.1987249255180359,
0.08527656644582748,
-0.3053310215473175,
0.00909261591732502,
0.04406672343611717,
0.11939163506031036,
0.02064138650894165,
-0.2948130667209625,
0.06873690336942673,
-0.39592862129211426,
-0.1712990701198578,
0.2813519537448883,
-0.07033199071884155,
0.03166527673602104,
-0.15372470021247864,
0.257382333278656,
-0.09090130776166916,
-0.42676717042922974,
0.050954196602106094,
-0.2767062783241272,
0.028397835791110992,
0.10546334087848663,
0.07564963400363922,
-0.11470845341682434,
-0.2927493155002594,
-0.30532729625701904,
-0.06285229325294495,
-0.7099632024765015,
0.3203248679637909,
-0.18604639172554016,
-0.0701955109834671,
-0.1804448813199997,
0.08171588182449341,
-0.15627899765968323,
0.6751777529716492,
-0.25305941700935364,
0.29751119017601013,
-0.34968581795692444,
-0.1501460075378418,
-0.3688192367553711,
-0.05329827219247818,
-0.017449598759412766,
-0.16701433062553406,
0.08121407777070999,
0.042482614517211914,
0.05548053979873657,
-0.133815735578537,
0.08199122548103333,
0.18063654005527496,
0.048367392271757126,
0.37820619344711304,
0.24943183362483978,
0.6993491053581238,
-0.20760318636894226,
0.128116637468338,
-0.07610596716403961,
0.002143261954188347,
0.07020377367734909,
-0.3034142255783081,
-0.09604305028915405,
0.4694739580154419,
0.3343992233276367,
0.00517784059047699,
0.157406285405159,
-0.17201773822307587,
-0.41114163398742676,
-0.13701637089252472,
0.07914330065250397,
0.32588234543800354,
-0.08484173566102982,
0.09266389161348343,
-0.16491474211215973,
0.06144953891634941,
-0.056414373219013214,
-0.1366061568260193,
-0.22065529227256775,
-0.46813759207725525,
-0.12548573315143585,
0.052449144423007965,
0.5152760744094849,
-0.048873383551836014,
-0.2732812762260437,
-0.1477472484111786,
-0.5455986857414246,
-0.03987403213977814,
0.21426361799240112,
0.29291096329689026,
0.08595310151576996,
-0.133428692817688,
0.018519967794418335,
0.32591384649276733,
0.7115464806556702,
-0.05439411848783493,
-0.10992120206356049,
0.10942140221595764,
0.01838550716638565,
-0.538507342338562,
-0.12457834184169769,
-0.009701266884803772,
0.04710519313812256,
-0.1953715980052948,
0.3313935399055481,
-0.038659825921058655,
-0.10933779925107956,
-0.00403636135160923,
0.1075248122215271,
-0.05094394460320473,
-0.1628250777721405,
-0.16983236372470856,
0.05114881694316864,
-0.13087455928325653,
0.12789921462535858,
0.04844927787780762,
0.1325814574956894,
-0.02534469962120056,
0.012658432126045227,
0.15194889903068542,
0.18692468106746674,
0.11826162785291672,
-0.027497950941324234,
0.07371416687965393,
0.6045282483100891,
0.4062539041042328,
-0.13876748085021973,
-0.4195207953453064,
0.3690944015979767,
0.0921526700258255,
0.02494727075099945,
-0.22768330574035645,
-0.08428189158439636,
0.4047025740146637,
0.3046830892562866,
0.03495188429951668,
-0.12403889000415802,
0.2416784018278122,
-0.23719912767410278,
0.28591978549957275,
-0.2906709909439087,
0.33906081318855286,
0.016479287296533585,
-0.20810960233211517,
-0.43433329463005066,
-0.7868008613586426,
0.05313693732023239,
0.06755737215280533,
0.1624210774898529,
0.4117378294467926,
-0.14063245058059692,
-0.10949154943227768,
0.1832849234342575,
0.054556816816329956,
0.5799344778060913,
-0.4442685842514038,
0.1678592711687088,
0.268013596534729,
0.27005288004875183,
0.16891606152057648,
-0.22749541699886322,
0.3306974768638611,
0.0345921516418457,
-0.5165999531745911,
0.15824322402477264,
-0.042798180133104324,
-0.2825772762298584,
0.0615728497505188,
-0.007609903812408447,
-0.07571320980787277,
0.27985185384750366,
-0.21809779107570648,
-0.26028791069984436,
0.19529002904891968,
-0.14460666477680206,
-0.24701860547065735,
0.16068044304847717,
0.05154801905155182,
-0.08889397978782654,
-0.16540029644966125,
0.20565523207187653,
-0.015947658568620682,
-0.09656625241041183,
0.43388479948043823,
-0.3921348750591278,
-0.17455744743347168,
-0.18392333388328552,
-0.09524791687726974,
-0.31586024165153503,
0.09849418699741364,
0.18031661212444305,
0.1811217963695526,
-0.16038139164447784,
0.2725645899772644,
-0.18681888282299042,
0.17488494515419006,
0.1146990954875946,
0.18043556809425354,
-0.07387465238571167,
0.0495944619178772,
0.1611640900373459,
0.012025594711303711,
-0.03419959545135498,
-0.04952213168144226,
0.2018256038427353,
-0.5303227305412292,
-0.4862028956413269,
-0.3012467920780182,
0.563899040222168,
-0.05759847164154053,
-0.24867555499076843,
0.12426456809043884,
0.12549692392349243,
0.03731343150138855,
0.05087767168879509,
-0.04300713166594505,
-0.12177227437496185,
0.21155714988708496,
-0.1973671019077301,
-0.14981983602046967,
-0.004317965358495712,
0.23544958233833313,
-0.06629643589258194,
0.3937324285507202,
0.15249499678611755,
0.06028272956609726,
-0.19696642458438873,
0.12390308082103729,
0.16733694076538086,
0.2052524983882904,
0.18409091234207153,
0.07241226732730865,
0.0932798907160759,
0.336181104183197,
0.22166045010089874,
0.16781362891197205,
-0.20181794464588165,
-0.21267583966255188,
-0.03559931367635727,
-0.02966833859682083,
-0.3390580415725708,
0.2240249067544937,
0.0004791694227606058,
0.2573980391025543,
-0.13072164356708527,
0.3216526210308075,
-0.3588040769100189,
0.10667011886835098,
-0.21463541686534882,
-0.1218823492527008,
0.37085917592048645,
-0.05586276948451996,
-0.16275742650032043,
0.14083588123321533,
-0.09930354356765747,
-0.08847218751907349,
-0.006288003176450729,
0.08656018227338791,
-0.1011975109577179,
-0.18595317006111145,
0.008506633341312408,
0.13377420604228973,
0.17533473670482635,
0.11778968572616577,
-0.026770131662487984,
-0.38948774337768555,
-0.4458574950695038,
-0.1788897067308426,
0.3632828891277313,
0.3919474482536316,
-0.1607041209936142,
0.1640835553407669,
0.6393970251083374,
-0.022871389985084534,
0.15782737731933594,
0.30162662267684937,
-0.0040762051939964294,
-0.15336306393146515,
0.06344610452651978,
-0.00852748192846775,
0.10709426552057266,
-0.16144753992557526,
-0.116182342171669,
0.07218766957521439,
0.2947973608970642,
-0.21874892711639404,
0.34836649894714355,
-0.0340617336332798,
0.11912992596626282,
0.3893015682697296,
0.03462894260883331,
0.47331637144088745,
0.04982735961675644,
-0.14029225707054138,
0.3336199223995209,
0.07460303604602814,
0.061872318387031555,
-0.0706309825181961,
0.08790596574544907,
0.1485472470521927,
-0.009455777704715729,
-0.04732607305049896,
-0.4607307016849518,
0.12975439429283142,
-0.21735191345214844,
0.0599249042570591,
-0.08914215862751007,
-0.06284016370773315,
-0.0644526332616806,
0.4097133278846741,
0.16624802350997925,
-0.11126667261123657,
-0.0047904253005981445,
-0.009060900658369064,
-0.06820040941238403,
0.22237081825733185,
0.40806522965431213,
0.5689970254898071,
-0.2566508650779724,
0.030521191656589508,
0.05087914690375328,
-0.5553818345069885,
0.003753389697521925,
0.49088606238365173,
-0.3584263324737549,
0.5350676774978638,
-0.006173253059387207,
0.023506220430135727,
0.18876612186431885,
0.08322663605213165,
0.0332232341170311,
0.28530576825141907,
-0.06090722233057022,
-0.22406929731369019,
0.291820764541626,
-0.22627148032188416,
0.048452869057655334,
0.28054749965667725,
-0.015987832099199295,
0.1593872606754303,
-0.02975272387266159,
0.008612841367721558,
0.04463727027177811,
0.0010242797434329987,
-0.006998132448643446,
0.3393953740596771,
0.3306838572025299,
-0.09525008499622345,
-0.166237473487854,
-0.1461692750453949,
-0.17867815494537354,
0.23679380118846893,
0.04102172702550888,
-0.26405149698257446,
0.19215819239616394,
0.14653384685516357,
0.06022078916430473,
-0.2111256718635559,
0.06359229236841202,
0.1083308756351471,
0.5683165788650513,
0.3690485954284668,
0.05958932265639305,
0.1627972573041916,
-0.010400461032986641,
-0.025599805638194084,
-0.14926712214946747,
-0.03174862265586853,
0.0426412932574749,
-0.17918787896633148,
-0.08318522572517395,
0.38048794865608215,
0.05867672711610794,
0.022696156054735184,
0.16854327917099,
-0.14889611303806305,
0.15870246291160583,
-0.18336476385593414,
-0.2672874629497528,
-0.02168155461549759,
0.061114802956581116,
0.04793828725814819,
-0.005037007853388786,
0.419792115688324,
0.035058263689279556,
-0.00027295108884572983,
-0.11372970044612885,
-0.2709501385688782,
-0.08148008584976196,
-0.08686405420303345,
0.02655993588268757,
0.3907715678215027,
0.2564530670642853,
0.168023943901062,
0.14541691541671753,
0.12064234912395477,
-0.43992841243743896,
-0.3127087354660034,
-0.3740394711494446,
0.3171064853668213,
-0.08070511370897293,
-0.12482988834381104,
-0.3616594672203064,
-0.021539462730288506,
0.015135489404201508,
-0.33026841282844543,
0.23188480734825134,
-0.013643968850374222,
-0.10414081066846848,
-0.06430354714393616,
0.24619799852371216,
0.13285717368125916,
0.16688358783721924,
-0.026102401316165924,
0.022379571571946144,
0.012419484555721283,
-0.014975354075431824,
0.17920082807540894,
-0.216924786567688,
0.11260627210140228,
-0.30697527527809143,
-0.17852410674095154,
-0.024606846272945404,
0.2320965826511383,
-0.07883790880441666,
-0.30646008253097534,
-0.02337360940873623,
0.10135155916213989,
-0.02112317830324173,
-0.23834413290023804,
-0.23731166124343872,
-0.11257979273796082,
0.24234257638454437,
0.2569192945957184,
0.017522413283586502,
0.35947632789611816,
-0.008865606039762497,
0.003913529217243195,
-0.1181495189666748,
0.11170616000890732,
0.3251575231552124,
-0.198769673705101,
-0.06402106583118439,
-0.08581049740314484,
-0.1619068682193756,
-0.0872923731803894,
0.15648093819618225,
-0.2812560200691223,
0.09294013679027557,
0.31968948245048523,
0.07444944977760315,
0.3311670422554016,
0.6512249708175659,
-0.11462937295436859,
0.06737561523914337,
0.010327562689781189,
0.420870304107666,
-0.011479927226901054,
-0.1207752674818039,
-0.18832243978977203,
-0.17012080550193787
] |
https://github.com/huggingface/datasets/issues/6236 | Thanks for your reply! @Rocketknight1
"We don't actually shuffle the entire dataset in-memory, using tf.data.Dataset.shuffle()! Instead, we shuffle an index array and then load from the dataset with that."
In such case, there will be random access to dataset data during shuffling. When the dataset is large, the performance can be X10 times slow. I have tried many ways with to_tf_dataset() trying to achieve comparable performance with tf.data.Dataset().shuffle(buffer_size).batch(). But the performance with to_tf_dataset() is still slow.
| Support buffer shuffle for to_tf_dataset | ### Feature request
I'm using to_tf_dataset to convert a large dataset to tf.data.Dataset and use Keras fit to train model.
Currently, to_tf_dataset only supports full size shuffle, which can be very slow on large dataset.
tf.data.Dataset support buffer shuffle by default.
shuffle(
buffer_size, seed=None, reshuffle_each_iteration=None, name=None
)
### Motivation
I'm very frustrated to find the loading with shuffling large dataset is very slow. It seems impossible to shuffle before training Keras with big dataset.
### Your contribution
NA | 76 | Support buffer shuffle for to_tf_dataset
### Feature request
I'm using to_tf_dataset to convert a large dataset to tf.data.Dataset and use Keras fit to train model.
Currently, to_tf_dataset only supports full size shuffle, which can be very slow on large dataset.
tf.data.Dataset support buffer shuffle by default.
shuffle(
buffer_size, seed=None, reshuffle_each_iteration=None, name=None
)
### Motivation
I'm very frustrated to find the loading with shuffling large dataset is very slow. It seems impossible to shuffle before training Keras with big dataset.
### Your contribution
NA
Thanks for your reply! @Rocketknight1
"We don't actually shuffle the entire dataset in-memory, using tf.data.Dataset.shuffle()! Instead, we shuffle an index array and then load from the dataset with that."
In such case, there will be random access to dataset data during shuffling. When the dataset is large, the performance can be X10 times slow. I have tried many ways with to_tf_dataset() trying to achieve comparable performance with tf.data.Dataset().shuffle(buffer_size).batch(). But the performance with to_tf_dataset() is still slow.
| [
-0.3856085538864136,
-0.2946014702320099,
0.0037971511483192444,
-0.04990128427743912,
0.3307363986968994,
0.3635885715484619,
0.05948565527796745,
0.5427847504615784,
-0.11980366706848145,
0.3561812937259674,
-0.34272798895835876,
0.3405897617340088,
-0.425658255815506,
0.1936900019645691,
0.10705181211233139,
-0.17247623205184937,
0.1288893222808838,
-0.04074232280254364,
-0.041503097862005234,
0.07331183552742004,
-0.07802678644657135,
-0.24680732190608978,
-0.2699524164199829,
-0.2721022069454193,
0.025607306510210037,
0.1897185891866684,
0.2621621787548065,
-0.004880253225564957,
-0.10240889340639114,
-0.01332663744688034,
0.10686171799898148,
0.5226160883903503,
-0.060766834765672684,
0.4965411126613617,
-0.000121107637824025,
0.1441435068845749,
0.07809862494468689,
-0.11109405755996704,
-0.12709137797355652,
0.16628089547157288,
-0.0653918981552124,
0.05288562923669815,
-0.29480063915252686,
-0.0063717663288116455,
-0.018271319568157196,
0.11852744221687317,
0.1089872419834137,
0.016856886446475983,
-0.05363289639353752,
-0.01938997581601143,
0.028555978089571,
-0.06830436736345291,
-0.1410258710384369,
0.1595785766839981,
0.4894576668739319,
0.3699195384979248,
-0.2575758397579193,
0.13138604164123535,
0.30606889724731445,
-0.000792577862739563,
-0.03629245236515999,
-0.11701282113790512,
-0.17735114693641663,
0.05534595251083374,
0.3004010021686554,
-0.2818443477153778,
-0.22886131703853607,
-0.11924615502357483,
-0.016763463616371155,
0.6099487543106079,
0.3885628581047058,
-0.2194969803094864,
-0.36108243465423584,
-0.33443382382392883,
-0.0069494545459747314,
-0.025084469467401505,
-0.20178115367889404,
-0.2957318425178528,
-0.1562635898590088,
-0.08130995184183121,
-0.5461546778678894,
-0.40913423895835876,
-0.03037440776824951,
-0.24062994122505188,
0.02956724911928177,
0.3489789366722107,
0.14806202054023743,
0.09148870408535004,
0.28702470660209656,
-0.3078998029232025,
0.4508894085884094,
-0.19846241176128387,
0.10364459455013275,
0.3237092196941376,
-0.7536494731903076,
-0.3262544870376587,
0.05581909790635109,
-0.14260388910770416,
0.4263201653957367,
-0.292243093252182,
0.08520816266536713,
0.31220585107803345,
-0.019652359187602997,
-0.1300750970840454,
-0.07354460656642914,
0.02830829843878746,
-0.42003947496414185,
0.3473597764968872,
0.08496294915676117,
-0.06944195181131363,
-0.11447075009346008,
0.11222058534622192,
-0.2767654359340668,
-0.018021102994680405,
-0.04052571952342987,
-0.029781684279441833,
-0.4473069906234741,
0.11574208736419678,
-0.029337767511606216,
-0.1306527704000473,
-0.009997420012950897,
-0.13106262683868408,
0.3127598762512207,
0.19046831130981445,
-0.11023198068141937,
0.14007782936096191,
-0.18493223190307617,
-0.2943519651889801,
-0.06997916102409363,
0.08640997856855392,
-0.10090240836143494,
-0.16856282949447632,
-0.09161607176065445,
0.01960882917046547,
0.12626305222511292,
-0.043539613485336304,
-0.12488682568073273,
-0.1191033199429512,
0.05983876436948776,
0.5803102254867554,
-0.2530314028263092,
0.01808607578277588,
0.03852643072605133,
0.11017443239688873,
-0.3091227412223816,
0.0006179213523864746,
-0.06592689454555511,
0.243211567401886,
-0.2630212903022766,
0.42786386609077454,
-0.5062043070793152,
-0.3582868278026581,
0.3063172698020935,
0.029649440199136734,
0.0005901232361793518,
-0.3440772593021393,
-0.6767072677612305,
0.5712491869926453,
-0.0008133687078952789,
-0.45160263776779175,
-0.12303538620471954,
-0.15732231736183167,
-0.7134302854537964,
-0.13850095868110657,
0.3083310127258301,
0.12466864287853241,
-0.23121294379234314,
0.11421911418437958,
0.2208273708820343,
-0.14737790822982788,
0.5753358006477356,
0.17397469282150269,
-0.08335600793361664,
0.06065510958433151,
-0.10581737756729126,
-0.4354890286922455,
0.30929937958717346,
0.04190017282962799,
-0.44077613949775696,
0.27818334102630615,
-0.24952203035354614,
0.21874797344207764,
0.210524320602417,
0.17166222631931305,
0.1677071750164032,
-0.2860778272151947,
0.5273484587669373,
0.556528627872467,
-0.28562137484550476,
0.3348610997200012,
-0.251092791557312,
0.016860075294971466,
0.1421004980802536,
0.5462511777877808,
-0.15241125226020813,
0.23558461666107178,
-0.045988019555807114,
0.3429162800312042,
0.5069571137428284,
-0.010323870927095413,
-0.09543822705745697,
0.005769088864326477,
0.04854494333267212,
0.1507767289876938,
-0.12595687806606293,
-0.22488154470920563,
-0.05790877714753151,
0.2307262420654297,
0.4000035524368286,
-0.2458113431930542,
0.6436209678649902,
-0.07577016949653625,
0.16477422416210175,
-0.05450303480029106,
0.04674016311764717,
0.18286757171154022,
-0.13345876336097717,
-0.09407098591327667,
0.40441617369651794,
0.2852124571800232,
-0.12178291380405426,
0.02385101281106472,
-0.4800654649734497,
-0.10429663956165314,
-0.01545809581875801,
0.11427807807922363,
0.6013897061347961,
-0.014046899974346161,
0.046494148671627045,
0.1525493562221527,
-0.3009883463382721,
-0.03449724242091179,
-0.1809426248073578,
0.29954662919044495,
0.12581318616867065,
0.051587045192718506,
-0.2632546126842499,
0.4140163064002991,
0.17650248110294342,
0.35483840107917786,
-0.15031515061855316,
-0.26792681217193604,
0.032502431422472,
-0.13626086711883545,
0.16704820096492767,
0.4179352819919586,
-0.45919525623321533,
0.26871976256370544,
0.2180013209581375,
-0.47672155499458313,
0.031023196876049042,
0.18029674887657166,
0.1702224612236023,
0.16399183869361877,
0.2651037573814392,
0.03101816400885582,
-0.20879296958446503,
-0.11399412155151367,
-0.4561748504638672,
-0.16682684421539307,
0.47609978914260864,
-0.14132899045944214,
-0.39047902822494507,
0.2525065541267395,
-0.039601121097803116,
-0.058494895696640015,
-0.13647042214870453,
0.2511783540248871,
0.20282302796840668,
0.2688964605331421,
0.1673927903175354,
-0.043118707835674286,
0.3910290598869324,
-0.09773595631122589,
0.16028183698654175,
-0.14638735353946686,
0.22651541233062744,
0.3979121744632721,
0.25650864839553833,
0.15094329416751862,
-0.16234634816646576,
-0.15383952856063843,
0.29283860325813293,
0.4402935802936554,
-0.23150905966758728,
-0.252490371465683,
-0.2596589922904968,
-0.4539417028427124,
0.028257809579372406,
-0.008202210068702698,
0.23909804224967957,
-0.02446736767888069,
0.1258014440536499,
0.5828315615653992,
0.13807901740074158,
0.0797308012843132,
0.08564015477895737,
0.20184288918972015,
0.10678252577781677,
-0.5029683709144592,
-0.22109730541706085,
0.024354957044124603,
0.0866241306066513,
0.025795407593250275,
0.2148442417383194,
-0.4467760920524597,
0.08353149890899658,
0.03203340619802475,
0.09537554532289505,
0.02444135770201683,
-0.1665172278881073,
0.09082522988319397,
-0.29516851902008057,
-0.029358573257923126,
0.004499930888414383,
0.16466188430786133,
-0.019741132855415344,
-0.2584259510040283,
0.09014120697975159,
-0.4133354425430298,
-0.14495441317558289,
0.2519211173057556,
-0.06397548317909241,
-0.03560630604624748,
-0.02954615280032158,
0.2790569067001343,
-0.17512495815753937,
-0.421829491853714,
0.024502409622073174,
-0.2910039722919464,
0.05839325115084648,
0.08539845794439316,
0.036944713443517685,
-0.12661099433898926,
-0.3338952660560608,
-0.24623221158981323,
-0.013470200821757317,
-0.7772453427314758,
0.32486456632614136,
-0.12303780019283295,
-0.11350063979625702,
-0.2692411243915558,
0.08674409240484238,
-0.22429722547531128,
0.6580153107643127,
-0.20190191268920898,
0.21332412958145142,
-0.3532976508140564,
-0.07193057239055634,
-0.3670128583908081,
-0.048543039709329605,
-0.020693231374025345,
-0.16751912236213684,
0.09554053097963333,
0.05557221174240112,
0.049633465707302094,
-0.11334788799285889,
0.029329735785722733,
0.08753447234630585,
0.11667424440383911,
0.3743647038936615,
0.21654324233531952,
0.6643580198287964,
-0.20162442326545715,
0.0718219205737114,
-0.05623826012015343,
-0.028780203312635422,
0.06896042823791504,
-0.26424112915992737,
-0.15772733092308044,
0.4217643439769745,
0.38185590505599976,
-0.0015438571572303772,
0.19038833677768707,
-0.23491036891937256,
-0.3391221761703491,
-0.19819337129592896,
0.03436850756406784,
0.315182626247406,
-0.06446786969900131,
0.052022628486156464,
-0.13796910643577576,
0.14662311971187592,
-0.05256678909063339,
-0.048441510647535324,
-0.18520128726959229,
-0.4750244617462158,
-0.0839693695306778,
0.12112526595592499,
0.5518844127655029,
-0.10306951403617859,
-0.2825576066970825,
-0.19512754678726196,
-0.5225038528442383,
-0.043795883655548096,
0.2537783086299896,
0.368940144777298,
0.032349593937397,
-0.06577859073877335,
0.10476052761077881,
0.31485894322395325,
0.744518518447876,
-0.0740273967385292,
0.018523624166846275,
0.0458604097366333,
-0.07763773947954178,
-0.4428001642227173,
-0.05149250850081444,
-0.011488370597362518,
0.057242825627326965,
-0.180398628115654,
0.35137656331062317,
-0.06373261660337448,
-0.14549627900123596,
-0.01675576902925968,
0.0669584721326828,
-0.02652662992477417,
-0.20313461124897003,
-0.13181495666503906,
0.09566895663738251,
-0.05508030578494072,
0.08914058655500412,
0.018820323050022125,
0.04103576019406319,
-0.00527673214673996,
0.016199685633182526,
0.13399486243724823,
0.227474644780159,
0.14420956373214722,
0.010509107261896133,
0.004926305264234543,
0.6256529092788696,
0.39289718866348267,
-0.1907334178686142,
-0.38870710134506226,
0.4113311469554901,
0.07290098816156387,
0.036215391010046005,
-0.22414517402648926,
-0.11673340201377869,
0.42211484909057617,
0.32097262144088745,
-0.006469905376434326,
-0.12681925296783447,
0.2672598958015442,
-0.28497314453125,
0.21704885363578796,
-0.21845780313014984,
0.23188021779060364,
0.07678557187318802,
-0.19167304039001465,
-0.4455159306526184,
-0.7582138776779175,
0.09554816782474518,
0.06974475085735321,
0.19343116879463196,
0.34352201223373413,
-0.1380538046360016,
-0.0420919731259346,
0.1333712339401245,
-0.04081578180193901,
0.4977676272392273,
-0.42464756965637207,
0.11636023223400116,
0.2093137949705124,
0.2561694085597992,
0.19325247406959534,
-0.18855872750282288,
0.3096356987953186,
-0.017890021204948425,
-0.6082273721694946,
0.12617895007133484,
-0.07379765808582306,
-0.2727213501930237,
0.07668048143386841,
-0.029175512492656708,
-0.08005137741565704,
0.2750013470649719,
-0.17965620756149292,
-0.22301647067070007,
0.25461310148239136,
-0.10962178558111191,
-0.21101072430610657,
0.10652932524681091,
-0.005677748471498489,
-0.07017132639884949,
-0.10813362151384354,
0.173651322722435,
-0.05496305599808693,
-0.13606193661689758,
0.4939269721508026,
-0.3460092842578888,
-0.10362493991851807,
-0.13499794900417328,
-0.06900790333747864,
-0.29120469093322754,
0.016796976327896118,
0.20570024847984314,
0.16671739518642426,
-0.15874910354614258,
0.2722174823284149,
-0.19497384130954742,
0.15150275826454163,
0.08157961070537567,
0.2023181915283203,
-0.023128310218453407,
0.11166681349277496,
0.20823010802268982,
0.0381602868437767,
-0.04322992265224457,
-0.038909703493118286,
0.15024472773075104,
-0.5930888652801514,
-0.4484444260597229,
-0.3225266635417938,
0.5404589176177979,
-0.06252773106098175,
-0.28523796796798706,
0.1309811770915985,
0.02529134601354599,
0.03281926363706589,
-0.0035849958658218384,
-0.02084917575120926,
-0.11880159378051758,
0.24247880280017853,
-0.16880068182945251,
-0.16528275609016418,
0.06994512677192688,
0.23230662941932678,
-0.11476664990186691,
0.41326186060905457,
0.21673038601875305,
0.06517225503921509,
-0.19331729412078857,
0.1376563161611557,
0.2257593870162964,
0.1804117113351822,
0.22657586634159088,
0.07689705491065979,
0.038241662085056305,
0.39643749594688416,
0.25916382670402527,
0.1452910602092743,
-0.24255606532096863,
-0.21488520503044128,
-0.0930887758731842,
-0.07069972157478333,
-0.3272583484649658,
0.2000267207622528,
0.029282279312610626,
0.14958038926124573,
-0.10626491904258728,
0.33364278078079224,
-0.33957821130752563,
0.07529427111148834,
-0.16732101142406464,
-0.12533029913902283,
0.3562643527984619,
-0.01083293929696083,
-0.10062898695468903,
0.10520729422569275,
-0.0958055928349495,
-0.04224509745836258,
-0.02103513851761818,
0.03532177582383156,
-0.06229365989565849,
-0.13535134494304657,
0.10958649218082428,
0.16847404837608337,
0.19041045010089874,
0.09926950186491013,
-0.017818167805671692,
-0.4113350212574005,
-0.5071666836738586,
-0.19174674153327942,
0.31270211935043335,
0.3420356512069702,
-0.16455650329589844,
0.1640501618385315,
0.5716625452041626,
-0.013330526649951935,
0.09759798645973206,
0.3349067270755768,
-0.03844481334090233,
-0.14389915764331818,
-0.01045670360326767,
0.005055754445493221,
0.12301255017518997,
-0.2057405710220337,
-0.18765613436698914,
0.08288727700710297,
0.35624268651008606,
-0.2137010097503662,
0.4620453715324402,
-0.0986713096499443,
0.13453640043735504,
0.3764142096042633,
0.060565412044525146,
0.520057201385498,
0.0595700666308403,
-0.1480012983083725,
0.30175116658210754,
0.015174860134720802,
0.06482400000095367,
-0.11955176293849945,
0.09643243253231049,
0.120694100856781,
0.019550956785678864,
-0.042637839913368225,
-0.44977498054504395,
0.14961126446723938,
-0.2263684868812561,
0.009095326066017151,
-0.05790667235851288,
-0.04634811729192734,
-0.099545419216156,
0.4748772382736206,
0.21065613627433777,
-0.06722211092710495,
0.02048393152654171,
0.021007459610700607,
-0.08552318066358566,
0.21836519241333008,
0.43438470363616943,
0.5978075861930847,
-0.2594592869281769,
0.03274749964475632,
0.13612884283065796,
-0.5354208946228027,
0.05668856203556061,
0.4889211654663086,
-0.30954259634017944,
0.4904986619949341,
-0.003783024847507477,
-0.029867224395275116,
0.10153795778751373,
0.06864790618419647,
0.025280550122261047,
0.2697438895702362,
-0.03040427714586258,
-0.16990311443805695,
0.32800793647766113,
-0.1848219931125641,
0.055118754506111145,
0.2872416377067566,
-0.10221555829048157,
0.2465972602367401,
-0.1259552538394928,
0.01239677146077156,
0.07912851870059967,
-0.06825990974903107,
0.0251060388982296,
0.2936537563800812,
0.3825018107891083,
-0.10393384099006653,
-0.14573143422603607,
-0.2167152762413025,
-0.17724382877349854,
0.24569498002529144,
0.07448730617761612,
-0.26268136501312256,
0.2221691757440567,
0.1887345314025879,
0.05518120154738426,
-0.2858293354511261,
0.04294329136610031,
0.19329407811164856,
0.5651171207427979,
0.3135744631290436,
0.013585241511464119,
0.15731605887413025,
-0.08432899415493011,
0.02177165076136589,
-0.10404862463474274,
-0.058586396276950836,
-0.0076270941644907,
-0.15072201192378998,
-0.08144587278366089,
0.40096551179885864,
-0.01726365089416504,
0.031300079077482224,
0.1463305950164795,
-0.17223608493804932,
0.1501220017671585,
-0.16259095072746277,
-0.26255860924720764,
-0.03661666437983513,
0.08307251334190369,
0.01768280565738678,
-0.07883179187774658,
0.3910236358642578,
0.08653640747070312,
0.11891546100378036,
-0.06375298649072647,
-0.2873784303665161,
-0.11127189546823502,
-0.048943616449832916,
0.15400254726409912,
0.33990076184272766,
0.2929076552391052,
0.14069214463233948,
0.14782842993736267,
0.13689061999320984,
-0.4263671636581421,
-0.3373555541038513,
-0.35543033480644226,
0.3722875118255615,
-0.0667949914932251,
-0.11683676391839981,
-0.40326741337776184,
0.02293452061712742,
-0.05987577512860298,
-0.3626335561275482,
0.2803189754486084,
-0.04770227521657944,
-0.15123528242111206,
-0.10171950608491898,
0.21416129171848297,
0.055751070380210876,
0.1204037144780159,
-0.014791879802942276,
0.020047033205628395,
0.046135541051626205,
-0.04605816304683685,
0.22112707793712616,
-0.14615464210510254,
0.1504165232181549,
-0.30052176117897034,
-0.03967496007680893,
0.008905136957764626,
0.1572670042514801,
0.0034305788576602936,
-0.32804399728775024,
0.0228627547621727,
0.09940303862094879,
-0.057285912334918976,
-0.2660473883152008,
-0.2052295058965683,
-0.1559358537197113,
0.19672153890132904,
0.23520661890506744,
0.0430343821644783,
0.29210370779037476,
0.011368824169039726,
-0.03477350249886513,
-0.19359715282917023,
0.19077283143997192,
0.31343281269073486,
-0.26495927572250366,
-0.0522046759724617,
-0.13773484528064728,
-0.14118853211402893,
-0.13327360153198242,
0.16391858458518982,
-0.25584545731544495,
0.07548561692237854,
0.37013906240463257,
0.08442695438861847,
0.3799709677696228,
0.6382097601890564,
-0.09944447129964828,
0.04109785705804825,
0.02537544071674347,
0.4129834771156311,
-0.016234057024121284,
-0.09160162508487701,
-0.19207537174224854,
-0.12760406732559204
] |
https://github.com/huggingface/datasets/issues/6229 | From what I see, `MMSegInferencer` supports NumPy arrays, so replace the line `image_path = example['image']` with `image_path = np.array(example['image'])` to fix the issue (`example["image"]` is a `PIL.Image` object). | Apply inference on all images in the dataset | ### Describe the bug
```
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In[14], line 11
9 for idx, example in enumerate(dataset['train']):
10 image_path = example['image']
---> 11 mask_image = process_image(image_path)
12 mask_image.save(f"mask_{idx}.png")
Cell In[14], line 4, in process_image(image_path)
2 def process_image(image_path):
3 print("Processing image:", image_path)
----> 4 result = inferencer(image_path)['predictions']
5 mask = np.where(result == 12, 255, 0).astype('uint8')
6 return Image.fromarray(mask)
File /usr/local/lib/python3.10/dist-packages/mmseg/apis/mmseg_inferencer.py:183, in MMSegInferencer.__call__(self, inputs, return_datasamples, batch_size, show, wait_time, out_dir, img_out_dir, pred_out_dir, **kwargs)
180 pred_out_dir = ''
181 img_out_dir = ''
--> 183 return super().__call__(
184 inputs=inputs,
185 return_datasamples=return_datasamples,
186 batch_size=batch_size,
187 show=show,
188 wait_time=wait_time,
189 img_out_dir=img_out_dir,
190 pred_out_dir=pred_out_dir,
191 **kwargs)
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:221, in BaseInferencer.__call__(self, inputs, return_datasamples, batch_size, **kwargs)
218 inputs = self.preprocess(
219 ori_inputs, batch_size=batch_size, **preprocess_kwargs)
220 preds = []
--> 221 for data in (track(inputs, description='Inference')
222 if self.show_progress else inputs):
223 preds.extend(self.forward(data, **forward_kwargs))
224 visualization = self.visualize(
225 ori_inputs, preds,
226 **visualize_kwargs) # type: ignore # noqa: E501
File /usr/local/lib/python3.10/dist-packages/rich/progress.py:168, in track(sequence, description, total, auto_refresh, console, transient, get_time, refresh_per_second, style, complete_style, finished_style, pulse_style, update_period, disable, show_speed)
157 progress = Progress(
158 *columns,
159 auto_refresh=auto_refresh,
(...)
164 disable=disable,
165 )
167 with progress:
--> 168 yield from progress.track(
169 sequence, total=total, description=description, update_period=update_period
170 )
File /usr/local/lib/python3.10/dist-packages/rich/progress.py:1210, in Progress.track(self, sequence, total, task_id, description, update_period)
1208 if self.live.auto_refresh:
1209 with _TrackThread(self, task_id, update_period) as track_thread:
-> 1210 for value in sequence:
1211 yield value
1212 track_thread.completed += 1
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:291, in BaseInferencer.preprocess(self, inputs, batch_size, **kwargs)
266 """Process the inputs into a model-feedable format.
267
268 Customize your preprocess by overriding this method. Preprocess should
(...)
287 Any: Data processed by the ``pipeline`` and ``collate_fn``.
288 """
289 chunked_data = self._get_chunk_data(
290 map(self.pipeline, inputs), batch_size)
--> 291 yield from map(self.collate_fn, chunked_data)
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:588, in BaseInferencer._get_chunk_data(self, inputs, chunk_size)
586 chunk_data = []
587 for _ in range(chunk_size):
--> 588 processed_data = next(inputs_iter)
589 chunk_data.append(processed_data)
590 yield chunk_data
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results)
9 def __call__(self,
10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]:
---> 12 return self.transform(results)
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/wrappers.py:88, in Compose.transform(self, results)
79 """Call function to apply transforms sequentially.
80
81 Args:
(...)
85 dict or None: Transformed results.
86 """
87 for t in self.transforms:
---> 88 results = t(results) # type: ignore
89 if results is None:
90 return None
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results)
9 def __call__(self,
10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]:
---> 12 return self.transform(results)
File /usr/local/lib/python3.10/dist-packages/mmseg/datasets/transforms/loading.py:496, in InferencerLoader.transform(self, single_input)
494 inputs = single_input
495 else:
--> 496 raise NotImplementedError
498 if 'img' in inputs:
499 return self.from_ndarray(inputs)
NotImplementedError:
````
### Steps to reproduce the bug
```
from datasets import load_dataset
dataset = load_dataset('Andyrasika/cat_kingdom')
dataset
from mmseg.apis import MMSegInferencer
checkpoint_name = 'segformer_mit-b5_8xb2-160k_ade20k-640x640'
inferencer = MMSegInferencer(model=checkpoint_name)
# Define a function to apply the code to each image in the dataset
def process_image(image_path):
print("Processing image:", image_path)
result = inferencer(image_path)['predictions']
mask = np.where(result == 12, 255, 0).astype('uint8')
return Image.fromarray(mask)
# Process and save masks for each image in the dataset
for idx, example in enumerate(dataset['train']):
image_path = example['image']
mask_image = process_image(image_path)
mask_image.save(f"mask_{idx}.png")
```
### Expected behavior
create a separate column with masks in the dataset and further shows as a separate column in hub
### Environment info
jupyter notebook RTX 3090 | 28 | Apply inference on all images in the dataset
### Describe the bug
```
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In[14], line 11
9 for idx, example in enumerate(dataset['train']):
10 image_path = example['image']
---> 11 mask_image = process_image(image_path)
12 mask_image.save(f"mask_{idx}.png")
Cell In[14], line 4, in process_image(image_path)
2 def process_image(image_path):
3 print("Processing image:", image_path)
----> 4 result = inferencer(image_path)['predictions']
5 mask = np.where(result == 12, 255, 0).astype('uint8')
6 return Image.fromarray(mask)
File /usr/local/lib/python3.10/dist-packages/mmseg/apis/mmseg_inferencer.py:183, in MMSegInferencer.__call__(self, inputs, return_datasamples, batch_size, show, wait_time, out_dir, img_out_dir, pred_out_dir, **kwargs)
180 pred_out_dir = ''
181 img_out_dir = ''
--> 183 return super().__call__(
184 inputs=inputs,
185 return_datasamples=return_datasamples,
186 batch_size=batch_size,
187 show=show,
188 wait_time=wait_time,
189 img_out_dir=img_out_dir,
190 pred_out_dir=pred_out_dir,
191 **kwargs)
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:221, in BaseInferencer.__call__(self, inputs, return_datasamples, batch_size, **kwargs)
218 inputs = self.preprocess(
219 ori_inputs, batch_size=batch_size, **preprocess_kwargs)
220 preds = []
--> 221 for data in (track(inputs, description='Inference')
222 if self.show_progress else inputs):
223 preds.extend(self.forward(data, **forward_kwargs))
224 visualization = self.visualize(
225 ori_inputs, preds,
226 **visualize_kwargs) # type: ignore # noqa: E501
File /usr/local/lib/python3.10/dist-packages/rich/progress.py:168, in track(sequence, description, total, auto_refresh, console, transient, get_time, refresh_per_second, style, complete_style, finished_style, pulse_style, update_period, disable, show_speed)
157 progress = Progress(
158 *columns,
159 auto_refresh=auto_refresh,
(...)
164 disable=disable,
165 )
167 with progress:
--> 168 yield from progress.track(
169 sequence, total=total, description=description, update_period=update_period
170 )
File /usr/local/lib/python3.10/dist-packages/rich/progress.py:1210, in Progress.track(self, sequence, total, task_id, description, update_period)
1208 if self.live.auto_refresh:
1209 with _TrackThread(self, task_id, update_period) as track_thread:
-> 1210 for value in sequence:
1211 yield value
1212 track_thread.completed += 1
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:291, in BaseInferencer.preprocess(self, inputs, batch_size, **kwargs)
266 """Process the inputs into a model-feedable format.
267
268 Customize your preprocess by overriding this method. Preprocess should
(...)
287 Any: Data processed by the ``pipeline`` and ``collate_fn``.
288 """
289 chunked_data = self._get_chunk_data(
290 map(self.pipeline, inputs), batch_size)
--> 291 yield from map(self.collate_fn, chunked_data)
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:588, in BaseInferencer._get_chunk_data(self, inputs, chunk_size)
586 chunk_data = []
587 for _ in range(chunk_size):
--> 588 processed_data = next(inputs_iter)
589 chunk_data.append(processed_data)
590 yield chunk_data
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results)
9 def __call__(self,
10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]:
---> 12 return self.transform(results)
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/wrappers.py:88, in Compose.transform(self, results)
79 """Call function to apply transforms sequentially.
80
81 Args:
(...)
85 dict or None: Transformed results.
86 """
87 for t in self.transforms:
---> 88 results = t(results) # type: ignore
89 if results is None:
90 return None
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results)
9 def __call__(self,
10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]:
---> 12 return self.transform(results)
File /usr/local/lib/python3.10/dist-packages/mmseg/datasets/transforms/loading.py:496, in InferencerLoader.transform(self, single_input)
494 inputs = single_input
495 else:
--> 496 raise NotImplementedError
498 if 'img' in inputs:
499 return self.from_ndarray(inputs)
NotImplementedError:
````
### Steps to reproduce the bug
```
from datasets import load_dataset
dataset = load_dataset('Andyrasika/cat_kingdom')
dataset
from mmseg.apis import MMSegInferencer
checkpoint_name = 'segformer_mit-b5_8xb2-160k_ade20k-640x640'
inferencer = MMSegInferencer(model=checkpoint_name)
# Define a function to apply the code to each image in the dataset
def process_image(image_path):
print("Processing image:", image_path)
result = inferencer(image_path)['predictions']
mask = np.where(result == 12, 255, 0).astype('uint8')
return Image.fromarray(mask)
# Process and save masks for each image in the dataset
for idx, example in enumerate(dataset['train']):
image_path = example['image']
mask_image = process_image(image_path)
mask_image.save(f"mask_{idx}.png")
```
### Expected behavior
create a separate column with masks in the dataset and further shows as a separate column in hub
### Environment info
jupyter notebook RTX 3090
From what I see, `MMSegInferencer` supports NumPy arrays, so replace the line `image_path = example['image']` with `image_path = np.array(example['image'])` to fix the issue (`example["image"]` is a `PIL.Image` object). | [
-0.16085383296012878,
-0.25083857774734497,
-0.12638023495674133,
0.06236794963479042,
0.177998349070549,
-0.13726964592933655,
0.46878403425216675,
0.2857837378978729,
-0.16836467385292053,
0.47970694303512573,
0.05943524092435837,
0.309304416179657,
-0.1869792491197586,
-0.23190489411354065,
-0.08889798820018768,
0.029002824798226357,
-0.13029885292053223,
0.08785492181777954,
-0.2631213665008545,
-0.32334253191947937,
-0.4141600728034973,
0.20842427015304565,
-0.042381152510643005,
0.19472631812095642,
-0.25941941142082214,
-0.056568294763565063,
-0.16699284315109253,
0.2089439481496811,
-0.1627531498670578,
-0.29512909054756165,
-0.08124338090419769,
-0.11968284845352173,
-0.11149246990680695,
0.19135162234306335,
-0.00010776155977509916,
-0.04945707321166992,
0.26245665550231934,
-0.07310266047716141,
-0.06873799860477448,
0.07661323994398117,
-0.003012537956237793,
-0.07928520441055298,
0.026131704449653625,
-0.41020068526268005,
-0.17082759737968445,
0.08637630194425583,
0.2034817636013031,
-0.2334618717432022,
0.3334730863571167,
0.372114360332489,
0.3077137768268585,
0.04326450452208519,
-0.1895155906677246,
-0.18495234847068787,
0.021913230419158936,
-0.02599993348121643,
0.1785585582256317,
0.03971955180168152,
-0.03698369488120079,
-0.1628408133983612,
0.021184615790843964,
0.513190507888794,
-0.07747125625610352,
0.16944868862628937,
-0.07322244346141815,
0.04460242763161659,
0.7400396466255188,
-0.21669906377792358,
0.00043889181688427925,
0.07243022322654724,
-0.056413423269987106,
0.12941282987594604,
-0.19041118025779724,
-0.16673456132411957,
-0.11451181024312973,
-0.2040364295244217,
0.06983634829521179,
0.17058688402175903,
-0.2545662820339203,
-0.04258807376027107,
-0.048785995692014694,
0.09275035560131073,
-0.20458883047103882,
-0.01187586784362793,
-0.24509018659591675,
0.15484027564525604,
0.049381550401449203,
0.11723707616329193,
-0.012610651552677155,
0.05880313366651535,
-0.06442511081695557,
-0.06477939337491989,
0.03052123822271824,
-0.13563933968544006,
-0.16337397694587708,
0.010002560913562775,
0.24299989640712738,
0.061266519129276276,
0.017799079418182373,
0.06691940128803253,
-0.1886419653892517,
0.025551985949277878,
0.3096899390220642,
0.22607001662254333,
0.049260322004556656,
-0.09890413284301758,
-0.5513803362846375,
0.16679370403289795,
0.20635883510112762,
0.06103282421827316,
-0.1811063289642334,
-0.02464752458035946,
0.10577769577503204,
-0.3378998935222626,
0.16634520888328552,
0.10543397068977356,
0.2996346056461334,
-0.10309000313282013,
-0.40535715222358704,
0.04388817027211189,
-0.21092501282691956,
0.2862146496772766,
-0.07919108122587204,
0.33028444647789,
-0.042597390711307526,
0.19854186475276947,
0.20642012357711792,
-0.05642053112387657,
-0.22329342365264893,
-0.05716272443532944,
-0.35224616527557373,
0.1987953633069992,
-0.4150283634662628,
-0.17084556818008423,
-0.14214472472667694,
0.3212313652038574,
0.21325194835662842,
-0.15639078617095947,
-0.08854803442955017,
-0.06487977504730225,
0.00879233330488205,
-0.2676304578781128,
0.4759840667247772,
0.20451389253139496,
-0.08941009640693665,
-0.1617588996887207,
0.27232474088668823,
0.07189425081014633,
-0.011994384229183197,
0.02972583845257759,
-0.09636794030666351,
-0.057263702154159546,
-0.14916329085826874,
0.3420904874801636,
-0.03820047527551651,
0.17946085333824158,
-0.030201222747564316,
0.08690907061100006,
0.07169666886329651,
0.12743501365184784,
0.2565721869468689,
-0.2905803918838501,
-0.39021897315979004,
-0.17182275652885437,
0.2820564806461334,
0.39920341968536377,
0.02400849014520645,
-0.09393474459648132,
-0.23646649718284607,
-0.15318387746810913,
0.130425363779068,
0.12245246767997742,
0.10881049931049347,
0.23057444393634796,
-0.44829314947128296,
0.062284961342811584,
0.1390625238418579,
-0.2430332899093628,
-0.2741459012031555,
-0.06907223165035248,
-0.3322739601135254,
0.23325254023075104,
0.09267502278089523,
0.10209093987941742,
0.08550997078418732,
0.2608160674571991,
0.03974955156445503,
0.22779963910579681,
-0.04825354367494583,
0.2008322775363922,
-0.29993778467178345,
0.13459327816963196,
-0.05032901465892792,
0.10178308933973312,
0.41468602418899536,
0.02776835672557354,
-0.028046302497386932,
-0.06695175170898438,
0.2222697138786316,
-0.2114914357662201,
-0.031222911551594734,
-0.10132323205471039,
0.49223148822784424,
-0.15155509114265442,
0.0838249921798706,
-0.19034767150878906,
0.04118691384792328,
0.12114616483449936,
-0.26989489793777466,
0.22750446200370789,
-0.18272659182548523,
-0.05647804215550423,
-0.04813363403081894,
-0.09615153074264526,
-0.22997473180294037,
-0.4138932228088379,
0.38076719641685486,
0.3803541660308838,
0.011506587266921997,
0.03473879396915436,
0.0038299039006233215,
0.4336453080177307,
-0.021872445940971375,
0.1296345591545105,
-0.04662400484085083,
0.158461794257164,
-0.2797485589981079,
-0.416820764541626,
-0.1047440618276596,
0.04939925670623779,
-0.07368601858615875,
-0.055027928203344345,
-0.16865012049674988,
0.3610057234764099,
0.22023171186447144,
0.1653538942337036,
-0.33510690927505493,
-0.17325422167778015,
-0.16631980240345,
-0.623816728591919,
-0.0585625022649765,
0.13615185022354126,
0.18916107714176178,
0.2595463991165161,
0.10552184283733368,
0.30120849609375,
0.1890275478363037,
0.007738657295703888,
0.02807854861021042,
0.042431630194187164,
0.005707144737243652,
-0.13515980541706085,
-0.19221346080303192,
-0.2088131606578827,
0.04633655399084091,
0.3687121272087097,
0.024658098816871643,
-0.06215648353099823,
-0.29887133836746216,
-0.0567985437810421,
0.1641598641872406,
0.18919770419597626,
0.09908861666917801,
-0.03832428529858589,
-0.22221505641937256,
-0.01219208538532257,
0.0485709086060524,
-0.2338121235370636,
0.3784567415714264,
0.2859404683113098,
0.047739945352077484,
0.30743011832237244,
-0.18123704195022583,
-0.10035908222198486,
0.31447768211364746,
0.46586182713508606,
0.09872084110975266,
0.2097400575876236,
0.2490542232990265,
-0.03900188207626343,
-0.5288792848587036,
-0.06162732094526291,
-0.1593051552772522,
0.16611036658287048,
-0.21875934302806854,
0.21403589844703674,
-0.24509656429290771,
-0.18423140048980713,
0.028836801648139954,
0.06096053123474121,
0.2445184290409088,
-0.10369722545146942,
0.08735020458698273,
0.1359649896621704,
-0.2567459046840668,
0.0398452952504158,
-0.25834935903549194,
0.26262974739074707,
0.24918469786643982,
0.19828295707702637,
-0.25850439071655273,
-0.013169337064027786,
-0.06662081182003021,
0.19842036068439484,
-0.037015773355960846,
0.22851352393627167,
0.3162206709384918,
-0.1483294814825058,
-0.03757881745696068,
-0.01120227761566639,
-0.5183011293411255,
0.0679633617401123,
-0.014950288459658623,
0.22982363402843475,
0.29690688848495483,
-0.10981225222349167,
0.028658486902713776,
-0.012247562408447266,
0.2623802721500397,
-0.28188684582710266,
-0.3491939902305603,
0.08782754838466644,
-0.18148845434188843,
-0.02390938252210617,
-0.30550217628479004,
-0.31181010603904724,
-0.21113328635692596,
-0.29981619119644165,
0.0763203501701355,
0.2616649568080902,
0.1991392970085144,
0.41574880480766296,
0.10848932713270187,
0.1711619347333908,
-0.03812268003821373,
0.41028085350990295,
-0.15785741806030273,
-0.2266393005847931,
0.02754567563533783,
-0.17235133051872253,
-0.162308469414711,
-0.13962675631046295,
-0.5300202965736389,
0.24454079568386078,
0.07918534427881241,
-0.3356209099292755,
-0.45842432975769043,
-0.06201266497373581,
-0.15080127120018005,
-0.015202699229121208,
-0.3010295331478119,
0.14947351813316345,
0.16096346080303192,
-0.29316988587379456,
-0.2393854260444641,
0.056584298610687256,
0.2330554872751236,
0.1271595060825348,
-0.09181614220142365,
-0.14742900431156158,
0.36527523398399353,
0.37659934163093567,
-0.19561626017093658,
0.2416802942752838,
-0.27658510208129883,
0.4553840160369873,
-0.0868239775300026,
0.17357119917869568,
-0.022008370608091354,
-0.3037755489349365,
0.4113045036792755,
0.20297041535377502,
-0.15266302227973938,
0.04738958925008774,
-0.3823649287223816,
0.083486407995224,
-0.061440736055374146,
0.19583535194396973,
-0.21465766429901123,
-0.17449888586997986,
0.0017797965556383133,
0.0830717608332634,
0.10424065589904785,
-0.047640472650527954,
0.029525384306907654,
-0.2050001621246338,
0.2228088676929474,
0.2695712745189667,
0.2063017189502716,
0.41754305362701416,
-0.19333873689174652,
-0.27057695388793945,
-0.03976503759622574,
-0.021864503622055054,
0.2047097235918045,
0.10081218183040619,
0.1683875024318695,
0.0033311396837234497,
-0.11563581228256226,
0.21381591260433197,
-0.32151055335998535,
0.6115880608558655,
-0.24905002117156982,
0.02549775503575802,
0.09428746998310089,
-0.2864815592765808,
-0.36993151903152466,
-0.11183728277683258,
-0.3108632564544678,
-0.409396767616272,
0.17388096451759338,
0.3686541020870209,
-0.20161202549934387,
-0.07654137909412384,
0.3335762321949005,
-0.1938844919204712,
-0.16273203492164612,
-0.08648483455181122,
-0.2050248682498932,
-0.10311660915613174,
-0.2670605480670929,
0.26870962977409363,
-0.0682748556137085,
0.21359704434871674,
0.07526976615190506,
-0.21342700719833374,
-0.1606278121471405,
0.02105358988046646,
-0.002759326249361038,
0.16420668363571167,
0.14382138848304749,
-0.12356650829315186,
0.14691194891929626,
0.14773206412792206,
0.36378854513168335,
0.398377001285553,
0.383327454328537,
-0.21223513782024384,
-0.14464066922664642,
0.07677039504051208,
0.2454102486371994,
0.09677138179540634,
0.24734237790107727,
-0.022542813792824745,
-0.19679252803325653,
-0.08876335620880127,
0.1892533302307129,
-0.14700298011302948,
0.4686269164085388,
0.45007219910621643,
0.0563872791826725,
0.27751630544662476,
-0.11141780018806458,
0.03609329089522362,
0.24698317050933838,
-0.042144015431404114,
-0.15580761432647705,
-0.2680087089538574,
-0.30674517154693604,
0.1712799370288849,
0.4055231511592865,
0.6805142164230347,
0.15366432070732117,
-0.001054086722433567,
0.3442355692386627,
0.04334937036037445,
0.08136479556560516,
0.20900410413742065,
0.19839757680892944,
-0.20532023906707764,
-0.19024738669395447,
-0.050909895449876785,
-0.28505170345306396,
0.20286479592323303,
-0.06951095163822174,
-0.21615836024284363,
0.1539856195449829,
-0.037598997354507446,
0.04548822343349457,
-0.01688786782324314,
-0.06623301655054092,
-0.060397885739803314,
-0.07760876417160034,
0.10858333855867386,
0.2533870041370392,
0.033178262412548065,
0.270830899477005,
0.007346339523792267,
-0.16413041949272156,
-0.10837089270353317,
-0.2872631549835205,
-0.05697236210107803,
0.233679860830307,
-0.46653828024864197,
0.03712618350982666,
-0.2626250684261322,
-0.20693212747573853,
-0.26279374957084656,
0.12498742341995239,
0.1356021761894226,
-0.0008095386438071728,
0.11409115791320801,
0.11326941847801208,
0.1520828902721405,
0.010480787605047226,
0.017879802733659744,
0.04722448065876961,
0.6831604838371277,
-0.13462890684604645,
-0.27511101961135864,
0.18730860948562622,
0.023902032524347305,
-0.09304364025592804,
-0.03345097601413727,
-0.023934535682201385,
0.4864511489868164,
0.16566134989261627,
-0.12794753909111023,
-0.22189614176750183,
-0.1760406196117401,
-0.29679855704307556,
0.24847061932086945,
0.11750870943069458,
-0.19277895987033844,
0.6005709171295166,
-0.06647372245788574,
-0.2272094190120697,
-0.01332077756524086,
0.3717731237411499,
-0.05367298051714897,
0.14067155122756958,
0.38715723156929016,
-0.27622509002685547,
-0.15810537338256836,
-0.304181843996048,
-0.2787131369113922,
0.16873019933700562,
0.11782139539718628,
0.1971079558134079,
-0.15165698528289795,
0.004914566874504089,
0.07131798565387726,
0.2275792807340622,
0.13270537555217743,
0.01532518956810236,
-0.20989783108234406,
-0.17870579659938812,
-0.43182098865509033,
0.20179688930511475,
-0.4064842462539673,
0.346470445394516,
-0.022312600165605545,
0.48120495676994324,
-0.12824532389640808,
-0.04492942988872528,
-0.4691360294818878,
0.12874835729599,
-0.3450220823287964,
0.16706550121307373,
-0.05212823301553726,
-0.20887577533721924,
-0.03573153540492058,
0.16069477796554565,
0.3237706422805786,
0.5755284428596497,
-0.2591340243816376,
-0.3102627098560333,
-0.06297290325164795,
0.08400347083806992,
0.1568494290113449,
-0.24460965394973755,
0.22261835634708405,
-0.013740457594394684,
-0.23654460906982422,
0.04330484941601753,
0.04075790196657181,
0.06497687101364136,
-0.11054052412509918,
0.06960876286029816,
-0.23740264773368835,
0.023405401036143303,
0.38000673055648804,
-0.005960081238299608,
-0.19758698344230652,
-0.177265927195549,
0.02303241565823555,
0.12169423699378967,
-0.42322778701782227,
-0.2177419364452362,
-0.1580372154712677,
0.07837963104248047,
-0.033161867409944534,
0.04322868213057518,
0.20640066266059875,
0.05560486763715744,
-0.4508601129055023,
-0.11004377156496048,
0.27493223547935486,
0.11677339673042297,
-0.11780846118927002,
0.014735423028469086,
0.014963768422603607,
0.4076984226703644,
-0.3491239845752716,
0.3373508155345917,
-0.021653516218066216,
-0.05647050589323044,
0.40833139419555664,
0.22492463886737823,
0.047157950699329376,
0.01764458417892456,
-0.15569467842578888,
0.18776234984397888,
0.25517556071281433,
-0.24153146147727966,
-0.02591337449848652,
0.2327747642993927,
-0.2517484724521637,
0.18589335680007935,
0.3337073028087616,
0.1629800796508789,
0.5125545263290405,
0.36346012353897095,
-0.01277894526720047,
0.274038165807724,
-0.26543959975242615,
-0.09765161573886871,
0.26617541909217834,
0.07794295251369476,
0.18913334608078003,
0.33587050437927246,
0.08516376465559006,
0.26950299739837646,
-0.04095333442091942,
0.008081220090389252,
0.02287193387746811,
-0.04547692835330963,
-0.18884989619255066,
0.27053868770599365,
-0.20153717696666718,
-0.051497653126716614,
-0.4920990467071533,
-0.06231364607810974,
-0.23141847550868988,
-0.07297976315021515,
0.19403761625289917,
-0.11884373426437378,
0.3435191512107849,
0.20013722777366638,
-0.1305476725101471,
-0.008820200338959694,
-0.6729939579963684,
0.13844791054725647,
0.06241476908326149,
-0.41283291578292847,
0.12423080205917358,
0.4318510890007019,
0.0555858388543129,
0.0901239663362503,
0.39801740646362305,
0.36252954602241516,
0.2480660229921341,
-0.09101027250289917,
-0.14619293808937073,
0.16078568994998932,
-0.19286197423934937,
-0.2946033179759979,
-0.008668717928230762,
0.054113682359457016,
-0.057722289115190506,
0.2233225703239441,
0.259326308965683,
-0.30572354793548584,
0.045584432780742645,
0.17037349939346313,
0.21635288000106812,
-0.30121687054634094,
0.2675648331642151,
0.21319997310638428,
0.009746655821800232,
-0.17761118710041046,
-0.06332413852214813,
-0.3722778856754303,
-0.15193992853164673,
-0.10063577443361282,
-0.146615669131279,
0.09318578243255615,
0.03351322561502457,
0.11706428229808807,
-0.23734056949615479,
-0.07603506743907928,
0.1038951724767685,
0.11181412637233734,
-0.22604869306087494,
-0.09259126335382462,
-0.3764047622680664,
0.3728986382484436,
0.08849610388278961,
-0.34106531739234924,
-0.05466318875551224,
0.3057573437690735,
-0.11453595757484436,
0.05403948947787285,
0.31528156995773315,
-0.01896032691001892,
0.1543218195438385,
0.47151488065719604,
-0.4982125163078308,
0.19848310947418213,
0.1351621150970459,
-0.2380504608154297,
0.2730514109134674,
-0.31935083866119385,
0.058285895735025406,
-0.2258215993642807,
0.28197556734085083,
-0.0033771339803934097,
0.005466103553771973,
-0.11795200407505035,
0.32421785593032837,
0.5688193440437317,
0.19820794463157654,
0.3407793641090393,
-0.2446877807378769,
-0.13181310892105103,
0.028237855061888695,
-0.03332861512899399,
-0.4946131706237793,
0.0029139816761016846,
0.09920229017734528,
0.5277743339538574,
0.16685962677001953,
-0.23497378826141357,
-0.07222196459770203,
0.2072799950838089,
0.2726665735244751,
-0.283314973115921,
-0.2119961678981781,
0.4238632917404175,
-0.03815728425979614,
0.0671653300523758,
-0.15544353425502777,
-0.0003141472116112709,
0.22300702333450317,
0.1319909244775772,
-0.44581854343414307,
-0.669092059135437,
0.6302875280380249,
-0.26665499806404114,
-0.2597367763519287,
-0.2107420563697815,
0.4208441972732544,
-0.2975257933139801,
0.04387105256319046,
-0.31544381380081177,
-0.00695018470287323,
0.32509738206863403,
-0.07370860874652863,
-0.1724848449230194,
0.15310902893543243,
0.24102365970611572,
0.05093960464000702,
-0.06937356293201447,
0.07319701462984085,
0.08322221785783768,
-0.0669018104672432,
-0.020575538277626038,
-0.4223182797431946
] |
https://github.com/huggingface/datasets/issues/6229 | > From what I see, `MMSegInferencer` supports NumPy arrays, so replace the line `image_path = example['image']` with `image_path = np.array(example['image'])` to fix the issue (`example["image"]` is a `PIL.Image` object).
Thanks @mariosasko for your reply...
i tried :
```
# Define a function to apply the code to each image in the dataset
def process_image(image_path):
print("Processing image:", image_path)
result = inferencer(image_path)['predictions']
mask = np.where(result == 12, 255, 0).astype('uint8')
return Image.fromarray(mask)
# Process and save masks for each image in the dataset
for idx, example in enumerate(dataset['train']):
image_path = np.array(example['image'])
mask_image = process_image(image_path)
mask_image.save(f"mask_{idx}.png")
```
and got
```
Processing image: [[[202 165 87]
[203 166 88]
[207 168 91]
...
[243 205 122]
[244 202 120]
[242 200 118]]
[[202 165 87]
[203 166 88]
[207 168 91]
...
[244 206 123]
[245 203 121]
[243 201 119]]
[[203 164 87]
[204 165 88]
[207 168 91]
...
[245 207 126]
[246 204 122]
[245 203 121]]
...
[[154 123 56]
[155 124 57]
[158 125 56]
...
[ 3 3 1]
[ 3 3 1]
[ 3 3 1]]
[[154 123 56]
[154 123 56]
[155 124 57]
...
[ 2 2 0]
[ 2 2 0]
[ 2 2 0]]
[[152 121 54]
[152 121 54]
[153 122 55]
...
[ 2 2 0]
[ 2 2 0]
[ 2 2 0]]]
Inference ββββββββββββββββββββββββββββββββββββββββ
Processing image: [[[ 39 44 40]
[ 39 44 40]
[ 39 43 44]
...
[187 185 164]
[208 204 175]
[203 198 166]]
[[ 42 47 43]
[ 40 45 41]
[ 40 44 45]
...
[188 186 165]
[202 198 169]
[201 196 164]]
[[ 41 46 42]
[ 39 44 40]
[ 40 44 45]
...
[187 184 165]
[197 193 166]
[201 196 166]]
...
[[ 29 27 30]
[ 28 26 29]
[ 25 23 26]
...
[ 48 33 28]
[ 44 31 25]
[ 39 26 20]]
[[ 34 29 33]
[ 32 27 31]
[ 29 24 28]
...
[ 30 17 11]
[ 36 23 15]
[ 41 28 20]]
[[ 35 30 34]
[ 33 28 32]
[ 28 23 27]
...
[ 28 15 9]
[ 41 28 20]
[ 46 33 25]]]
Inference ββββββββββββββββββββββββββββββββββββββββ
Processing image: [[[ 65 53 55]
[ 65 53 55]
[ 51 39 41]
...
[133 127 111]
[150 141 124]
[133 124 107]]
[[ 58 45 52]
[ 61 48 55]
[ 51 38 45]
...
[148 141 123]
[178 169 152]
[144 135 118]]
[[ 79 66 83]
[ 73 60 77]
[ 65 51 66]
...
[140 131 114]
[142 133 116]
[147 136 118]]
...
[[132 122 133]
[ 95 85 94]
[ 61 51 60]
...
[ 39 28 42]
[ 46 36 45]
[ 25 16 21]]
[[150 143 151]
[114 107 115]
[ 64 54 63]
...
[ 47 35 47]
[ 38 27 35]
[140 129 133]]
[[145 138 146]
[115 108 116]
[ 69 59 67]
...
[ 31 19 31]
[128 117 123]
[196 185 189]]]
Inference ββββββββββββββββββββββββββββββββββββββββ
Processing image: [[[159 151 140]
[171 163 152]
[161 148 142]
...
[198 184 171]
[189 175 162]
[183 169 156]]
[[128 118 106]
[138 128 116]
[138 125 116]
...
[200 186 173]
[190 176 163]
[187 173 160]]
[[165 153 137]
[170 158 142]
[174 162 148]
...
[200 187 171]
[188 175 159]
[182 169 153]]
```
However , when trying to add to:
```
from datasets import load_dataset
dataset = load_dataset('Andyrasika/cat_kingdom')
dataset
```
i did
```
new_column = ["mask"] * len(dataset["train"])
new_column
dataset = dataset.add_column("/workspace/data", new_column)
print(dataset)
```
got error:
```
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[11], line 3
1 new_column = ["mask"] * len(dataset["train"])
2 new_column
----> 3 dataset = dataset.add_column("/workspace/data", new_column)
5 print(dataset)
AttributeError: 'DatasetDict' object has no attribute 'add_column'
``` | Apply inference on all images in the dataset | ### Describe the bug
```
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In[14], line 11
9 for idx, example in enumerate(dataset['train']):
10 image_path = example['image']
---> 11 mask_image = process_image(image_path)
12 mask_image.save(f"mask_{idx}.png")
Cell In[14], line 4, in process_image(image_path)
2 def process_image(image_path):
3 print("Processing image:", image_path)
----> 4 result = inferencer(image_path)['predictions']
5 mask = np.where(result == 12, 255, 0).astype('uint8')
6 return Image.fromarray(mask)
File /usr/local/lib/python3.10/dist-packages/mmseg/apis/mmseg_inferencer.py:183, in MMSegInferencer.__call__(self, inputs, return_datasamples, batch_size, show, wait_time, out_dir, img_out_dir, pred_out_dir, **kwargs)
180 pred_out_dir = ''
181 img_out_dir = ''
--> 183 return super().__call__(
184 inputs=inputs,
185 return_datasamples=return_datasamples,
186 batch_size=batch_size,
187 show=show,
188 wait_time=wait_time,
189 img_out_dir=img_out_dir,
190 pred_out_dir=pred_out_dir,
191 **kwargs)
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:221, in BaseInferencer.__call__(self, inputs, return_datasamples, batch_size, **kwargs)
218 inputs = self.preprocess(
219 ori_inputs, batch_size=batch_size, **preprocess_kwargs)
220 preds = []
--> 221 for data in (track(inputs, description='Inference')
222 if self.show_progress else inputs):
223 preds.extend(self.forward(data, **forward_kwargs))
224 visualization = self.visualize(
225 ori_inputs, preds,
226 **visualize_kwargs) # type: ignore # noqa: E501
File /usr/local/lib/python3.10/dist-packages/rich/progress.py:168, in track(sequence, description, total, auto_refresh, console, transient, get_time, refresh_per_second, style, complete_style, finished_style, pulse_style, update_period, disable, show_speed)
157 progress = Progress(
158 *columns,
159 auto_refresh=auto_refresh,
(...)
164 disable=disable,
165 )
167 with progress:
--> 168 yield from progress.track(
169 sequence, total=total, description=description, update_period=update_period
170 )
File /usr/local/lib/python3.10/dist-packages/rich/progress.py:1210, in Progress.track(self, sequence, total, task_id, description, update_period)
1208 if self.live.auto_refresh:
1209 with _TrackThread(self, task_id, update_period) as track_thread:
-> 1210 for value in sequence:
1211 yield value
1212 track_thread.completed += 1
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:291, in BaseInferencer.preprocess(self, inputs, batch_size, **kwargs)
266 """Process the inputs into a model-feedable format.
267
268 Customize your preprocess by overriding this method. Preprocess should
(...)
287 Any: Data processed by the ``pipeline`` and ``collate_fn``.
288 """
289 chunked_data = self._get_chunk_data(
290 map(self.pipeline, inputs), batch_size)
--> 291 yield from map(self.collate_fn, chunked_data)
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:588, in BaseInferencer._get_chunk_data(self, inputs, chunk_size)
586 chunk_data = []
587 for _ in range(chunk_size):
--> 588 processed_data = next(inputs_iter)
589 chunk_data.append(processed_data)
590 yield chunk_data
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results)
9 def __call__(self,
10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]:
---> 12 return self.transform(results)
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/wrappers.py:88, in Compose.transform(self, results)
79 """Call function to apply transforms sequentially.
80
81 Args:
(...)
85 dict or None: Transformed results.
86 """
87 for t in self.transforms:
---> 88 results = t(results) # type: ignore
89 if results is None:
90 return None
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results)
9 def __call__(self,
10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]:
---> 12 return self.transform(results)
File /usr/local/lib/python3.10/dist-packages/mmseg/datasets/transforms/loading.py:496, in InferencerLoader.transform(self, single_input)
494 inputs = single_input
495 else:
--> 496 raise NotImplementedError
498 if 'img' in inputs:
499 return self.from_ndarray(inputs)
NotImplementedError:
````
### Steps to reproduce the bug
```
from datasets import load_dataset
dataset = load_dataset('Andyrasika/cat_kingdom')
dataset
from mmseg.apis import MMSegInferencer
checkpoint_name = 'segformer_mit-b5_8xb2-160k_ade20k-640x640'
inferencer = MMSegInferencer(model=checkpoint_name)
# Define a function to apply the code to each image in the dataset
def process_image(image_path):
print("Processing image:", image_path)
result = inferencer(image_path)['predictions']
mask = np.where(result == 12, 255, 0).astype('uint8')
return Image.fromarray(mask)
# Process and save masks for each image in the dataset
for idx, example in enumerate(dataset['train']):
image_path = example['image']
mask_image = process_image(image_path)
mask_image.save(f"mask_{idx}.png")
```
### Expected behavior
create a separate column with masks in the dataset and further shows as a separate column in hub
### Environment info
jupyter notebook RTX 3090 | 638 | Apply inference on all images in the dataset
### Describe the bug
```
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In[14], line 11
9 for idx, example in enumerate(dataset['train']):
10 image_path = example['image']
---> 11 mask_image = process_image(image_path)
12 mask_image.save(f"mask_{idx}.png")
Cell In[14], line 4, in process_image(image_path)
2 def process_image(image_path):
3 print("Processing image:", image_path)
----> 4 result = inferencer(image_path)['predictions']
5 mask = np.where(result == 12, 255, 0).astype('uint8')
6 return Image.fromarray(mask)
File /usr/local/lib/python3.10/dist-packages/mmseg/apis/mmseg_inferencer.py:183, in MMSegInferencer.__call__(self, inputs, return_datasamples, batch_size, show, wait_time, out_dir, img_out_dir, pred_out_dir, **kwargs)
180 pred_out_dir = ''
181 img_out_dir = ''
--> 183 return super().__call__(
184 inputs=inputs,
185 return_datasamples=return_datasamples,
186 batch_size=batch_size,
187 show=show,
188 wait_time=wait_time,
189 img_out_dir=img_out_dir,
190 pred_out_dir=pred_out_dir,
191 **kwargs)
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:221, in BaseInferencer.__call__(self, inputs, return_datasamples, batch_size, **kwargs)
218 inputs = self.preprocess(
219 ori_inputs, batch_size=batch_size, **preprocess_kwargs)
220 preds = []
--> 221 for data in (track(inputs, description='Inference')
222 if self.show_progress else inputs):
223 preds.extend(self.forward(data, **forward_kwargs))
224 visualization = self.visualize(
225 ori_inputs, preds,
226 **visualize_kwargs) # type: ignore # noqa: E501
File /usr/local/lib/python3.10/dist-packages/rich/progress.py:168, in track(sequence, description, total, auto_refresh, console, transient, get_time, refresh_per_second, style, complete_style, finished_style, pulse_style, update_period, disable, show_speed)
157 progress = Progress(
158 *columns,
159 auto_refresh=auto_refresh,
(...)
164 disable=disable,
165 )
167 with progress:
--> 168 yield from progress.track(
169 sequence, total=total, description=description, update_period=update_period
170 )
File /usr/local/lib/python3.10/dist-packages/rich/progress.py:1210, in Progress.track(self, sequence, total, task_id, description, update_period)
1208 if self.live.auto_refresh:
1209 with _TrackThread(self, task_id, update_period) as track_thread:
-> 1210 for value in sequence:
1211 yield value
1212 track_thread.completed += 1
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:291, in BaseInferencer.preprocess(self, inputs, batch_size, **kwargs)
266 """Process the inputs into a model-feedable format.
267
268 Customize your preprocess by overriding this method. Preprocess should
(...)
287 Any: Data processed by the ``pipeline`` and ``collate_fn``.
288 """
289 chunked_data = self._get_chunk_data(
290 map(self.pipeline, inputs), batch_size)
--> 291 yield from map(self.collate_fn, chunked_data)
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:588, in BaseInferencer._get_chunk_data(self, inputs, chunk_size)
586 chunk_data = []
587 for _ in range(chunk_size):
--> 588 processed_data = next(inputs_iter)
589 chunk_data.append(processed_data)
590 yield chunk_data
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results)
9 def __call__(self,
10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]:
---> 12 return self.transform(results)
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/wrappers.py:88, in Compose.transform(self, results)
79 """Call function to apply transforms sequentially.
80
81 Args:
(...)
85 dict or None: Transformed results.
86 """
87 for t in self.transforms:
---> 88 results = t(results) # type: ignore
89 if results is None:
90 return None
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results)
9 def __call__(self,
10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]:
---> 12 return self.transform(results)
File /usr/local/lib/python3.10/dist-packages/mmseg/datasets/transforms/loading.py:496, in InferencerLoader.transform(self, single_input)
494 inputs = single_input
495 else:
--> 496 raise NotImplementedError
498 if 'img' in inputs:
499 return self.from_ndarray(inputs)
NotImplementedError:
````
### Steps to reproduce the bug
```
from datasets import load_dataset
dataset = load_dataset('Andyrasika/cat_kingdom')
dataset
from mmseg.apis import MMSegInferencer
checkpoint_name = 'segformer_mit-b5_8xb2-160k_ade20k-640x640'
inferencer = MMSegInferencer(model=checkpoint_name)
# Define a function to apply the code to each image in the dataset
def process_image(image_path):
print("Processing image:", image_path)
result = inferencer(image_path)['predictions']
mask = np.where(result == 12, 255, 0).astype('uint8')
return Image.fromarray(mask)
# Process and save masks for each image in the dataset
for idx, example in enumerate(dataset['train']):
image_path = example['image']
mask_image = process_image(image_path)
mask_image.save(f"mask_{idx}.png")
```
### Expected behavior
create a separate column with masks in the dataset and further shows as a separate column in hub
### Environment info
jupyter notebook RTX 3090
> From what I see, `MMSegInferencer` supports NumPy arrays, so replace the line `image_path = example['image']` with `image_path = np.array(example['image'])` to fix the issue (`example["image"]` is a `PIL.Image` object).
Thanks @mariosasko for your reply...
i tried :
```
# Define a function to apply the code to each image in the dataset
def process_image(image_path):
print("Processing image:", image_path)
result = inferencer(image_path)['predictions']
mask = np.where(result == 12, 255, 0).astype('uint8')
return Image.fromarray(mask)
# Process and save masks for each image in the dataset
for idx, example in enumerate(dataset['train']):
image_path = np.array(example['image'])
mask_image = process_image(image_path)
mask_image.save(f"mask_{idx}.png")
```
and got
```
Processing image: [[[202 165 87]
[203 166 88]
[207 168 91]
...
[243 205 122]
[244 202 120]
[242 200 118]]
[[202 165 87]
[203 166 88]
[207 168 91]
...
[244 206 123]
[245 203 121]
[243 201 119]]
[[203 164 87]
[204 165 88]
[207 168 91]
...
[245 207 126]
[246 204 122]
[245 203 121]]
...
[[154 123 56]
[155 124 57]
[158 125 56]
...
[ 3 3 1]
[ 3 3 1]
[ 3 3 1]]
[[154 123 56]
[154 123 56]
[155 124 57]
...
[ 2 2 0]
[ 2 2 0]
[ 2 2 0]]
[[152 121 54]
[152 121 54]
[153 122 55]
...
[ 2 2 0]
[ 2 2 0]
[ 2 2 0]]]
Inference ββββββββββββββββββββββββββββββββββββββββ
Processing image: [[[ 39 44 40]
[ 39 44 40]
[ 39 43 44]
...
[187 185 164]
[208 204 175]
[203 198 166]]
[[ 42 47 43]
[ 40 45 41]
[ 40 44 45]
...
[188 186 165]
[202 198 169]
[201 196 164]]
[[ 41 46 42]
[ 39 44 40]
[ 40 44 45]
...
[187 184 165]
[197 193 166]
[201 196 166]]
...
[[ 29 27 30]
[ 28 26 29]
[ 25 23 26]
...
[ 48 33 28]
[ 44 31 25]
[ 39 26 20]]
[[ 34 29 33]
[ 32 27 31]
[ 29 24 28]
...
[ 30 17 11]
[ 36 23 15]
[ 41 28 20]]
[[ 35 30 34]
[ 33 28 32]
[ 28 23 27]
...
[ 28 15 9]
[ 41 28 20]
[ 46 33 25]]]
Inference ββββββββββββββββββββββββββββββββββββββββ
Processing image: [[[ 65 53 55]
[ 65 53 55]
[ 51 39 41]
...
[133 127 111]
[150 141 124]
[133 124 107]]
[[ 58 45 52]
[ 61 48 55]
[ 51 38 45]
...
[148 141 123]
[178 169 152]
[144 135 118]]
[[ 79 66 83]
[ 73 60 77]
[ 65 51 66]
...
[140 131 114]
[142 133 116]
[147 136 118]]
...
[[132 122 133]
[ 95 85 94]
[ 61 51 60]
...
[ 39 28 42]
[ 46 36 45]
[ 25 16 21]]
[[150 143 151]
[114 107 115]
[ 64 54 63]
...
[ 47 35 47]
[ 38 27 35]
[140 129 133]]
[[145 138 146]
[115 108 116]
[ 69 59 67]
...
[ 31 19 31]
[128 117 123]
[196 185 189]]]
Inference ββββββββββββββββββββββββββββββββββββββββ
Processing image: [[[159 151 140]
[171 163 152]
[161 148 142]
...
[198 184 171]
[189 175 162]
[183 169 156]]
[[128 118 106]
[138 128 116]
[138 125 116]
...
[200 186 173]
[190 176 163]
[187 173 160]]
[[165 153 137]
[170 158 142]
[174 162 148]
...
[200 187 171]
[188 175 159]
[182 169 153]]
```
However , when trying to add to:
```
from datasets import load_dataset
dataset = load_dataset('Andyrasika/cat_kingdom')
dataset
```
i did
```
new_column = ["mask"] * len(dataset["train"])
new_column
dataset = dataset.add_column("/workspace/data", new_column)
print(dataset)
```
got error:
```
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[11], line 3
1 new_column = ["mask"] * len(dataset["train"])
2 new_column
----> 3 dataset = dataset.add_column("/workspace/data", new_column)
5 print(dataset)
AttributeError: 'DatasetDict' object has no attribute 'add_column'
``` | [
-0.16085383296012878,
-0.25083857774734497,
-0.12638023495674133,
0.06236794963479042,
0.177998349070549,
-0.13726964592933655,
0.46878403425216675,
0.2857837378978729,
-0.16836467385292053,
0.47970694303512573,
0.05943524092435837,
0.309304416179657,
-0.1869792491197586,
-0.23190489411354065,
-0.08889798820018768,
0.029002824798226357,
-0.13029885292053223,
0.08785492181777954,
-0.2631213665008545,
-0.32334253191947937,
-0.4141600728034973,
0.20842427015304565,
-0.042381152510643005,
0.19472631812095642,
-0.25941941142082214,
-0.056568294763565063,
-0.16699284315109253,
0.2089439481496811,
-0.1627531498670578,
-0.29512909054756165,
-0.08124338090419769,
-0.11968284845352173,
-0.11149246990680695,
0.19135162234306335,
-0.00010776155977509916,
-0.04945707321166992,
0.26245665550231934,
-0.07310266047716141,
-0.06873799860477448,
0.07661323994398117,
-0.003012537956237793,
-0.07928520441055298,
0.026131704449653625,
-0.41020068526268005,
-0.17082759737968445,
0.08637630194425583,
0.2034817636013031,
-0.2334618717432022,
0.3334730863571167,
0.372114360332489,
0.3077137768268585,
0.04326450452208519,
-0.1895155906677246,
-0.18495234847068787,
0.021913230419158936,
-0.02599993348121643,
0.1785585582256317,
0.03971955180168152,
-0.03698369488120079,
-0.1628408133983612,
0.021184615790843964,
0.513190507888794,
-0.07747125625610352,
0.16944868862628937,
-0.07322244346141815,
0.04460242763161659,
0.7400396466255188,
-0.21669906377792358,
0.00043889181688427925,
0.07243022322654724,
-0.056413423269987106,
0.12941282987594604,
-0.19041118025779724,
-0.16673456132411957,
-0.11451181024312973,
-0.2040364295244217,
0.06983634829521179,
0.17058688402175903,
-0.2545662820339203,
-0.04258807376027107,
-0.048785995692014694,
0.09275035560131073,
-0.20458883047103882,
-0.01187586784362793,
-0.24509018659591675,
0.15484027564525604,
0.049381550401449203,
0.11723707616329193,
-0.012610651552677155,
0.05880313366651535,
-0.06442511081695557,
-0.06477939337491989,
0.03052123822271824,
-0.13563933968544006,
-0.16337397694587708,
0.010002560913562775,
0.24299989640712738,
0.061266519129276276,
0.017799079418182373,
0.06691940128803253,
-0.1886419653892517,
0.025551985949277878,
0.3096899390220642,
0.22607001662254333,
0.049260322004556656,
-0.09890413284301758,
-0.5513803362846375,
0.16679370403289795,
0.20635883510112762,
0.06103282421827316,
-0.1811063289642334,
-0.02464752458035946,
0.10577769577503204,
-0.3378998935222626,
0.16634520888328552,
0.10543397068977356,
0.2996346056461334,
-0.10309000313282013,
-0.40535715222358704,
0.04388817027211189,
-0.21092501282691956,
0.2862146496772766,
-0.07919108122587204,
0.33028444647789,
-0.042597390711307526,
0.19854186475276947,
0.20642012357711792,
-0.05642053112387657,
-0.22329342365264893,
-0.05716272443532944,
-0.35224616527557373,
0.1987953633069992,
-0.4150283634662628,
-0.17084556818008423,
-0.14214472472667694,
0.3212313652038574,
0.21325194835662842,
-0.15639078617095947,
-0.08854803442955017,
-0.06487977504730225,
0.00879233330488205,
-0.2676304578781128,
0.4759840667247772,
0.20451389253139496,
-0.08941009640693665,
-0.1617588996887207,
0.27232474088668823,
0.07189425081014633,
-0.011994384229183197,
0.02972583845257759,
-0.09636794030666351,
-0.057263702154159546,
-0.14916329085826874,
0.3420904874801636,
-0.03820047527551651,
0.17946085333824158,
-0.030201222747564316,
0.08690907061100006,
0.07169666886329651,
0.12743501365184784,
0.2565721869468689,
-0.2905803918838501,
-0.39021897315979004,
-0.17182275652885437,
0.2820564806461334,
0.39920341968536377,
0.02400849014520645,
-0.09393474459648132,
-0.23646649718284607,
-0.15318387746810913,
0.130425363779068,
0.12245246767997742,
0.10881049931049347,
0.23057444393634796,
-0.44829314947128296,
0.062284961342811584,
0.1390625238418579,
-0.2430332899093628,
-0.2741459012031555,
-0.06907223165035248,
-0.3322739601135254,
0.23325254023075104,
0.09267502278089523,
0.10209093987941742,
0.08550997078418732,
0.2608160674571991,
0.03974955156445503,
0.22779963910579681,
-0.04825354367494583,
0.2008322775363922,
-0.29993778467178345,
0.13459327816963196,
-0.05032901465892792,
0.10178308933973312,
0.41468602418899536,
0.02776835672557354,
-0.028046302497386932,
-0.06695175170898438,
0.2222697138786316,
-0.2114914357662201,
-0.031222911551594734,
-0.10132323205471039,
0.49223148822784424,
-0.15155509114265442,
0.0838249921798706,
-0.19034767150878906,
0.04118691384792328,
0.12114616483449936,
-0.26989489793777466,
0.22750446200370789,
-0.18272659182548523,
-0.05647804215550423,
-0.04813363403081894,
-0.09615153074264526,
-0.22997473180294037,
-0.4138932228088379,
0.38076719641685486,
0.3803541660308838,
0.011506587266921997,
0.03473879396915436,
0.0038299039006233215,
0.4336453080177307,
-0.021872445940971375,
0.1296345591545105,
-0.04662400484085083,
0.158461794257164,
-0.2797485589981079,
-0.416820764541626,
-0.1047440618276596,
0.04939925670623779,
-0.07368601858615875,
-0.055027928203344345,
-0.16865012049674988,
0.3610057234764099,
0.22023171186447144,
0.1653538942337036,
-0.33510690927505493,
-0.17325422167778015,
-0.16631980240345,
-0.623816728591919,
-0.0585625022649765,
0.13615185022354126,
0.18916107714176178,
0.2595463991165161,
0.10552184283733368,
0.30120849609375,
0.1890275478363037,
0.007738657295703888,
0.02807854861021042,
0.042431630194187164,
0.005707144737243652,
-0.13515980541706085,
-0.19221346080303192,
-0.2088131606578827,
0.04633655399084091,
0.3687121272087097,
0.024658098816871643,
-0.06215648353099823,
-0.29887133836746216,
-0.0567985437810421,
0.1641598641872406,
0.18919770419597626,
0.09908861666917801,
-0.03832428529858589,
-0.22221505641937256,
-0.01219208538532257,
0.0485709086060524,
-0.2338121235370636,
0.3784567415714264,
0.2859404683113098,
0.047739945352077484,
0.30743011832237244,
-0.18123704195022583,
-0.10035908222198486,
0.31447768211364746,
0.46586182713508606,
0.09872084110975266,
0.2097400575876236,
0.2490542232990265,
-0.03900188207626343,
-0.5288792848587036,
-0.06162732094526291,
-0.1593051552772522,
0.16611036658287048,
-0.21875934302806854,
0.21403589844703674,
-0.24509656429290771,
-0.18423140048980713,
0.028836801648139954,
0.06096053123474121,
0.2445184290409088,
-0.10369722545146942,
0.08735020458698273,
0.1359649896621704,
-0.2567459046840668,
0.0398452952504158,
-0.25834935903549194,
0.26262974739074707,
0.24918469786643982,
0.19828295707702637,
-0.25850439071655273,
-0.013169337064027786,
-0.06662081182003021,
0.19842036068439484,
-0.037015773355960846,
0.22851352393627167,
0.3162206709384918,
-0.1483294814825058,
-0.03757881745696068,
-0.01120227761566639,
-0.5183011293411255,
0.0679633617401123,
-0.014950288459658623,
0.22982363402843475,
0.29690688848495483,
-0.10981225222349167,
0.028658486902713776,
-0.012247562408447266,
0.2623802721500397,
-0.28188684582710266,
-0.3491939902305603,
0.08782754838466644,
-0.18148845434188843,
-0.02390938252210617,
-0.30550217628479004,
-0.31181010603904724,
-0.21113328635692596,
-0.29981619119644165,
0.0763203501701355,
0.2616649568080902,
0.1991392970085144,
0.41574880480766296,
0.10848932713270187,
0.1711619347333908,
-0.03812268003821373,
0.41028085350990295,
-0.15785741806030273,
-0.2266393005847931,
0.02754567563533783,
-0.17235133051872253,
-0.162308469414711,
-0.13962675631046295,
-0.5300202965736389,
0.24454079568386078,
0.07918534427881241,
-0.3356209099292755,
-0.45842432975769043,
-0.06201266497373581,
-0.15080127120018005,
-0.015202699229121208,
-0.3010295331478119,
0.14947351813316345,
0.16096346080303192,
-0.29316988587379456,
-0.2393854260444641,
0.056584298610687256,
0.2330554872751236,
0.1271595060825348,
-0.09181614220142365,
-0.14742900431156158,
0.36527523398399353,
0.37659934163093567,
-0.19561626017093658,
0.2416802942752838,
-0.27658510208129883,
0.4553840160369873,
-0.0868239775300026,
0.17357119917869568,
-0.022008370608091354,
-0.3037755489349365,
0.4113045036792755,
0.20297041535377502,
-0.15266302227973938,
0.04738958925008774,
-0.3823649287223816,
0.083486407995224,
-0.061440736055374146,
0.19583535194396973,
-0.21465766429901123,
-0.17449888586997986,
0.0017797965556383133,
0.0830717608332634,
0.10424065589904785,
-0.047640472650527954,
0.029525384306907654,
-0.2050001621246338,
0.2228088676929474,
0.2695712745189667,
0.2063017189502716,
0.41754305362701416,
-0.19333873689174652,
-0.27057695388793945,
-0.03976503759622574,
-0.021864503622055054,
0.2047097235918045,
0.10081218183040619,
0.1683875024318695,
0.0033311396837234497,
-0.11563581228256226,
0.21381591260433197,
-0.32151055335998535,
0.6115880608558655,
-0.24905002117156982,
0.02549775503575802,
0.09428746998310089,
-0.2864815592765808,
-0.36993151903152466,
-0.11183728277683258,
-0.3108632564544678,
-0.409396767616272,
0.17388096451759338,
0.3686541020870209,
-0.20161202549934387,
-0.07654137909412384,
0.3335762321949005,
-0.1938844919204712,
-0.16273203492164612,
-0.08648483455181122,
-0.2050248682498932,
-0.10311660915613174,
-0.2670605480670929,
0.26870962977409363,
-0.0682748556137085,
0.21359704434871674,
0.07526976615190506,
-0.21342700719833374,
-0.1606278121471405,
0.02105358988046646,
-0.002759326249361038,
0.16420668363571167,
0.14382138848304749,
-0.12356650829315186,
0.14691194891929626,
0.14773206412792206,
0.36378854513168335,
0.398377001285553,
0.383327454328537,
-0.21223513782024384,
-0.14464066922664642,
0.07677039504051208,
0.2454102486371994,
0.09677138179540634,
0.24734237790107727,
-0.022542813792824745,
-0.19679252803325653,
-0.08876335620880127,
0.1892533302307129,
-0.14700298011302948,
0.4686269164085388,
0.45007219910621643,
0.0563872791826725,
0.27751630544662476,
-0.11141780018806458,
0.03609329089522362,
0.24698317050933838,
-0.042144015431404114,
-0.15580761432647705,
-0.2680087089538574,
-0.30674517154693604,
0.1712799370288849,
0.4055231511592865,
0.6805142164230347,
0.15366432070732117,
-0.001054086722433567,
0.3442355692386627,
0.04334937036037445,
0.08136479556560516,
0.20900410413742065,
0.19839757680892944,
-0.20532023906707764,
-0.19024738669395447,
-0.050909895449876785,
-0.28505170345306396,
0.20286479592323303,
-0.06951095163822174,
-0.21615836024284363,
0.1539856195449829,
-0.037598997354507446,
0.04548822343349457,
-0.01688786782324314,
-0.06623301655054092,
-0.060397885739803314,
-0.07760876417160034,
0.10858333855867386,
0.2533870041370392,
0.033178262412548065,
0.270830899477005,
0.007346339523792267,
-0.16413041949272156,
-0.10837089270353317,
-0.2872631549835205,
-0.05697236210107803,
0.233679860830307,
-0.46653828024864197,
0.03712618350982666,
-0.2626250684261322,
-0.20693212747573853,
-0.26279374957084656,
0.12498742341995239,
0.1356021761894226,
-0.0008095386438071728,
0.11409115791320801,
0.11326941847801208,
0.1520828902721405,
0.010480787605047226,
0.017879802733659744,
0.04722448065876961,
0.6831604838371277,
-0.13462890684604645,
-0.27511101961135864,
0.18730860948562622,
0.023902032524347305,
-0.09304364025592804,
-0.03345097601413727,
-0.023934535682201385,
0.4864511489868164,
0.16566134989261627,
-0.12794753909111023,
-0.22189614176750183,
-0.1760406196117401,
-0.29679855704307556,
0.24847061932086945,
0.11750870943069458,
-0.19277895987033844,
0.6005709171295166,
-0.06647372245788574,
-0.2272094190120697,
-0.01332077756524086,
0.3717731237411499,
-0.05367298051714897,
0.14067155122756958,
0.38715723156929016,
-0.27622509002685547,
-0.15810537338256836,
-0.304181843996048,
-0.2787131369113922,
0.16873019933700562,
0.11782139539718628,
0.1971079558134079,
-0.15165698528289795,
0.004914566874504089,
0.07131798565387726,
0.2275792807340622,
0.13270537555217743,
0.01532518956810236,
-0.20989783108234406,
-0.17870579659938812,
-0.43182098865509033,
0.20179688930511475,
-0.4064842462539673,
0.346470445394516,
-0.022312600165605545,
0.48120495676994324,
-0.12824532389640808,
-0.04492942988872528,
-0.4691360294818878,
0.12874835729599,
-0.3450220823287964,
0.16706550121307373,
-0.05212823301553726,
-0.20887577533721924,
-0.03573153540492058,
0.16069477796554565,
0.3237706422805786,
0.5755284428596497,
-0.2591340243816376,
-0.3102627098560333,
-0.06297290325164795,
0.08400347083806992,
0.1568494290113449,
-0.24460965394973755,
0.22261835634708405,
-0.013740457594394684,
-0.23654460906982422,
0.04330484941601753,
0.04075790196657181,
0.06497687101364136,
-0.11054052412509918,
0.06960876286029816,
-0.23740264773368835,
0.023405401036143303,
0.38000673055648804,
-0.005960081238299608,
-0.19758698344230652,
-0.177265927195549,
0.02303241565823555,
0.12169423699378967,
-0.42322778701782227,
-0.2177419364452362,
-0.1580372154712677,
0.07837963104248047,
-0.033161867409944534,
0.04322868213057518,
0.20640066266059875,
0.05560486763715744,
-0.4508601129055023,
-0.11004377156496048,
0.27493223547935486,
0.11677339673042297,
-0.11780846118927002,
0.014735423028469086,
0.014963768422603607,
0.4076984226703644,
-0.3491239845752716,
0.3373508155345917,
-0.021653516218066216,
-0.05647050589323044,
0.40833139419555664,
0.22492463886737823,
0.047157950699329376,
0.01764458417892456,
-0.15569467842578888,
0.18776234984397888,
0.25517556071281433,
-0.24153146147727966,
-0.02591337449848652,
0.2327747642993927,
-0.2517484724521637,
0.18589335680007935,
0.3337073028087616,
0.1629800796508789,
0.5125545263290405,
0.36346012353897095,
-0.01277894526720047,
0.274038165807724,
-0.26543959975242615,
-0.09765161573886871,
0.26617541909217834,
0.07794295251369476,
0.18913334608078003,
0.33587050437927246,
0.08516376465559006,
0.26950299739837646,
-0.04095333442091942,
0.008081220090389252,
0.02287193387746811,
-0.04547692835330963,
-0.18884989619255066,
0.27053868770599365,
-0.20153717696666718,
-0.051497653126716614,
-0.4920990467071533,
-0.06231364607810974,
-0.23141847550868988,
-0.07297976315021515,
0.19403761625289917,
-0.11884373426437378,
0.3435191512107849,
0.20013722777366638,
-0.1305476725101471,
-0.008820200338959694,
-0.6729939579963684,
0.13844791054725647,
0.06241476908326149,
-0.41283291578292847,
0.12423080205917358,
0.4318510890007019,
0.0555858388543129,
0.0901239663362503,
0.39801740646362305,
0.36252954602241516,
0.2480660229921341,
-0.09101027250289917,
-0.14619293808937073,
0.16078568994998932,
-0.19286197423934937,
-0.2946033179759979,
-0.008668717928230762,
0.054113682359457016,
-0.057722289115190506,
0.2233225703239441,
0.259326308965683,
-0.30572354793548584,
0.045584432780742645,
0.17037349939346313,
0.21635288000106812,
-0.30121687054634094,
0.2675648331642151,
0.21319997310638428,
0.009746655821800232,
-0.17761118710041046,
-0.06332413852214813,
-0.3722778856754303,
-0.15193992853164673,
-0.10063577443361282,
-0.146615669131279,
0.09318578243255615,
0.03351322561502457,
0.11706428229808807,
-0.23734056949615479,
-0.07603506743907928,
0.1038951724767685,
0.11181412637233734,
-0.22604869306087494,
-0.09259126335382462,
-0.3764047622680664,
0.3728986382484436,
0.08849610388278961,
-0.34106531739234924,
-0.05466318875551224,
0.3057573437690735,
-0.11453595757484436,
0.05403948947787285,
0.31528156995773315,
-0.01896032691001892,
0.1543218195438385,
0.47151488065719604,
-0.4982125163078308,
0.19848310947418213,
0.1351621150970459,
-0.2380504608154297,
0.2730514109134674,
-0.31935083866119385,
0.058285895735025406,
-0.2258215993642807,
0.28197556734085083,
-0.0033771339803934097,
0.005466103553771973,
-0.11795200407505035,
0.32421785593032837,
0.5688193440437317,
0.19820794463157654,
0.3407793641090393,
-0.2446877807378769,
-0.13181310892105103,
0.028237855061888695,
-0.03332861512899399,
-0.4946131706237793,
0.0029139816761016846,
0.09920229017734528,
0.5277743339538574,
0.16685962677001953,
-0.23497378826141357,
-0.07222196459770203,
0.2072799950838089,
0.2726665735244751,
-0.283314973115921,
-0.2119961678981781,
0.4238632917404175,
-0.03815728425979614,
0.0671653300523758,
-0.15544353425502777,
-0.0003141472116112709,
0.22300702333450317,
0.1319909244775772,
-0.44581854343414307,
-0.669092059135437,
0.6302875280380249,
-0.26665499806404114,
-0.2597367763519287,
-0.2107420563697815,
0.4208441972732544,
-0.2975257933139801,
0.04387105256319046,
-0.31544381380081177,
-0.00695018470287323,
0.32509738206863403,
-0.07370860874652863,
-0.1724848449230194,
0.15310902893543243,
0.24102365970611572,
0.05093960464000702,
-0.06937356293201447,
0.07319701462984085,
0.08322221785783768,
-0.0669018104672432,
-0.020575538277626038,
-0.4223182797431946
] |
https://github.com/huggingface/datasets/issues/6221 | Not a fan of pickling this sort of stuff either.
Note that users can also share the code in their dataset documentation. | Support saving datasets with custom formatting | Requested in https://discuss.huggingface.co/t/using-set-transform-on-a-dataset-leads-to-an-exception/53036.
I am not sure if supporting this is the best idea for the following reasons:
>For this to work, we would have to pickle a custom transform, which means the transform and the objects it references need to be serializable. Also, deserializing these bytes would make `load_from_disk` unsafe, so I'm not sure this is a good idea.
@lhoestq WDYT?
| 22 | Support saving datasets with custom formatting
Requested in https://discuss.huggingface.co/t/using-set-transform-on-a-dataset-leads-to-an-exception/53036.
I am not sure if supporting this is the best idea for the following reasons:
>For this to work, we would have to pickle a custom transform, which means the transform and the objects it references need to be serializable. Also, deserializing these bytes would make `load_from_disk` unsafe, so I'm not sure this is a good idea.
@lhoestq WDYT?
Not a fan of pickling this sort of stuff either.
Note that users can also share the code in their dataset documentation. | [
-0.23778676986694336,
-0.09020714461803436,
0.0006607063114643097,
0.07739213854074478,
0.36724480986595154,
0.11472795903682709,
0.30022862553596497,
0.0956723690032959,
-0.20880524814128876,
0.014439713209867477,
-0.13830327987670898,
0.07821661233901978,
-0.34521082043647766,
0.4699134826660156,
0.23126259446144104,
-0.16099870204925537,
-0.08931697905063629,
0.2635231614112854,
-0.08685777336359024,
0.21183288097381592,
-0.3054133653640747,
0.1701563596725464,
0.0769461840391159,
-0.020123835653066635,
-0.20320728421211243,
0.021257026121020317,
0.056449681520462036,
0.13830381631851196,
-0.1329766809940338,
-0.1441877782344818,
0.1655963659286499,
0.20960578322410583,
0.065863236784935,
0.23648881912231445,
-0.00010783510515466332,
0.05718047916889191,
-0.1317817121744156,
-0.32711780071258545,
-0.17192070186138153,
0.11892838776111603,
-0.1644710898399353,
-0.3323977291584015,
-0.3568944036960602,
-0.2893279194831848,
-0.3342049717903137,
-0.14901050925254822,
-0.17179253697395325,
-0.34950384497642517,
0.519889235496521,
0.05136464908719063,
0.2470824122428894,
0.23429621756076813,
-0.12784932553768158,
0.039142072200775146,
-0.051697246730327606,
0.73764568567276,
-0.24432171881198883,
0.08049207925796509,
0.05664908513426781,
0.32726770639419556,
0.13007475435733795,
0.2791665196418762,
-0.036122843623161316,
-0.15698200464248657,
0.27549171447753906,
0.02417781576514244,
-0.36615562438964844,
0.11384326964616776,
-0.05004657804965973,
0.2966385781764984,
0.4109552800655365,
-0.4101814925670624,
-0.48443603515625,
-0.44788748025894165,
-0.08355371654033661,
-0.30281996726989746,
0.09055836498737335,
0.3739015758037567,
-0.005095161497592926,
0.5931649208068848,
-0.4068067669868469,
-0.3461093008518219,
-0.5034356713294983,
-0.1289595514535904,
-0.08988277614116669,
-0.12640836834907532,
-0.24497835338115692,
-0.1785365492105484,
-0.19166599214076996,
-0.10847362130880356,
0.11197829246520996,
0.0005590375512838364,
-0.20602130889892578,
-0.07126405835151672,
0.15371151268482208,
-0.4034023880958557,
-0.46979859471321106,
0.04990653321146965,
0.37070155143737793,
0.17784015834331512,
0.3655575215816498,
0.3178316056728363,
-0.3146125078201294,
-0.05885933339595795,
0.09748254716396332,
0.18417851626873016,
0.07039935886859894,
-0.23146139085292816,
0.35729721188545227,
-0.15296557545661926,
0.275602787733078,
-0.06467515230178833,
0.2177073061466217,
0.06592431664466858,
-0.1053311750292778,
0.06557609885931015,
0.14923495054244995,
-0.1301283985376358,
-0.004416525363922119,
-0.032086413353681564,
0.3998819589614868,
-0.11191433668136597,
-0.11815336346626282,
0.2140893191099167,
0.2005140781402588,
-0.01218747440725565,
0.037120476365089417,
0.14816227555274963,
0.11515634506940842,
-0.34797951579093933,
-0.052492059767246246,
-0.281320184469223,
0.05451434105634689,
0.17637300491333008,
0.2651040852069855,
0.05660247430205345,
0.05187724530696869,
-0.05898592621088028,
0.00018456019461154938,
0.2368011772632599,
-0.022256415337324142,
0.20485936105251312,
0.35686469078063965,
0.218814879655838,
-0.4082907736301422,
0.02279476821422577,
-0.0261710025370121,
-0.027123212814331055,
-0.2596445083618164,
0.2824695110321045,
0.028068087995052338,
-0.12356140464544296,
-0.315843403339386,
0.16303330659866333,
-0.32570233941078186,
-0.2227097898721695,
-0.4134790003299713,
0.2646252512931824,
0.2257942110300064,
-0.1656731367111206,
-0.05868246406316757,
0.05825026333332062,
-0.32175347208976746,
-0.20955929160118103,
0.037050485610961914,
0.2118178904056549,
-0.38927915692329407,
-0.2681529223918915,
0.25948694348335266,
-0.176690936088562,
0.11075976490974426,
0.3568457067012787,
-0.07189995050430298,
-0.12239141762256622,
-0.3398515284061432,
0.2579742670059204,
0.3370143175125122,
-0.042934171855449677,
-0.24776777625083923,
0.22009512782096863,
-0.011927880346775055,
0.020179875195026398,
0.14406952261924744,
0.060478467494249344,
0.5318580269813538,
-0.2755269706249237,
-0.3032751679420471,
0.3819598853588104,
0.0035718828439712524,
0.3354687988758087,
-0.09762220829725266,
-0.27913999557495117,
0.15734551846981049,
0.02505970001220703,
-0.2068362981081009,
0.06029655784368515,
0.1386815905570984,
0.1780582070350647,
0.24163565039634705,
-0.3109186887741089,
0.3184393048286438,
-0.07550214231014252,
0.2470959573984146,
-0.0157814659178257,
-0.06631709635257721,
-0.19840022921562195,
-0.417502224445343,
0.04830603301525116,
0.10652276873588562,
-0.0795627161860466,
0.023701105266809464,
-0.3299386203289032,
-0.18245108425617218,
-0.24828478693962097,
-0.19670754671096802,
-0.09441061317920685,
0.13132129609584808,
0.1968006193637848,
0.07311230897903442,
0.005143947899341583,
-0.33697694540023804,
-0.017582658678293228,
0.09196571260690689,
-0.041037485003471375,
-0.0858755111694336,
0.13876479864120483,
0.13650648295879364,
-0.1445280760526657,
-0.17724920809268951,
0.10490114986896515,
-0.09529648721218109,
-0.1490781009197235,
-0.09163050353527069,
0.3449096977710724,
-0.04407758638262749,
0.25305286049842834,
-0.36622247099876404,
0.29608389735221863,
0.43843600153923035,
-0.1462494283914566,
0.15310750901699066,
0.06555509567260742,
-0.014693979173898697,
-0.043994128704071045,
-0.8663097023963928,
0.5622457265853882,
-0.06094427779316902,
-0.10320521891117096,
-0.1330413669347763,
0.05109309405088425,
0.3252149224281311,
-0.047088202089071274,
-0.154008150100708,
-0.48543232679367065,
-0.371783971786499,
-0.10456740111112595,
0.06955414265394211,
-0.10481708496809006,
-0.42162400484085083,
0.07001297175884247,
0.5244282484054565,
0.030101224780082703,
0.28164058923721313,
0.168233260512352,
-0.028982441872358322,
0.024083666503429413,
0.1303170770406723,
0.3362278640270233,
0.3607744574546814,
0.22994479537010193,
-0.09457597881555557,
0.12429889291524887,
0.19109675288200378,
-0.10742709040641785,
0.32999175786972046,
-0.10596220195293427,
0.0996338278055191,
0.17732121050357819,
0.14998337626457214,
-0.05650709941983223,
-0.3886833190917969,
0.04911807179450989,
-0.13810968399047852,
-0.3175438940525055,
-0.43150466680526733,
-0.2603507936000824,
-0.13407839834690094,
-0.08132227510213852,
-0.4993132948875427,
-0.25933629274368286,
-0.061138518154621124,
0.051393814384937286,
-0.020589377731084824,
0.05716904625296593,
-0.1682874858379364,
0.06525116413831711,
0.13199083507061005,
0.7252048850059509,
0.000799134373664856,
-0.055918239057064056,
-0.21835234761238098,
0.03432172164320946,
0.1788175106048584,
0.1435367614030838,
0.06059369072318077,
-0.17865054309368134,
0.463884562253952,
-0.17520198225975037,
0.17996111512184143,
-0.28535306453704834,
-0.29480087757110596,
0.17787906527519226,
-0.21442709863185883,
0.041305117309093475,
0.4569791257381439,
0.19581079483032227,
0.15288344025611877,
0.22149601578712463,
0.19666938483715057,
-0.07789840549230576,
-0.0789220854640007,
-0.08376969397068024,
0.1963423639535904,
0.27649205923080444,
-0.49570000171661377,
0.08422132581472397,
-0.2526501715183258,
-0.21924665570259094,
0.478374719619751,
-0.05646934360265732,
0.03803085908293724,
0.173181414604187,
-0.004256594926118851,
-0.04254229739308357,
0.1168178841471672,
-0.0948600023984909,
-0.16433623433113098,
-0.4949673116207123,
0.41326552629470825,
-0.4822079837322235,
-0.2926511764526367,
0.06036871671676636,
0.26560473442077637,
-0.16685470938682556,
0.0897165834903717,
-0.1463845819234848,
-0.13811032474040985,
-0.245536208152771,
-0.024254634976387024,
0.01246087159961462,
0.13699962198734283,
0.17050404846668243,
0.16212965548038483,
-0.025484763085842133,
-0.13119882345199585,
-0.2903173565864563,
0.05104101076722145,
0.13003265857696533,
-0.10309354215860367,
0.13082988560199738,
0.20084716379642487,
0.20588251948356628,
0.290485143661499,
0.012759938836097717,
-0.12516266107559204,
0.24961936473846436,
0.016768982633948326,
0.4060491621494293,
-0.12016482651233673,
-0.140595942735672,
0.2014695405960083,
0.05680927634239197,
0.024351850152015686,
0.2554577887058258,
0.18261386454105377,
0.2158198207616806,
0.046209290623664856,
-0.14037759602069855,
-0.10681166499853134,
-0.24376726150512695,
0.10945786535739899,
0.26747366786003113,
0.16084955632686615,
-0.03885111212730408,
0.18735027313232422,
0.08626337349414825,
-0.11186119168996811,
0.28110453486442566,
0.18351243436336517,
0.1762605607509613,
-0.0596437007188797,
-0.08405015617609024,
0.036390479654073715,
-0.35725072026252747,
0.18532511591911316,
0.07185973227024078,
0.07809469848871231,
-0.05130833759903908,
-0.06800766289234161,
-0.1199386864900589,
-0.041766270995140076,
0.5550093054771423,
-0.13548342883586884,
-0.0523340106010437,
-0.05000331252813339,
-0.17016693949699402,
-0.3260996639728546,
0.12738388776779175,
0.10462009906768799,
0.0028780363500118256,
-0.3276052176952362,
0.42453983426094055,
-0.2919152081012726,
-0.12364402413368225,
0.0010660719126462936,
0.1569276750087738,
-0.42654693126678467,
-0.1672302633523941,
0.15927650034427643,
-0.18579411506652832,
-0.43472304940223694,
-0.09791750460863113,
0.20091554522514343,
0.010136798024177551,
-0.06506570428609848,
-0.018011339008808136,
-0.1998247355222702,
-0.08018466085195541,
0.22534328699111938,
-0.02732168883085251,
0.20390266180038452,
0.22799770534038544,
-0.16067543625831604,
0.2143498659133911,
0.18163830041885376,
0.27432194352149963,
0.3831372559070587,
-0.11773496866226196,
-0.1409088373184204,
-0.06873774528503418,
-0.38038939237594604,
0.25040411949157715,
0.175749272108078,
0.10142665356397629,
-0.4119769334793091,
0.15213371813297272,
-0.07360754907131195,
-0.6015992164611816,
-0.024189800024032593,
-0.1948760449886322,
-0.15537424385547638,
-0.2954327166080475,
-0.44094300270080566,
0.406642884016037,
-0.13992395997047424,
0.1026635617017746,
-0.23045837879180908,
0.32529789209365845,
-0.5885511636734009,
0.39635512232780457,
0.39776748418807983,
0.7708979845046997,
-0.22466963529586792,
0.4981811046600342,
0.0003396477550268173,
-0.4138002395629883,
0.30896955728530884,
-0.10653772950172424,
-0.15390898287296295,
-0.30709826946258545,
-0.08538621664047241,
-0.17112299799919128,
0.00595209002494812,
0.3056255578994751,
0.32326751947402954,
-0.48012152314186096,
-0.06441124528646469,
0.0471096932888031,
-0.09917834401130676,
-0.07094036042690277,
0.1645437479019165,
-0.15588268637657166,
-0.5516954064369202,
-0.3529404103755951,
0.1866658627986908,
-0.29715490341186523,
-0.23770740628242493,
-0.03854893893003464,
-0.11998914182186127,
-0.026817694306373596,
0.08492977172136307,
-0.2515486478805542,
-0.2168392837047577,
-0.10543413460254669,
-0.028568275272846222,
-0.21235087513923645,
-0.27785924077033997,
0.41430985927581787,
0.30954602360725403,
0.3687756061553955,
0.20805564522743225,
-0.3375590145587921,
-0.02490895986557007,
-0.17929476499557495,
0.287894070148468,
-0.15407425165176392,
0.0631895512342453,
0.25835469365119934,
0.09007386863231659,
0.21397337317466736,
-0.11011302471160889,
0.1572113186120987,
-0.11960495263338089,
0.034518107771873474,
-0.1575338989496231,
-0.17077626287937164,
-0.5331438183784485,
-0.20538941025733948,
-0.24992917478084564,
0.19391386210918427,
-0.16360202431678772,
0.1218971461057663,
0.3281443417072296,
0.10616940259933472,
0.2920091152191162,
-0.056273285299539566,
0.09141005575656891,
-0.1629079282283783,
0.1227530837059021,
-0.15143144130706787,
-0.053205542266368866,
0.2794008255004883,
0.12038371711969376,
-0.19254553318023682,
-0.27808094024658203,
0.40937381982803345,
-0.038385070860385895,
-0.5146612524986267,
0.3144647479057312,
0.134290874004364,
-0.1316870003938675,
-0.1397177278995514,
0.5419227480888367,
0.1819424033164978,
-0.17911416292190552,
0.1282149702310562,
-0.025289922952651978,
-0.2754094898700714,
-0.1328968107700348,
0.00537060247734189,
0.5269947648048401,
0.1331835389137268,
0.24090763926506042,
-0.0544193834066391,
-0.07351921498775482,
-0.3871590197086334,
0.0938141718506813,
0.3268115520477295,
-0.16209733486175537,
0.17779429256916046,
0.2703341245651245,
0.018384471535682678,
-0.24931442737579346,
-0.0002213604748249054,
0.25277179479599,
-0.11674390733242035,
-0.21294666826725006,
-0.3688322901725769,
0.13928940892219543,
-0.01019855123013258,
0.006172925233840942,
-0.1791439801454544,
0.05574911832809448,
-0.08926275372505188,
-0.2617255449295044,
0.2026270031929016,
0.2933078110218048,
-0.06537612527608871,
0.44348078966140747,
0.1122770756483078,
0.04668939858675003,
-0.14758805930614471,
-0.05269693210721016,
0.21163198351860046,
0.2615785002708435,
0.02820296213030815,
0.1968318521976471,
-0.2560679018497467,
-0.05979252606630325,
0.138190358877182,
0.30056530237197876,
0.396801233291626,
0.18970808386802673,
0.28187236189842224,
-0.1783675253391266,
0.01769101619720459,
0.42933839559555054,
0.5011141300201416,
-0.1352924108505249,
-0.1918058544397354,
-0.1722467839717865,
0.3050306439399719,
0.23942098021507263,
0.1593714952468872,
-0.03054262325167656,
0.3654055595397949,
-0.13650110363960266,
0.028493978083133698,
0.4066607356071472,
0.2317543923854828,
0.16654399037361145,
-0.3807576894760132,
0.06323109567165375,
0.34959810972213745,
-0.003317680209875107,
0.02905092015862465,
0.3963860869407654,
-0.12226873636245728,
-0.009992504492402077,
0.24837805330753326,
0.07274717837572098,
0.4600713551044464,
0.16249850392341614,
-0.015679851174354553,
0.10860318690538406,
0.2770228981971741,
0.2578796148300171,
0.08889853954315186,
-0.37437140941619873,
0.2507769763469696,
-0.24229109287261963,
0.02936801128089428,
0.42096325755119324,
0.314042329788208,
0.3361237347126007,
-0.06781736761331558,
-0.1500077247619629,
-0.17600373923778534,
0.2740386724472046,
-0.1279505491256714,
-0.0520344078540802,
0.0909949243068695,
0.03336441516876221,
0.17132693529129028,
0.04062732309103012,
-0.36422207951545715,
-0.1349855661392212,
0.12954816222190857,
-0.033112842589616776,
0.3433819115161896,
0.14074519276618958,
0.1689155101776123,
-0.25172320008277893,
0.15448985993862152,
-0.23315775394439697,
0.02573576383292675,
0.3186928629875183,
-0.07851321995258331,
0.2392922341823578,
0.3421631455421448,
0.19785374402999878,
0.09267659485340118,
0.12296734005212784,
0.14858758449554443,
-0.4534507095813751,
0.06850770860910416,
-0.1276809573173523,
0.1939687430858612,
-0.16526450216770172,
-0.07449597120285034,
0.4665965139865875,
0.1910877376794815,
-0.05693723261356354,
-0.15353478491306305,
0.18765641748905182,
0.1467415690422058,
-0.1121472716331482,
-0.12944664061069489,
0.06730697304010391,
-0.298489511013031,
0.045108597725629807,
-0.19648221135139465,
-0.06878656148910522,
-0.152383953332901,
0.3169374167919159,
-0.10261360555887222,
0.16828300058841705,
0.1151857003569603,
0.10338442027568817,
0.3235901892185211,
0.45783084630966187,
0.16318023204803467,
-0.20574870705604553,
0.13792684674263,
-0.06586644053459167,
-0.36911651492118835,
-0.07531112432479858,
0.42083677649497986,
-0.03182514011859894,
-0.04596738517284393,
0.02402491122484207,
0.23525801301002502,
0.23406432569026947,
-0.07856501638889313,
-0.13871291279792786,
0.034114304929971695,
0.2397824078798294,
-0.01605863869190216,
-0.05063534155488014,
0.3464019298553467,
0.25517210364341736,
0.08133096247911453,
-0.11852157860994339,
0.23239865899085999,
0.2586512565612793,
0.10391673445701599,
-0.4201987385749817,
0.4333266615867615,
-0.35681843757629395,
-0.19362258911132812,
0.38292640447616577,
0.21500198543071747,
0.021030418574810028,
-0.1187305599451065,
-0.03187520056962967,
0.14029912650585175,
0.1256731152534485,
-0.11705024540424347,
0.227176234126091,
0.06604006886482239,
0.5327149629592896,
-0.20576077699661255,
-0.034368306398391724,
-0.3157443404197693,
0.08587019145488739,
0.04031503200531006,
0.23942013084888458,
-0.25858983397483826,
0.37856197357177734,
-0.26546794176101685,
-0.3838012218475342,
0.11933398246765137,
0.26784801483154297,
-0.13558776676654816,
0.28102099895477295,
-0.07597312331199646,
-0.3817572593688965,
0.28350043296813965,
-0.07584703713655472,
-0.41400080919265747,
0.2066802978515625,
-0.040379203855991364,
-0.048629701137542725,
-0.03981417417526245,
-0.7552732229232788,
0.19080571830272675,
0.18612615764141083,
-0.0811963677406311,
-0.10929233580827713,
0.23999851942062378,
-0.0646226704120636,
-0.3156704008579254,
-0.13236810266971588,
0.6142446398735046,
0.12353992462158203,
-0.1593223512172699,
-0.276398628950119,
-0.16976113617420197
] |
https://github.com/huggingface/datasets/issues/6217 | We need to implement the `Image` type as a PyArrow extension type (to allow us to override the Python conversion) for this to work as expected. For now, it's best to use your approach indeed. | `Dataset.to_dict()` ignore `decode=True` with Image feature | ### Describe the bug
`Dataset.to_dict` seems to ignore the decoding instruction passed in features.
### Steps to reproduce the bug
```python
import datasets
import numpy as np
from PIL import Image
img = np.random.randint(0, 256, (5, 5, 3), dtype=np.uint8)
img = Image.fromarray(img)
features = datasets.Features({"image": datasets.Image(decode=True)})
dataset = datasets.Dataset.from_dict({"image": [img]}, features=features)
print({key: dataset[key] for key in dataset.column_names})
# {'image': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=5x5 at 0x7EFBC80E15B0>]}
print(dataset.to_dict())
# {'image': [{'bytes': b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x05\x00\x00\x00\x05\x08\x02\x00\x00\x00\x02\r\xb1\xb2\x00\x00\x00[IDATx\x9c\x01P\x00\xaf\xff\x01\x13\x1b<7\xe7\xe0\xdc^6\xed\x04\xc7M\xd2\x9f\x00X\x1b\xb0?\x1ba\x15\xc5 o\xd0\x80\xbe\x19/\x01\xec\x95\x1f\x9f\xffj\xfa1\xa7\xc4X\xea\xbe\xa4g\x00\xc4\x15\xdeC\xc7 \xbbaqe\xc8\xb9\xa9q\xe7\x00,?M\xc0)\xdaD`}\xb1\xdci\x1e\xafC\xa9]%.@\xa6\xf0\xb3\x00\x00\x00\x00IEND\xaeB`\x82', 'path': None}]}
```
### Expected behavior
I would expect `{key: dataset[key] for key in dataset.column_names}` and `dataset.to_dict()` to be equivalent. If the previous behavior is expected, then it should be stated [in the doc](https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset.to_dict).
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
- Pillow 9.5.0
- numpy 1.25.2 | 35 | `Dataset.to_dict()` ignore `decode=True` with Image feature
### Describe the bug
`Dataset.to_dict` seems to ignore the decoding instruction passed in features.
### Steps to reproduce the bug
```python
import datasets
import numpy as np
from PIL import Image
img = np.random.randint(0, 256, (5, 5, 3), dtype=np.uint8)
img = Image.fromarray(img)
features = datasets.Features({"image": datasets.Image(decode=True)})
dataset = datasets.Dataset.from_dict({"image": [img]}, features=features)
print({key: dataset[key] for key in dataset.column_names})
# {'image': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=5x5 at 0x7EFBC80E15B0>]}
print(dataset.to_dict())
# {'image': [{'bytes': b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x05\x00\x00\x00\x05\x08\x02\x00\x00\x00\x02\r\xb1\xb2\x00\x00\x00[IDATx\x9c\x01P\x00\xaf\xff\x01\x13\x1b<7\xe7\xe0\xdc^6\xed\x04\xc7M\xd2\x9f\x00X\x1b\xb0?\x1ba\x15\xc5 o\xd0\x80\xbe\x19/\x01\xec\x95\x1f\x9f\xffj\xfa1\xa7\xc4X\xea\xbe\xa4g\x00\xc4\x15\xdeC\xc7 \xbbaqe\xc8\xb9\xa9q\xe7\x00,?M\xc0)\xdaD`}\xb1\xdci\x1e\xafC\xa9]%.@\xa6\xf0\xb3\x00\x00\x00\x00IEND\xaeB`\x82', 'path': None}]}
```
### Expected behavior
I would expect `{key: dataset[key] for key in dataset.column_names}` and `dataset.to_dict()` to be equivalent. If the previous behavior is expected, then it should be stated [in the doc](https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset.to_dict).
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
- Pillow 9.5.0
- numpy 1.25.2
We need to implement the `Image` type as a PyArrow extension type (to allow us to override the Python conversion) for this to work as expected. For now, it's best to use your approach indeed. | [
0.0348966121673584,
-0.20412680506706238,
-0.11633122712373734,
0.20876918733119965,
0.2717641592025757,
0.20352843403816223,
0.19232070446014404,
0.39373579621315,
-0.03279522433876991,
0.1958099752664566,
0.15691202878952026,
0.6271664500236511,
0.05341333895921707,
0.28227800130844116,
-0.25181519985198975,
0.09020768105983734,
0.22407832741737366,
0.30187326669692993,
0.00032830797135829926,
-0.11098118126392365,
-0.39342597126960754,
0.15752609074115753,
-0.31405967473983765,
-0.05018717050552368,
-0.22202971577644348,
0.10320280492305756,
-0.06965956836938858,
-0.11253176629543304,
-0.07118114084005356,
-0.23678803443908691,
-0.0368344821035862,
0.0908237099647522,
-0.19135682284832,
0.05475137010216713,
-0.00010831929103005677,
0.006993681192398071,
0.2998615801334381,
-0.09241949766874313,
-0.18736658990383148,
-0.0019241869449615479,
-0.5536105632781982,
-0.4242140054702759,
-0.017165016382932663,
-0.47653332352638245,
-0.221596360206604,
-0.23783782124519348,
0.08652999997138977,
-0.09800732880830765,
0.49819645285606384,
0.1599610298871994,
0.282443642616272,
-0.011462494730949402,
0.2540091872215271,
0.3351166248321533,
0.16293762624263763,
0.37641698122024536,
-0.09630279988050461,
-0.20479123294353485,
-0.09685422480106354,
0.08109626173973083,
-0.0030633583664894104,
0.5783225297927856,
-0.19731022417545319,
-0.009982912801206112,
0.09537528455257416,
0.08843539655208588,
-0.0782155692577362,
-0.37076497077941895,
-0.08729521930217743,
0.0015920819714665413,
0.260730504989624,
-0.003642634954303503,
-0.20478129386901855,
-0.24235263466835022,
-0.21171583235263824,
-0.33832815289497375,
0.06467372179031372,
-0.16051867604255676,
-0.15096315741539001,
0.1877920925617218,
-0.1337122768163681,
-0.2919747233390808,
-0.24515777826309204,
-0.01223820075392723,
-0.31069111824035645,
-0.10968948155641556,
-0.13002192974090576,
0.07750292122364044,
-0.2168251872062683,
0.09493211656808853,
-0.04074179381132126,
-0.007292147725820541,
0.19840958714485168,
-0.2499716728925705,
-0.07959714531898499,
-0.23194611072540283,
0.08010956645011902,
-0.2301347851753235,
0.11686527729034424,
0.04865894839167595,
-0.2398998737335205,
0.05740264803171158,
-0.1974872350692749,
0.24660220742225647,
0.08698263764381409,
-0.13913628458976746,
-0.2108825445175171,
0.44310179352760315,
0.11999046057462692,
0.24704092741012573,
-0.25966450572013855,
-0.05987221375107765,
0.28549620509147644,
-0.03317081183195114,
0.32599112391471863,
-0.13715659081935883,
0.6972804665565491,
-0.22581999003887177,
-0.4145357608795166,
0.08190853893756866,
-0.029446452856063843,
0.12431054562330246,
-0.22463439404964447,
0.13185784220695496,
0.14163890480995178,
0.32873180508613586,
0.22535163164138794,
0.2621128559112549,
-0.3167124390602112,
-0.27620360255241394,
-0.3436698317527771,
-0.00679710041731596,
0.19542871415615082,
-0.19528716802597046,
-0.17473039031028748,
0.3254615068435669,
0.004444647580385208,
0.16563189029693604,
0.06154204159975052,
-0.06613451987504959,
-0.013569425791501999,
-0.23846012353897095,
0.4407481551170349,
0.06340391933917999,
-0.31896770000457764,
-0.04929080978035927,
0.2525038719177246,
-0.12206994742155075,
-0.12575677037239075,
0.33256521821022034,
-0.3248169422149658,
0.15332011878490448,
-0.20060855150222778,
0.28308990597724915,
-0.10584460198879242,
-0.24228863418102264,
-0.19161610305309296,
0.3677936792373657,
0.16972944140434265,
-0.289545476436615,
0.09977848827838898,
-0.21258433163166046,
-0.42748966813087463,
-0.4823192358016968,
0.27241742610931396,
0.39166349172592163,
-0.03725650906562805,
0.20597749948501587,
0.028954390436410904,
-0.19298844039440155,
0.45424291491508484,
0.08052270114421844,
0.22509363293647766,
-0.044852469116449356,
-0.2536543905735016,
-0.00705043226480484,
0.07343445718288422,
-0.3107767105102539,
-0.5254594087600708,
0.3378140926361084,
0.009228594601154327,
0.2752191126346588,
0.0016455762088298798,
0.25020119547843933,
0.09936854243278503,
-0.037414081394672394,
-0.20437197387218475,
0.5512681603431702,
-0.11420615017414093,
0.05519726127386093,
-0.09990853816270828,
-0.25669267773628235,
0.25373777747154236,
0.1690579354763031,
-0.025628328323364258,
0.19132423400878906,
-0.032458554953336716,
-0.04421551525592804,
0.45036429166793823,
0.13558267056941986,
0.03775615245103836,
-0.09769110381603241,
0.3622490465641022,
-0.08783821016550064,
0.07491324096918106,
-0.11374840885400772,
0.08228904008865356,
0.11029849946498871,
0.3471541702747345,
0.0038222321309149265,
-0.6007868051528931,
-0.22689247131347656,
-0.04676703363656998,
-0.06832646578550339,
-0.5921632647514343,
-0.19784504175186157,
0.2764776945114136,
0.03372388705611229,
-0.15042079985141754,
0.22898048162460327,
-0.08318539708852768,
0.3472509980201721,
0.08505164831876755,
0.21063010394573212,
-0.12633927166461945,
0.12099124491214752,
-0.07092437893152237,
0.05408467724919319,
-0.10063436627388,
0.25915318727493286,
0.05059608072042465,
-0.028634771704673767,
-0.2105713188648224,
0.3128199875354767,
0.2918078899383545,
0.08623161911964417,
-0.2619757652282715,
-0.3178795576095581,
0.16223274171352386,
-0.8451242446899414,
-0.076094850897789,
0.4355255961418152,
0.2442399263381958,
0.011425651609897614,
-0.07977400720119476,
0.1941840648651123,
0.08332439512014389,
0.050903286784887314,
-0.14022640883922577,
0.19248883426189423,
0.07251603156328201,
-0.08641654998064041,
-0.02575754001736641,
-0.5148473381996155,
-0.20468126237392426,
0.015168577432632446,
-0.2567926347255707,
-0.163496732711792,
-0.20548897981643677,
0.12975862622261047,
0.597248375415802,
0.1625484824180603,
0.008184154517948627,
0.10011781752109528,
0.09740090370178223,
0.010661430656909943,
0.19457745552062988,
0.04598751664161682,
0.06424455344676971,
0.24097512662410736,
-0.05742470547556877,
0.023569731041789055,
-0.23305298388004303,
0.042212873697280884,
0.10177409648895264,
0.04601192846894264,
0.06061551347374916,
0.0032088765874505043,
0.2558709681034088,
0.06467732787132263,
-0.17550063133239746,
-0.18910999596118927,
-0.13502679765224457,
-0.20499669015407562,
-0.13326643407344818,
0.12796980142593384,
-0.44057944416999817,
-0.44844937324523926,
0.10488784313201904,
0.3278433680534363,
-0.014853596687316895,
-0.4102218747138977,
0.05389757454395294,
-0.009440052323043346,
-0.0012703314423561096,
0.03206244111061096,
-0.40590178966522217,
-0.05189378559589386,
0.16677221655845642,
-0.34539103507995605,
-0.04459429904818535,
0.10145464539527893,
-0.18626992404460907,
0.1062881201505661,
0.015231691300868988,
-0.06894852221012115,
0.45359909534454346,
-0.25204408168792725,
-0.08240172266960144,
-0.009910576045513153,
-0.3196030259132385,
0.23022396862506866,
-0.2847314178943634,
0.11551811546087265,
0.08134725689888,
0.14312785863876343,
0.056130051612854004,
0.21041977405548096,
0.2927769720554352,
0.08633747696876526,
-0.306680291891098,
0.049062810838222504,
0.17456865310668945,
0.06339073181152344,
-0.1672554612159729,
-0.2267497032880783,
-0.08444838225841522,
-0.261322021484375,
-0.06099480390548706,
0.15335893630981445,
0.20861463248729706,
0.24587875604629517,
0.218666672706604,
0.09131726622581482,
0.1618189811706543,
0.2628719210624695,
-0.2823028266429901,
0.03984369337558746,
0.2646901309490204,
0.030020181089639664,
-0.17555195093154907,
-0.1414601057767868,
-0.15944257378578186,
-0.043850187212228775,
0.3555116057395935,
-0.5147260427474976,
-0.24935151636600494,
-0.44711804389953613,
0.3386681079864502,
-0.19351421296596527,
-0.08437176048755646,
0.008173871785402298,
0.319671630859375,
-0.10045139491558075,
-0.24438554048538208,
-0.11650893092155457,
0.20869570970535278,
0.09747966378927231,
0.17069461941719055,
0.11907802522182465,
0.3293347954750061,
0.21880267560482025,
-0.03291735425591469,
0.019268669188022614,
0.0762808620929718,
0.5349506139755249,
-0.20759260654449463,
0.41331300139427185,
-0.04840141534805298,
-0.1346961110830307,
0.11542487889528275,
0.10806179791688919,
-0.14095082879066467,
-0.27066612243652344,
-0.26229220628738403,
0.009044038131833076,
-0.09428180754184723,
0.022999443113803864,
-0.42238497734069824,
-0.2239454984664917,
-0.059221938252449036,
-0.14499224722385406,
0.1189824789762497,
-0.18056190013885498,
0.19028352200984955,
-0.022414598613977432,
0.07681131362915039,
-0.021277040243148804,
0.11670444905757904,
0.43371355533599854,
-0.06534813344478607,
-0.20498478412628174,
-0.35159701108932495,
-0.12443327903747559,
0.1783697009086609,
-0.03653927147388458,
0.2717432677745819,
-0.07337825000286102,
-0.12245909124612808,
0.11613058298826218,
-0.09176802635192871,
0.562536895275116,
-0.09662189334630966,
0.08686672896146774,
0.13789913058280945,
0.12231165170669556,
0.009438090026378632,
-0.07928397506475449,
-0.27650874853134155,
0.16695575416088104,
-0.3457641899585724,
0.4643893241882324,
-0.21517795324325562,
-0.01842818409204483,
0.343455046415329,
0.30687540769577026,
-0.17180189490318298,
-0.0841895341873169,
-0.18123719096183777,
-0.3713533282279968,
-0.2464861422777176,
0.007631972432136536,
0.286306232213974,
0.22713568806648254,
-0.11839036643505096,
-0.30149123072624207,
-0.2877506911754608,
-0.17366093397140503,
0.07030948251485825,
0.17873555421829224,
0.2880532741546631,
-0.40612301230430603,
-0.014237619936466217,
-0.13035419583320618,
0.2668825685977936,
0.24067264795303345,
0.5276919603347778,
0.02361254021525383,
-0.6730330586433411,
-0.3009605407714844,
-0.1057915985584259,
0.22000634670257568,
0.14006425440311432,
-0.1407688558101654,
0.08483061194419861,
-0.026349030435085297,
-0.005131613463163376,
-0.25271227955818176,
0.09993819892406464,
0.4192813038825989,
0.0738525539636612,
-0.2046435922384262,
-0.24497978389263153,
0.4216465353965759,
0.007077552378177643,
0.1695009469985962,
-0.01196867786347866,
0.13658741116523743,
-0.20256391167640686,
0.722220242023468,
0.15806308388710022,
0.7972458600997925,
0.17288914322853088,
0.07658806443214417,
0.42045456171035767,
-0.15670567750930786,
0.5556835532188416,
0.2119755893945694,
0.3588849902153015,
-0.017658673226833344,
-0.2341909110546112,
-0.11027771979570389,
0.0647810697555542,
0.08627098798751831,
-0.002093011513352394,
-0.2642860412597656,
0.24265694618225098,
-0.44657760858535767,
-0.008442135527729988,
0.2044740915298462,
-0.041440822184085846,
-0.07890455424785614,
0.13681474328041077,
0.16151204705238342,
0.222615584731102,
0.08573728799819946,
0.05693318694829941,
0.11831918358802795,
-0.4021148383617401,
-0.1973259449005127,
-0.10104604065418243,
-0.16565339267253876,
0.1961071640253067,
-0.1800183355808258,
0.29828310012817383,
-0.17381638288497925,
-0.2775779962539673,
0.10756708681583405,
0.35841816663742065,
0.164385586977005,
0.13526427745819092,
-0.031536683440208435,
0.014430927112698555,
0.30648642778396606,
0.12856581807136536,
0.10542216897010803,
-0.07971533387899399,
0.5171509385108948,
-0.0143890380859375,
-0.2599678039550781,
-0.005377005785703659,
0.058485664427280426,
-0.12794218957424164,
-0.046032145619392395,
0.01291736401617527,
0.11730398237705231,
-0.09050145745277405,
-0.21744637191295624,
-0.25145843625068665,
-0.07413671910762787,
-0.21203356981277466,
0.20774435997009277,
0.057922426611185074,
-0.12669673562049866,
0.3304610550403595,
-0.0755772590637207,
-0.28110599517822266,
-0.031098293140530586,
-0.034989889711141586,
0.10300717502832413,
0.008704699575901031,
0.3998563289642334,
-0.18615365028381348,
-0.12319153547286987,
-0.21610885858535767,
-0.04229138046503067,
-0.07742803543806076,
0.013303861021995544,
0.2732922434806824,
-0.1711539775133133,
0.12681710720062256,
-0.3245662450790405,
-0.14757636189460754,
-0.20651191473007202,
-0.13967043161392212,
-0.21452593803405762,
-0.2877469062805176,
-0.24842382967472076,
0.10476258397102356,
-0.06949898600578308,
0.11532570421695709,
-0.16797977685928345,
0.26914945244789124,
-0.08113821595907211,
-0.03931989520788193,
-0.3625751733779907,
0.049154601991176605,
-0.1639939844608307,
-0.0014906032010912895,
0.23419561982154846,
0.23877130448818207,
-0.13295553624629974,
0.045973002910614014,
0.3165529668331146,
0.2815459370613098,
-0.012054180726408958,
-0.22883525490760803,
-0.10023070871829987,
0.12410955131053925,
0.10715890675783157,
-0.09761884808540344,
-0.013875741511583328,
-0.08341985940933228,
-0.3375634551048279,
-0.06116032600402832,
-0.024335969239473343,
-0.008136168122291565,
-0.0900040939450264,
0.3786270022392273,
-0.21970811486244202,
0.29425695538520813,
0.21221449971199036,
-0.06615209579467773,
-0.25475120544433594,
0.11032949388027191,
0.13109982013702393,
0.17610205709934235,
0.04035266488790512,
-0.014533132314682007,
-0.2507290840148926,
-0.16102255880832672,
-0.2338869571685791,
-0.011925937607884407,
0.3022189736366272,
0.05203384906053543,
-0.022471308708190918,
0.18903040885925293,
0.2329481840133667,
0.3280409574508667,
-0.4063775837421417,
-0.20460167527198792,
0.00025994330644607544,
0.3504970669746399,
-0.3326895534992218,
0.013661742210388184,
0.26656681299209595,
-0.21231792867183685,
0.014575392007827759,
0.34316644072532654,
-0.09238895028829575,
0.2790725827217102,
-0.42457273602485657,
0.04085433855652809,
0.10731188952922821,
-0.20625492930412292,
0.13558131456375122,
0.5560587644577026,
-0.0661262795329094,
0.1372351050376892,
0.20546983182430267,
0.12988978624343872,
0.2532995045185089,
0.8012601733207703,
-0.025576546788215637,
0.4209859371185303,
0.25474366545677185,
0.151580348610878,
0.32078737020492554,
-0.12529565393924713,
0.2502000331878662,
0.22403022646903992,
-0.1641310304403305,
0.2998526692390442,
0.009160894900560379,
-0.1340232640504837,
-0.25907593965530396,
-0.07721635699272156,
-0.012388058006763458,
0.12776991724967957,
-0.1481551080942154,
0.04149596393108368,
0.25843551754951477,
-0.005583956837654114,
-0.45402902364730835,
-0.25097569823265076,
0.12352199852466583,
-0.17234185338020325,
-0.0017282329499721527,
0.12154531478881836,
-0.15295852720737457,
-0.11369278281927109,
0.015995148569345474,
-0.06474077701568604,
0.43636688590049744,
-0.230215385556221,
-0.07262047380208969,
0.2906818389892578,
0.0050068628042936325,
0.3114718794822693,
0.12972094118595123,
0.3261697292327881,
0.20541909337043762,
-0.24489714205265045,
-0.057158101350069046,
-0.15405873954296112,
-0.25492730736732483,
-0.147970512509346,
0.10394690930843353,
-0.18473206460475922,
0.29693326354026794,
0.31463608145713806,
0.20369437336921692,
-0.21557259559631348,
-0.24532370269298553,
0.11215829104185104,
0.05133557319641113,
-0.44179290533065796,
0.38850483298301697,
-0.19200727343559265,
-0.16818022727966309,
-0.19955109059810638,
-0.13188211619853973,
-0.3693738579750061,
-0.31984445452690125,
0.2751367688179016,
0.19606027007102966,
0.1939430832862854,
0.3060554563999176,
0.12062453478574753,
-0.3003488779067993,
-0.13707002997398376,
0.24168457090854645,
0.25251850485801697,
-0.07590648531913757,
0.0038859397172927856,
-0.5155344009399414,
0.23866376280784607,
0.15754030644893646,
-0.7308480143547058,
0.025594551116228104,
0.2454768270254135,
0.07083123177289963,
0.0912599265575409,
0.016830626875162125,
0.08229166269302368,
0.3890162408351898,
0.25365495681762695,
-0.0803808867931366,
-0.11244669556617737,
0.055713098496198654,
-0.08736135810613632,
-0.15157350897789001,
-0.40534135699272156,
0.40478554368019104,
0.1308922916650772,
0.20689766108989716,
-0.061086948961019516,
0.016445711255073547,
-0.15934345126152039,
-0.11078694462776184,
0.19906380772590637,
0.4130028486251831,
0.2613352835178375,
-0.3768422603607178,
-0.2250519096851349,
0.07358008623123169,
0.2532612085342407,
-0.4669046103954315,
0.28408193588256836,
-0.02944381907582283,
0.4871329069137573,
-0.030034799128770828,
0.21067339181900024,
-0.13138523697853088,
0.35496172308921814,
0.15607817471027374,
-0.19380995631217957,
-0.33547842502593994,
0.26819753646850586,
-0.1480555534362793,
0.028386611491441727,
0.03937912359833717,
0.04781994968652725,
0.032047901302576065,
0.042239949107170105,
-0.18459898233413696,
-0.6203670501708984,
0.2839617431163788,
-0.09516136348247528,
-0.2773030996322632,
-0.08323705941438675,
0.17830917239189148,
-0.016568288207054138,
0.19688931107521057,
-0.3448026180267334,
-0.07976578176021576,
0.3674505054950714,
-0.16684490442276,
-0.07886160165071487,
0.43028295040130615,
0.2509136497974396,
0.08344373106956482,
0.0041035935282707214,
0.3483949899673462,
-0.008580592460930347,
0.074521504342556,
0.13949018716812134,
-0.05413069576025009
] |
https://github.com/huggingface/datasets/issues/6212 | Hi @exs-avianello, is it really needed? Note you can alternatively use `pathlib.Path` among others as it follows:
```python
import datasets
from pathlib import Path
# save a parquet file at ~/path/to/data.parquet
data_files = Path.home() / "path/to/data.parquet"
dataset = datasets.load_dataset("parquet", data_files=data_files)
``` | Tilde (~) is not supported for data_files | ### Describe the bug
Attempting to `load_dataset` from a path starting with `~` (as a shorthand for the user's home directory) seems not to be fully working - at least as far as the `parquet` dataset builder is concerned.
(the same file can be loaded correctly if providing its absolute path instead)
I think that this is very similar to https://github.com/huggingface/datasets/issues/5757, but for `data_files` rather than `data_dir`
### Steps to reproduce the bug
```python
import datasets
# save a parquet file at ~/path/to/data.parquet
data_files = "~/path/to/data.parquet"
dataset = datasets.load_dataset("parquet", data_files=data_files)
```
```
Downloading data files: 100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 1/1 [00:00<00:00, 12671.61it/s]
Extracting data files: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 1/1 [00:00<00:00, 22671.91it/s]
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1949, in _prepare_split_single
num_examples, num_bytes = writer.finalize()
^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/datasets/arrow_writer.py", line 598, in finalize
raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
datasets.arrow_writer.SchemaInferenceError: Please pass `features` or at least one example when writing data
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_dataset
builder_instance.download_and_prepare(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1813, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1958, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
Can use `~` shorthand in paths when loading local (parquet) datasets.
### Environment info
`datasets 2.14.3`
| 41 | Tilde (~) is not supported for data_files
### Describe the bug
Attempting to `load_dataset` from a path starting with `~` (as a shorthand for the user's home directory) seems not to be fully working - at least as far as the `parquet` dataset builder is concerned.
(the same file can be loaded correctly if providing its absolute path instead)
I think that this is very similar to https://github.com/huggingface/datasets/issues/5757, but for `data_files` rather than `data_dir`
### Steps to reproduce the bug
```python
import datasets
# save a parquet file at ~/path/to/data.parquet
data_files = "~/path/to/data.parquet"
dataset = datasets.load_dataset("parquet", data_files=data_files)
```
```
Downloading data files: 100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 1/1 [00:00<00:00, 12671.61it/s]
Extracting data files: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 1/1 [00:00<00:00, 22671.91it/s]
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1949, in _prepare_split_single
num_examples, num_bytes = writer.finalize()
^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/datasets/arrow_writer.py", line 598, in finalize
raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
datasets.arrow_writer.SchemaInferenceError: Please pass `features` or at least one example when writing data
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_dataset
builder_instance.download_and_prepare(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1813, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1958, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
Can use `~` shorthand in paths when loading local (parquet) datasets.
### Environment info
`datasets 2.14.3`
Hi @exs-avianello, is it really needed? Note you can alternatively use `pathlib.Path` among others as it follows:
```python
import datasets
from pathlib import Path
# save a parquet file at ~/path/to/data.parquet
data_files = Path.home() / "path/to/data.parquet"
dataset = datasets.load_dataset("parquet", data_files=data_files)
``` | [
-0.4094029664993286,
0.05227942764759064,
0.030013274401426315,
0.43264785408973694,
0.4441775977611542,
-0.0865611881017685,
0.15651258826255798,
0.17398977279663086,
0.12685751914978027,
0.09496255218982697,
0.10140696913003922,
0.2661038041114807,
-0.2220899760723114,
0.22296962141990662,
0.1424063742160797,
-0.05563743785023689,
-0.013206098228693008,
0.014007646590471268,
-0.4212552011013031,
-0.0352427139878273,
-0.3010823726654053,
0.2387695461511612,
-0.013417042791843414,
0.34117361903190613,
-0.13782376050949097,
0.04165346175432205,
0.09487668424844742,
0.4120275676250458,
-0.025261323899030685,
-0.5201501846313477,
0.5566515326499939,
-0.1386258453130722,
0.19621331989765167,
0.6206662058830261,
-0.00011011483729816973,
0.2678747773170471,
0.3564029037952423,
-0.13173961639404297,
-0.37167662382125854,
-0.5818912982940674,
0.10625146329402924,
-0.34308379888534546,
0.39210283756256104,
-0.2381654679775238,
-0.30733317136764526,
-0.3576509654521942,
0.12642675638198853,
-0.2377632111310959,
0.3159564137458801,
0.23947599530220032,
0.1986905038356781,
0.06584548950195312,
0.12951946258544922,
-0.2539331018924713,
0.45146632194519043,
0.23237712681293488,
0.09970556199550629,
0.22524493932724,
-0.056193310767412186,
-0.21361783146858215,
0.048873525112867355,
0.03891459479928017,
0.1779431402683258,
-0.07819855958223343,
0.5623183250427246,
0.27065080404281616,
0.5488086342811584,
-0.12576083838939667,
-0.0809985101222992,
0.14696192741394043,
0.582777738571167,
-0.14233550429344177,
-0.2816154956817627,
-0.23424306511878967,
-0.17572011053562164,
-0.2696368396282196,
0.46713265776634216,
0.20249971747398376,
-0.16635246574878693,
0.2209300398826599,
0.06756391376256943,
-0.0001783408224582672,
-0.07089193165302277,
0.24872340261936188,
-0.03445754200220108,
-0.019905664026737213,
-0.22818991541862488,
0.05843681842088699,
-0.0356040857732296,
-0.32390689849853516,
-0.15030400454998016,
-0.17354045808315277,
0.13123975694179535,
0.0762229859828949,
-0.14754250645637512,
0.13097676634788513,
0.28033244609832764,
-0.22012564539909363,
0.059891775250434875,
0.1640179604291916,
0.0535581037402153,
0.06885413080453873,
-0.04201853275299072,
0.1510486602783203,
0.3008696436882019,
-0.2698551416397095,
-0.0692245364189148,
-0.09528865665197372,
0.310271680355072,
0.23473943769931793,
0.10528838634490967,
-0.07162466645240784,
-0.0162741057574749,
-0.3948722183704376,
-0.35268670320510864,
-0.14670461416244507,
0.38380342721939087,
0.05608101189136505,
-0.29218488931655884,
0.16723987460136414,
0.09084661304950714,
0.0006924532353878021,
0.12857961654663086,
0.4271981418132782,
0.11304502189159393,
-0.1206558421254158,
0.07505489885807037,
0.28998863697052,
-0.03532993793487549,
0.07317596673965454,
-0.23462942242622375,
-0.15308836102485657,
-0.2723933756351471,
-0.24295005202293396,
0.06395716220140457,
0.010299991816282272,
0.1826634705066681,
0.22115647792816162,
-0.010641545057296753,
-0.09612351655960083,
0.015249453485012054,
-0.055470872670412064,
-0.022987745702266693,
0.14333432912826538,
-0.22554942965507507,
0.1724247932434082,
0.27827557921409607,
-0.4402085840702057,
-0.22683361172676086,
0.02955682948231697,
-0.22007352113723755,
-0.15892915427684784,
-0.20652174949645996,
0.21206945180892944,
0.06824690848588943,
0.05161086097359657,
-0.549666702747345,
0.05917060375213623,
0.09125210344791412,
-0.003915853798389435,
-0.059283483773469925,
-0.11686598509550095,
-0.17434737086296082,
-0.2925976812839508,
0.5420272946357727,
0.4975396394729614,
-0.3037116229534149,
-0.052924253046512604,
0.16194608807563782,
-0.2680681347846985,
0.07646816968917847,
0.2847828269004822,
-0.29647907614707947,
0.4617866575717926,
-0.2562784254550934,
0.008898913860321045,
0.48505842685699463,
-0.2227199673652649,
-0.03442060947418213,
0.1344526708126068,
-0.22571977972984314,
-0.0009981393814086914,
0.08609772473573685,
-0.2559620141983032,
0.23620977997779846,
-0.04829520732164383,
0.2678644359111786,
0.2903302013874054,
0.10789984464645386,
0.031792499125003815,
-0.16837109625339508,
-0.2438305914402008,
0.12864086031913757,
0.1514478325843811,
-0.09302450716495514,
-0.3029543459415436,
0.10441409051418304,
-0.14305195212364197,
0.3082036077976227,
-0.2807338237762451,
-0.02325747162103653,
0.3519859313964844,
0.16750086843967438,
0.4341784417629242,
0.05825548991560936,
-0.10442241281270981,
-0.38653242588043213,
0.23772670328617096,
0.3006173074245453,
-0.1620892435312271,
-0.07543821632862091,
-0.09088094532489777,
-0.2579178214073181,
0.05405500531196594,
-0.233256995677948,
-0.1659104824066162,
0.10695026069879532,
0.07272642105817795,
-0.183367520570755,
0.09613524377346039,
-0.21274800598621368,
0.12372137606143951,
-0.07958746701478958,
0.3351798355579376,
-0.11711585521697998,
0.39085817337036133,
-0.0455588698387146,
-0.2754775285720825,
-0.09341789036989212,
0.14070071280002594,
0.3239721357822418,
-0.3595404326915741,
0.049969013780355453,
0.48626506328582764,
0.2541130483150482,
0.06400500237941742,
-0.1315804123878479,
-0.1761859953403473,
0.14115573465824127,
-0.3083627223968506,
-0.07419761270284653,
0.35111066699028015,
0.10805198550224304,
0.031851038336753845,
-0.26953551173210144,
0.06321807950735092,
-0.09515190869569778,
0.21678054332733154,
0.1032920852303505,
0.0021995380520820618,
0.3231884241104126,
0.08220547437667847,
0.2070293128490448,
-0.028580792248249054,
0.34471115469932556,
-0.04459220543503761,
0.011675193905830383,
-0.21008336544036865,
-0.3805057406425476,
-0.017563991248607635,
-0.02713477984070778,
0.13607633113861084,
0.11135073751211166,
0.18587493896484375,
-0.012029975652694702,
-0.0972415953874588,
-0.04462991654872894,
0.10287469625473022,
0.24896866083145142,
0.172489196062088,
0.2773893475532532,
0.1704704910516739,
0.08339689671993256,
-0.2237529754638672,
0.23449429869651794,
0.10784478485584259,
-0.2702483832836151,
0.03215361386537552,
-0.05413427948951721,
0.16894292831420898,
-0.30008232593536377,
0.0367794930934906,
-0.034727487713098526,
0.09703203290700912,
-0.46768462657928467,
0.12605571746826172,
-0.3944980502128601,
-0.2229982614517212,
-0.12796781957149506,
0.19573791325092316,
0.06383409351110458,
-0.10624049603939056,
-0.08806274831295013,
0.19406156241893768,
-0.35531100630760193,
0.21354426443576813,
0.20705704391002655,
0.18262004852294922,
0.02822745591402054,
-0.16224440932273865,
-0.23266279697418213,
-0.19234995543956757,
-0.21742892265319824,
-0.011562172323465347,
0.31359437108039856,
0.2697297930717468,
0.02684844098985195,
-0.12814562022686005,
-0.033010222017765045,
-0.6351003646850586,
-0.27836620807647705,
0.06423749029636383,
0.07151375710964203,
0.45781514048576355,
0.4049995541572571,
0.026952598243951797,
0.025765888392925262,
-0.07777682691812515,
0.25401583313941956,
-0.07252547144889832,
-0.08159788697957993,
0.07948723435401917,
0.40827035903930664,
-0.004530265927314758,
-0.3083506226539612,
-0.1546390950679779,
-0.2210811823606491,
-0.46180033683776855,
0.12090204656124115,
0.28895407915115356,
0.09655123949050903,
-0.18081168830394745,
0.04213247075676918,
0.17435507476329803,
-0.3162606954574585,
0.13702255487442017,
-0.05133995786309242,
-0.29704755544662476,
0.21739991009235382,
-0.3299902081489563,
-0.46612057089805603,
0.09793689846992493,
-0.06460992991924286,
-0.00894404761493206,
0.03005393221974373,
-0.3784283995628357,
0.22483424842357635,
-0.2219008356332779,
0.2914208769798279,
-0.21193529665470123,
0.2908342778682709,
0.20115770399570465,
0.08894806355237961,
-0.11584010720252991,
-0.121950164437294,
-0.20762014389038086,
0.09043645113706589,
-0.008362673223018646,
0.13078172504901886,
-0.08945776522159576,
0.4140866696834564,
-0.048951245844364166,
0.6943065524101257,
0.1775062531232834,
-0.010906442999839783,
0.5697876811027527,
-0.19952470064163208,
0.5488816499710083,
-0.12259353697299957,
-0.22358638048171997,
0.0003561191260814667,
0.0635959729552269,
-0.009776931256055832,
0.14058569073677063,
0.10558044910430908,
0.1921355128288269,
-0.05000772699713707,
-0.08017092943191528,
-0.11268799006938934,
-0.42511579394340515,
0.053171537816524506,
-0.16188161075115204,
0.009419615380465984,
-0.08289119601249695,
0.26186710596084595,
-0.08779531717300415,
-0.03225027024745941,
0.04261959344148636,
0.4992964267730713,
0.13748431205749512,
0.008679039776325226,
0.003658488392829895,
0.26405978202819824,
-0.255426287651062,
0.05267792195081711,
-0.20978115499019623,
0.14243893325328827,
-0.1969328224658966,
-0.12121440470218658,
0.018367435783147812,
-0.07935731112957001,
0.8429042100906372,
-0.07359332591295242,
0.2529256343841553,
-0.014863565564155579,
0.09711754322052002,
-0.5428969860076904,
-0.024503111839294434,
0.06944670528173447,
-0.10746408998966217,
0.03306002914905548,
0.9008173942565918,
-0.47861817479133606,
-0.28970709443092346,
0.18596859276294708,
0.1486387550830841,
-0.14042973518371582,
0.14862659573554993,
-0.19895394146442413,
-0.3975691497325897,
-0.17097407579421997,
0.08577801287174225,
0.16049808263778687,
0.31202298402786255,
0.26362425088882446,
0.12968885898590088,
-0.25772425532341003,
0.08973881602287292,
-0.21117259562015533,
0.014541111886501312,
0.4345429241657257,
-0.2797258496284485,
0.23898309469223022,
0.14278627932071686,
0.029712723568081856,
0.2042349874973297,
0.6067447662353516,
-0.18943318724632263,
-0.427112340927124,
0.1454852670431137,
-0.03591887652873993,
0.3172968626022339,
0.34141433238983154,
-0.2261100709438324,
-0.056023649871349335,
-0.19851039350032806,
0.07664775848388672,
-0.4238967299461365,
0.3286150395870209,
0.31576859951019287,
0.03210798650979996,
-0.06868191063404083,
-0.324468195438385,
0.44303104281425476,
-0.10019482672214508,
-0.014990970492362976,
0.038121987134218216,
0.6071007251739502,
-0.360734760761261,
0.44253960251808167,
0.01634792983531952,
0.6684382557868958,
-0.08713439106941223,
0.33748066425323486,
0.2700527310371399,
-0.3164592981338501,
0.40451374650001526,
-0.13945771753787994,
-0.13553065061569214,
-0.25333788990974426,
-0.15311488509178162,
-0.05878624692559242,
-0.2552643120288849,
0.09419912844896317,
0.2303774356842041,
-0.027529790997505188,
0.14192651212215424,
0.0380745530128479,
0.31177231669425964,
-0.06469618529081345,
0.2838607728481293,
0.06483008712530136,
-0.11280868947505951,
-0.11628741770982742,
0.1446768194437027,
0.03570639342069626,
0.025117576122283936,
-0.1693926304578781,
-0.18621112406253815,
-0.0200648233294487,
-0.3072367310523987,
-0.17304964363574982,
0.10247397422790527,
-0.2737369239330292,
0.23667828738689423,
0.05673065036535263,
-0.7025495171546936,
0.17797091603279114,
0.14643535017967224,
0.19812308251857758,
0.20906637609004974,
-0.11750967800617218,
0.08908574283123016,
-0.20963329076766968,
0.06262616068124771,
-0.15658622980117798,
0.030340544879436493,
0.21549613773822784,
0.09153175354003906,
0.04771089553833008,
-0.27803778648376465,
-0.13884252309799194,
-0.07430469989776611,
0.04164278507232666,
0.12999562919139862,
-0.07923655211925507,
-0.27359652519226074,
-0.1470584273338318,
-0.24796240031719208,
0.02485208958387375,
-0.2996891736984253,
0.13201378285884857,
0.1892918348312378,
-0.045303262770175934,
-0.1366097778081894,
-0.2179015576839447,
-0.2652762532234192,
-0.020596690475940704,
0.23620155453681946,
-0.4510336220264435,
-0.07300800830125809,
0.6288067698478699,
0.12464122474193573,
-0.36656948924064636,
-0.17544937133789062,
0.32848626375198364,
0.38089558482170105,
-0.28124964237213135,
0.2722678780555725,
-0.1383294016122818,
0.14395743608474731,
0.05129164457321167,
0.09948737919330597,
0.22303684055805206,
-0.3477647304534912,
0.015194661915302277,
-0.43393751978874207,
-0.13418109714984894,
0.321437805891037,
-0.28139302134513855,
0.1302308589220047,
0.22728165984153748,
-0.17707890272140503,
0.0030021965503692627,
-0.40600407123565674,
-0.3020765781402588,
0.32011303305625916,
-0.15721964836120605,
0.12737181782722473,
0.49017176032066345,
-0.03763274848461151,
0.14185257256031036,
-0.10522237420082092,
0.12804695963859558,
-0.193899467587471,
-0.1688692569732666,
-0.2098381519317627,
-0.22403864562511444,
0.08887619525194168,
0.12776783108711243,
-0.04831409826874733,
-0.006180070340633392,
-0.1417052298784256,
-0.07704789191484451,
-0.1454247087240219,
0.10951796919107437,
-0.07663487643003464,
-0.06669165194034576,
0.0547587126493454,
0.25508832931518555,
0.27202051877975464,
-0.28743815422058105,
0.12836864590644836,
-0.09736941754817963,
0.19702571630477905,
-0.2853901982307434,
0.0018918667919933796,
-0.31923961639404297,
-0.12354286760091782,
-0.272963285446167,
0.13528506457805634,
0.12150153517723083,
0.10175685584545135,
0.37012410163879395,
-0.2550201117992401,
-0.18412432074546814,
0.015119962394237518,
0.30335456132888794,
0.5716789364814758,
-0.18643543124198914,
-0.1029861718416214,
0.6198880076408386,
0.15578272938728333,
-0.09572915732860565,
0.043860577046871185,
0.19934633374214172,
0.052333276718854904,
0.13865983486175537,
0.1306745857000351,
-0.18949049711227417,
-0.01762840896844864,
-0.42309510707855225,
0.18629929423332214,
0.5067429542541504,
-0.1680711805820465,
0.2868281602859497,
0.5354304313659668,
-0.16391530632972717,
0.07462039589881897,
0.23818287253379822,
0.3292510211467743,
0.26806217432022095,
0.8924441933631897,
-0.037222396582365036,
0.25279197096824646,
0.16415122151374817,
-0.18304184079170227,
-0.016530077904462814,
-0.3959546387195587,
0.03687811270356178,
0.0172891765832901,
0.10937070846557617,
-0.19440186023712158,
-0.01643279939889908,
0.28231924772262573,
-0.388004869222641,
-0.026188770309090614,
-0.009870227426290512,
0.004751619882881641,
-0.21305644512176514,
-0.17669960856437683,
0.0645202249288559,
-0.1323385387659073,
-0.02570722997188568,
-0.024642765522003174,
-0.36789798736572266,
-0.16532647609710693,
-0.0917079821228981,
0.10623470693826675,
0.06930726766586304,
-0.18575519323349,
-0.00118306465446949,
-0.19340139627456665,
-0.1023520976305008,
-0.1604868620634079,
0.21985110640525818,
0.1399833858013153,
-0.13220739364624023,
-0.07479871064424515,
0.34928420186042786,
0.40573519468307495,
0.4070248305797577,
-0.31735920906066895,
-0.16133259236812592,
-0.0643155574798584,
-0.06414587050676346,
-0.05341034382581711,
0.1847812980413437,
-0.016853269189596176,
0.2888967990875244,
0.3276500403881073,
0.17287492752075195,
-0.12087509036064148,
-0.09751357138156891,
0.2661932110786438,
0.14438743889331818,
-0.32036834955215454,
0.2045418918132782,
-0.28122183680534363,
-0.03970026224851608,
0.039706069976091385,
-0.08852950483560562,
-0.29872235655784607,
0.012872949242591858,
0.5141218900680542,
0.39497923851013184,
0.2845290005207062,
-0.04318888485431671,
0.10094162821769714,
0.2577451169490814,
0.5830250382423401,
0.2793978750705719,
0.04765666276216507,
-0.45546233654022217,
0.04352131485939026,
-0.8275564908981323,
0.020696409046649933,
-0.21745604276657104,
-0.17208801209926605,
0.18562936782836914,
0.19729125499725342,
0.1460493952035904,
0.21716338396072388,
0.14009010791778564,
0.12659388780593872,
-0.0902036651968956,
0.18678270280361176,
-0.09595903754234314,
-0.2243787944316864,
0.07265026122331619,
-0.13665933907032013,
-0.020173560827970505,
-0.40197888016700745,
0.29008206725120544,
-0.02776101417839527,
0.06235460191965103,
0.06398092955350876,
-0.10744817554950714,
-0.1517505943775177,
-0.20402371883392334,
0.3086084723472595,
-0.03776393085718155,
0.04361394792795181,
0.010305933654308319,
-0.05371609330177307,
-0.4006206691265106,
-0.41076385974884033,
-0.23226511478424072,
0.39507001638412476,
-0.11914441734552383,
0.18840071558952332,
-0.480846643447876,
-0.034648723900318146,
-0.4831155240535736,
-0.22196412086486816,
-0.03811575472354889,
0.015899021178483963,
-0.07423558831214905,
0.12391885370016098,
-0.019277073442935944,
-0.043174415826797485,
0.18115460872650146,
-0.00859331339597702,
-0.09877283126115799,
0.13367068767547607,
-0.20232126116752625,
-0.46008387207984924,
0.449920654296875,
-0.22663944959640503,
-0.3288552463054657,
-0.13916094601154327,
0.2028694897890091,
0.22121790051460266,
-0.002461342141032219,
-0.40649622678756714,
0.0585610568523407,
0.3493649661540985,
0.07147471606731415,
-0.29023343324661255,
-0.06907539069652557,
-0.12728366255760193,
-0.1454336941242218,
-0.1950092911720276,
0.33065372705459595,
0.07581773400306702,
-0.11914809048175812,
-0.009851008653640747,
-0.3313473165035248
] |
https://github.com/huggingface/datasets/issues/6212 | Hi @alvarobartt !
This is definitely just a "nice to have" and I am personally more than happy to just use absolute paths client-side. I just wanted to flag it up in case it can help improve the package even more π It might not be immediately obvious from the stack trace that the error is triggered by the `~` in the path | Tilde (~) is not supported for data_files | ### Describe the bug
Attempting to `load_dataset` from a path starting with `~` (as a shorthand for the user's home directory) seems not to be fully working - at least as far as the `parquet` dataset builder is concerned.
(the same file can be loaded correctly if providing its absolute path instead)
I think that this is very similar to https://github.com/huggingface/datasets/issues/5757, but for `data_files` rather than `data_dir`
### Steps to reproduce the bug
```python
import datasets
# save a parquet file at ~/path/to/data.parquet
data_files = "~/path/to/data.parquet"
dataset = datasets.load_dataset("parquet", data_files=data_files)
```
```
Downloading data files: 100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 1/1 [00:00<00:00, 12671.61it/s]
Extracting data files: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 1/1 [00:00<00:00, 22671.91it/s]
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1949, in _prepare_split_single
num_examples, num_bytes = writer.finalize()
^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/datasets/arrow_writer.py", line 598, in finalize
raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
datasets.arrow_writer.SchemaInferenceError: Please pass `features` or at least one example when writing data
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_dataset
builder_instance.download_and_prepare(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1813, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1958, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
Can use `~` shorthand in paths when loading local (parquet) datasets.
### Environment info
`datasets 2.14.3`
| 63 | Tilde (~) is not supported for data_files
### Describe the bug
Attempting to `load_dataset` from a path starting with `~` (as a shorthand for the user's home directory) seems not to be fully working - at least as far as the `parquet` dataset builder is concerned.
(the same file can be loaded correctly if providing its absolute path instead)
I think that this is very similar to https://github.com/huggingface/datasets/issues/5757, but for `data_files` rather than `data_dir`
### Steps to reproduce the bug
```python
import datasets
# save a parquet file at ~/path/to/data.parquet
data_files = "~/path/to/data.parquet"
dataset = datasets.load_dataset("parquet", data_files=data_files)
```
```
Downloading data files: 100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 1/1 [00:00<00:00, 12671.61it/s]
Extracting data files: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 1/1 [00:00<00:00, 22671.91it/s]
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1949, in _prepare_split_single
num_examples, num_bytes = writer.finalize()
^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/datasets/arrow_writer.py", line 598, in finalize
raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
datasets.arrow_writer.SchemaInferenceError: Please pass `features` or at least one example when writing data
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_dataset
builder_instance.download_and_prepare(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1813, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1958, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
Can use `~` shorthand in paths when loading local (parquet) datasets.
### Environment info
`datasets 2.14.3`
Hi @alvarobartt !
This is definitely just a "nice to have" and I am personally more than happy to just use absolute paths client-side. I just wanted to flag it up in case it can help improve the package even more π It might not be immediately obvious from the stack trace that the error is triggered by the `~` in the path | [
-0.4094029664993286,
0.05227942764759064,
0.030013274401426315,
0.43264785408973694,
0.4441775977611542,
-0.0865611881017685,
0.15651258826255798,
0.17398977279663086,
0.12685751914978027,
0.09496255218982697,
0.10140696913003922,
0.2661038041114807,
-0.2220899760723114,
0.22296962141990662,
0.1424063742160797,
-0.05563743785023689,
-0.013206098228693008,
0.014007646590471268,
-0.4212552011013031,
-0.0352427139878273,
-0.3010823726654053,
0.2387695461511612,
-0.013417042791843414,
0.34117361903190613,
-0.13782376050949097,
0.04165346175432205,
0.09487668424844742,
0.4120275676250458,
-0.025261323899030685,
-0.5201501846313477,
0.5566515326499939,
-0.1386258453130722,
0.19621331989765167,
0.6206662058830261,
-0.00011011483729816973,
0.2678747773170471,
0.3564029037952423,
-0.13173961639404297,
-0.37167662382125854,
-0.5818912982940674,
0.10625146329402924,
-0.34308379888534546,
0.39210283756256104,
-0.2381654679775238,
-0.30733317136764526,
-0.3576509654521942,
0.12642675638198853,
-0.2377632111310959,
0.3159564137458801,
0.23947599530220032,
0.1986905038356781,
0.06584548950195312,
0.12951946258544922,
-0.2539331018924713,
0.45146632194519043,
0.23237712681293488,
0.09970556199550629,
0.22524493932724,
-0.056193310767412186,
-0.21361783146858215,
0.048873525112867355,
0.03891459479928017,
0.1779431402683258,
-0.07819855958223343,
0.5623183250427246,
0.27065080404281616,
0.5488086342811584,
-0.12576083838939667,
-0.0809985101222992,
0.14696192741394043,
0.582777738571167,
-0.14233550429344177,
-0.2816154956817627,
-0.23424306511878967,
-0.17572011053562164,
-0.2696368396282196,
0.46713265776634216,
0.20249971747398376,
-0.16635246574878693,
0.2209300398826599,
0.06756391376256943,
-0.0001783408224582672,
-0.07089193165302277,
0.24872340261936188,
-0.03445754200220108,
-0.019905664026737213,
-0.22818991541862488,
0.05843681842088699,
-0.0356040857732296,
-0.32390689849853516,
-0.15030400454998016,
-0.17354045808315277,
0.13123975694179535,
0.0762229859828949,
-0.14754250645637512,
0.13097676634788513,
0.28033244609832764,
-0.22012564539909363,
0.059891775250434875,
0.1640179604291916,
0.0535581037402153,
0.06885413080453873,
-0.04201853275299072,
0.1510486602783203,
0.3008696436882019,
-0.2698551416397095,
-0.0692245364189148,
-0.09528865665197372,
0.310271680355072,
0.23473943769931793,
0.10528838634490967,
-0.07162466645240784,
-0.0162741057574749,
-0.3948722183704376,
-0.35268670320510864,
-0.14670461416244507,
0.38380342721939087,
0.05608101189136505,
-0.29218488931655884,
0.16723987460136414,
0.09084661304950714,
0.0006924532353878021,
0.12857961654663086,
0.4271981418132782,
0.11304502189159393,
-0.1206558421254158,
0.07505489885807037,
0.28998863697052,
-0.03532993793487549,
0.07317596673965454,
-0.23462942242622375,
-0.15308836102485657,
-0.2723933756351471,
-0.24295005202293396,
0.06395716220140457,
0.010299991816282272,
0.1826634705066681,
0.22115647792816162,
-0.010641545057296753,
-0.09612351655960083,
0.015249453485012054,
-0.055470872670412064,
-0.022987745702266693,
0.14333432912826538,
-0.22554942965507507,
0.1724247932434082,
0.27827557921409607,
-0.4402085840702057,
-0.22683361172676086,
0.02955682948231697,
-0.22007352113723755,
-0.15892915427684784,
-0.20652174949645996,
0.21206945180892944,
0.06824690848588943,
0.05161086097359657,
-0.549666702747345,
0.05917060375213623,
0.09125210344791412,
-0.003915853798389435,
-0.059283483773469925,
-0.11686598509550095,
-0.17434737086296082,
-0.2925976812839508,
0.5420272946357727,
0.4975396394729614,
-0.3037116229534149,
-0.052924253046512604,
0.16194608807563782,
-0.2680681347846985,
0.07646816968917847,
0.2847828269004822,
-0.29647907614707947,
0.4617866575717926,
-0.2562784254550934,
0.008898913860321045,
0.48505842685699463,
-0.2227199673652649,
-0.03442060947418213,
0.1344526708126068,
-0.22571977972984314,
-0.0009981393814086914,
0.08609772473573685,
-0.2559620141983032,
0.23620977997779846,
-0.04829520732164383,
0.2678644359111786,
0.2903302013874054,
0.10789984464645386,
0.031792499125003815,
-0.16837109625339508,
-0.2438305914402008,
0.12864086031913757,
0.1514478325843811,
-0.09302450716495514,
-0.3029543459415436,
0.10441409051418304,
-0.14305195212364197,
0.3082036077976227,
-0.2807338237762451,
-0.02325747162103653,
0.3519859313964844,
0.16750086843967438,
0.4341784417629242,
0.05825548991560936,
-0.10442241281270981,
-0.38653242588043213,
0.23772670328617096,
0.3006173074245453,
-0.1620892435312271,
-0.07543821632862091,
-0.09088094532489777,
-0.2579178214073181,
0.05405500531196594,
-0.233256995677948,
-0.1659104824066162,
0.10695026069879532,
0.07272642105817795,
-0.183367520570755,
0.09613524377346039,
-0.21274800598621368,
0.12372137606143951,
-0.07958746701478958,
0.3351798355579376,
-0.11711585521697998,
0.39085817337036133,
-0.0455588698387146,
-0.2754775285720825,
-0.09341789036989212,
0.14070071280002594,
0.3239721357822418,
-0.3595404326915741,
0.049969013780355453,
0.48626506328582764,
0.2541130483150482,
0.06400500237941742,
-0.1315804123878479,
-0.1761859953403473,
0.14115573465824127,
-0.3083627223968506,
-0.07419761270284653,
0.35111066699028015,
0.10805198550224304,
0.031851038336753845,
-0.26953551173210144,
0.06321807950735092,
-0.09515190869569778,
0.21678054332733154,
0.1032920852303505,
0.0021995380520820618,
0.3231884241104126,
0.08220547437667847,
0.2070293128490448,
-0.028580792248249054,
0.34471115469932556,
-0.04459220543503761,
0.011675193905830383,
-0.21008336544036865,
-0.3805057406425476,
-0.017563991248607635,
-0.02713477984070778,
0.13607633113861084,
0.11135073751211166,
0.18587493896484375,
-0.012029975652694702,
-0.0972415953874588,
-0.04462991654872894,
0.10287469625473022,
0.24896866083145142,
0.172489196062088,
0.2773893475532532,
0.1704704910516739,
0.08339689671993256,
-0.2237529754638672,
0.23449429869651794,
0.10784478485584259,
-0.2702483832836151,
0.03215361386537552,
-0.05413427948951721,
0.16894292831420898,
-0.30008232593536377,
0.0367794930934906,
-0.034727487713098526,
0.09703203290700912,
-0.46768462657928467,
0.12605571746826172,
-0.3944980502128601,
-0.2229982614517212,
-0.12796781957149506,
0.19573791325092316,
0.06383409351110458,
-0.10624049603939056,
-0.08806274831295013,
0.19406156241893768,
-0.35531100630760193,
0.21354426443576813,
0.20705704391002655,
0.18262004852294922,
0.02822745591402054,
-0.16224440932273865,
-0.23266279697418213,
-0.19234995543956757,
-0.21742892265319824,
-0.011562172323465347,
0.31359437108039856,
0.2697297930717468,
0.02684844098985195,
-0.12814562022686005,
-0.033010222017765045,
-0.6351003646850586,
-0.27836620807647705,
0.06423749029636383,
0.07151375710964203,
0.45781514048576355,
0.4049995541572571,
0.026952598243951797,
0.025765888392925262,
-0.07777682691812515,
0.25401583313941956,
-0.07252547144889832,
-0.08159788697957993,
0.07948723435401917,
0.40827035903930664,
-0.004530265927314758,
-0.3083506226539612,
-0.1546390950679779,
-0.2210811823606491,
-0.46180033683776855,
0.12090204656124115,
0.28895407915115356,
0.09655123949050903,
-0.18081168830394745,
0.04213247075676918,
0.17435507476329803,
-0.3162606954574585,
0.13702255487442017,
-0.05133995786309242,
-0.29704755544662476,
0.21739991009235382,
-0.3299902081489563,
-0.46612057089805603,
0.09793689846992493,
-0.06460992991924286,
-0.00894404761493206,
0.03005393221974373,
-0.3784283995628357,
0.22483424842357635,
-0.2219008356332779,
0.2914208769798279,
-0.21193529665470123,
0.2908342778682709,
0.20115770399570465,
0.08894806355237961,
-0.11584010720252991,
-0.121950164437294,
-0.20762014389038086,
0.09043645113706589,
-0.008362673223018646,
0.13078172504901886,
-0.08945776522159576,
0.4140866696834564,
-0.048951245844364166,
0.6943065524101257,
0.1775062531232834,
-0.010906442999839783,
0.5697876811027527,
-0.19952470064163208,
0.5488816499710083,
-0.12259353697299957,
-0.22358638048171997,
0.0003561191260814667,
0.0635959729552269,
-0.009776931256055832,
0.14058569073677063,
0.10558044910430908,
0.1921355128288269,
-0.05000772699713707,
-0.08017092943191528,
-0.11268799006938934,
-0.42511579394340515,
0.053171537816524506,
-0.16188161075115204,
0.009419615380465984,
-0.08289119601249695,
0.26186710596084595,
-0.08779531717300415,
-0.03225027024745941,
0.04261959344148636,
0.4992964267730713,
0.13748431205749512,
0.008679039776325226,
0.003658488392829895,
0.26405978202819824,
-0.255426287651062,
0.05267792195081711,
-0.20978115499019623,
0.14243893325328827,
-0.1969328224658966,
-0.12121440470218658,
0.018367435783147812,
-0.07935731112957001,
0.8429042100906372,
-0.07359332591295242,
0.2529256343841553,
-0.014863565564155579,
0.09711754322052002,
-0.5428969860076904,
-0.024503111839294434,
0.06944670528173447,
-0.10746408998966217,
0.03306002914905548,
0.9008173942565918,
-0.47861817479133606,
-0.28970709443092346,
0.18596859276294708,
0.1486387550830841,
-0.14042973518371582,
0.14862659573554993,
-0.19895394146442413,
-0.3975691497325897,
-0.17097407579421997,
0.08577801287174225,
0.16049808263778687,
0.31202298402786255,
0.26362425088882446,
0.12968885898590088,
-0.25772425532341003,
0.08973881602287292,
-0.21117259562015533,
0.014541111886501312,
0.4345429241657257,
-0.2797258496284485,
0.23898309469223022,
0.14278627932071686,
0.029712723568081856,
0.2042349874973297,
0.6067447662353516,
-0.18943318724632263,
-0.427112340927124,
0.1454852670431137,
-0.03591887652873993,
0.3172968626022339,
0.34141433238983154,
-0.2261100709438324,
-0.056023649871349335,
-0.19851039350032806,
0.07664775848388672,
-0.4238967299461365,
0.3286150395870209,
0.31576859951019287,
0.03210798650979996,
-0.06868191063404083,
-0.324468195438385,
0.44303104281425476,
-0.10019482672214508,
-0.014990970492362976,
0.038121987134218216,
0.6071007251739502,
-0.360734760761261,
0.44253960251808167,
0.01634792983531952,
0.6684382557868958,
-0.08713439106941223,
0.33748066425323486,
0.2700527310371399,
-0.3164592981338501,
0.40451374650001526,
-0.13945771753787994,
-0.13553065061569214,
-0.25333788990974426,
-0.15311488509178162,
-0.05878624692559242,
-0.2552643120288849,
0.09419912844896317,
0.2303774356842041,
-0.027529790997505188,
0.14192651212215424,
0.0380745530128479,
0.31177231669425964,
-0.06469618529081345,
0.2838607728481293,
0.06483008712530136,
-0.11280868947505951,
-0.11628741770982742,
0.1446768194437027,
0.03570639342069626,
0.025117576122283936,
-0.1693926304578781,
-0.18621112406253815,
-0.0200648233294487,
-0.3072367310523987,
-0.17304964363574982,
0.10247397422790527,
-0.2737369239330292,
0.23667828738689423,
0.05673065036535263,
-0.7025495171546936,
0.17797091603279114,
0.14643535017967224,
0.19812308251857758,
0.20906637609004974,
-0.11750967800617218,
0.08908574283123016,
-0.20963329076766968,
0.06262616068124771,
-0.15658622980117798,
0.030340544879436493,
0.21549613773822784,
0.09153175354003906,
0.04771089553833008,
-0.27803778648376465,
-0.13884252309799194,
-0.07430469989776611,
0.04164278507232666,
0.12999562919139862,
-0.07923655211925507,
-0.27359652519226074,
-0.1470584273338318,
-0.24796240031719208,
0.02485208958387375,
-0.2996891736984253,
0.13201378285884857,
0.1892918348312378,
-0.045303262770175934,
-0.1366097778081894,
-0.2179015576839447,
-0.2652762532234192,
-0.020596690475940704,
0.23620155453681946,
-0.4510336220264435,
-0.07300800830125809,
0.6288067698478699,
0.12464122474193573,
-0.36656948924064636,
-0.17544937133789062,
0.32848626375198364,
0.38089558482170105,
-0.28124964237213135,
0.2722678780555725,
-0.1383294016122818,
0.14395743608474731,
0.05129164457321167,
0.09948737919330597,
0.22303684055805206,
-0.3477647304534912,
0.015194661915302277,
-0.43393751978874207,
-0.13418109714984894,
0.321437805891037,
-0.28139302134513855,
0.1302308589220047,
0.22728165984153748,
-0.17707890272140503,
0.0030021965503692627,
-0.40600407123565674,
-0.3020765781402588,
0.32011303305625916,
-0.15721964836120605,
0.12737181782722473,
0.49017176032066345,
-0.03763274848461151,
0.14185257256031036,
-0.10522237420082092,
0.12804695963859558,
-0.193899467587471,
-0.1688692569732666,
-0.2098381519317627,
-0.22403864562511444,
0.08887619525194168,
0.12776783108711243,
-0.04831409826874733,
-0.006180070340633392,
-0.1417052298784256,
-0.07704789191484451,
-0.1454247087240219,
0.10951796919107437,
-0.07663487643003464,
-0.06669165194034576,
0.0547587126493454,
0.25508832931518555,
0.27202051877975464,
-0.28743815422058105,
0.12836864590644836,
-0.09736941754817963,
0.19702571630477905,
-0.2853901982307434,
0.0018918667919933796,
-0.31923961639404297,
-0.12354286760091782,
-0.272963285446167,
0.13528506457805634,
0.12150153517723083,
0.10175685584545135,
0.37012410163879395,
-0.2550201117992401,
-0.18412432074546814,
0.015119962394237518,
0.30335456132888794,
0.5716789364814758,
-0.18643543124198914,
-0.1029861718416214,
0.6198880076408386,
0.15578272938728333,
-0.09572915732860565,
0.043860577046871185,
0.19934633374214172,
0.052333276718854904,
0.13865983486175537,
0.1306745857000351,
-0.18949049711227417,
-0.01762840896844864,
-0.42309510707855225,
0.18629929423332214,
0.5067429542541504,
-0.1680711805820465,
0.2868281602859497,
0.5354304313659668,
-0.16391530632972717,
0.07462039589881897,
0.23818287253379822,
0.3292510211467743,
0.26806217432022095,
0.8924441933631897,
-0.037222396582365036,
0.25279197096824646,
0.16415122151374817,
-0.18304184079170227,
-0.016530077904462814,
-0.3959546387195587,
0.03687811270356178,
0.0172891765832901,
0.10937070846557617,
-0.19440186023712158,
-0.01643279939889908,
0.28231924772262573,
-0.388004869222641,
-0.026188770309090614,
-0.009870227426290512,
0.004751619882881641,
-0.21305644512176514,
-0.17669960856437683,
0.0645202249288559,
-0.1323385387659073,
-0.02570722997188568,
-0.024642765522003174,
-0.36789798736572266,
-0.16532647609710693,
-0.0917079821228981,
0.10623470693826675,
0.06930726766586304,
-0.18575519323349,
-0.00118306465446949,
-0.19340139627456665,
-0.1023520976305008,
-0.1604868620634079,
0.21985110640525818,
0.1399833858013153,
-0.13220739364624023,
-0.07479871064424515,
0.34928420186042786,
0.40573519468307495,
0.4070248305797577,
-0.31735920906066895,
-0.16133259236812592,
-0.0643155574798584,
-0.06414587050676346,
-0.05341034382581711,
0.1847812980413437,
-0.016853269189596176,
0.2888967990875244,
0.3276500403881073,
0.17287492752075195,
-0.12087509036064148,
-0.09751357138156891,
0.2661932110786438,
0.14438743889331818,
-0.32036834955215454,
0.2045418918132782,
-0.28122183680534363,
-0.03970026224851608,
0.039706069976091385,
-0.08852950483560562,
-0.29872235655784607,
0.012872949242591858,
0.5141218900680542,
0.39497923851013184,
0.2845290005207062,
-0.04318888485431671,
0.10094162821769714,
0.2577451169490814,
0.5830250382423401,
0.2793978750705719,
0.04765666276216507,
-0.45546233654022217,
0.04352131485939026,
-0.8275564908981323,
0.020696409046649933,
-0.21745604276657104,
-0.17208801209926605,
0.18562936782836914,
0.19729125499725342,
0.1460493952035904,
0.21716338396072388,
0.14009010791778564,
0.12659388780593872,
-0.0902036651968956,
0.18678270280361176,
-0.09595903754234314,
-0.2243787944316864,
0.07265026122331619,
-0.13665933907032013,
-0.020173560827970505,
-0.40197888016700745,
0.29008206725120544,
-0.02776101417839527,
0.06235460191965103,
0.06398092955350876,
-0.10744817554950714,
-0.1517505943775177,
-0.20402371883392334,
0.3086084723472595,
-0.03776393085718155,
0.04361394792795181,
0.010305933654308319,
-0.05371609330177307,
-0.4006206691265106,
-0.41076385974884033,
-0.23226511478424072,
0.39507001638412476,
-0.11914441734552383,
0.18840071558952332,
-0.480846643447876,
-0.034648723900318146,
-0.4831155240535736,
-0.22196412086486816,
-0.03811575472354889,
0.015899021178483963,
-0.07423558831214905,
0.12391885370016098,
-0.019277073442935944,
-0.043174415826797485,
0.18115460872650146,
-0.00859331339597702,
-0.09877283126115799,
0.13367068767547607,
-0.20232126116752625,
-0.46008387207984924,
0.449920654296875,
-0.22663944959640503,
-0.3288552463054657,
-0.13916094601154327,
0.2028694897890091,
0.22121790051460266,
-0.002461342141032219,
-0.40649622678756714,
0.0585610568523407,
0.3493649661540985,
0.07147471606731415,
-0.29023343324661255,
-0.06907539069652557,
-0.12728366255760193,
-0.1454336941242218,
-0.1950092911720276,
0.33065372705459595,
0.07581773400306702,
-0.11914809048175812,
-0.009851008653640747,
-0.3313473165035248
] |
https://github.com/huggingface/datasets/issues/6206 | I solved the problem by modifying the "self DEFAULT_WRITER_BATCH_SIZE" in "class MyDataset (datasets. GeneratorBasedBuilder) : __init__" | When calling load_dataset, raise error: pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays | ### Describe the bug
When calling load_dataset, raise error
```
Traceback (most recent call last):
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1694, in _pre
pare_split_single
writer.write(example, key)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 490, in
write
self.write_examples_on_file()
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 448, in
write_examples_on_file
self.write_batch(batch_examples=batch_examples)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 559, in
write_batch
self.write_table(pa_table, writer_batch_size)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 571, in
write_table
pa_table = pa_table.combine_chunks()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "pyarrow/table.pxi", line 3439, in pyarrow.lib.Table.combine_chunks
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
dataset = load_dataset(
^^^^^^^^^^^^^
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_da
taset
builder_instance.download_and_prepare(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 954, in downl
oad_and_prepare
self._download_and_prepare(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _dow
nload_and_prepare
super()._download_and_prepare(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _dow
nload_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _pre
pare_split
for job_id, done, content in self._prepare_split_single(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1712, in _pre
pare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
Setting num_proc from 8 back to 1 for the train split to disable multiprocessing as it only contains one shard.
09/04/2023 12:02:04 - WARNING - datasets.builder - Setting num_proc from 8 back to 1 for the train split to dis
able multiprocessing as it only contains one shard.
```
### Steps to reproduce the bug
Call load_dataset with the large image as feature
### Expected behavior
no error
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 16 | When calling load_dataset, raise error: pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays
### Describe the bug
When calling load_dataset, raise error
```
Traceback (most recent call last):
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1694, in _pre
pare_split_single
writer.write(example, key)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 490, in
write
self.write_examples_on_file()
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 448, in
write_examples_on_file
self.write_batch(batch_examples=batch_examples)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 559, in
write_batch
self.write_table(pa_table, writer_batch_size)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 571, in
write_table
pa_table = pa_table.combine_chunks()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "pyarrow/table.pxi", line 3439, in pyarrow.lib.Table.combine_chunks
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
dataset = load_dataset(
^^^^^^^^^^^^^
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_da
taset
builder_instance.download_and_prepare(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 954, in downl
oad_and_prepare
self._download_and_prepare(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _dow
nload_and_prepare
super()._download_and_prepare(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _dow
nload_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _pre
pare_split
for job_id, done, content in self._prepare_split_single(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1712, in _pre
pare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
Setting num_proc from 8 back to 1 for the train split to disable multiprocessing as it only contains one shard.
09/04/2023 12:02:04 - WARNING - datasets.builder - Setting num_proc from 8 back to 1 for the train split to dis
able multiprocessing as it only contains one shard.
```
### Steps to reproduce the bug
Call load_dataset with the large image as feature
### Expected behavior
no error
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
I solved the problem by modifying the "self DEFAULT_WRITER_BATCH_SIZE" in "class MyDataset (datasets. GeneratorBasedBuilder) : __init__" | [
-0.4871370792388916,
-0.0712931826710701,
-0.06189573183655739,
0.5471633672714233,
0.14621853828430176,
-0.06050470471382141,
0.3858751058578491,
0.27677014470100403,
-0.508307695388794,
0.2028869092464447,
0.12906524538993835,
0.4395868480205536,
0.10653211176395416,
-0.03990921005606651,
-0.04529561474919319,
-0.173033207654953,
0.01112322136759758,
0.04922633245587349,
-0.10261262953281403,
0.105234295129776,
-0.36265602707862854,
-0.0012163054198026657,
-0.3092159330844879,
0.13489298522472382,
-0.15666463971138,
-0.2030685693025589,
-0.03436905890703201,
0.35955584049224854,
-0.12137990444898605,
-0.537617027759552,
0.17959439754486084,
-0.23360702395439148,
0.029984861612319946,
0.29319074749946594,
-0.00011475650535430759,
0.0638287290930748,
0.406665176153183,
0.06745705753564835,
-0.337328165769577,
0.011294208467006683,
-0.04526805505156517,
-0.23394881188869476,
0.18639513850212097,
-0.36668068170547485,
0.1899256557226181,
-0.500088632106781,
-0.1443658024072647,
-0.03382144123315811,
0.32106590270996094,
0.19856514036655426,
0.1938474476337433,
0.20404043793678284,
0.45079243183135986,
-0.026515621691942215,
0.3836553394794464,
-0.1662396341562271,
-0.017239771783351898,
0.25908249616622925,
0.1283428966999054,
-0.06938616186380386,
-0.37811198830604553,
0.08772832900285721,
-0.16653116047382355,
0.021747343242168427,
0.2520030736923218,
0.07852819561958313,
0.018567988649010658,
0.01592184044420719,
-0.13191215693950653,
-0.012722164392471313,
0.4690856635570526,
-0.41222482919692993,
-0.26736927032470703,
-0.23045134544372559,
0.14535564184188843,
-0.20553120970726013,
0.25469258427619934,
0.2299855649471283,
-0.11517086625099182,
0.023027051240205765,
-0.16646890342235565,
0.1357729732990265,
-0.3185027241706848,
0.15847952663898468,
0.11215414106845856,
0.13178154826164246,
0.06467531621456146,
0.18807457387447357,
0.18047992885112762,
-0.24594974517822266,
0.658118486404419,
-0.1494823843240738,
-0.18669700622558594,
0.10267288982868195,
-0.4472072720527649,
0.24133038520812988,
0.07167856395244598,
-0.0767146497964859,
0.2505056858062744,
0.047186534851789474,
0.29136568307876587,
0.049973953515291214,
0.3337623178958893,
0.24957714974880219,
0.23843908309936523,
0.24358193576335907,
-0.058397069573402405,
0.18573391437530518,
-0.020328259095549583,
0.05178442969918251,
0.2055380493402481,
-0.11005789041519165,
-0.12291061878204346,
-0.4109870195388794,
0.2849186956882477,
0.07735316455364227,
0.3071627616882324,
-0.05441368743777275,
-0.37242385745048523,
-0.07142871618270874,
-0.20785865187644958,
-0.03420209139585495,
0.06797592341899872,
0.28173843026161194,
0.10938442498445511,
0.19669583439826965,
0.09159986674785614,
0.21012726426124573,
-0.03368264436721802,
-0.19342447817325592,
-0.1338272988796234,
-0.16931313276290894,
-0.1899310201406479,
-0.040272876620292664,
0.12480220943689346,
-0.1754511296749115,
0.1130317971110344,
0.2332577109336853,
0.15785640478134155,
0.08113114535808563,
0.15363717079162598,
-0.10204993933439255,
0.20304077863693237,
0.006057513412088156,
0.032875508069992065,
-0.06891527026891708,
0.017235392704606056,
0.17792852222919464,
-0.05390595644712448,
0.418573260307312,
-0.19186550378799438,
-0.43773457407951355,
-0.27328789234161377,
0.27549535036087036,
0.0791623592376709,
0.04553027078509331,
-0.09485860168933868,
-0.15537598729133606,
0.5261751413345337,
-0.16440632939338684,
0.14699998497962952,
-0.11828149110078812,
0.08397658914327621,
-0.30801987648010254,
0.25768041610717773,
0.2338504046201706,
-0.5312833786010742,
0.2421291172504425,
-0.07236896455287933,
-0.017696909606456757,
0.11382991820573807,
0.1708875596523285,
-0.32868897914886475,
0.2484472393989563,
-0.2869623899459839,
0.06056733429431915,
0.3965144753456116,
-0.28017061948776245,
-0.5026530623435974,
0.07571834325790405,
-0.1676030158996582,
-0.022009123116731644,
0.2731866240501404,
-0.11032448709011078,
-0.11878782510757446,
0.18222881853580475,
0.054090194404125214,
0.4189265966415405,
-0.08673188090324402,
0.10305038839578629,
-0.3265993893146515,
-0.1811595857143402,
0.14790114760398865,
0.13893213868141174,
-0.2580410838127136,
-0.31904494762420654,
0.11932986974716187,
-0.44750818610191345,
0.2163841724395752,
-0.16664332151412964,
0.06447849422693253,
0.26195529103279114,
-0.08997423946857452,
-0.2325562685728073,
0.1511557549238205,
-0.039716195315122604,
-0.4842892289161682,
-0.002967551350593567,
-0.23362796008586884,
-0.19941240549087524,
-0.40815305709838867,
-0.13831284642219543,
-0.1576547622680664,
0.3455657958984375,
-0.29971182346343994,
0.2930644750595093,
0.1454942524433136,
0.041924431920051575,
0.10787849873304367,
-0.11342693120241165,
-0.013010561466217041,
0.11561807245016098,
-0.14812184870243073,
0.08083338290452957,
-0.38059714436531067,
0.2924553155899048,
-0.23387999832630157,
-0.3991210162639618,
0.07919824123382568,
0.18541660904884338,
0.14893443882465363,
-0.08368823677301407,
-0.13329502940177917,
0.6463285088539124,
-0.12927383184432983,
0.053718239068984985,
-0.3017420768737793,
-0.3621717393398285,
0.07573393732309341,
-0.43400314450263977,
0.25234276056289673,
-0.12867608666419983,
0.006907526403665543,
-0.05742422118782997,
0.03146807849407196,
0.37855008244514465,
-0.09050330519676208,
0.21279355883598328,
-0.03183785080909729,
-0.12611371278762817,
-0.007580585777759552,
-0.052688758820295334,
0.27751901745796204,
-0.1677292138338089,
0.19067436456680298,
0.3014686107635498,
0.3612568974494934,
0.010335683822631836,
-0.182308167219162,
0.17419421672821045,
0.5760257840156555,
0.0251239612698555,
-0.026682600378990173,
0.17122606933116913,
-0.19487051665782928,
-0.12545350193977356,
0.25134187936782837,
-0.1685875803232193,
0.35954204201698303,
0.33803316950798035,
-0.21672439575195312,
-0.12893089652061462,
0.040970925241708755,
-0.15405023097991943,
0.2945539355278015,
0.007397770881652832,
0.26074734330177307,
0.4146482050418854,
0.3353169560432434,
-0.0386183075606823,
-0.2553997039794922,
-0.04253026098012924,
0.05820930749177933,
0.1598467081785202,
-0.2879323959350586,
0.13944263756275177,
-0.011752881109714508,
-0.21917226910591125,
-0.30509522557258606,
-0.362210750579834,
-0.1366630345582962,
-0.3376142382621765,
-0.0010431613773107529,
0.15848088264465332,
-0.2009572684764862,
0.3312307298183441,
0.12348067760467529,
0.10274161398410797,
0.34632766246795654,
-0.1994888037443161,
-0.26528435945510864,
-0.14153075218200684,
-0.2098654806613922,
0.04585246741771698,
0.38334476947784424,
-0.08381818979978561,
0.1563461720943451,
0.21765896677970886,
0.1275394707918167,
-0.037395231425762177,
-0.044404223561286926,
-0.019499951973557472,
0.04397429898381233,
0.044369280338287354,
0.27861282229423523,
-0.055560193955898285,
0.06921786814928055,
-0.5506462454795837,
0.25681114196777344,
0.07033354043960571,
-0.22841423749923706,
0.4218934178352356,
0.06926870346069336,
-0.007446974515914917,
-0.16154220700263977,
-0.2316521406173706,
-0.0920160785317421,
-0.5245944261550903,
0.09797681868076324,
-0.0037436559796333313,
0.20884805917739868,
-0.006764199584722519,
0.3379219174385071,
0.18883804976940155,
0.05675768852233887,
-0.04580147564411163,
0.05344848707318306,
-0.022075019776821136,
0.25921908020973206,
-0.19526635110378265,
-0.3119505047798157,
-0.17652317881584167,
-0.16508375108242035,
0.127116858959198,
0.2542157769203186,
-0.32232406735420227,
0.03635135665535927,
-0.05020613968372345,
0.41150909662246704,
-0.4617927074432373,
0.13703221082687378,
0.1141197681427002,
0.45854681730270386,
-0.11833206564188004,
-0.07486037909984589,
0.03269098699092865,
0.1465376317501068,
-0.2657734453678131,
0.09912701696157455,
-0.04697205126285553,
0.24498839676380157,
-0.1873301863670349,
0.6510533094406128,
0.0632757842540741,
-0.1892714649438858,
0.27381038665771484,
0.016016045585274696,
0.1862168163061142,
-0.15414905548095703,
-0.22709250450134277,
-0.14062252640724182,
0.0852445513010025,
0.12292449176311493,
0.006731435656547546,
-0.20155324041843414,
-0.16984763741493225,
0.0011435598134994507,
-0.04025616869330406,
-0.2397974133491516,
-0.00003965198993682861,
0.15068963170051575,
-0.25363796949386597,
0.13398228585720062,
-0.09400375932455063,
0.026102662086486816,
-0.22043177485466003,
-0.11026577651500702,
-0.05550166592001915,
-0.30290600657463074,
0.0051210299134254456,
-0.20435196161270142,
-0.06384310126304626,
-0.16149413585662842,
-0.22573652863502502,
0.42599737644195557,
0.24736732244491577,
0.1818801313638687,
0.15368005633354187,
-0.12184581160545349,
0.15445172786712646,
-0.22706781327724457,
0.7742675542831421,
-0.028767503798007965,
-0.035465776920318604,
0.17434746026992798,
0.39180445671081543,
-0.6377677917480469,
0.016474731266498566,
-0.0869738906621933,
0.1659269630908966,
0.00910869613289833,
0.16349577903747559,
-0.22041159868240356,
0.021851908415555954,
0.36820363998413086,
0.20214857161045074,
-0.15742552280426025,
-0.31404757499694824,
-0.22357553243637085,
-0.1804174780845642,
-0.11954587697982788,
-0.0015324689447879791,
-0.07960022985935211,
0.49211394786834717,
-0.08578324317932129,
-0.261182963848114,
-0.15152522921562195,
-0.009732872247695923,
-0.4079943895339966,
0.029831379652023315,
0.5830897688865662,
-0.4015844166278839,
0.07177160680294037,
0.078731007874012,
0.1515735387802124,
0.743303120136261,
0.49107295274734497,
-0.02398103103041649,
-0.20451593399047852,
-0.14235952496528625,
-0.17690062522888184,
0.36402764916419983,
0.04436600208282471,
-0.09422838687896729,
0.09818458557128906,
0.0007841978222131729,
0.13013634085655212,
-0.011906351894140244,
-0.23856250941753387,
0.17155182361602783,
-0.07849960029125214,
-0.08224907517433167,
-0.13566190004348755,
0.4319249987602234,
-0.04875505715608597,
0.11282925307750702,
0.5752939581871033,
-0.1652272343635559,
-0.35065001249313354,
0.3912525773048401,
0.14673474431037903,
0.836948037147522,
0.00036792922765016556,
0.116628497838974,
0.3895827829837799,
-0.13077133893966675,
0.0943455845117569,
-0.044912904500961304,
0.16943404078483582,
-0.4967699646949768,
-0.14761364459991455,
0.0353308767080307,
-0.3982897698879242,
-0.06746307015419006,
0.1397193968296051,
-0.255574107170105,
0.010605301707983017,
-0.3764192461967468,
0.10969185084104538,
-0.1231255829334259,
0.14380888640880585,
-0.20234879851341248,
-0.035062022507190704,
-0.3513444662094116,
0.05464480072259903,
0.016789376735687256,
-0.4178520143032074,
-0.14140500128269196,
-0.21840766072273254,
-0.03198862820863724,
-0.34245622158050537,
-0.180329367518425,
0.3761521577835083,
-0.36481910943984985,
0.26693296432495117,
0.10952667146921158,
-0.5007921457290649,
0.1349502056837082,
0.10296829044818878,
-0.1642492711544037,
-0.07696881145238876,
0.05358239263296127,
-0.1099935919046402,
0.24840831756591797,
-0.17342692613601685,
-0.20184063911437988,
0.08221703767776489,
0.15905538201332092,
-0.007554769515991211,
-0.2597733438014984,
0.24542982876300812,
-0.053477659821510315,
-0.11474813520908356,
0.1779036521911621,
0.1864463835954666,
0.20061184465885162,
-0.456992506980896,
0.0569893941283226,
-0.2713589668273926,
-0.02059631422162056,
-0.157135471701622,
0.11536329239606857,
-0.04382196441292763,
-0.16154009103775024,
0.004660641774535179,
-0.10770796239376068,
-0.24438020586967468,
-0.04359522834420204,
0.47219112515449524,
0.16833429038524628,
0.1583540439605713,
0.6179548501968384,
0.26516902446746826,
-0.05057729035615921,
-0.17396658658981323,
0.05675330013036728,
0.3715118169784546,
-0.7178106904029846,
0.1164521649479866,
-0.0028147920966148376,
0.23065008223056793,
0.05287901684641838,
0.19368183612823486,
0.16072209179401398,
0.20612284541130066,
-0.23903539776802063,
-0.24416515231132507,
-0.2898998558521271,
0.09905920922756195,
0.011503445915877819,
0.15773451328277588,
0.18082186579704285,
-0.04908863082528114,
0.03176869451999664,
0.020822348073124886,
-0.3192440867424011,
-0.035652171820402145,
-0.122324138879776,
0.13304594159126282,
-0.06532303988933563,
-0.08944854140281677,
0.0013171955943107605,
-0.009928558021783829,
0.1517012119293213,
0.10541051626205444,
-0.03868156671524048,
-0.28229856491088867,
0.09475035965442657,
0.07404907047748566,
-0.004394314251840115,
-0.2424994707107544,
-0.2979164719581604,
-0.15816056728363037,
-0.013401839882135391,
-0.045526571571826935,
0.1270751655101776,
-0.15004462003707886,
-0.019810214638710022,
0.07514487206935883,
0.3259637653827667,
0.04614657908678055,
-0.24490951001644135,
0.055971503257751465,
-0.18850304186344147,
0.07476827502250671,
-0.07118457555770874,
0.41565850377082825,
-0.1306440532207489,
-0.09800124168395996,
0.011410702019929886,
0.06606343388557434,
0.16104178130626678,
0.027176793664693832,
0.20550218224525452,
-0.3275551497936249,
-0.3503146767616272,
-0.05311286076903343,
0.33871254324913025,
0.5611952543258667,
-0.2889995574951172,
-0.26699936389923096,
0.016280584037303925,
0.2432105541229248,
-0.19937290251255035,
-0.2130964994430542,
-0.10859757661819458,
-0.043848391622304916,
-0.08690377324819565,
-0.01818022131919861,
0.03795246034860611,
-0.4485017657279968,
-0.005938231945037842,
0.18872058391571045,
0.22714215517044067,
0.05082448199391365,
-0.010209057480096817,
0.5026076436042786,
0.013012155890464783,
-0.15789192914962769,
0.49255478382110596,
0.1798480749130249,
0.4926813840866089,
0.2730419337749481,
-0.07743929326534271,
0.17545543611049652,
0.08360110223293304,
-0.09132527559995651,
-0.14403754472732544,
-0.3842194080352783,
0.01074968185275793,
0.27583223581314087,
0.11206088960170746,
-0.007221592590212822,
0.16040226817131042,
0.557276725769043,
0.27424824237823486,
-0.22420182824134827,
0.05487173795700073,
0.01785114035010338,
-0.22503069043159485,
0.1763748824596405,
-0.3286594748497009,
-0.09075981378555298,
-0.09041474759578705,
-0.04933617264032364,
-0.057013072073459625,
0.024412743747234344,
0.625024676322937,
0.1116567850112915,
-0.07353290915489197,
-0.3858519494533539,
0.5275946855545044,
0.4124314785003662,
-0.008844979107379913,
-0.4770418405532837,
0.41009753942489624,
0.4956887364387512,
0.07629327476024628,
-0.041029613465070724,
0.4063620865345001,
0.6996640563011169,
0.4198751151561737,
-0.09232859313488007,
-0.09021374583244324,
0.06006917729973793,
-0.12922507524490356,
-0.14578214287757874,
0.12472670525312424,
0.07587069272994995,
0.17597262561321259,
0.25776034593582153,
0.20292097330093384,
-0.19335448741912842,
0.08989211171865463,
0.41081398725509644,
0.0653054267168045,
-0.08091635257005692,
-0.06654807925224304,
-0.09564480185508728,
-0.6084588766098022,
0.04410245269536972,
-0.023000769317150116,
-0.33540233969688416,
0.08956450968980789,
0.5199781656265259,
0.14514729380607605,
0.05205336585640907,
-0.03193120285868645,
0.08415403217077255,
-0.03239690884947777,
0.6892514228820801,
0.5850961208343506,
0.2993069291114807,
-0.3543477952480316,
-0.33467134833335876,
-0.2635965049266815,
0.40455162525177,
-0.198874831199646,
0.06633539497852325,
0.255494624376297,
0.12943488359451294,
-0.09001278132200241,
0.05229026451706886,
0.4101494550704956,
0.2418638914823532,
-0.13204343616962433,
0.34724390506744385,
-0.5858006477355957,
-0.13093744218349457,
0.24496610462665558,
-0.2505662143230438,
-0.08040610700845718,
-0.49479103088378906,
0.2571267783641815,
-0.22611168026924133,
0.09423249959945679,
-0.08746127784252167,
-0.07974646985530853,
0.2827874720096588,
0.05233977362513542,
0.5602846741676331,
0.0909133329987526,
0.26511210203170776,
-0.05718602240085602,
0.05335203558206558,
-0.10325662791728973,
-0.386513352394104,
-0.2304443120956421,
0.30185508728027344,
0.14599505066871643,
0.1752987504005432,
-0.21366935968399048,
-0.1981465220451355,
-0.21752160787582397,
0.2320886254310608,
-0.01038532704114914,
0.02937239781022072,
0.10348919034004211,
0.09708075225353241,
0.022025756537914276,
-0.20963332056999207,
0.06067253276705742,
-0.12840597331523895,
0.16192516684532166,
0.18367281556129456,
-0.2735830545425415,
-0.34122952818870544,
0.21694321930408478,
-0.09980988502502441,
-0.24536463618278503,
0.19150127470493317,
0.11884889006614685,
0.08935271203517914,
-0.12404966354370117,
-0.5901420712471008,
0.12916073203086853,
0.5431957840919495,
-0.017234569415450096,
-0.17733681201934814,
0.20693685114383698,
-0.04672389104962349,
0.09491584450006485,
-0.06944631040096283,
0.09942641854286194,
0.09816847741603851,
-0.3082073926925659,
-0.0873616561293602,
-0.32738256454467773
] |
https://github.com/huggingface/datasets/issues/6203 | (cross-posting from the linked DVC issue)
I think this should already work out of the box with the current `datasets` and `dvc.api` releases by passing the correct `storage_options` into the datasets calls. `storage_options` is essentially just the kwargs dict that gets passed to the fsspec fs constructor.
The main thing to note here is that the fsspec DVCFileSystem URL should be `dvc://folder/file.json` (i.e. this should be the DVCFileSystem path that is relative to the DVC repo root). You cannot use a URL like `https://gitlab.com/user/repo/folder/file.json`.
I think something like this should work for you (in a venv where both DVC and datasets are installed):
```python
import datasets
# load a dataset from Git/DVC repository where Git repo is located at https://gitlab.com/user/repo.git
# and path to dataset (relative to git/dvc repo root) is 'folder/file.json'
datasets.load_from_disk(
"dvc://folder/file.json",
storage_options={"url": "https://gitlab.com/user/repo.git"},
)
```
basically the `dvc://` is what tells fsspec to create a `DVCFileSystem` and it will construct it like
```python
fs = DVCFileSystem(**storage_options)
```
Then the subsequent calls use the rest of the `dvc://...` URL like
```python
fs.exists("folder/file.json")
``` | Support loading from a DVC remote repository | ### Feature request
Adding support for loading a file from a DVC repository, tracked remotely on a SCM.
### Motivation
DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`.
I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded.
### Your contribution
I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC.
```python
from fsspec.core import url_to_fs
fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo")
```
From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`? | 175 | Support loading from a DVC remote repository
### Feature request
Adding support for loading a file from a DVC repository, tracked remotely on a SCM.
### Motivation
DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`.
I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded.
### Your contribution
I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC.
```python
from fsspec.core import url_to_fs
fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo")
```
From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`?
(cross-posting from the linked DVC issue)
I think this should already work out of the box with the current `datasets` and `dvc.api` releases by passing the correct `storage_options` into the datasets calls. `storage_options` is essentially just the kwargs dict that gets passed to the fsspec fs constructor.
The main thing to note here is that the fsspec DVCFileSystem URL should be `dvc://folder/file.json` (i.e. this should be the DVCFileSystem path that is relative to the DVC repo root). You cannot use a URL like `https://gitlab.com/user/repo/folder/file.json`.
I think something like this should work for you (in a venv where both DVC and datasets are installed):
```python
import datasets
# load a dataset from Git/DVC repository where Git repo is located at https://gitlab.com/user/repo.git
# and path to dataset (relative to git/dvc repo root) is 'folder/file.json'
datasets.load_from_disk(
"dvc://folder/file.json",
storage_options={"url": "https://gitlab.com/user/repo.git"},
)
```
basically the `dvc://` is what tells fsspec to create a `DVCFileSystem` and it will construct it like
```python
fs = DVCFileSystem(**storage_options)
```
Then the subsequent calls use the rest of the `dvc://...` URL like
```python
fs.exists("folder/file.json")
``` | [
-0.1739344596862793,
0.18651391565799713,
0.04655923694372177,
-0.03338225558400154,
0.27074846625328064,
-0.36072176694869995,
0.2354198694229126,
0.035695672035217285,
0.10046906769275665,
-0.09577052295207977,
0.07728295773267746,
0.40473347902297974,
-0.15993854403495789,
0.4113047122955322,
-0.020780034363269806,
0.23820960521697998,
0.0696825236082077,
0.018222559243440628,
0.14311158657073975,
0.06437604129314423,
0.0225982666015625,
-0.021436477079987526,
0.0458659827709198,
-0.04077265411615372,
-0.13008475303649902,
0.22261735796928406,
-0.2555924355983734,
0.5343834161758423,
-0.12775537371635437,
-0.282684326171875,
0.48303285241127014,
0.33942416310310364,
0.503118097782135,
0.29282984137535095,
-0.00011968691978836432,
0.02135215699672699,
0.1654590368270874,
-0.3130369782447815,
-0.5225285291671753,
-0.06770119816064835,
-0.13680976629257202,
-0.17423193156719208,
0.20925486087799072,
-0.35804036259651184,
0.05395073443651199,
0.07414162158966064,
0.058001674711704254,
-0.4455040693283081,
0.21435429155826569,
0.14818833768367767,
0.061135876923799515,
0.13285869359970093,
-0.3011050820350647,
0.08942601084709167,
-0.17607776820659637,
0.3081566095352173,
0.07182595878839493,
0.7529934048652649,
0.325521856546402,
0.08742872625589371,
-0.0384339801967144,
-0.02856333926320076,
-0.2886433005332947,
0.058700572699308395,
0.6349220275878906,
0.04296761378645897,
-0.18101432919502258,
-0.03555139899253845,
0.07578705996274948,
-0.0754852294921875,
0.5235697627067566,
-0.38679465651512146,
-0.4488222002983093,
-0.2829590439796448,
-0.29698994755744934,
0.010298646986484528,
0.12248887121677399,
-0.03002787008881569,
0.08060739189386368,
0.3040533661842346,
-0.38029745221138,
-0.4024140536785126,
-0.20941852033138275,
0.18396781384944916,
-0.08536624908447266,
-0.1324586719274521,
-0.03383130952715874,
0.16364696621894836,
0.015092731453478336,
-0.03880244866013527,
0.029785331338644028,
-0.4816514849662781,
-0.0704515129327774,
0.2610706090927124,
-0.11331763863563538,
-0.16197890043258667,
0.228725403547287,
-0.040263500064611435,
0.24370621144771576,
0.420093297958374,
-0.12613047659397125,
0.12358874082565308,
-0.28474241495132446,
0.17839017510414124,
0.2948893904685974,
0.21240273118019104,
-0.17357930541038513,
0.3792566955089569,
0.2665243446826935,
0.02480310946702957,
0.07918782532215118,
-0.1571633517742157,
-0.37778663635253906,
-0.0052563101053237915,
-0.40770596265792847,
-0.012405247427523136,
0.06974620372056961,
-0.1567370742559433,
0.18029239773750305,
-0.007551763206720352,
-0.11142821609973907,
0.15030121803283691,
-0.05604301393032074,
0.3717266917228699,
0.06763496994972229,
0.6125067472457886,
0.0407070517539978,
0.025863584131002426,
-0.10758763551712036,
0.09404891729354858,
0.09406039118766785,
0.03476400300860405,
-0.24806469678878784,
0.17454230785369873,
0.053786538541316986,
-0.2752922773361206,
0.06311433762311935,
-0.3128643035888672,
0.11071541905403137,
0.024077177047729492,
-0.21659421920776367,
0.21920379996299744,
0.04369832202792168,
-0.06053332984447479,
0.07693079113960266,
-0.00446300208568573,
0.20554694533348083,
-0.03466206043958664,
-0.24543903768062592,
0.19229602813720703,
-0.40613168478012085,
-0.4934983551502228,
-0.20353879034519196,
-0.008795729838311672,
-0.24941742420196533,
0.06724458187818527,
-0.813198983669281,
0.2127527892589569,
-0.37389373779296875,
-0.16694775223731995,
0.06580862402915955,
0.14541257917881012,
0.17557722330093384,
-0.1471880078315735,
0.2654077410697937,
0.41516587138175964,
-0.31754639744758606,
-0.18777668476104736,
0.05583615228533745,
-0.06933921575546265,
0.15007562935352325,
-0.0187749732285738,
-0.2637482285499573,
-0.03710620105266571,
-0.07848471403121948,
0.15988647937774658,
0.14927300810813904,
-0.6197471618652344,
-0.1323658525943756,
0.7259740829467773,
-0.2747138738632202,
0.13634826242923737,
-0.0812930166721344,
0.09171051532030106,
0.19163469970226288,
-0.04997019097208977,
-0.3332515060901642,
0.3762299716472626,
-0.06519851088523865,
0.049610063433647156,
-0.20617753267288208,
-0.4505270719528198,
-0.2742365002632141,
0.23487846553325653,
0.04951161891222,
0.22765783965587616,
0.43664366006851196,
-0.23028944432735443,
0.24344022572040558,
-0.2059641182422638,
0.05631189048290253,
0.027497977018356323,
0.4129754602909088,
0.321139931678772,
-0.13232840597629547,
-0.06119276583194733,
-0.5602240562438965,
0.5047457814216614,
0.2555428147315979,
-0.0015345015563070774,
-0.25279557704925537,
-0.033987339586019516,
0.10411224514245987,
0.2105688452720642,
-0.08529611676931381,
-0.09750086069107056,
-0.11827843636274338,
0.027007555589079857,
-0.10647149384021759,
-0.13763992488384247,
-0.37109729647636414,
0.20647211372852325,
0.07034477591514587,
0.09320341050624847,
0.07556846737861633,
0.6736273169517517,
0.1421830803155899,
0.05756151303648949,
0.0799359679222107,
0.23212197422981262,
0.20013156533241272,
-0.19854217767715454,
-0.03463892638683319,
0.4796317517757416,
0.03508567810058594,
0.25426414608955383,
0.33708274364471436,
0.3179240822792053,
0.10065304487943649,
-0.05497485026717186,
0.002488657832145691,
0.09050600230693817,
0.21040219068527222,
0.25157779455184937,
-0.21811926364898682,
0.39538148045539856,
0.04111912474036217,
0.25720760226249695,
0.22399699687957764,
0.0674138143658638,
0.3192530572414398,
-0.1154661625623703,
-0.07080043852329254,
-0.0219721719622612,
-0.07864227890968323,
0.34927964210510254,
0.028018474578857422,
0.11340759694576263,
-0.15304186940193176,
0.0526597797870636,
-0.1306724101305008,
-0.2799769639968872,
-0.226328045129776,
0.2150767743587494,
0.04977542161941528,
-0.23112733662128448,
0.43243491649627686,
0.18839947879314423,
0.21399115025997162,
0.11485318094491959,
-0.19959630072116852,
-0.017826424911618233,
0.04645856097340584,
-0.05685010552406311,
0.35919445753097534,
-0.097353994846344,
-0.3627189099788666,
0.13342224061489105,
-0.06081044673919678,
0.060172829777002335,
0.14448824524879456,
-0.5241333842277527,
-0.0024157464504241943,
-0.07339245826005936,
-0.3700726628303528,
0.30075520277023315,
-0.38245755434036255,
-0.29010048508644104,
0.0370652936398983,
-0.09008927643299103,
0.03481896594166756,
0.030194491147994995,
-0.1444503664970398,
0.2684853971004486,
-0.17597225308418274,
0.10440365970134735,
-0.4170840084552765,
0.5403257012367249,
-0.19076454639434814,
-0.3847775459289551,
0.16693289577960968,
-0.20367197692394257,
-0.227133110165596,
-0.07411448657512665,
0.22315874695777893,
0.11891008913516998,
0.19436122477054596,
0.3528323173522949,
0.19801700115203857,
-0.5224588513374329,
-0.05405747890472412,
0.246396005153656,
0.08266661316156387,
0.10147067904472351,
-0.022089306265115738,
-0.013935022056102753,
0.3410772681236267,
-0.07813575863838196,
0.09739004075527191,
0.12844309210777283,
0.09631600230932236,
-0.1771632432937622,
0.22883006930351257,
-0.38923516869544983,
-0.2928064167499542,
0.13946057856082916,
-0.13741926848888397,
-0.24435681104660034,
0.09258092194795609,
-0.13267923891544342,
-0.035630978643894196,
0.04470495879650116,
0.12145434319972992,
-0.05530714616179466,
0.20669832825660706,
-0.36905771493911743,
0.12725645303726196,
-0.42653146386146545,
0.3062044382095337,
-0.07979889959096909,
-0.16857267916202545,
0.09301668405532837,
-0.12166272103786469,
-0.08664146065711975,
0.24316412210464478,
-0.2569945454597473,
-0.2026512175798416,
0.07955972105264664,
0.1775551438331604,
0.256991982460022,
-0.11417963355779648,
0.3504104018211365,
0.21851326525211334,
0.09165076911449432,
-0.29396748542785645,
-0.2048705816268921,
0.15302762389183044,
0.10047398507595062,
-0.08702647686004639,
0.3029884099960327,
0.3162446618080139,
0.0487467423081398,
0.8944075107574463,
-0.0250912606716156,
-0.1876295804977417,
0.4235087037086487,
-0.09231874346733093,
0.345724493265152,
0.1673581302165985,
-0.21886348724365234,
-0.020899487659335136,
-0.3974260687828064,
-0.2584053874015808,
0.5588658452033997,
0.273342490196228,
-0.07099124789237976,
-0.3229018449783325,
0.028316937386989594,
0.09234312921762466,
-0.30072885751724243,
-0.02402268536388874,
-0.4320640563964844,
0.336527556180954,
0.05011281371116638,
-0.09178861230611801,
-0.29740384221076965,
0.1405605971813202,
0.031137995421886444,
0.36824554204940796,
0.26232969760894775,
0.11422803997993469,
-0.38305914402008057,
0.17696264386177063,
-0.21080711483955383,
0.28097832202911377,
0.3609117865562439,
-0.11696757376194,
0.1373949944972992,
0.0916665568947792,
0.04245693236589432,
-0.344460666179657,
-0.011538609862327576,
0.044960714876651764,
0.2932572662830353,
0.04786914587020874,
0.01361895352602005,
-0.18765288591384888,
-0.006549805402755737,
0.4229530692100525,
0.04182298481464386,
-0.1436246782541275,
0.11799651384353638,
-0.4210558533668518,
-0.13231061398983002,
-0.4781421422958374,
-0.30361419916152954,
-0.30229032039642334,
0.03881225734949112,
0.056183040142059326,
-0.1832137107849121,
-0.33661162853240967,
-0.3958219587802887,
0.1640562117099762,
0.09566177427768707,
-0.002167869359254837,
0.1231754869222641,
0.04121975600719452,
-0.04452236741781235,
0.15807971358299255,
0.019982919096946716,
0.20600555837154388,
-0.1099848598241806,
0.11785528063774109,
0.1904096007347107,
0.46370601654052734,
0.3533618152141571,
0.7649341821670532,
-0.0519685223698616,
-0.19906644523143768,
-0.03447846323251724,
0.06340782344341278,
0.18769428133964539,
0.4868839681148529,
-0.044425562024116516,
0.04236505180597305,
0.11581464111804962,
-0.11051040887832642,
-0.5141141414642334,
0.25287920236587524,
-0.11612217128276825,
-0.11584161967039108,
-0.06794708967208862,
-0.6296219825744629,
0.3078288733959198,
-0.25836309790611267,
-0.21743091940879822,
0.17004060745239258,
0.4901391863822937,
-0.29762494564056396,
0.17936553061008453,
0.2714426517486572,
0.9702057242393494,
0.17182067036628723,
0.23720768094062805,
0.389547735452652,
-0.1829492300748825,
-0.10980215668678284,
-0.4968986213207245,
-0.039849888533353806,
-0.29194921255111694,
0.24341046810150146,
-0.29586589336395264,
-0.08876243978738785,
-0.035705238580703735,
0.3277951180934906,
0.11774037778377533,
0.17114771902561188,
0.179220512509346,
0.08487263321876526,
0.33583274483680725,
0.33407801389694214,
0.17831315100193024,
-0.25085389614105225,
-0.16723886132240295,
0.07535441219806671,
0.09708341211080551,
-0.13013942539691925,
-0.09714284539222717,
-0.3190230131149292,
-0.09529099613428116,
-0.22943785786628723,
-0.20772427320480347,
0.26333150267601013,
-0.13602828979492188,
0.11165760457515717,
-0.15187926590442657,
0.2978788912296295,
0.012905552983283997,
0.16783075034618378,
-0.12590104341506958,
-0.07836350053548813,
-0.31480672955513,
0.15678848326206207,
-0.010016459971666336,
0.19791309535503387,
-0.005571004003286362,
-0.137806236743927,
0.10939780622720718,
-0.05617624521255493,
0.13968928158283234,
-0.0660037025809288,
-0.15140017867088318,
-0.6526402831077576,
-0.06600780785083771,
-0.05023963749408722,
0.23484161496162415,
-0.09235931932926178,
-0.1561674177646637,
0.17074023187160492,
0.17194333672523499,
0.05139680206775665,
-0.03715825453400612,
0.06703825294971466,
0.23566876351833344,
-0.10316894203424454,
-0.1483265459537506,
0.12204429507255554,
0.08805803954601288,
0.2937271296977997,
-0.4852219820022583,
0.03854832798242569,
-0.010189451277256012,
-0.18752503395080566,
-0.19094212353229523,
0.08362758159637451,
-0.07657412439584732,
0.023089319467544556,
-0.3642352819442749,
0.13828647136688232,
-0.07679808884859085,
-0.23716242611408234,
-0.13791687786579132,
0.5696882605552673,
0.2273954451084137,
-0.05048403888940811,
0.014765165746212006,
-0.15703144669532776,
0.08589780330657959,
0.16784241795539856,
-0.3529723584651947,
0.19956882297992706,
-0.053362611681222916,
0.2848762273788452,
-0.2166910171508789,
-0.2962777018547058,
-0.1767614632844925,
0.18223723769187927,
-0.034645795822143555,
-0.04666406661272049,
0.4139930307865143,
0.05185145512223244,
0.4072292447090149,
-0.17132490873336792,
-0.0910157710313797,
-0.28782403469085693,
-0.01606171205639839,
0.0724649503827095,
-0.19578376412391663,
0.2543814182281494,
0.2922297716140747,
-0.3851124048233032,
-0.14442256093025208,
-0.4212949275970459,
-0.35466453433036804,
-0.18833941221237183,
0.03768523037433624,
0.32294175028800964,
-0.005842398852109909,
-0.264460951089859,
0.021945424377918243,
0.10780543088912964,
-0.546898603439331,
0.404353529214859,
0.33166828751564026,
0.6933184862136841,
0.07676325738430023,
-0.1284903585910797,
-0.28667667508125305,
-0.02874647080898285,
-0.028911489993333817,
0.362033486366272,
0.5844848155975342,
0.26073750853538513,
0.7183284759521484,
-0.09750804305076599,
0.04179683327674866,
0.31246060132980347,
0.4451306164264679,
0.20025578141212463,
-0.2719644606113434,
-0.021983835846185684,
0.4547027051448822,
0.031837090849876404,
-0.08840535581111908,
-0.013968180865049362,
-0.17292781174182892,
-0.18490639328956604,
-0.04470604285597801,
0.12688344717025757,
0.18614205718040466,
-0.0990680381655693,
0.10176476091146469,
0.041165709495544434,
0.3978649377822876,
0.5485979318618774,
0.017606668174266815,
0.018225498497486115,
0.10281677544116974,
0.39557749032974243,
-0.04276353865861893,
0.12877218425273895,
0.4135065972805023,
0.13727259635925293,
-0.4158530831336975,
0.012934761121869087,
0.17542479932308197,
0.13962428271770477,
0.14262625575065613,
-0.3722153306007385,
-0.1612774282693863,
-0.4042246639728546,
0.09196172654628754,
0.08621629327535629,
-0.14789509773254395,
0.18099336326122284,
-0.13989345729351044,
-0.12960682809352875,
0.015526704490184784,
0.27274319529533386,
0.12732256948947906,
-0.29334017634391785,
0.03432140499353409,
-0.16846629977226257,
-0.1363190859556198,
0.13813546299934387,
-0.10483917593955994,
-0.24149112403392792,
-0.030213642865419388,
0.049626100808382034,
0.04949416220188141,
-0.3718741834163666,
0.19704179465770721,
0.21481789648532867,
0.18303653597831726,
-0.017766885459423065,
0.16433046758174896,
0.043553467839956284,
-0.1298426389694214,
0.5186468958854675,
-0.3273266553878784,
0.14265599846839905,
0.16522328555583954,
0.026407316327095032,
-0.252603143453598,
-0.042450662702322006,
0.12540599703788757,
0.08727724105119705,
0.0382302924990654,
-0.34892240166664124,
0.14622411131858826,
0.25994807481765747,
0.009338006377220154,
-0.045785319060087204,
0.1057782992720604,
-0.11860726773738861,
0.21851757168769836,
-0.17495056986808777,
0.6641519069671631,
0.31352943181991577,
0.19694465398788452,
-0.03249458223581314,
0.18122375011444092,
-0.24352045357227325,
-0.1956232786178589,
0.1798827201128006,
0.013207346200942993,
0.13384327292442322,
-0.17539027333259583,
0.031161941587924957,
0.06795370578765869,
0.20859897136688232,
0.18061420321464539,
0.018159959465265274,
-0.13172516226768494,
-0.09290459752082825,
-0.5457471609115601,
0.013030946254730225,
0.08738277852535248,
-0.630632221698761,
-0.1438206136226654,
0.010168947279453278,
0.23087382316589355,
-0.03750235587358475,
-0.43343043327331543,
-0.15079829096794128,
0.22002345323562622,
-0.1526789665222168,
0.06803500652313232,
-0.12813815474510193,
-0.33720260858535767,
0.19861285388469696,
-0.1634088158607483,
-0.3972548246383667,
-0.12940703332424164,
0.059698693454265594,
-0.11318893730640411,
0.1318097710609436,
-0.18733662366867065,
-0.002730920910835266,
-0.2700408697128296,
0.31851208209991455,
-0.13676241040229797,
0.2475770264863968,
0.0636342242360115,
0.00468551367521286,
-0.25001463294029236,
0.18026264011859894,
-0.1336594671010971,
-0.46743255853652954,
-0.057750411331653595,
0.307062566280365,
-0.48454558849334717,
0.539730966091156,
-0.5159928798675537,
-0.14333316683769226,
0.03704879432916641,
0.12546241283416748,
-0.20547357201576233,
0.023306332528591156,
-0.3573180139064789,
0.014537811279296875,
-0.18825280666351318,
0.2718021869659424,
-0.19190075993537903,
0.4516746997833252,
-0.15814141929149628,
-0.13909733295440674,
0.559106707572937,
-0.6494937539100647,
-0.0958886370062828,
0.35705679655075073,
0.13866853713989258,
0.10682794451713562,
0.0841834768652916,
-0.08003218472003937,
-0.07207483798265457,
0.28121328353881836,
0.1353825032711029,
-0.1466343104839325,
0.07502447068691254,
0.03288298472762108,
-0.07065597176551819,
-0.1630246490240097,
0.25259944796562195,
0.06583249568939209,
-0.10287313163280487,
-0.023073971271514893,
-0.2739219069480896
] |
https://github.com/huggingface/datasets/issues/6203 | Hi @pmrowla Thank you for your help, that's very helpful, I was indeed using `fsspec` incorrectly here. There is still an issue with `datasets`:
```python
import datasets
dataset = datasets.load_dataset("json", data_files="dvc://folder/file.jsonl", storage_options={"url": "https://gitlab.com/repo/folder/"})
```
results in the following exception:
```
Traceback (most recent call last):
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/fs.py", line 217, in info
ret = self.trie.info(key)
^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/git/objects.py", line 141, in info
obj = self.trie[key]
~~~~~~~~~^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/pygtrie.py", line 937, in __getitem__
node, _ = self._get_node(key_or_slice)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/pygtrie.py", line 630, in _get_node
raise KeyError(key)
KeyError: ('dvc:', 'datasets', 'spider', 'train.jsonl')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 2129, in load_dataset
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 1815, in load_dataset_builder
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 1430, in dataset_module_factory
).get_module()
^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 958, in get_module
data_files = DataFilesDict.from_patterns(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 674, in from_patterns
DataFilesList.from_patterns(
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 589, in from_patterns
origin_metadata = _get_origin_metadata(data_files, download_config=download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 504, in _get_origin_metadata
return thread_map(
^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map
return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map
return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
yield _result_or_cancel(fs.pop())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
return fut.result(timeout)
^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 491, in _get_single_origin_metadata
info = fs.info(data_file)
^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc/fs/dvc.py", line 357, in info
return self._info(key, path, ignore_subrepos=ignore_subrepos)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc/fs/dvc.py", line 377, in _info
fs_info = fs.info(fs_path)
^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc_objects/fs/base.py", line 501, in info
return self.fs.info(path, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/fs.py", line 221, in info
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), path)
FileNotFoundError: [Errno 2] No such file or directory: '/dvc:/folder/file.jsonl'
```
Somehow the URL gets turned into `/dvc:/folder/file.jsonl` inside `datasets`. Otherwise I can confirm that using `fsspec` properly with DVC works as expected.
| Support loading from a DVC remote repository | ### Feature request
Adding support for loading a file from a DVC repository, tracked remotely on a SCM.
### Motivation
DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`.
I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded.
### Your contribution
I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC.
```python
from fsspec.core import url_to_fs
fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo")
```
From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`? | 327 | Support loading from a DVC remote repository
### Feature request
Adding support for loading a file from a DVC repository, tracked remotely on a SCM.
### Motivation
DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`.
I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded.
### Your contribution
I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC.
```python
from fsspec.core import url_to_fs
fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo")
```
From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`?
Hi @pmrowla Thank you for your help, that's very helpful, I was indeed using `fsspec` incorrectly here. There is still an issue with `datasets`:
```python
import datasets
dataset = datasets.load_dataset("json", data_files="dvc://folder/file.jsonl", storage_options={"url": "https://gitlab.com/repo/folder/"})
```
results in the following exception:
```
Traceback (most recent call last):
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/fs.py", line 217, in info
ret = self.trie.info(key)
^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/git/objects.py", line 141, in info
obj = self.trie[key]
~~~~~~~~~^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/pygtrie.py", line 937, in __getitem__
node, _ = self._get_node(key_or_slice)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/pygtrie.py", line 630, in _get_node
raise KeyError(key)
KeyError: ('dvc:', 'datasets', 'spider', 'train.jsonl')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 2129, in load_dataset
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 1815, in load_dataset_builder
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 1430, in dataset_module_factory
).get_module()
^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 958, in get_module
data_files = DataFilesDict.from_patterns(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 674, in from_patterns
DataFilesList.from_patterns(
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 589, in from_patterns
origin_metadata = _get_origin_metadata(data_files, download_config=download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 504, in _get_origin_metadata
return thread_map(
^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map
return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map
return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
yield _result_or_cancel(fs.pop())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
return fut.result(timeout)
^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 491, in _get_single_origin_metadata
info = fs.info(data_file)
^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc/fs/dvc.py", line 357, in info
return self._info(key, path, ignore_subrepos=ignore_subrepos)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc/fs/dvc.py", line 377, in _info
fs_info = fs.info(fs_path)
^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc_objects/fs/base.py", line 501, in info
return self.fs.info(path, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/fs.py", line 221, in info
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), path)
FileNotFoundError: [Errno 2] No such file or directory: '/dvc:/folder/file.jsonl'
```
Somehow the URL gets turned into `/dvc:/folder/file.jsonl` inside `datasets`. Otherwise I can confirm that using `fsspec` properly with DVC works as expected.
| [
-0.14952722191810608,
0.13017386198043823,
0.03631466627120972,
-0.03125686198472977,
0.2512752413749695,
-0.36142194271087646,
0.25599178671836853,
0.04165944829583168,
0.11361847817897797,
-0.09889458119869232,
0.1056753396987915,
0.35265541076660156,
-0.17089712619781494,
0.39652204513549805,
-0.0030216872692108154,
0.2262575924396515,
0.06812623143196106,
0.011987518519163132,
0.1308586597442627,
0.0322868674993515,
0.025262117385864258,
-0.0019279439002275467,
0.04927524924278259,
-0.07337117195129395,
-0.1648668795824051,
0.23687463998794556,
-0.20339424908161163,
0.5552011728286743,
-0.1170443743467331,
-0.2871253192424774,
0.45674431324005127,
0.2924330532550812,
0.5217875242233276,
0.3617275655269623,
-0.00011865056148963049,
0.03457431495189667,
0.1539255827665329,
-0.3318328857421875,
-0.5155202150344849,
-0.10630239546298981,
-0.09991522878408432,
-0.1883969008922577,
0.23688657581806183,
-0.3493293523788452,
0.011695191264152527,
0.08931496739387512,
0.057333871722221375,
-0.4086940288543701,
0.24463069438934326,
0.14029771089553833,
0.06995609402656555,
0.14649391174316406,
-0.26382529735565186,
0.12591519951820374,
-0.15392929315567017,
0.26766055822372437,
0.10692504793405533,
0.8096517324447632,
0.33223989605903625,
0.13175225257873535,
0.039995912462472916,
0.0010537579655647278,
-0.2779843211174011,
0.04909133538603783,
0.613667905330658,
0.03563956543803215,
-0.1548646241426468,
-0.03740614652633667,
0.02125418186187744,
-0.12015363574028015,
0.5243937969207764,
-0.4023122191429138,
-0.4239407479763031,
-0.2141653299331665,
-0.2885438799858093,
-0.011779546737670898,
0.09811702370643616,
0.020859133452177048,
0.09210404753684998,
0.3209156394004822,
-0.37001219391822815,
-0.399180144071579,
-0.2094438076019287,
0.209225133061409,
-0.10552829504013062,
-0.12192761898040771,
-0.04453526437282562,
0.16705389320850372,
-0.03173962980508804,
-0.02806101180613041,
-0.013888424262404442,
-0.4582212567329407,
-0.03575364872813225,
0.2654551863670349,
-0.10903744399547577,
-0.17695105075836182,
0.16649624705314636,
-0.064628005027771,
0.22966134548187256,
0.4243950843811035,
-0.12206453084945679,
0.10774864256381989,
-0.28951001167297363,
0.19846957921981812,
0.319257527589798,
0.21397757530212402,
-0.19702789187431335,
0.369559645652771,
0.31370943784713745,
0.001858305186033249,
0.05976008623838425,
-0.16406060755252838,
-0.3927883207798004,
-0.006202664226293564,
-0.36253097653388977,
-0.0013602934777736664,
0.08241380751132965,
-0.18845921754837036,
0.18188637495040894,
-0.006934646517038345,
-0.17950960993766785,
0.12523554265499115,
-0.05978286266326904,
0.38786613941192627,
0.04048624634742737,
0.5710511803627014,
0.05605395883321762,
0.03930205479264259,
-0.09981179237365723,
0.08626686036586761,
0.08837561309337616,
0.0720696747303009,
-0.2673654556274414,
0.15277335047721863,
0.07534757256507874,
-0.26803770661354065,
0.10307150334119797,
-0.3489830195903778,
0.10594214498996735,
-0.023901216685771942,
-0.21289804577827454,
0.18628717958927155,
0.04200674220919609,
-0.02986973151564598,
0.14296278357505798,
-0.04364456608891487,
0.212216317653656,
-0.07581587880849838,
-0.266986608505249,
0.19257426261901855,
-0.45152217149734497,
-0.48676469922065735,
-0.20414070785045624,
0.0016054008156061172,
-0.24067065119743347,
0.062529057264328,
-0.8617404103279114,
0.15121719241142273,
-0.3876936733722687,
-0.16591450572013855,
0.06605488806962967,
0.13731740415096283,
0.23084533214569092,
-0.1295478641986847,
0.2479366958141327,
0.38662242889404297,
-0.2789681851863861,
-0.1753145158290863,
0.12682166695594788,
-0.06954266130924225,
0.1718074381351471,
0.03573469817638397,
-0.2768256366252899,
-0.012388035655021667,
-0.07353585213422775,
0.12335044145584106,
0.16350138187408447,
-0.6602645516395569,
-0.13014429807662964,
0.7228550910949707,
-0.33561667799949646,
0.10182540118694305,
-0.1039448156952858,
0.09670627117156982,
0.1603909134864807,
-0.07741130888462067,
-0.3077956736087799,
0.3915373384952545,
-0.0012109596282243729,
0.07852654159069061,
-0.23225878179073334,
-0.4064381718635559,
-0.27319830656051636,
0.24684461951255798,
0.0006957254954613745,
0.23498763144016266,
0.4538869261741638,
-0.2395726889371872,
0.2603186368942261,
-0.22296223044395447,
0.029169641435146332,
0.07001316547393799,
0.41654855012893677,
0.31046831607818604,
-0.13689960539340973,
-0.04534593224525452,
-0.529768705368042,
0.45762932300567627,
0.2498205006122589,
0.015347929671406746,
-0.27922534942626953,
-0.010255590081214905,
0.0974198579788208,
0.1739078164100647,
-0.08645547181367874,
-0.08911177515983582,
-0.11006692051887512,
0.007470916956663132,
-0.11306468397378922,
-0.15362347662448883,
-0.3552156686782837,
0.22515180706977844,
0.06137306988239288,
0.11029631644487381,
0.05345766618847847,
0.7041655778884888,
0.11250318586826324,
0.05615859106183052,
0.11722570657730103,
0.22560404241085052,
0.2209218293428421,
-0.24187703430652618,
-0.0376693457365036,
0.4596775770187378,
-0.0032294094562530518,
0.25029900670051575,
0.34969645738601685,
0.30048394203186035,
0.09123358875513077,
-0.12195056676864624,
-0.00712495855987072,
0.1305103302001953,
0.2296449840068817,
0.27063965797424316,
-0.2042214423418045,
0.3778231143951416,
0.060435645282268524,
0.24582397937774658,
0.25324106216430664,
0.032088883221149445,
0.33757996559143066,
-0.14561502635478973,
-0.10078714042901993,
-0.01983821392059326,
-0.033391404896974564,
0.41161030530929565,
-0.013564154505729675,
0.10689616948366165,
-0.18280816078186035,
0.01047150045633316,
-0.11902563273906708,
-0.3029487729072571,
-0.18510667979717255,
0.2437661588191986,
0.00933069922029972,
-0.21083752810955048,
0.3639918565750122,
0.1917567402124405,
0.21943512558937073,
0.143325537443161,
-0.24748852849006653,
0.021196434274315834,
0.08302903920412064,
-0.06505805999040604,
0.3438480794429779,
-0.10599368810653687,
-0.36098140478134155,
0.1259380728006363,
-0.04618532583117485,
0.06122514605522156,
0.1322994977235794,
-0.5638629198074341,
-0.030646231025457382,
-0.04872835427522659,
-0.3804492950439453,
0.3156158924102783,
-0.38634175062179565,
-0.2656066417694092,
-0.004713024944067001,
-0.09833887219429016,
0.014181144535541534,
0.08769379556179047,
-0.18034100532531738,
0.27454715967178345,
-0.14998838305473328,
0.09237512201070786,
-0.41317254304885864,
0.5173177719116211,
-0.1971258819103241,
-0.4155113399028778,
0.16567462682724,
-0.21299287676811218,
-0.23162534832954407,
-0.0756952315568924,
0.22191959619522095,
0.15564388036727905,
0.20132403075695038,
0.2683439254760742,
0.17733827233314514,
-0.505885124206543,
-0.02507307380437851,
0.26225313544273376,
0.08562794327735901,
0.11253905296325684,
-0.03983450308442116,
0.03533312678337097,
0.33521634340286255,
-0.09034926444292068,
0.09902376681566238,
0.09508925676345825,
0.0877327099442482,
-0.1643831729888916,
0.20323604345321655,
-0.39711323380470276,
-0.26390525698661804,
0.08920615911483765,
-0.19622758030891418,
-0.25961339473724365,
0.0933777242898941,
-0.05315545201301575,
-0.020802747458219528,
0.042908430099487305,
0.09883138537406921,
-0.062077850103378296,
0.21341843903064728,
-0.3427680730819702,
0.1365036815404892,
-0.5005275011062622,
0.31850114464759827,
-0.09600009024143219,
-0.17612087726593018,
0.1202722117304802,
-0.12098078429698944,
-0.1031009703874588,
0.21322807669639587,
-0.2487603724002838,
-0.20459547638893127,
0.08834701031446457,
0.15681324899196625,
0.21950817108154297,
-0.08128783851861954,
0.3108564019203186,
0.2076644003391266,
0.062120407819747925,
-0.255729079246521,
-0.2315458059310913,
0.13203279674053192,
0.11900433897972107,
-0.0500037707388401,
0.30318373441696167,
0.3437185287475586,
0.017398960888385773,
0.9094589948654175,
-0.05069222301244736,
-0.23887908458709717,
0.42474281787872314,
-0.09277868270874023,
0.31502053141593933,
0.15171682834625244,
-0.21581178903579712,
-0.02045254223048687,
-0.4240981936454773,
-0.24170753359794617,
0.5449745059013367,
0.3055114150047302,
-0.06771845370531082,
-0.34303098917007446,
-0.010750487446784973,
0.005028128623962402,
-0.30343592166900635,
-0.042813509702682495,
-0.3565647602081299,
0.34547582268714905,
0.04783499985933304,
-0.1668180674314499,
-0.297676682472229,
0.12684668600559235,
0.006654541939496994,
0.43603867292404175,
0.2352464199066162,
0.12795446813106537,
-0.4366423785686493,
0.15686973929405212,
-0.20478953421115875,
0.28341221809387207,
0.35600546002388,
-0.09071995317935944,
0.14684361219406128,
0.113075852394104,
0.03396780788898468,
-0.3609783947467804,
0.005878891795873642,
0.06402848660945892,
0.3354850113391876,
0.045697472989559174,
0.028893612325191498,
-0.19839352369308472,
0.008171327412128448,
0.4072923958301544,
0.08591246604919434,
-0.10809357464313507,
0.12147194147109985,
-0.41459760069847107,
-0.14369234442710876,
-0.40542659163475037,
-0.27899134159088135,
-0.31776756048202515,
-0.01424827054142952,
-0.0105423703789711,
-0.2081686109304428,
-0.3304160535335541,
-0.4277467727661133,
0.2191421538591385,
0.09361328184604645,
0.015646755695343018,
0.13288025557994843,
0.08083825558423996,
-0.0867677554488182,
0.14331169426441193,
0.015387505292892456,
0.2270231693983078,
-0.08900316059589386,
0.09714892506599426,
0.18506813049316406,
0.4982765018939972,
0.35012540221214294,
0.7957822680473328,
-0.051813557744026184,
-0.1825706958770752,
-0.03440935164690018,
0.08957564830780029,
0.21993912756443024,
0.4609108567237854,
-0.01428733766078949,
0.05941417068243027,
0.14419135451316833,
-0.0774943083524704,
-0.45429766178131104,
0.2481476366519928,
-0.11294732987880707,
-0.07438383996486664,
-0.09174688905477524,
-0.6168456673622131,
0.3168051540851593,
-0.24957840144634247,
-0.1725481152534485,
0.13416904211044312,
0.4426552653312683,
-0.29581016302108765,
0.1884639859199524,
0.24165290594100952,
1.029491662979126,
0.167397141456604,
0.24134421348571777,
0.3684808015823364,
-0.18814432621002197,
-0.09815065562725067,
-0.5830994844436646,
-0.014934327453374863,
-0.3018121123313904,
0.2527157962322235,
-0.3150809407234192,
-0.13610459864139557,
-0.010869789868593216,
0.3180825710296631,
0.08035457879304886,
0.2213420867919922,
0.14520400762557983,
0.06024688109755516,
0.33218902349472046,
0.3712449073791504,
0.21589793264865875,
-0.2511341869831085,
-0.24691687524318695,
0.06758236885070801,
0.0885796844959259,
-0.09169594943523407,
-0.12411737442016602,
-0.3080301284790039,
-0.10796770453453064,
-0.27178800106048584,
-0.17840759456157684,
0.2916577458381653,
-0.13122256100177765,
0.07139764726161957,
-0.1292562484741211,
0.27369609475135803,
0.014950491487979889,
0.14833541214466095,
-0.1489379107952118,
-0.0585390105843544,
-0.28273990750312805,
0.14082883298397064,
-0.026189643889665604,
0.17540524899959564,
-0.004731681197881699,
-0.0991860032081604,
0.10253351926803589,
-0.12092283368110657,
0.11142873764038086,
-0.05792107433080673,
-0.1520824432373047,
-0.6901991963386536,
-0.03660561144351959,
-0.02393920347094536,
0.19681251049041748,
-0.06135400012135506,
-0.1508096605539322,
0.21833066642284393,
0.1499052494764328,
0.04869765043258667,
-0.025211570784449577,
0.08278084546327591,
0.21591216325759888,
-0.12001495808362961,
-0.07596055418252945,
0.0767802745103836,
0.07314690947532654,
0.31117182970046997,
-0.4731374979019165,
0.06846694648265839,
0.027728423476219177,
-0.17628979682922363,
-0.1800343096256256,
0.06142105907201767,
-0.06412166357040405,
0.047961268573999405,
-0.38101083040237427,
0.12637317180633545,
-0.07261956483125687,
-0.18506351113319397,
-0.1416899710893631,
0.5593466758728027,
0.23480181396007538,
-0.05411535128951073,
0.04906637221574783,
-0.21665173768997192,
0.07509025931358337,
0.14238187670707703,
-0.32125476002693176,
0.14554192125797272,
-0.018857240676879883,
0.35068732500076294,
-0.1722031533718109,
-0.31651392579078674,
-0.19224828481674194,
0.20870599150657654,
-0.05996418744325638,
-0.03278949111700058,
0.42479997873306274,
0.02107233554124832,
0.432672381401062,
-0.1382395476102829,
-0.05040965974330902,
-0.3135465979576111,
-0.030154597014188766,
0.05473688989877701,
-0.1763719916343689,
0.24829256534576416,
0.2739332616329193,
-0.38864466547966003,
-0.1376943290233612,
-0.3796657621860504,
-0.3152027130126953,
-0.1186104416847229,
0.007387794554233551,
0.31677374243736267,
0.021011866629123688,
-0.25603631138801575,
0.005684191826730967,
0.054732006043195724,
-0.5802546739578247,
0.35706186294555664,
0.3152913451194763,
0.7087336182594299,
0.10984085500240326,
-0.12780329585075378,
-0.2793595790863037,
-0.031858690083026886,
-0.09395170211791992,
0.33137398958206177,
0.6027801632881165,
0.29297322034835815,
0.7133540511131287,
-0.15408743917942047,
0.06036815047264099,
0.29183411598205566,
0.4262487292289734,
0.17691846191883087,
-0.31670838594436646,
-0.006894946098327637,
0.4701692759990692,
0.047992706298828125,
-0.08524207770824432,
-0.03062530979514122,
-0.1621597707271576,
-0.1678370237350464,
-0.04003617912530899,
0.12362107634544373,
0.16115108132362366,
-0.08894491195678711,
0.08103674650192261,
0.03158055990934372,
0.4202015995979309,
0.561072587966919,
-0.021207286044955254,
-0.007206321693956852,
0.09754428267478943,
0.3918955326080322,
-0.07452193647623062,
0.1711910367012024,
0.43135327100753784,
0.1057993620634079,
-0.39470353722572327,
-0.008107111789286137,
0.1390570104122162,
0.14654439687728882,
0.06777699291706085,
-0.32916033267974854,
-0.18545325100421906,
-0.360975444316864,
0.08163690567016602,
0.07162091135978699,
-0.1486406922340393,
0.19752910733222961,
-0.09886825829744339,
-0.09850823879241943,
0.0303853377699852,
0.28475451469421387,
0.14467114210128784,
-0.28022125363349915,
0.042708635330200195,
-0.14537706971168518,
-0.14980670809745789,
0.1434338390827179,
-0.11273662000894547,
-0.23563255369663239,
-0.11507156491279602,
0.1092749834060669,
0.04489879682660103,
-0.3906814754009247,
0.19439667463302612,
0.2006964385509491,
0.17803315818309784,
-0.025366172194480896,
0.19220110774040222,
0.05512090399861336,
-0.13432590663433075,
0.5031905770301819,
-0.3406396806240082,
0.16249507665634155,
0.1836317777633667,
0.057346753776073456,
-0.26410046219825745,
-0.06471804529428482,
0.1039913147687912,
0.09299276024103165,
0.024066779762506485,
-0.3085426688194275,
0.14788033068180084,
0.2608150839805603,
0.03814598545432091,
-0.05975763499736786,
0.16603463888168335,
-0.09219944477081299,
0.2029363214969635,
-0.17717546224594116,
0.6625040173530579,
0.289707213640213,
0.1890575885772705,
-0.07972154766321182,
0.17435722053050995,
-0.30354994535446167,
-0.14717170596122742,
0.18931856751441956,
0.0017596632242202759,
0.13144031167030334,
-0.17170938849449158,
0.039140649139881134,
0.05182802677154541,
0.2485303282737732,
0.17298033833503723,
0.07364824414253235,
-0.1336362510919571,
-0.09622621536254883,
-0.5343399047851562,
0.01210923120379448,
0.027574531733989716,
-0.6122962236404419,
-0.15882833302021027,
0.012656666338443756,
0.22833290696144104,
0.043024368584156036,
-0.4170103073120117,
-0.1853540986776352,
0.14549461007118225,
-0.1496075689792633,
0.06652896851301193,
-0.13141682744026184,
-0.3358685076236725,
0.30179286003112793,
-0.13853445649147034,
-0.39217978715896606,
-0.15364253520965576,
0.020854253321886063,
-0.08949363976716995,
0.1004035547375679,
-0.17036974430084229,
-0.004597850143909454,
-0.26716291904449463,
0.35515251755714417,
-0.15070955455303192,
0.2824358642101288,
0.04723484814167023,
-0.028517726808786392,
-0.23872579634189606,
0.14852958917617798,
-0.13966739177703857,
-0.4415820240974426,
-0.025340931490063667,
0.29315465688705444,
-0.4776409864425659,
0.5315713286399841,
-0.5274847149848938,
-0.13923262059688568,
0.02712608128786087,
0.10855649411678314,
-0.18649789690971375,
-0.03136805444955826,
-0.29032307863235474,
-0.0011907853186130524,
-0.19813062250614166,
0.26366397738456726,
-0.19994483888149261,
0.41453829407691956,
-0.1813022643327713,
-0.11001335084438324,
0.5871320962905884,
-0.6292839050292969,
-0.08406240493059158,
0.37179645895957947,
0.18793639540672302,
0.08280537277460098,
0.08783083409070969,
-0.010105147957801819,
-0.018832847476005554,
0.30993127822875977,
0.19170325994491577,
-0.19338642060756683,
0.10412725806236267,
0.04039156809449196,
-0.08638925850391388,
-0.14674028754234314,
0.18932688236236572,
0.042365171015262604,
-0.11970005929470062,
-0.04928877577185631,
-0.24997398257255554
] |
https://github.com/huggingface/datasets/issues/6203 | For the record, there was a `dvc.api.DVCFileSystem` bug which is fixed in DVC `main` and will be available in the next DVC release.
To use DVC with `datasets` you just need to pass the Git/DVC repo `url` in `storage_options` as discussed above.
(note that this requires having both `datasets` and `dvc` installed in your python environment)
```python
>>> from datasets import load_dataset
>>> load_dataset(
... "json",
... data_files="dvc://eval/metrics.json",
... storage_options={"url": "https://github.com/iterative/example-get-started.git"},
... )
DatasetDict({
train: Dataset({
features: ['avg_prec', 'roc_auc'],
num_rows: 1
})
})
```
Any additional `DVCFileSystem` args can be passed in the same way, so to get a specific branch/tag/commit from the DVC repo you just need to specify the `rev` in `storage_options` like
```
storage_options={"url": "https://github.com/iterative/example-get-started.git", "rev": "main"}
```
I think this issue can probably be closed now. | Support loading from a DVC remote repository | ### Feature request
Adding support for loading a file from a DVC repository, tracked remotely on a SCM.
### Motivation
DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`.
I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded.
### Your contribution
I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC.
```python
from fsspec.core import url_to_fs
fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo")
```
From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`? | 130 | Support loading from a DVC remote repository
### Feature request
Adding support for loading a file from a DVC repository, tracked remotely on a SCM.
### Motivation
DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`.
I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded.
### Your contribution
I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC.
```python
from fsspec.core import url_to_fs
fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo")
```
From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`?
For the record, there was a `dvc.api.DVCFileSystem` bug which is fixed in DVC `main` and will be available in the next DVC release.
To use DVC with `datasets` you just need to pass the Git/DVC repo `url` in `storage_options` as discussed above.
(note that this requires having both `datasets` and `dvc` installed in your python environment)
```python
>>> from datasets import load_dataset
>>> load_dataset(
... "json",
... data_files="dvc://eval/metrics.json",
... storage_options={"url": "https://github.com/iterative/example-get-started.git"},
... )
DatasetDict({
train: Dataset({
features: ['avg_prec', 'roc_auc'],
num_rows: 1
})
})
```
Any additional `DVCFileSystem` args can be passed in the same way, so to get a specific branch/tag/commit from the DVC repo you just need to specify the `rev` in `storage_options` like
```
storage_options={"url": "https://github.com/iterative/example-get-started.git", "rev": "main"}
```
I think this issue can probably be closed now. | [
-0.17393767833709717,
0.17896315455436707,
0.0372188538312912,
-0.04128967598080635,
0.2395937144756317,
-0.3132011592388153,
0.2638843059539795,
0.054811906069517136,
0.09661697596311569,
-0.07596766948699951,
0.07595217972993851,
0.39492619037628174,
-0.17496736347675323,
0.35434263944625854,
0.001460254192352295,
0.21908263862133026,
0.043992746621370316,
0.020262617617845535,
0.16769221425056458,
0.06442123651504517,
0.05181413143873215,
-0.029476569965481758,
0.05937814712524414,
-0.06156359985470772,
-0.12466919422149658,
0.23964005708694458,
-0.21476781368255615,
0.5284099578857422,
-0.0844869390130043,
-0.23397722840309143,
0.4735817611217499,
0.31839895248413086,
0.4995143413543701,
0.3192237913608551,
-0.00011885726416949183,
0.06976267695426941,
0.1488727331161499,
-0.3280973732471466,
-0.5208738446235657,
-0.11481177806854248,
-0.10973993688821793,
-0.17196187376976013,
0.21993504464626312,
-0.3452836871147156,
0.045612022280693054,
0.14183376729488373,
0.0819752886891365,
-0.42483824491500854,
0.18474891781806946,
0.09237696975469589,
0.0679612010717392,
0.14278438687324524,
-0.25814396142959595,
0.0909653902053833,
-0.13779404759407043,
0.31659528613090515,
0.08387623727321625,
0.8570797443389893,
0.4111493229866028,
0.15858839452266693,
-0.02272035926580429,
-0.03286126255989075,
-0.2814190685749054,
0.06447064876556396,
0.6088854074478149,
0.06518656760454178,
-0.15166503190994263,
0.005035370588302612,
0.059912048280239105,
-0.08384151756763458,
0.5629595518112183,
-0.3931288421154022,
-0.40663960576057434,
-0.23852255940437317,
-0.27154457569122314,
-0.018370483070611954,
0.12636391818523407,
0.00917835533618927,
0.06345505267381668,
0.3189297616481781,
-0.41117551922798157,
-0.4488149583339691,
-0.216831773519516,
0.17582616209983826,
-0.09025221318006516,
-0.09660107642412186,
-0.03320249170064926,
0.16440829634666443,
0.024534616619348526,
-0.03856995329260826,
0.004562314599752426,
-0.41899606585502625,
-0.07010038197040558,
0.2280656099319458,
-0.10599067807197571,
-0.18839097023010254,
0.13950102031230927,
-0.04743776470422745,
0.26803281903266907,
0.4129948914051056,
-0.10609816014766693,
0.08529575169086456,
-0.34866228699684143,
0.19220906496047974,
0.29750728607177734,
0.2413421869277954,
-0.22117583453655243,
0.3907121419906616,
0.29411160945892334,
0.0133541040122509,
0.09132228791713715,
-0.16699838638305664,
-0.37152594327926636,
0.031805772334337234,
-0.3792792856693268,
-0.042659200727939606,
0.07890210300683975,
-0.19331589341163635,
0.16160890460014343,
-0.075742706656456,
-0.14547331631183624,
0.14685192704200745,
-0.01375339925289154,
0.3731788694858551,
0.06753619760274887,
0.5588781833648682,
0.013540312647819519,
0.01226964220404625,
-0.07911264151334763,
0.06308667361736298,
0.10564960539340973,
0.014082279056310654,
-0.24268844723701477,
0.1685658097267151,
0.08432954549789429,
-0.30666136741638184,
0.07718996703624725,
-0.30995261669158936,
0.14176687598228455,
0.046259358525276184,
-0.2097470462322235,
0.20516104996204376,
0.03306015208363533,
-0.06238964945077896,
0.15156549215316772,
-0.03983556106686592,
0.2070448100566864,
-0.04680245742201805,
-0.26099228858947754,
0.20194977521896362,
-0.48817867040634155,
-0.4907214343547821,
-0.22000652551651,
-0.013158245012164116,
-0.19986213743686676,
0.06465839594602585,
-0.7961309552192688,
0.18086281418800354,
-0.3611588478088379,
-0.20295464992523193,
0.06739291548728943,
0.17537760734558105,
0.21784014999866486,
-0.1541050374507904,
0.27243471145629883,
0.3688097298145294,
-0.33384740352630615,
-0.17337021231651306,
0.08556102216243744,
-0.06683988869190216,
0.15825298428535461,
-0.010644853115081787,
-0.30823323130607605,
-0.09325525164604187,
-0.08207426965236664,
0.08090761303901672,
0.14627227187156677,
-0.6485422849655151,
-0.13783183693885803,
0.7033458948135376,
-0.3267896771430969,
0.09122464060783386,
-0.09939351677894592,
0.11933046579360962,
0.162608340382576,
-0.08464018255472183,
-0.33732253313064575,
0.37233269214630127,
-0.055700935423374176,
0.05152285099029541,
-0.19367223978042603,
-0.4354742169380188,
-0.275500625371933,
0.24311256408691406,
-0.0037926258519291878,
0.23177814483642578,
0.4509544372558594,
-0.21604406833648682,
0.21311374008655548,
-0.17730960249900818,
0.07412771135568619,
0.03488457202911377,
0.36672380566596985,
0.3126329481601715,
-0.16278386116027832,
-0.03615620732307434,
-0.5373191237449646,
0.48490527272224426,
0.2741599678993225,
-0.04343191534280777,
-0.27195438742637634,
-0.012598350644111633,
0.11171133816242218,
0.17348244786262512,
-0.06418560445308685,
-0.06811580061912537,
-0.11608648300170898,
0.06279212981462479,
-0.13011139631271362,
-0.1453847438097,
-0.3620266616344452,
0.24128420650959015,
0.08593611419200897,
0.06555646657943726,
0.07288292795419693,
0.7106791138648987,
0.14936701953411102,
0.06625325977802277,
0.06927535682916641,
0.20120735466480255,
0.20002150535583496,
-0.1999243050813675,
-0.05082361027598381,
0.49132010340690613,
-0.10291290283203125,
0.2838800549507141,
0.3778623342514038,
0.27096378803253174,
0.12475521117448807,
-0.08211412280797958,
0.02292313612997532,
0.06018834933638573,
0.22740386426448822,
0.2511594295501709,
-0.2260071486234665,
0.3335469365119934,
0.021807877346873283,
0.22288067638874054,
0.24187156558036804,
0.040453873574733734,
0.33970263600349426,
-0.12494657933712006,
-0.0663120225071907,
-0.05877338722348213,
-0.06873466074466705,
0.34873515367507935,
0.027682743966579437,
0.0747552365064621,
-0.188728928565979,
0.03438878804445267,
-0.11263251304626465,
-0.27487263083457947,
-0.1868632733821869,
0.23567284643650055,
0.0006772764027118683,
-0.19596533477306366,
0.3635609745979309,
0.21040856838226318,
0.21322427690029144,
0.1228192150592804,
-0.20385757088661194,
-0.030273426324129105,
0.04513629525899887,
-0.07402284443378448,
0.33414793014526367,
-0.10721978545188904,
-0.3656381666660309,
0.1033434197306633,
-0.055919475853443146,
0.05193399637937546,
0.20924846827983856,
-0.5276107788085938,
0.02938207983970642,
-0.0812876895070076,
-0.35060203075408936,
0.27362847328186035,
-0.4102597236633301,
-0.2630574107170105,
0.003746911883354187,
-0.1418047547340393,
0.015326399356126785,
0.09243839234113693,
-0.15248219668865204,
0.28182515501976013,
-0.13820728659629822,
0.08579269051551819,
-0.4405229687690735,
0.5508929491043091,
-0.18690378963947296,
-0.40362265706062317,
0.21399542689323425,
-0.20799961686134338,
-0.22888389229774475,
-0.054710887372493744,
0.22302328050136566,
0.12907186150550842,
0.2259679138660431,
0.3099368214607239,
0.17900602519512177,
-0.5265647768974304,
0.010213911533355713,
0.2695819139480591,
0.08425979316234589,
0.07781171053647995,
-0.059023573994636536,
-0.016815658658742905,
0.30732712149620056,
-0.07918667793273926,
0.10545287281274796,
0.1277356892824173,
0.10263366252183914,
-0.1851867139339447,
0.23519295454025269,
-0.3806030750274658,
-0.296492338180542,
0.1376202404499054,
-0.18034864962100983,
-0.2589932382106781,
0.03677981346845627,
-0.08665553480386734,
-0.034432318061590195,
0.02636091783642769,
0.08215631544589996,
-0.017721213400363922,
0.21849241852760315,
-0.3515247702598572,
0.15380451083183289,
-0.48451530933380127,
0.31733807921409607,
-0.12248440086841583,
-0.1356160044670105,
0.1256546974182129,
-0.07232706993818283,
-0.07883896678686142,
0.27578574419021606,
-0.2432214468717575,
-0.19343018531799316,
0.09017042815685272,
0.15672528743743896,
0.23342743515968323,
-0.12177707999944687,
0.34200379252433777,
0.22549250721931458,
0.07545201480388641,
-0.27961787581443787,
-0.2518380284309387,
0.16780611872673035,
0.089266836643219,
-0.05774148553609848,
0.35252976417541504,
0.3531935214996338,
0.04095342755317688,
0.934167742729187,
-0.04673149436712265,
-0.22061215341091156,
0.4405234456062317,
-0.04208458214998245,
0.3532571792602539,
0.1582399308681488,
-0.22940663993358612,
-0.029918279498815536,
-0.4020381569862366,
-0.22723394632339478,
0.5595900416374207,
0.28919047117233276,
-0.08444996178150177,
-0.35164791345596313,
-0.06278069317340851,
0.08602231740951538,
-0.29356908798217773,
-0.02906329557299614,
-0.4073033928871155,
0.37105536460876465,
0.01772589236497879,
-0.15938274562358856,
-0.31943994760513306,
0.08672699332237244,
0.018763229250907898,
0.41537344455718994,
0.26706475019454956,
0.14203912019729614,
-0.3945421576499939,
0.17591853439807892,
-0.18386830389499664,
0.27592137455940247,
0.3619043827056885,
-0.14032524824142456,
0.12741544842720032,
0.11621318757534027,
0.015840567648410797,
-0.3599023222923279,
-0.07013711333274841,
0.08151160925626755,
0.3296199440956116,
0.03168641775846481,
0.004928521811962128,
-0.14451561868190765,
0.002598501741886139,
0.4271451532840729,
0.08782680332660675,
-0.12442918121814728,
0.13429108262062073,
-0.4069122076034546,
-0.11085082590579987,
-0.4258863031864166,
-0.30688178539276123,
-0.30409330129623413,
0.008604444563388824,
0.050879523158073425,
-0.14726731181144714,
-0.34363454580307007,
-0.39587944746017456,
0.17726720869541168,
0.08568305522203445,
-0.0028637386858463287,
0.09965923428535461,
0.06691103428602219,
-0.09644860774278641,
0.12729044258594513,
0.004112858325242996,
0.22276049852371216,
-0.0925946906208992,
0.11118590086698532,
0.1965646594762802,
0.5064781308174133,
0.33410266041755676,
0.7990343570709229,
-0.04810269922018051,
-0.17778556048870087,
-0.011107079684734344,
0.056029438972473145,
0.19507384300231934,
0.4573715925216675,
-0.031173791736364365,
0.07047797739505768,
0.1287071257829666,
-0.13905198872089386,
-0.4364784061908722,
0.2281392216682434,
-0.1545834243297577,
-0.131292924284935,
-0.10155513137578964,
-0.5857598185539246,
0.3030192255973816,
-0.2630700469017029,
-0.1965004950761795,
0.12941467761993408,
0.44431281089782715,
-0.3050054609775543,
0.10809943079948425,
0.27156275510787964,
0.965656042098999,
0.17427664995193481,
0.20863115787506104,
0.324151873588562,
-0.18890681862831116,
-0.09244421124458313,
-0.5079609155654907,
-0.0161406509578228,
-0.2638879418373108,
0.2030351161956787,
-0.30918461084365845,
-0.1145571917295456,
-0.05252924934029579,
0.2963908314704895,
0.048580385744571686,
0.18890759348869324,
0.1516389548778534,
0.1348932981491089,
0.3454822897911072,
0.317573606967926,
0.21662741899490356,
-0.2674942910671234,
-0.1512315720319748,
0.07064686715602875,
0.08752715587615967,
-0.15846019983291626,
-0.11386948823928833,
-0.3302176296710968,
-0.08023257553577423,
-0.21997028589248657,
-0.21054640412330627,
0.26846519112586975,
-0.11056527495384216,
0.08580057322978973,
-0.15748900175094604,
0.2691255807876587,
0.03523606061935425,
0.12143903970718384,
-0.10882514715194702,
-0.04379545524716377,
-0.3250270485877991,
0.13187910616397858,
-0.01756274327635765,
0.1948826164007187,
-0.014352673664689064,
-0.10009104758501053,
0.11600414663553238,
-0.09274841845035553,
0.11966735124588013,
-0.02059706673026085,
-0.13441453874111176,
-0.7331786751747131,
-0.05865888297557831,
-0.05371503904461861,
0.252241313457489,
-0.048165272921323776,
-0.14287647604942322,
0.16102895140647888,
0.18624107539653778,
0.04161746799945831,
-0.03184787556529045,
0.08276072889566422,
0.25095221400260925,
-0.19046789407730103,
-0.10929455608129501,
0.09835292398929596,
0.08631770312786102,
0.2595491409301758,
-0.45497021079063416,
0.04776226729154587,
-0.009761369787156582,
-0.18389984965324402,
-0.17381133139133453,
0.105620376765728,
-0.09816530346870422,
0.03979552909731865,
-0.4142162799835205,
0.13295713067054749,
-0.07842454314231873,
-0.17984922230243683,
-0.11210867762565613,
0.5052773356437683,
0.24178782105445862,
-0.026546869426965714,
0.00944916158914566,
-0.20653539896011353,
0.06489893794059753,
0.1404137909412384,
-0.3494987487792969,
0.1603447049856186,
-0.024219326674938202,
0.27960848808288574,
-0.17750519514083862,
-0.26362547278404236,
-0.18383929133415222,
0.18392647802829742,
-0.0709649994969368,
-0.03461205214262009,
0.4423099160194397,
0.059559036046266556,
0.3972587585449219,
-0.12346750497817993,
-0.08358544856309891,
-0.2962486147880554,
-0.019155777990818024,
0.07033799588680267,
-0.16009923815727234,
0.24272023141384125,
0.23616093397140503,
-0.37764978408813477,
-0.17264340817928314,
-0.4538038372993469,
-0.3280984163284302,
-0.14136627316474915,
0.05566418170928955,
0.2706843912601471,
0.008068902418017387,
-0.31825685501098633,
0.029619460925459862,
0.1061517745256424,
-0.5833718776702881,
0.39233914017677307,
0.3594803512096405,
0.6875528693199158,
0.08588629961013794,
-0.12109099328517914,
-0.3027900159358978,
-0.025747530162334442,
-0.11129917204380035,
0.32855138182640076,
0.6147561073303223,
0.26641911268234253,
0.7103339433670044,
-0.10016317665576935,
0.05011497437953949,
0.312876433134079,
0.4149594306945801,
0.11639958620071411,
-0.26062172651290894,
0.004065960645675659,
0.48390311002731323,
0.03337332233786583,
-0.0820847898721695,
-0.019445570185780525,
-0.189473956823349,
-0.13067924976348877,
-0.05444905534386635,
0.12775103747844696,
0.17689302563667297,
-0.07759661972522736,
0.1138337031006813,
0.060075633227825165,
0.42385709285736084,
0.5304763913154602,
0.0005149170756340027,
0.060110922902822495,
0.11514122784137726,
0.3862205743789673,
-0.05817532539367676,
0.15383104979991913,
0.431504487991333,
0.09282273054122925,
-0.4455549418926239,
0.000758931040763855,
0.20110860466957092,
0.12969502806663513,
0.1518343985080719,
-0.32171630859375,
-0.2045578509569168,
-0.3607351779937744,
0.09756778925657272,
0.08726254850625992,
-0.14876911044120789,
0.18741083145141602,
-0.11008365452289581,
-0.1306881606578827,
-0.0009970292448997498,
0.2831152081489563,
0.13378864526748657,
-0.253523588180542,
0.042434558272361755,
-0.1834055781364441,
-0.13277223706245422,
0.13293534517288208,
-0.10917406529188156,
-0.1949130892753601,
-0.0856681615114212,
0.06331139802932739,
0.04246355593204498,
-0.37681740522384644,
0.22486914694309235,
0.2548774182796478,
0.14927101135253906,
-0.010917484760284424,
0.18816179037094116,
0.07362238317728043,
-0.1303817629814148,
0.5320225358009338,
-0.3242558538913727,
0.10167383402585983,
0.19228625297546387,
0.09865869581699371,
-0.26230135560035706,
-0.031816478818655014,
0.1230912059545517,
0.12178204953670502,
0.01947316899895668,
-0.29227155447006226,
0.12805324792861938,
0.24008487164974213,
0.02828342095017433,
-0.0367654412984848,
0.17027342319488525,
-0.13975387811660767,
0.23360198736190796,
-0.20158211886882782,
0.682336688041687,
0.31691625714302063,
0.17476336658000946,
-0.04090355336666107,
0.1696968972682953,
-0.26840531826019287,
-0.13682453334331512,
0.17542535066604614,
0.0022708214819431305,
0.09853153675794601,
-0.17288152873516083,
0.030590176582336426,
0.08995643258094788,
0.19594570994377136,
0.1559905707836151,
0.007046547718346119,
-0.12958620488643646,
-0.09528589248657227,
-0.5357540249824524,
0.054924268275499344,
0.07979817688465118,
-0.620678186416626,
-0.1515105962753296,
-0.002729855477809906,
0.271866112947464,
0.005685973912477493,
-0.41128191351890564,
-0.22063007950782776,
0.2184506058692932,
-0.22477731108665466,
0.08339659124612808,
-0.16978886723518372,
-0.30288830399513245,
0.22481563687324524,
-0.16759556531906128,
-0.36835911870002747,
-0.15162569284439087,
0.06826604157686234,
-0.1115921288728714,
0.11740684509277344,
-0.17723248898983002,
0.03857453912496567,
-0.22859902679920197,
0.32684555649757385,
-0.17114539444446564,
0.26478642225265503,
0.08599740266799927,
0.007501937448978424,
-0.266080379486084,
0.18462549149990082,
-0.13210129737854004,
-0.5198383331298828,
-0.01936940848827362,
0.29103097319602966,
-0.5432162284851074,
0.5447009801864624,
-0.5266764760017395,
-0.14698871970176697,
0.006520301103591919,
0.1528523564338684,
-0.15441854298114777,
-0.03945619612932205,
-0.29762575030326843,
-0.03252793848514557,
-0.13818460702896118,
0.24685746431350708,
-0.18514475226402283,
0.3915713429450989,
-0.17431087791919708,
-0.08122719079256058,
0.5414794087409973,
-0.6133053302764893,
-0.07759100198745728,
0.3601965606212616,
0.15083646774291992,
0.11627013981342316,
0.10201635211706161,
-0.07404299080371857,
-0.0712786391377449,
0.30210623145103455,
0.18626515567302704,
-0.1342395395040512,
0.07194790989160538,
0.09349681437015533,
-0.035753995180130005,
-0.16618311405181885,
0.220906600356102,
0.06811337172985077,
-0.14953655004501343,
-0.041901569813489914,
-0.2581225633621216
] |
https://github.com/huggingface/datasets/issues/6202 | https://github.com/huggingface/datasets/blob/main/setup.py#L236
Currently has the highest version at 0.3.25; Not sure if there is any reason for this, other than that was the tested version? | avoid downgrading jax version | ### Feature request
Whenever I `pip install datasets[jax]` it downgrades jax to version 0.3.25. I seem to be able to install this library first then upgrade jax back to version 0.4.13.
### Motivation
It would be nice to not overwrite currently installed version of jax if possible.
### Your contribution
I would be willing to beta test. Or maybe write some code if I could get pointed in the right direction, I'm not super familiar with this codebase. | 24 | avoid downgrading jax version
### Feature request
Whenever I `pip install datasets[jax]` it downgrades jax to version 0.3.25. I seem to be able to install this library first then upgrade jax back to version 0.4.13.
### Motivation
It would be nice to not overwrite currently installed version of jax if possible.
### Your contribution
I would be willing to beta test. Or maybe write some code if I could get pointed in the right direction, I'm not super familiar with this codebase.
https://github.com/huggingface/datasets/blob/main/setup.py#L236
Currently has the highest version at 0.3.25; Not sure if there is any reason for this, other than that was the tested version? | [
0.03834281861782074,
-0.03251977264881134,
-0.018348224461078644,
-0.1174321174621582,
0.26987597346305847,
0.1588345170021057,
-0.025461025536060333,
0.6368866562843323,
0.027017757296562195,
0.12465295195579529,
0.15229052305221558,
0.279801607131958,
-0.06330268830060959,
0.4718644618988037,
-0.16654065251350403,
-0.09663096070289612,
0.11437034606933594,
0.23498138785362244,
-0.056159596890211105,
0.21595965325832367,
-0.1408332884311676,
0.07584070414304733,
0.04357166588306427,
-0.10543879866600037,
-0.16910326480865479,
0.2747947573661804,
0.1817924529314041,
-0.06715084612369537,
-0.5859386920928955,
-0.40602511167526245,
0.504223644733429,
0.17084360122680664,
0.2185388207435608,
0.4707804322242737,
-0.00011660716700134799,
-0.24088776111602783,
0.3161129653453827,
0.10041511058807373,
-0.21480873227119446,
-0.24694161117076874,
-0.30029958486557007,
-0.6601783633232117,
0.12463255971670151,
-0.17344889044761658,
-0.1967599093914032,
-0.17759262025356293,
-0.11356179416179657,
-0.06773966550827026,
0.6951388120651245,
-0.26413601636886597,
0.2188204526901245,
0.062282174825668335,
0.005133621394634247,
0.14879083633422852,
0.2478722333908081,
0.2771971523761749,
-0.4053278863430023,
0.1435285061597824,
0.39474964141845703,
0.3627254068851471,
0.05349448695778847,
0.3766365945339203,
-0.13674145936965942,
-0.17744432389736176,
0.6108911037445068,
-0.2306724190711975,
0.15032002329826355,
0.0683523565530777,
0.1458442211151123,
0.18326427042484283,
0.793519914150238,
-0.4211269021034241,
-0.47770005464553833,
-0.1892225742340088,
0.2634621858596802,
-0.6547197103500366,
0.2648768126964569,
-0.19709831476211548,
0.06198414787650108,
0.03263591229915619,
-0.2903423011302948,
-0.42991065979003906,
-0.20309579372406006,
0.03786863386631012,
0.2338087260723114,
0.2976377308368683,
-0.08926216512918472,
-0.10678426921367645,
0.23293794691562653,
-0.22996428608894348,
0.17003405094146729,
-0.09166358411312103,
0.14020942151546478,
0.15884694457054138,
-0.02537435293197632,
-0.3982946574687958,
-0.05572133511304855,
0.01559547707438469,
0.12359499931335449,
0.05092746391892433,
-0.23520135879516602,
0.18196110427379608,
0.25377169251441956,
-0.12012206017971039,
0.33128446340560913,
0.1678503304719925,
0.0934700220823288,
-0.010190539062023163,
0.42772161960601807,
0.4346989393234253,
0.30633509159088135,
-0.0055918567813932896,
0.1812463402748108,
0.08668477833271027,
-0.18888148665428162,
0.04739214479923248,
0.40561652183532715,
-0.5180215239524841,
0.261258065700531,
-0.11731173098087311,
-0.1269504874944687,
-0.07241500914096832,
0.03216466307640076,
-0.10238762199878693,
0.07377529889345169,
0.4656376540660858,
-0.21883802115917206,
0.13729090988636017,
-0.14733052253723145,
-0.10469275712966919,
-0.12780755758285522,
-0.012067253701388836,
-0.32273638248443604,
0.14834950864315033,
0.15194174647331238,
-0.1150885820388794,
0.021134212613105774,
0.29334911704063416,
-0.019739247858524323,
0.11619406938552856,
0.22395506501197815,
0.24475711584091187,
-0.15755578875541687,
0.162427619099617,
-0.3614180088043213,
0.28078481554985046,
-0.051410213112831116,
-0.09364401549100876,
-0.3212262988090515,
0.015368273481726646,
0.05253414437174797,
-0.32229602336883545,
-0.12434685230255127,
0.11896633356809616,
-0.17859041690826416,
0.18784600496292114,
-0.33191514015197754,
0.09434385597705841,
-0.0643363893032074,
0.015965968370437622,
0.057265620678663254,
0.07465803623199463,
-0.11258869618177414,
-0.1390300989151001,
0.19954806566238403,
0.1319313645362854,
-0.22195546329021454,
-0.06723226606845856,
-0.1280040442943573,
0.034392423927783966,
-0.16375409066677094,
-0.10709105432033539,
-0.04992609843611717,
-0.04349151626229286,
0.10162971168756485,
-0.4261723458766937,
0.3381885290145874,
-0.28086861968040466,
-0.32420021295547485,
0.04789356142282486,
-0.01700303703546524,
0.07176393270492554,
-0.04659406468272209,
0.3996017873287201,
-0.10469938814640045,
-0.10755650699138641,
-0.5270382165908813,
0.44979411363601685,
-0.01609937846660614,
-0.06272710859775543,
-0.2772427201271057,
-0.5432760715484619,
0.1064821183681488,
-0.006355099380016327,
-0.14941847324371338,
-0.22263991832733154,
-0.06913911551237106,
0.1402042806148529,
0.1875889152288437,
-0.1626906841993332,
-0.08169056475162506,
0.21560138463974,
0.41638463735580444,
0.054109301418066025,
-0.22523874044418335,
-0.22864052653312683,
-0.32781982421875,
0.1603415161371231,
0.2943558394908905,
-0.3283645212650299,
-0.22536328434944153,
-0.2323123812675476,
-0.16645541787147522,
-0.0361579991877079,
-0.03788861632347107,
-0.057192523032426834,
0.06320067495107651,
0.004699345678091049,
0.21669495105743408,
-0.10412890464067459,
-0.18692831695079803,
-0.1219210997223854,
-0.06292745471000671,
0.22053095698356628,
-0.7292444705963135,
0.002668231725692749,
0.058007605373859406,
0.12862975895404816,
0.04754622280597687,
0.34809404611587524,
0.10772605985403061,
-0.13639071583747864,
-0.0959257259964943,
0.16814500093460083,
0.13348686695098877,
0.30722662806510925,
0.049439437687397,
0.4649360775947571,
0.03699539601802826,
0.08116891980171204,
0.08073072135448456,
0.2581840753555298,
-0.3570910394191742,
0.1319657564163208,
-0.1811194270849228,
0.3428150713443756,
0.008178428746759892,
0.10039876401424408,
-0.09009566158056259,
0.06633254885673523,
-0.12595483660697937,
-0.0685742199420929,
-0.2165718823671341,
-0.20132136344909668,
-0.036091532558202744,
0.2981278896331787,
-0.05073641240596771,
0.10460612922906876,
-0.13215264678001404,
0.008023153990507126,
0.23274415731430054,
-0.027638811618089676,
-0.08660808950662613,
0.06631109863519669,
0.10559658706188202,
-0.07272408157587051,
0.27865684032440186,
0.5874054431915283,
-0.05186246335506439,
0.19720709323883057,
-0.0736662819981575,
0.14827324450016022,
0.0003894194960594177,
-0.07496707886457443,
0.06482026726007462,
0.08277252316474915,
0.20268119871616364,
-0.027608085423707962,
0.2077714502811432,
0.14229363203048706,
0.09771305322647095,
0.3102715015411377,
-0.21702781319618225,
0.0186499934643507,
0.014564678072929382,
-0.031827934086322784,
-0.40408387780189514,
-0.4218839704990387,
-0.36438876390457153,
-0.5122309923171997,
-0.18741720914840698,
-0.24945110082626343,
0.24376198649406433,
0.1090787723660469,
-0.2741483449935913,
0.27664440870285034,
-0.5019515752792358,
0.05372868478298187,
-0.35482972860336304,
-0.444286048412323,
-0.14108175039291382,
0.28704601526260376,
-0.0032811006531119347,
0.0414794385433197,
0.4065585136413574,
0.4425615966320038,
0.4090240001678467,
-0.02480228617787361,
-0.050499048084020615,
-0.3820483684539795,
-0.7419846057891846,
-0.014365298673510551,
-0.2316889613866806,
0.19623276591300964,
0.4641462564468384,
0.030323732644319534,
-0.3403177559375763,
-0.028705144301056862,
-0.003830414265394211,
-0.3198368549346924,
0.0707545354962349,
-0.19111603498458862,
0.1424686312675476,
0.2000633031129837,
0.036899253726005554,
-0.3779292702674866,
0.19490371644496918,
-0.3607936203479767,
0.2207632064819336,
-0.015978127717971802,
0.07982689142227173,
-0.0008270032703876495,
-0.14779025316238403,
0.21160414814949036,
0.17903606593608856,
0.11496517807245255,
0.1306353509426117,
-0.13102981448173523,
0.20676499605178833,
-0.07854613661766052,
-0.050776608288288116,
0.22717154026031494,
0.020369485020637512,
0.10814019292593002,
-0.08408033847808838,
-0.31717240810394287,
-0.15148182213306427,
-0.07097774744033813,
0.29587510228157043,
0.04329685494303703,
-0.044885262846946716,
0.18667984008789062,
0.21466365456581116,
-0.009811673313379288,
0.001550041139125824,
-0.0572410449385643,
-0.20097221434116364,
-0.09955325722694397,
0.4418181777000427,
0.17369899153709412,
0.07272804528474808,
-0.026728861033916473,
0.6848086714744568,
0.2073625773191452,
-0.046596709638834,
0.0622841939330101,
0.31987157464027405,
0.33537620306015015,
-0.18864655494689941,
-0.23762524127960205,
-0.246555358171463,
0.027005977928638458,
0.05814661085605621,
0.050246600061655045,
0.41915881633758545,
0.20100563764572144,
-0.0864865854382515,
0.006280951201915741,
0.2602677345275879,
-0.19645977020263672,
-0.2245921790599823,
0.2523828446865082,
0.11055077612400055,
0.018018409609794617,
-0.0025461390614509583,
0.10680122673511505,
-0.2196899950504303,
0.08930845558643341,
0.061003148555755615,
-0.08283029496669769,
0.222442626953125,
-0.32253366708755493,
-0.04020143300294876,
-0.6147125363349915,
0.322772353887558,
-0.0032966434955596924,
-0.19441455602645874,
0.302338182926178,
-0.19901876151561737,
0.04952392354607582,
-0.057342417538166046,
0.15397384762763977,
-0.08559069037437439,
-0.04609880596399307,
0.04498638957738876,
-0.06041515991091728,
-0.4416278600692749,
0.08007248491048813,
-0.0032051876187324524,
0.10406501591205597,
0.5174901485443115,
0.6077758073806763,
-0.16673709452152252,
-0.44401517510414124,
0.14479202032089233,
0.37116289138793945,
0.1426876038312912,
-0.11104130744934082,
-0.21374213695526123,
-0.3123677372932434,
0.022145971655845642,
-0.14681176841259003,
-0.1576845347881317,
0.05694790557026863,
-0.05208239704370499,
-0.20022541284561157,
0.023777322843670845,
0.06923870742321014,
-0.04271058365702629,
-0.05462038889527321,
0.09786638617515564,
0.03507567569613457,
0.33130812644958496,
0.18150311708450317,
0.40878745913505554,
0.066202811896801,
0.2761596441268921,
-0.14448519051074982,
-0.1446886658668518,
-0.34081360697746277,
0.13086168467998505,
0.14311347901821136,
0.17215034365653992,
-0.13273409008979797,
0.3795279860496521,
-0.3346260190010071,
-0.025046207010746002,
-0.02190888673067093,
-0.36327511072158813,
0.13522839546203613,
0.2520821690559387,
-0.17041939496994019,
-0.339263379573822,
0.3871612250804901,
0.10805097222328186,
-0.20540884137153625,
0.21983057260513306,
0.26403558254241943,
0.029076822102069855,
-0.22460967302322388,
0.4662780463695526,
1.0273940563201904,
0.00030473340302705765,
0.21189343929290771,
0.20939239859580994,
-0.2300451695919037,
0.6136902570724487,
0.052314817905426025,
0.04815742373466492,
-0.4491537809371948,
-0.2001301795244217,
-0.0752144306898117,
0.12213709950447083,
0.23096562922000885,
-0.3809686303138733,
-0.24762368202209473,
0.4790593683719635,
0.04250618815422058,
0.019518164917826653,
-0.2585204243659973,
0.26069575548171997,
-0.3696284592151642,
-0.13048553466796875,
-0.6132591366767883,
0.10396921634674072,
0.09222961962223053,
-0.13468432426452637,
0.009887490421533585,
0.023720357567071915,
0.21390965580940247,
-0.46719828248023987,
-0.08096721768379211,
0.0015389695763587952,
-0.055310267955064774,
0.18437635898590088,
0.1788407862186432,
-0.27566373348236084,
0.4458771049976349,
0.32542774081230164,
0.17009761929512024,
0.2488643079996109,
-0.24882911145687103,
0.009266635403037071,
-0.16408629715442657,
0.03131914511322975,
-0.032607562839984894,
0.030512172728776932,
0.09187688678503036,
-0.09875299036502838,
-0.11829564720392227,
-0.20721493661403656,
0.274885356426239,
-0.20809321105480194,
0.10078291594982147,
-0.32395362854003906,
0.16196465492248535,
-0.23555856943130493,
-0.07937881350517273,
0.01603183150291443,
0.08609721064567566,
-0.2978925406932831,
0.15564192831516266,
-0.2280324548482895,
0.0049751028418540955,
-0.003939606249332428,
-0.03980163484811783,
-0.25723135471343994,
-0.032685860991477966,
0.2827310860157013,
0.06408001482486725,
-0.31222063302993774,
0.2992645502090454,
0.3014912009239197,
-0.23098202049732208,
-0.15132947266101837,
0.22588057816028595,
-0.0342646948993206,
0.020485155284404755,
-0.10214400291442871,
-0.030452053993940353,
-0.024242371320724487,
0.10591791570186615,
0.23594745993614197,
0.08882196992635727,
-0.20369741320610046,
0.022693172097206116,
-0.012872889637947083,
-0.4122539460659027,
0.3879944086074829,
0.18582101166248322,
0.2636256217956543,
-0.2860438823699951,
-0.5179744362831116,
0.09116406738758087,
0.21065448224544525,
-0.2670833170413971,
0.09493578225374222,
0.1080864891409874,
-0.06131768971681595,
0.4182015359401703,
0.21014857292175293,
0.06748249381780624,
-0.15207728743553162,
-0.0166170671582222,
0.1627396047115326,
-0.4370037615299225,
-0.1421383172273636,
-0.17675325274467468,
0.1149839460849762,
-0.01597561314702034,
-0.05175258591771126,
0.2741602659225464,
-0.011143170297145844,
-0.012769393622875214,
-0.1668100506067276,
0.007894158363342285,
0.34749025106430054,
0.12419971823692322,
0.14654794335365295,
-0.08575904369354248,
0.09934873878955841,
-0.07114828377962112,
0.03147831931710243,
0.10945567488670349,
-0.13667753338813782,
0.14923793077468872,
0.2159624546766281,
0.21821928024291992,
-0.030188120901584625,
-0.39351317286491394,
0.012399211525917053,
0.24244144558906555,
0.09520067274570465,
-0.09915979206562042,
0.16269126534461975,
-0.1230805367231369,
0.5049511790275574,
0.49578404426574707,
0.08992870897054672,
-0.18962639570236206,
0.03317546844482422,
0.3683311343193054,
0.2000269889831543,
-0.3683330714702606,
-0.08605285733938217,
0.05558200553059578,
-0.02844703197479248,
-0.20095035433769226,
0.22469350695610046,
0.14687572419643402,
0.21338492631912231,
0.059628069400787354,
-0.019558124244213104,
-0.24816471338272095,
-0.2074596881866455,
0.5783941149711609,
0.5269125699996948,
-0.26341891288757324,
-0.416154146194458,
0.25931429862976074,
0.1294984221458435,
0.037923023104667664,
0.1496688276529312,
-0.19971440732479095,
0.32206830382347107,
-0.025439944118261337,
0.07964955270290375,
-0.3534259498119354,
-0.12486233562231064,
0.2207273244857788,
0.3762935698032379,
0.11062400788068771,
0.1638430804014206,
0.19957377016544342,
0.6397924423217773,
0.1563550978899002,
-0.19648529589176178,
-0.34533554315567017,
0.18715102970600128,
0.21905390918254852,
-0.22539058327674866,
0.3073927164077759,
0.02272053062915802,
-0.3310818672180176,
0.06069553643465042,
-0.11623667180538177,
-0.03182290121912956,
0.4150027930736542,
0.11757007986307144,
0.03669455274939537,
-0.6582630276679993,
0.62995845079422,
-0.012077020481228828,
0.42061716318130493,
-0.029675550758838654,
0.0555158331990242,
-0.21188604831695557,
0.11910799145698547,
0.01297423429787159,
0.07641839236021042,
-0.0390581414103508,
0.061104390770196915,
0.13460324704647064,
-0.027244452387094498,
-0.2926144599914551,
-0.009908061474561691,
0.10431459546089172,
0.3493432104587555,
-0.1332518756389618,
0.04407975450158119,
0.1218351423740387,
0.026619471609592438,
-0.06534528732299805,
0.1423751562833786,
0.06327208131551743,
0.4276677370071411,
-0.46688947081565857,
0.682543158531189,
0.2639697194099426,
-0.19693949818611145,
0.09918857365846634,
0.2711479067802429,
-0.32643526792526245,
-0.029478440061211586,
0.13510188460350037,
0.3394799828529358,
-0.02778465300798416,
-0.3527125418186188,
0.061372268944978714,
-0.11944618821144104,
0.30340775847435,
0.07279662042856216,
-0.13412325084209442,
-0.01430981419980526,
-0.14468063414096832,
-0.5027770400047302,
-0.12183547019958496,
-0.06717117130756378,
-0.16981440782546997,
0.2437339723110199,
-0.3389686048030853,
-0.10396416485309601,
0.3128061592578888,
0.25125840306282043,
0.054536040872335434,
0.009373776614665985,
-0.16189825534820557,
-0.11442133039236069,
0.1484537422657013,
0.22108836472034454,
-0.08232130855321884,
-0.024777788668870926,
-0.25515538454055786,
-0.16457639634609222,
0.17842154204845428,
-0.10780149698257446,
-0.003097919747233391,
0.187090665102005,
0.02049838751554489,
-0.13394397497177124,
0.27411872148513794,
0.21331162750720978,
0.09306108951568604,
-0.10270228981971741,
-0.39459657669067383,
-0.4132017493247986,
-0.2982538640499115,
-0.41902217268943787,
0.16644689440727234,
-0.28778716921806335,
0.34886282682418823,
-0.47036296129226685,
0.14933207631111145,
-0.45069625973701477,
0.3804587423801422,
-0.18128244578838348,
-0.161769300699234,
-0.14651460945606232,
-0.09327621757984161,
-0.07921627908945084,
0.2602888345718384,
-0.12612339854240417,
0.17075686156749725,
-0.04418357461690903,
0.23525811731815338,
-0.3173469007015228,
-0.029225368052721024,
0.5512170195579529,
-0.27098944783210754,
-0.2033267617225647,
-0.1720777302980423,
0.20886610448360443,
0.3249146044254303,
-0.2499409168958664,
-0.7793349027633667,
0.047764092683792114,
-0.027160294353961945,
0.24751296639442444,
-0.003944985568523407,
0.6093693375587463,
-0.10649161785840988,
-0.028317518532276154,
-0.09880322217941284,
0.390471875667572,
-0.14896255731582642,
-0.07134018838405609,
0.18366917967796326,
-0.08080209046602249
] |
https://github.com/huggingface/datasets/issues/6199 | Hugging Face's datasets library may prioritize remote configurations. Make sure there are no conflicting configurations causing the library to prefer downloading data
May be try debugging
raw_datasets = load_dataset('json', data_files=data_files)
print(raw_datasets)
| Use load_dataset for local json files, but it not works | ### Describe the bug
when I use load_dataset to load my local datasetsοΌit always goes to Hugging Face to download the data instead of loading the local dataset.
### Steps to reproduce the bug
`raw_datasets = load_dataset(
βjsonβ,
data_files=data_files)`
### Expected behavior
![image](https://github.com/huggingface/datasets/assets/50519434/add3747f-6481-4da7-b374-8f81c5a6472c)
### Environment info
python version 3.8.5
datasets version 2.12
os version unbuntu 18.04 | 31 | Use load_dataset for local json files, but it not works
### Describe the bug
when I use load_dataset to load my local datasetsοΌit always goes to Hugging Face to download the data instead of loading the local dataset.
### Steps to reproduce the bug
`raw_datasets = load_dataset(
βjsonβ,
data_files=data_files)`
### Expected behavior
![image](https://github.com/huggingface/datasets/assets/50519434/add3747f-6481-4da7-b374-8f81c5a6472c)
### Environment info
python version 3.8.5
datasets version 2.12
os version unbuntu 18.04
Hugging Face's datasets library may prioritize remote configurations. Make sure there are no conflicting configurations causing the library to prefer downloading data
May be try debugging
raw_datasets = load_dataset('json', data_files=data_files)
print(raw_datasets)
| [
-0.1304634064435959,
-0.2979297935962677,
-0.04019120708107948,
0.26985105872154236,
0.06918518245220184,
0.10537590086460114,
0.2759689390659332,
0.23396185040473938,
0.7306881546974182,
0.05163054168224335,
-0.1663374900817871,
0.2450324296951294,
0.15466763079166412,
0.30776768922805786,
0.12207299470901489,
-0.0540170893073082,
0.1732914000749588,
0.16678093373775482,
0.030274605378508568,
-0.18588988482952118,
-0.35682475566864014,
0.29825296998023987,
-0.08944381773471832,
-0.04328157752752304,
0.0415448434650898,
0.4309608042240143,
0.17834216356277466,
0.35565483570098877,
0.09333288669586182,
-0.2235899567604065,
0.5108846426010132,
0.10708284378051758,
0.12662388384342194,
0.5308385491371155,
-0.0001178204984171316,
0.21653974056243896,
0.34422755241394043,
-0.04150468111038208,
-0.20329342782497406,
-0.6096554398536682,
-0.1652231216430664,
-0.2350359559059143,
0.3569478988647461,
0.023134365677833557,
-0.23195582628250122,
-0.45622718334198,
0.05686793476343155,
-0.46962741017341614,
0.5116491317749023,
0.2202490121126175,
0.13112887740135193,
0.3025374710559845,
-0.050030726939439774,
-0.053696032613515854,
0.07025399059057236,
0.43058982491493225,
0.030098959803581238,
0.44977283477783203,
0.13508139550685883,
-0.013277251273393631,
0.19791492819786072,
0.03591430187225342,
-0.13371336460113525,
0.019480817019939423,
0.27935469150543213,
0.17124158143997192,
-0.25022026896476746,
-0.028234606608748436,
0.16166344285011292,
0.058548182249069214,
0.4222697913646698,
-0.17431750893592834,
-0.18345080316066742,
-0.28081434965133667,
-0.35247111320495605,
0.10954826325178146,
0.249611496925354,
0.26549550890922546,
-0.08739864081144333,
0.3000342547893524,
-0.5185991525650024,
-0.2097381055355072,
-0.10208506882190704,
0.35085204243659973,
0.03174252808094025,
0.04092014208436012,
-0.10238620638847351,
0.15512026846408844,
0.2716946303844452,
0.045975156128406525,
-0.045723021030426025,
-0.22481879591941833,
0.06958290934562683,
0.11488091200590134,
-0.22078527510166168,
0.1958552747964859,
0.13921400904655457,
0.11255696415901184,
0.244871586561203,
0.2048199623823166,
-0.03469112142920494,
0.16579727828502655,
-0.15814322233200073,
0.12997567653656006,
0.3983316123485565,
0.10307621955871582,
0.20394819974899292,
0.036470767110586166,
0.19907763600349426,
0.24294820427894592,
-0.051472652703523636,
-0.09049364924430847,
0.14114052057266235,
-0.11205245554447174,
-0.2551248073577881,
-0.3829055428504944,
0.24274298548698425,
-0.30508360266685486,
-0.04110512509942055,
0.00817028433084488,
-0.1241549551486969,
-0.12510643899440765,
0.1963234692811966,
0.5060574412345886,
-0.11438007652759552,
0.12156932055950165,
0.11825214326381683,
0.35241881012916565,
-0.13190573453903198,
0.00564001128077507,
-0.22010698914527893,
-0.15208762884140015,
0.001157522201538086,
0.03294187784194946,
0.19415952265262604,
-0.2965868413448334,
0.5089269280433655,
0.0483500100672245,
0.169442817568779,
-0.018430694937705994,
-0.07699722796678543,
0.09099888056516647,
-0.018620379269123077,
0.2981165945529938,
0.03294588625431061,
0.17999999225139618,
0.15780745446681976,
-0.28060466051101685,
-0.2617282271385193,
0.04752720892429352,
-0.29454508423805237,
-0.2809412479400635,
0.050711676478385925,
0.07061708718538284,
-0.1911209374666214,
-0.06027122586965561,
-0.4626118242740631,
0.0031779855489730835,
-0.10961323976516724,
0.016310781240463257,
-0.03112972527742386,
0.15023264288902283,
-0.21571937203407288,
-0.10182720422744751,
0.35517024993896484,
0.620340883731842,
-0.23438425362110138,
-0.18859708309173584,
0.032771527767181396,
-0.18719324469566345,
0.05395532771945,
0.2999974489212036,
-0.3486711382865906,
0.07190169394016266,
-0.28120654821395874,
-0.15470077097415924,
0.03213336318731308,
-0.6558765172958374,
-0.47974342107772827,
0.5233868360519409,
-0.25977951288223267,
0.1936718374490738,
0.012187827378511429,
0.06437404453754425,
-0.41104090213775635,
0.2489386647939682,
0.21059074997901917,
0.4410648047924042,
0.12104818969964981,
0.2056330293416977,
-0.15100593864917755,
-0.2674521207809448,
-0.019122660160064697,
0.41640692949295044,
-0.2613576054573059,
0.2680951952934265,
0.1620958298444748,
-0.11192765831947327,
0.28985074162483215,
-0.014570523053407669,
-0.06185927242040634,
0.22035308182239532,
0.18866628408432007,
-0.09350767731666565,
0.031450241804122925,
0.23101605474948883,
-0.5809575319290161,
0.28590723872184753,
-0.0036792904138565063,
-0.10671740770339966,
-0.17630495131015778,
-0.02795097976922989,
-0.4116460084915161,
-0.0037992894649505615,
-0.4021618664264679,
-0.19162078201770782,
-0.06387829780578613,
0.32967525720596313,
0.34709590673446655,
0.2886688709259033,
-0.3073897957801819,
0.3252193033695221,
-0.0196647010743618,
0.15864801406860352,
-0.46306681632995605,
0.3737039864063263,
0.21017161011695862,
-0.0011800825595855713,
-0.039315953850746155,
-0.11090084165334702,
0.02469683811068535,
-0.2818768620491028,
-0.10317350924015045,
0.3420015573501587,
0.09066599607467651,
0.3706415295600891,
0.011211035773158073,
-0.21446025371551514,
0.1696893870830536,
-0.14878594875335693,
-0.06925999373197556,
0.22085145115852356,
0.06030603125691414,
0.005282662808895111,
-0.26336464285850525,
0.27107149362564087,
-0.2342754602432251,
0.3000246286392212,
-0.15489013493061066,
-0.1896435022354126,
0.18250559270381927,
-0.06108320504426956,
-0.20623177289962769,
-0.11139429360628128,
0.20291119813919067,
0.0470358207821846,
0.39596208930015564,
0.1304330825805664,
-0.45003724098205566,
-0.18184807896614075,
0.3838562071323395,
-0.0490320585668087,
-0.15727388858795166,
0.21447205543518066,
-0.07554803788661957,
0.03895273804664612,
0.20356197655200958,
0.14339113235473633,
0.5414374470710754,
0.07519888877868652,
-0.12305647134780884,
0.30436328053474426,
0.2740362882614136,
-0.27728015184402466,
-0.0460350438952446,
-0.13199377059936523,
0.055178917944431305,
0.06825992465019226,
0.11252595484256744,
-0.2175876796245575,
-0.37646958231925964,
0.17727850377559662,
-0.2366919219493866,
0.13399836421012878,
-0.2835957705974579,
0.19623398780822754,
-0.44642704725265503,
-0.06782786548137665,
-0.22594556212425232,
-0.12288641184568405,
-0.19038094580173492,
-0.047050945460796356,
-0.2057649940252304,
0.18481822311878204,
-0.0020784661173820496,
-0.03831755742430687,
-0.007242374122142792,
0.29377612471580505,
-0.1243114173412323,
-0.6971433758735657,
-0.3781454265117645,
0.0713081806898117,
-0.3808934688568115,
-0.09739574790000916,
0.2817835211753845,
0.050802215933799744,
0.042548008263111115,
-0.5741277933120728,
-0.17914868891239166,
0.050760477781295776,
0.08801038563251495,
0.046956826001405716,
0.12078505754470825,
0.4783152639865875,
-0.018596012145280838,
0.3449183404445648,
-0.312404066324234,
0.042055681347846985,
0.39281415939331055,
-0.10843534767627716,
-0.21558496356010437,
-0.11943036317825317,
0.22009797394275665,
0.08015250414609909,
-0.17711856961250305,
-0.21190296113491058,
-0.28505271673202515,
-0.3349096179008484,
0.6556700468063354,
0.16901282966136932,
-0.0258449986577034,
-0.05220692604780197,
0.20009064674377441,
0.10171201825141907,
-0.32340019941329956,
0.11533750593662262,
-0.10319569706916809,
-0.8470113277435303,
0.21018239855766296,
-0.2379547357559204,
-0.4582870900630951,
-0.04379093274474144,
0.1845536231994629,
0.19209498167037964,
-0.09923480451107025,
-0.501949667930603,
-0.09546154737472534,
-0.12033164501190186,
0.13554500043392181,
0.05707318335771561,
0.08028221130371094,
0.0690222755074501,
-0.2902894616127014,
0.0998104140162468,
0.053211115300655365,
-0.30838629603385925,
0.25578001141548157,
0.04975151643157005,
0.03798685967922211,
0.4141544699668884,
0.3998379409313202,
-0.21738587319850922,
0.42704397439956665,
0.227791428565979,
-0.07216888666152954,
0.5885139107704163,
-0.21572576463222504,
0.19439396262168884,
-0.38227683305740356,
-0.469193696975708,
-0.06455817818641663,
0.2255554497241974,
-0.04894058406352997,
0.140487939119339,
0.13697150349617004,
0.13062189519405365,
-0.515575647354126,
-0.2966061234474182,
-0.4796977937221527,
-0.1066737174987793,
-0.11079446226358414,
0.3120167553424835,
-0.027298562228679657,
-0.018917441368103027,
0.06192006170749664,
0.2281205952167511,
-0.07018058001995087,
0.08709026873111725,
0.3888576030731201,
0.12986904382705688,
0.2181290090084076,
-0.433640718460083,
0.10931973159313202,
-0.33701446652412415,
0.28303414583206177,
-0.2356872856616974,
0.3192088007926941,
-0.19393567740917206,
-0.09990514814853668,
0.18554480373859406,
-0.09609507024288177,
0.7150730490684509,
0.30048635601997375,
0.16326458752155304,
-0.32281920313835144,
-0.43433457612991333,
-0.44931215047836304,
0.11607785522937775,
0.26993653178215027,
0.1188434436917305,
-0.06287577748298645,
0.9340019226074219,
-0.1948363482952118,
-0.22653597593307495,
-0.1375194936990738,
0.22704888880252838,
0.010661907494068146,
-0.39344465732574463,
-0.41495832800865173,
-0.22103628516197205,
-0.2957889139652252,
-0.11831960827112198,
-0.18341173231601715,
0.24431203305721283,
0.06121896207332611,
-0.09902111440896988,
0.04916936904191971,
-0.05367864668369293,
-0.07064715027809143,
0.05426906421780586,
0.25391706824302673,
-0.14598211646080017,
0.1966441571712494,
0.43732959032058716,
0.233273446559906,
0.2132679522037506,
0.8415846228599548,
0.038364019244909286,
-0.5295887589454651,
-0.1719525307416916,
0.21349146962165833,
0.187107115983963,
0.11920391023159027,
-0.0884520635008812,
-0.02561815455555916,
0.3957975208759308,
-0.019886814057826996,
-0.23277828097343445,
0.07734361290931702,
0.15264707803726196,
-0.03752293437719345,
0.014851853251457214,
-0.5933846831321716,
0.5184226036071777,
-0.028617728501558304,
0.10567021369934082,
0.0707176923751831,
0.01685146801173687,
-0.08604545891284943,
0.179564967751503,
-0.07462410628795624,
0.6459156274795532,
-0.12310905754566193,
0.08495481312274933,
0.1766834557056427,
-0.23759154975414276,
0.4307498633861542,
-0.2910629212856293,
-0.0369567796587944,
-0.2530325651168823,
0.087287038564682,
-0.027626853436231613,
-0.1780972182750702,
0.2331826388835907,
0.14663907885551453,
0.15284086763858795,
0.16753336787223816,
-0.08153700083494186,
0.07599891722202301,
-0.15704795718193054,
0.40083155035972595,
-0.026448285207152367,
-0.1310444474220276,
-0.45472458004951477,
0.05888592451810837,
-0.060829997062683105,
0.5605379939079285,
0.09121920168399811,
-0.16840983927249908,
-0.26614826917648315,
-0.14518022537231445,
0.23341695964336395,
0.1677999198436737,
0.009303409606218338,
-0.11437265574932098,
0.3546178638935089,
-0.29962587356567383,
-0.032280538231134415,
0.43350210785865784,
0.05602807179093361,
0.02922266349196434,
-0.3793594241142273,
-0.019474320113658905,
-0.2415723204612732,
0.03908873721957207,
-0.13644349575042725,
-0.1634807288646698,
0.018579697236418724,
-0.10308072715997696,
-0.36221742630004883,
-0.09896032512187958,
-0.019289333373308182,
-0.3933602273464203,
-0.056480854749679565,
0.2201700210571289,
-0.2598572373390198,
-0.06980092823505402,
-0.5483031272888184,
-0.12876096367835999,
0.43829411268234253,
0.016667693853378296,
0.07458475977182388,
0.213515505194664,
0.06119192764163017,
-0.22547753155231476,
0.05276181176304817,
-0.46210581064224243,
-0.313839852809906,
0.730728805065155,
-0.32761648297309875,
-0.06302902102470398,
0.319390207529068,
0.13511647284030914,
0.020802341401576996,
-0.1023121178150177,
0.19736161828041077,
0.5174775123596191,
-0.31576302647590637,
0.05742006376385689,
-0.025947999209165573,
0.1900491565465927,
-0.12487190961837769,
0.1825214922428131,
0.07164998352527618,
-0.5026010274887085,
0.27814871072769165,
-0.42340636253356934,
-0.4543670415878296,
0.1744605004787445,
0.04658970609307289,
0.015444040298461914,
0.37915635108947754,
-0.07251600176095963,
0.05626862496137619,
-0.1452975869178772,
-0.18747487664222717,
0.038450807332992554,
-0.1202695220708847,
-0.25768011808395386,
0.19515490531921387,
0.17351460456848145,
0.27245649695396423,
-0.0356508269906044,
0.09739634394645691,
0.017679642885923386,
-0.21187670528888702,
-0.16746671497821808,
-0.08503333479166031,
0.16008247435092926,
0.12132000923156738,
-0.102782242000103,
-0.11887688934803009,
-0.3217583894729614,
-0.07694478332996368,
-0.13167402148246765,
0.1917373538017273,
0.18612131476402283,
-0.047568801790475845,
0.08554127812385559,
-0.05065663531422615,
-0.05106087028980255,
-0.0980067104101181,
0.12026646733283997,
-0.16262651979923248,
-0.01922442391514778,
0.01726638898253441,
0.001116529107093811,
-0.08622081577777863,
0.01766403764486313,
-0.11235491931438446,
-0.013047371059656143,
0.3074283003807068,
0.22196894884109497,
0.1358257234096527,
-0.31440162658691406,
0.045034170150756836,
0.15779419243335724,
0.4469452500343323,
0.27179455757141113,
-0.2895480990409851,
0.1293846070766449,
0.23522353172302246,
0.05627647787332535,
-0.11925718188285828,
-0.25678566098213196,
0.3804621696472168,
0.19256439805030823,
0.00859164446592331,
0.23416800796985626,
0.209722638130188,
0.048206403851509094,
-0.09322269260883331,
0.017389953136444092,
0.4803120195865631,
0.1703084111213684,
0.1079108715057373,
0.31834131479263306,
-0.10319031774997711,
0.13557055592536926,
-0.03223244100809097,
0.425811231136322,
0.18225809931755066,
0.34607362747192383,
-0.1501903533935547,
-0.01419876143336296,
-0.2023763805627823,
0.3812037706375122,
-0.10170868039131165,
-0.441921591758728,
0.2035450041294098,
0.11831630021333694,
-0.22812101244926453,
0.02103223279118538,
0.029820214956998825,
0.5636758208274841,
-0.16053639352321625,
0.06482958793640137,
-0.22073829174041748,
0.2362363189458847,
0.020575642585754395,
-0.2632395029067993,
-0.03402393311262131,
-0.2591594457626343,
-0.18417736887931824,
0.20891517400741577,
-0.0773688405752182,
-0.36549466848373413,
0.05630228668451309,
-0.005187854170799255,
-0.09493660926818848,
-0.18954455852508545,
-0.050276048481464386,
0.09309627115726471,
-0.11572322249412537,
0.048972368240356445,
0.18815010786056519,
-0.061909690499305725,
-0.021806854754686356,
0.2619282603263855,
0.057311899960041046,
0.014015771448612213,
0.3603276312351227,
0.21252553164958954,
-0.001980561763048172,
-0.12834954261779785,
-0.05782029405236244,
-0.2637805938720703,
0.3857596516609192,
-0.11348272114992142,
0.11629065871238708,
0.3155786693096161,
0.137882262468338,
-0.09551762044429779,
0.07155744731426239,
-0.05138653144240379,
0.3491922616958618,
-0.5289215445518494,
0.271356999874115,
-0.3398866057395935,
-0.017848923802375793,
-0.0594177208840847,
-0.09850145131349564,
-0.28392380475997925,
-0.16160817444324493,
0.1442161500453949,
0.17458131909370422,
0.21195736527442932,
-0.26934510469436646,
0.0283428393304348,
-0.0025300346314907074,
0.39243388175964355,
0.10452421009540558,
0.34736770391464233,
-0.1070149838924408,
-0.24861633777618408,
-0.504429280757904,
0.11271771788597107,
0.003698805347084999,
0.19731539487838745,
0.09853588789701462,
-0.05218826234340668,
0.12293918430805206,
0.235592320561409,
-0.22126504778862,
0.20508915185928345,
-0.03185230493545532,
0.09657213091850281,
0.18879437446594238,
-0.14749327301979065,
-0.3363763093948364,
0.23605309426784515,
0.09840653836727142,
-0.14258763194084167,
0.22473886609077454,
-0.1629253327846527,
-0.05555223301053047,
-0.17606838047504425,
0.18529459834098816,
-0.13560733199119568,
-0.2927688956260681,
0.4202520549297333,
0.09583801031112671,
0.09730786830186844,
-0.0871637761592865,
-0.06938876956701279,
-0.05048363283276558,
-0.07300353050231934,
-0.30629318952560425,
0.2212972491979599,
-0.27158862352371216,
0.21075354516506195,
-0.32313740253448486,
-0.13614121079444885,
-0.4033438563346863,
0.10722997784614563,
0.09165382385253906,
-0.23396636545658112,
-0.033088281750679016,
-0.12440061569213867,
-0.1283719837665558,
-0.1203039288520813,
0.29865771532058716,
0.2167804092168808,
-0.052213698625564575,
0.002183385193347931,
-0.16216696798801422,
0.06294263154268265,
0.5389264225959778,
-0.3763383626937866,
0.015076875686645508,
0.3287663459777832,
-0.038220904767513275,
0.06422710418701172,
-0.3909997045993805,
-0.22258886694908142,
0.18183250725269318,
0.29627031087875366,
-0.12085922062397003,
0.08959203958511353,
0.1561209261417389,
-0.05620430409908295,
0.04254981130361557,
-0.08843161910772324,
0.2549343705177307,
0.302592009305954,
-0.10257105529308319,
0.27427586913108826,
-0.13082711398601532
] |
https://github.com/huggingface/datasets/issues/6199 | It doesn't download them but writes them to the local HF cache. The logging could indeed be better. Does loading the dataset succeed? If it doesn't, can you share the error stack trace? | Use load_dataset for local json files, but it not works | ### Describe the bug
when I use load_dataset to load my local datasetsοΌit always goes to Hugging Face to download the data instead of loading the local dataset.
### Steps to reproduce the bug
`raw_datasets = load_dataset(
βjsonβ,
data_files=data_files)`
### Expected behavior
![image](https://github.com/huggingface/datasets/assets/50519434/add3747f-6481-4da7-b374-8f81c5a6472c)
### Environment info
python version 3.8.5
datasets version 2.12
os version unbuntu 18.04 | 33 | Use load_dataset for local json files, but it not works
### Describe the bug
when I use load_dataset to load my local datasetsοΌit always goes to Hugging Face to download the data instead of loading the local dataset.
### Steps to reproduce the bug
`raw_datasets = load_dataset(
βjsonβ,
data_files=data_files)`
### Expected behavior
![image](https://github.com/huggingface/datasets/assets/50519434/add3747f-6481-4da7-b374-8f81c5a6472c)
### Environment info
python version 3.8.5
datasets version 2.12
os version unbuntu 18.04
It doesn't download them but writes them to the local HF cache. The logging could indeed be better. Does loading the dataset succeed? If it doesn't, can you share the error stack trace? | [
-0.12820279598236084,
-0.19124987721443176,
-0.03220813348889351,
0.3830964267253876,
0.06709733605384827,
0.16781267523765564,
0.2023807317018509,
0.2872556149959564,
0.7623166441917419,
-0.12106135487556458,
-0.16880372166633606,
0.19303558766841888,
0.11190101504325867,
0.2189147174358368,
0.14139904081821442,
-0.07512573897838593,
0.1302882432937622,
0.10437758266925812,
-0.021099906414747238,
-0.28792881965637207,
-0.3719426393508911,
0.2648804187774658,
-0.13270078599452972,
0.08055956661701202,
-0.07425135374069214,
0.35183554887771606,
0.08791112154722214,
0.38254761695861816,
0.11527733504772186,
-0.2686159014701843,
0.49260348081588745,
0.13093815743923187,
0.23705507814884186,
0.5245574712753296,
-0.00011832891323138028,
0.22122395038604736,
0.4188002347946167,
-0.06650622934103012,
-0.22132346034049988,
-0.4730384051799774,
-0.2328900396823883,
-0.35011932253837585,
0.3092239201068878,
0.04023049771785736,
-0.16092762351036072,
-0.5830652713775635,
-0.00015662051737308502,
-0.47486892342567444,
0.6066855788230896,
0.2365788221359253,
0.13558340072631836,
0.25783419609069824,
0.0027172118425369263,
0.06771552562713623,
0.14068201184272766,
0.5132763981819153,
0.0343535915017128,
0.3325442373752594,
0.12727177143096924,
-0.16371333599090576,
0.20123355090618134,
0.022456694394350052,
-0.07785394042730331,
0.056326135993003845,
0.2897787094116211,
0.13762643933296204,
-0.24964307248592377,
-0.08656050264835358,
0.23211905360221863,
0.06715034693479538,
0.5662503242492676,
-0.30222058296203613,
-0.2733389735221863,
-0.22699055075645447,
-0.29946190118789673,
0.03924379497766495,
0.2086566835641861,
0.2778770923614502,
-0.19323980808258057,
0.2933051884174347,
-0.4277999699115753,
-0.28796860575675964,
-0.12632592022418976,
0.29534634947776794,
0.06728839874267578,
-0.04870530962944031,
-0.10357539355754852,
0.10801459848880768,
0.09241846203804016,
0.03629719838500023,
0.056318897753953934,
-0.2684599459171295,
0.10140058398246765,
0.25774556398391724,
-0.3514551520347595,
0.2038847804069519,
0.10893572866916656,
0.11391839385032654,
0.29712921380996704,
0.019836939871311188,
-0.04111793264746666,
0.1579083651304245,
-0.23863448202610016,
0.19491466879844666,
0.38874351978302,
0.11576381325721741,
0.2501170337200165,
0.1355133056640625,
0.17716675996780396,
0.10726591944694519,
-0.06093532592058182,
-0.0764349177479744,
0.0813579261302948,
-0.05975000932812691,
-0.06556586176156998,
-0.39776143431663513,
0.1871410608291626,
-0.37663015723228455,
-0.07258210331201553,
0.20888157188892365,
-0.21190136671066284,
-0.19349129498004913,
0.10880576074123383,
0.5270440578460693,
-0.1819542646408081,
0.1330287754535675,
0.07825163006782532,
0.3633391559123993,
-0.10924291610717773,
0.03872402757406235,
-0.22828862071037292,
-0.12777593731880188,
0.056672103703022,
0.07856331765651703,
0.24090147018432617,
-0.21955284476280212,
0.48002344369888306,
-0.029910512268543243,
0.061174627393484116,
-0.08537685871124268,
0.045272305607795715,
0.02064688503742218,
0.00009329989552497864,
0.37664344906806946,
0.05903725326061249,
0.12508389353752136,
0.18852859735488892,
-0.23282182216644287,
-0.2064909189939499,
0.06926584243774414,
-0.32406604290008545,
-0.2534552812576294,
-0.019234521314501762,
0.06986821442842484,
-0.16287928819656372,
-0.03891024738550186,
-0.42757073044776917,
0.01216028444468975,
-0.04124923422932625,
0.03452109545469284,
-0.018065813928842545,
0.1163954958319664,
-0.16850900650024414,
-0.11601985991001129,
0.37496131658554077,
0.6574848294258118,
-0.34978148341178894,
-0.21597209572792053,
0.10556823760271072,
-0.2186383754014969,
0.08924315869808197,
0.3204609751701355,
-0.23370632529258728,
0.2256506085395813,
-0.3225739002227783,
-0.10116057842969894,
0.0627356693148613,
-0.575585126876831,
-0.39366868138313293,
0.5642514228820801,
-0.014566823840141296,
0.21240434050559998,
0.02065424621105194,
-0.028896860778331757,
-0.3707118630409241,
0.1954212337732315,
0.24621599912643433,
0.35343533754348755,
0.11424677819013596,
0.11776749044656754,
-0.2816213071346283,
-0.267917662858963,
-0.04237275943160057,
0.49451392889022827,
-0.12188532948493958,
0.2466437816619873,
0.21449732780456543,
-0.12028439342975616,
0.3639255464076996,
-0.006486939266324043,
-0.027110060676932335,
0.32639431953430176,
0.2140551209449768,
-0.031096793711185455,
0.09043106436729431,
0.19522204995155334,
-0.6708871722221375,
0.22949010133743286,
-0.1669670045375824,
-0.2093682885169983,
-0.10131604969501495,
-0.08124349266290665,
-0.3854469656944275,
0.08853527158498764,
-0.45990726351737976,
-0.22306552529335022,
-0.025900857523083687,
0.2522803246974945,
0.35204648971557617,
0.2400895208120346,
-0.3816361129283905,
0.4612191915512085,
-0.018183548003435135,
0.16523803770542145,
-0.4059988260269165,
0.44871658086776733,
0.2276725322008133,
0.04995320364832878,
-0.005750246345996857,
-0.031515903770923615,
0.03201185539364815,
-0.27837076783180237,
-0.11219379305839539,
0.2214248776435852,
0.03679516911506653,
0.303831547498703,
0.08629089593887329,
-0.16326949000358582,
0.1658869832754135,
-0.21221086382865906,
0.01797698251903057,
0.14521291851997375,
0.10920785367488861,
-0.08498862385749817,
-0.2659318149089813,
0.22713211178779602,
-0.1890718936920166,
0.27434873580932617,
-0.15580806136131287,
-0.23299163579940796,
0.2102038711309433,
-0.06311747431755066,
-0.18986070156097412,
-0.00030416250228881836,
0.2856615483760834,
0.07246840745210648,
0.4501807689666748,
0.044577136635780334,
-0.41856998205184937,
-0.15588979423046112,
0.35425707697868347,
-0.1090247854590416,
-0.0700354278087616,
0.35705846548080444,
-0.160859152674675,
-0.01832403987646103,
0.27060726284980774,
0.061015479266643524,
0.5715006589889526,
0.09259280562400818,
-0.11424065381288528,
0.3228324353694916,
0.18807481229305267,
-0.13056126236915588,
-0.07226894795894623,
-0.15149904787540436,
0.036197446286678314,
0.23198489844799042,
0.04643207788467407,
-0.1371152400970459,
-0.4205285906791687,
0.11217563599348068,
-0.17787215113639832,
0.22756856679916382,
-0.3736392855644226,
0.16385065019130707,
-0.4039649963378906,
-0.042322222143411636,
-0.14322693645954132,
-0.03633156791329384,
-0.18955136835575104,
-0.1339138150215149,
-0.17049993574619293,
0.18221163749694824,
0.027063027024269104,
-0.06186436116695404,
-0.07101808488368988,
0.2606180012226105,
-0.06248093023896217,
-0.5448808670043945,
-0.4394163191318512,
0.04892308637499809,
-0.3588559627532959,
-0.11981292814016342,
0.34451812505722046,
0.13069140911102295,
0.08404853194952011,
-0.552353024482727,
-0.16687741875648499,
0.03881083428859711,
0.08775395900011063,
0.1950751394033432,
0.18872681260108948,
0.3946009874343872,
-0.0719386488199234,
0.36402660608291626,
-0.32858842611312866,
0.04816830903291702,
0.30289867520332336,
-0.10965608060359955,
-0.22009381651878357,
0.009083785116672516,
0.12331131100654602,
0.030764255672693253,
-0.12048853933811188,
-0.15191906690597534,
-0.397465318441391,
-0.3449845612049103,
0.5823482275009155,
0.13653214275836945,
0.07013815641403198,
0.053539909422397614,
0.1520994007587433,
0.15529093146324158,
-0.23415131866931915,
0.024687815457582474,
-0.2127990871667862,
-0.8340516686439514,
0.23433542251586914,
-0.2791392505168915,
-0.4642558991909027,
0.004265196621417999,
0.14684797823429108,
0.09961235523223877,
-0.1759265661239624,
-0.5586335062980652,
-0.10619333386421204,
-0.018090039491653442,
0.17688097059726715,
0.019181108102202415,
0.17336271703243256,
0.0293518528342247,
-0.31283101439476013,
0.12857143580913544,
0.02442556619644165,
-0.2663438320159912,
0.18946869671344757,
0.047954823821783066,
0.14346231520175934,
0.38333818316459656,
0.4202961325645447,
-0.2425227016210556,
0.5033044815063477,
0.3179420530796051,
-0.013753831386566162,
0.5802305936813354,
-0.1549922376871109,
0.25760403275489807,
-0.33618679642677307,
-0.439225971698761,
-0.11276815831661224,
0.11206384748220444,
-0.1449991911649704,
0.09016069769859314,
0.16446173191070557,
0.06471660733222961,
-0.42876845598220825,
-0.17991584539413452,
-0.4466659426689148,
-0.09719985723495483,
-0.07437654584646225,
0.27071499824523926,
0.0013173054903745651,
0.02299298346042633,
0.053491100668907166,
0.16992340981960297,
-0.04728163406252861,
0.17913170158863068,
0.43390145897865295,
0.16393232345581055,
0.22142142057418823,
-0.4075097441673279,
0.07077682018280029,
-0.3898390233516693,
0.26505452394485474,
-0.2641356885433197,
0.39516162872314453,
-0.23896564543247223,
0.005833752453327179,
0.1423739641904831,
-0.07813751697540283,
0.6487435698509216,
0.09237083047628403,
0.14018313586711884,
-0.181517094373703,
-0.27864208817481995,
-0.40697208046913147,
0.0698351189494133,
0.2075142115354538,
0.1596045047044754,
-0.11934292316436768,
0.8546817898750305,
-0.16801969707012177,
-0.24938032031059265,
-0.13119345903396606,
0.19533488154411316,
-0.11526228487491608,
-0.44478467106819153,
-0.36358821392059326,
-0.29086610674858093,
-0.2726512849330902,
-0.12664464116096497,
-0.15039360523223877,
0.15503937005996704,
0.05506299436092377,
-0.15722814202308655,
0.06085874140262604,
-0.029946621507406235,
-0.0028550997376441956,
0.02136503905057907,
0.23238645493984222,
-0.08723171055316925,
0.21276593208312988,
0.371631920337677,
0.21921426057815552,
0.2615469694137573,
0.8809881210327148,
-0.029584607109427452,
-0.46209901571273804,
-0.022449534386396408,
0.11118777096271515,
0.2517799735069275,
0.09436428546905518,
-0.11867840588092804,
-0.12618732452392578,
0.2726965844631195,
0.05472530424594879,
-0.2332518845796585,
0.06694895029067993,
0.11227229982614517,
0.013050615787506104,
-0.015261676162481308,
-0.5056496858596802,
0.5915822386741638,
0.018417276442050934,
0.1065899133682251,
0.17012645304203033,
-0.04925486072897911,
-0.09905214607715607,
0.25011011958122253,
-0.14351777732372284,
0.6233782768249512,
-0.18294723331928253,
0.07018113136291504,
0.1565311998128891,
-0.3255903124809265,
0.3195417523384094,
-0.4297909438610077,
-0.10108453035354614,
-0.25960081815719604,
0.049840860068798065,
-0.06326766312122345,
-0.17231857776641846,
0.2295585423707962,
0.1443684846162796,
0.1579565405845642,
0.23920336365699768,
-0.08860786259174347,
-0.015572219155728817,
-0.10511713474988937,
0.37631165981292725,
-0.05199973285198212,
-0.2099083811044693,
-0.5630281567573547,
0.08777546137571335,
-0.07094313204288483,
0.5927110910415649,
0.006035160273313522,
-0.17822930216789246,
-0.11766686290502548,
-0.08354277163743973,
0.0565456748008728,
0.20898553729057312,
0.07834209501743317,
-0.11901018768548965,
0.387185662984848,
-0.24496018886566162,
-0.05241796746850014,
0.3131713271141052,
0.1278798133134842,
-0.035254813730716705,
-0.3765220642089844,
-0.08768920600414276,
-0.2645716667175293,
0.09740443527698517,
-0.1605740785598755,
-0.10227665305137634,
0.13395966589450836,
-0.122456394135952,
-0.33374059200286865,
-0.006104700267314911,
-0.18573501706123352,
-0.40510132908821106,
0.031454622745513916,
0.09298055619001389,
-0.19328351318836212,
-0.05293392017483711,
-0.44939690828323364,
-0.02937091514468193,
0.31496602296829224,
0.06320683658123016,
0.10107391327619553,
0.3513967990875244,
-0.00478455051779747,
-0.10432275384664536,
0.06882454454898834,
-0.34002792835235596,
-0.30162426829338074,
0.591944694519043,
-0.27022549510002136,
-0.05804861709475517,
0.34287285804748535,
0.25875335931777954,
-0.035430848598480225,
-0.14101548492908478,
0.21395818889141083,
0.6627403497695923,
-0.2565186321735382,
-0.04913070797920227,
-0.0511200912296772,
0.21157489717006683,
-0.14756189286708832,
0.15769365429878235,
0.09881331026554108,
-0.4649316370487213,
0.2788342833518982,
-0.49515557289123535,
-0.5347673892974854,
0.1803901195526123,
0.07124915719032288,
0.028095567598938942,
0.3624665141105652,
-0.1316731572151184,
0.10850657522678375,
-0.08383002877235413,
-0.200092613697052,
-0.05885688588023186,
-0.1385912299156189,
-0.3547118604183197,
0.13796527683734894,
0.22350122034549713,
0.24091851711273193,
-0.11293438076972961,
0.08848658949136734,
0.018380913883447647,
-0.21344242990016937,
-0.17079612612724304,
-0.060734838247299194,
0.18135029077529907,
0.16536283493041992,
-0.062458284199237823,
-0.13396593928337097,
-0.2717044949531555,
-0.13365760445594788,
-0.045825760811567307,
0.17099544405937195,
0.1961926817893982,
-0.11904023587703705,
0.2253197282552719,
0.001651134341955185,
-0.042773500084877014,
-0.14355643093585968,
0.12707538902759552,
-0.014904703944921494,
0.11439716815948486,
-0.0643799901008606,
-0.019830208271741867,
-0.0625254362821579,
0.01818116009235382,
-0.16603153944015503,
0.01910846307873726,
0.19324535131454468,
0.17249774932861328,
0.3221426010131836,
-0.48871177434921265,
0.13649553060531616,
0.18408232927322388,
0.3849427103996277,
0.27015984058380127,
-0.32492899894714355,
0.20380741357803345,
0.24419443309307098,
0.07235822081565857,
-0.1467738151550293,
-0.2773664891719818,
0.3203793168067932,
0.13891179859638214,
-0.11052282154560089,
0.18680694699287415,
0.24296648800373077,
-0.036720313131809235,
0.013875240460038185,
0.1210864707827568,
0.49862003326416016,
0.12979905307292938,
-0.04995381087064743,
0.2780267894268036,
-0.14106924831867218,
0.2126011848449707,
-0.028824985027313232,
0.3873046338558197,
0.09908528625965118,
0.3904423713684082,
-0.01243794709444046,
0.02258804626762867,
-0.12539757788181305,
0.4639766812324524,
-0.18732716143131256,
-0.5371381044387817,
0.24947577714920044,
0.19992578029632568,
-0.22106719017028809,
0.19432778656482697,
-0.10563615709543228,
0.4164934754371643,
-0.1423415094614029,
-0.01918042078614235,
-0.2037276029586792,
0.2146637737751007,
-0.018761979416012764,
-0.1436641663312912,
0.006604984402656555,
-0.22810617089271545,
-0.15560784935951233,
0.1461763232946396,
-0.061077456921339035,
-0.346903920173645,
0.04006944224238396,
-0.027873903512954712,
-0.16275112330913544,
-0.13641056418418884,
0.012226732447743416,
0.14712229371070862,
-0.02554359659552574,
-0.006086729466915131,
0.22588758170604706,
-0.13445386290550232,
-0.1295393705368042,
0.121925488114357,
0.0729484111070633,
0.0931527316570282,
0.40404555201530457,
0.15346600115299225,
0.016435232013463974,
-0.13808727264404297,
-0.04967912286520004,
-0.1449381560087204,
0.4175233840942383,
-0.14030037820339203,
-0.09532749652862549,
0.3466692566871643,
0.10868248343467712,
-0.05257374048233032,
0.13457833230495453,
-0.09741953760385513,
0.3015750050544739,
-0.4473014175891876,
0.2973631024360657,
-0.29393863677978516,
-0.06307128071784973,
-0.027210474014282227,
-0.16565565764904022,
-0.28309571743011475,
-0.17083463072776794,
0.2635670304298401,
0.18499481678009033,
0.2718515992164612,
-0.29814156889915466,
0.04466656222939491,
-0.1313709318637848,
0.4091958999633789,
0.26650193333625793,
0.30474594235420227,
-0.12983784079551697,
-0.16479241847991943,
-0.584180474281311,
0.07890791445970535,
-0.03022412210702896,
0.10906872153282166,
0.25626876950263977,
-0.04246486723423004,
0.13578733801841736,
0.2688348889350891,
-0.19266073405742645,
0.14781033992767334,
0.004275940358638763,
0.12141470611095428,
0.04885679483413696,
-0.1538832187652588,
-0.313311368227005,
0.3277357220649719,
0.06562050431966782,
-0.3015711307525635,
0.3544684052467346,
-0.21595360338687897,
-0.045426689088344574,
-0.1528322696685791,
0.16838482022285461,
-0.08738043159246445,
-0.32243263721466064,
0.3887017071247101,
0.037602297961711884,
0.08542253822088242,
-0.056753210723400116,
-0.04717171937227249,
-0.007834862917661667,
-0.15985724329948425,
-0.2353595644235611,
0.20713773369789124,
-0.3391164541244507,
0.20871049165725708,
-0.2712819278240204,
-0.28344354033470154,
-0.3815234303474426,
0.0165487602353096,
0.08139944076538086,
-0.27757614850997925,
-0.07119893282651901,
-0.012543629854917526,
-0.1482456624507904,
-0.06365717202425003,
0.35767292976379395,
0.20238399505615234,
-0.06832273304462433,
0.01339324563741684,
-0.16263017058372498,
0.09619279205799103,
0.5011923909187317,
-0.4166339337825775,
-0.03901737555861473,
0.21820813417434692,
0.025554046034812927,
0.004945116117596626,
-0.45870402455329895,
-0.2789040207862854,
0.17857512831687927,
0.33141958713531494,
-0.17259739339351654,
0.07325613498687744,
0.1315067708492279,
-0.08336325734853745,
0.04093608260154724,
-0.09452477097511292,
0.22846615314483643,
0.18392962217330933,
-0.0753689706325531,
0.2465236783027649,
-0.14846710860729218
] |
https://github.com/huggingface/datasets/issues/6197 | People using previous releases of `datasets` should pin `pandas` in their local environment:
```
python -m pip install 'pandas<2.1.0'
``` | ValueError: 'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns' | ### Describe the bug
Saving a dataset `.to_json()` fails with a `ValueError` since the latest `pandas` [release](https://pandas.pydata.org/docs/dev/whatsnew/v2.1.0.html) (`2.1.0`)
In their latest release we have:
> Improved error handling when using [DataFrame.to_json()](https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.to_json.html#pandas.DataFrame.to_json) with incompatible index and orient arguments ([GH 52143](https://github.com/pandas-dev/pandas/issues/52143))
i.e. an error is now raised for invalid combinations of `index` and `orient`.
This means that unfortunately the custom logic at this line might sometimes lead to contradictions:
https://github.com/huggingface/datasets/blob/029227a116c14720afca71b9b22e78eb2a1c09a6/src/datasets/io/json.py#L96
e.g. for the default case `orient=records` leads to `index=True`, which now raises a `ValueError`
### Steps to reproduce the bug
```python
import datasets
if __name__ == '__main__':
dataset = datasets.Dataset.from_dict({"A": [1, 2, 3], "B": [4, 5, 6]})
dataset.to_json("dataset.json")
```
```shell
>>>
ValueError: 'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns'.
```
### Expected behavior
The dataset is successfully saved as `.json`
### Environment info
`python >= 3.9`
`pandas >= 2.1.0` | 20 | ValueError: 'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns'
### Describe the bug
Saving a dataset `.to_json()` fails with a `ValueError` since the latest `pandas` [release](https://pandas.pydata.org/docs/dev/whatsnew/v2.1.0.html) (`2.1.0`)
In their latest release we have:
> Improved error handling when using [DataFrame.to_json()](https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.to_json.html#pandas.DataFrame.to_json) with incompatible index and orient arguments ([GH 52143](https://github.com/pandas-dev/pandas/issues/52143))
i.e. an error is now raised for invalid combinations of `index` and `orient`.
This means that unfortunately the custom logic at this line might sometimes lead to contradictions:
https://github.com/huggingface/datasets/blob/029227a116c14720afca71b9b22e78eb2a1c09a6/src/datasets/io/json.py#L96
e.g. for the default case `orient=records` leads to `index=True`, which now raises a `ValueError`
### Steps to reproduce the bug
```python
import datasets
if __name__ == '__main__':
dataset = datasets.Dataset.from_dict({"A": [1, 2, 3], "B": [4, 5, 6]})
dataset.to_json("dataset.json")
```
```shell
>>>
ValueError: 'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns'.
```
### Expected behavior
The dataset is successfully saved as `.json`
### Environment info
`python >= 3.9`
`pandas >= 2.1.0`
People using previous releases of `datasets` should pin `pandas` in their local environment:
```
python -m pip install 'pandas<2.1.0'
``` | [
0.0543651282787323,
0.21008306741714478,
-0.012207593768835068,
0.14300532639026642,
0.22878742218017578,
0.2148909717798233,
0.5008203983306885,
0.5437043905258179,
-0.07516998052597046,
0.08667115867137909,
-0.2040853500366211,
0.5609626770019531,
0.0017831027507781982,
-0.05196439474821091,
-0.3864617645740509,
-0.28144562244415283,
0.2735849916934967,
0.21611720323562622,
0.0719941183924675,
0.05017126351594925,
-0.5537838935852051,
0.17571525275707245,
-0.17786557972431183,
0.2605574131011963,
-0.0669434443116188,
-0.23652498424053192,
-0.2563042938709259,
0.003765663132071495,
-0.026402587071061134,
-0.36512255668640137,
0.2063131332397461,
-0.3391743302345276,
0.06309665739536285,
0.34212735295295715,
-0.00010698410915210843,
-0.02383122593164444,
0.1812184453010559,
-0.05850831791758537,
-0.23775121569633484,
-0.3096597194671631,
-0.41828763484954834,
-0.11424434185028076,
-0.009801451116800308,
-0.4073633551597595,
0.1084391325712204,
-0.47495201230049133,
-0.012009554542601109,
-0.15976138412952423,
0.31744274497032166,
0.41331905126571655,
0.2524862289428711,
0.0810200646519661,
0.2143290489912033,
-0.15911483764648438,
0.0648939460515976,
-0.006587885320186615,
-0.0747540295124054,
0.2182941883802414,
-0.3718949556350708,
0.02410557121038437,
0.04442887380719185,
0.06437322497367859,
-0.024210035800933838,
-0.09370368719100952,
-0.20176056027412415,
0.13810858130455017,
0.04361885040998459,
-0.2744181156158447,
-0.16425858438014984,
0.15358446538448334,
0.20201237499713898,
-0.24271491169929504,
-0.547701358795166,
-0.131221741437912,
-0.048806674778461456,
-0.3369928300380707,
0.16930951178073883,
0.0742131844162941,
0.1323016881942749,
0.20414748787879944,
0.41445058584213257,
0.2251477986574173,
-0.27485910058021545,
0.1410948634147644,
-0.2849055826663971,
0.19846883416175842,
-0.19937480986118317,
0.056013014167547226,
0.052606310695409775,
-0.2323554903268814,
0.04800151288509369,
-0.17492376267910004,
-0.1598043292760849,
-0.038385774940252304,
-0.3877635598182678,
-0.16944333910942078,
0.22229966521263123,
-0.5897786021232605,
-0.10812617838382721,
-0.0015952689573168755,
0.12102031707763672,
-0.07244458049535751,
0.016286298632621765,
0.3528278172016144,
0.44324636459350586,
0.2688235938549042,
0.06930142641067505,
0.4181464612483978,
0.17801819741725922,
0.30624255537986755,
0.17109563946723938,
-0.013511012308299541,
0.24137835204601288,
-0.23520950973033905,
0.3943972587585449,
-0.017134565860033035,
0.4690335988998413,
-0.1333494335412979,
-0.550248384475708,
0.35010549426078796,
-0.6393764019012451,
-0.03467416390776634,
-0.04000239819288254,
0.10606588423252106,
-0.04671364650130272,
0.45779603719711304,
0.23902437090873718,
0.41919124126434326,
0.162623792886734,
0.360292911529541,
-0.22950227558612823,
0.45618152618408203,
0.22058653831481934,
-0.23831036686897278,
0.023865848779678345,
-0.14435406029224396,
0.028407447040081024,
0.16220659017562866,
-0.048076510429382324,
-0.16910769045352936,
-0.19633662700653076,
-0.4096983075141907,
0.15337201952934265,
0.3323533535003662,
0.1380171775817871,
0.041677579283714294,
0.17590630054473877,
-0.23816779255867004,
-0.17585444450378418,
0.1738469898700714,
-0.08054136484861374,
-0.12078434228897095,
0.09289918839931488,
0.2511277198791504,
0.0035866424441337585,
-0.11169252544641495,
-0.37726277112960815,
0.25367024540901184,
0.1410086303949356,
0.08865778148174286,
0.14282256364822388,
-0.08873476088047028,
0.0019966214895248413,
-0.37023529410362244,
0.049282655119895935,
0.1752927601337433,
-0.2814169228076935,
0.13376455008983612,
0.08703863620758057,
-0.04751371592283249,
0.00954810157418251,
0.12583664059638977,
0.06840940564870834,
0.24205853044986725,
-0.14848308265209198,
0.14133381843566895,
0.26827019453048706,
-0.2751286029815674,
-0.15484754741191864,
0.1254880279302597,
-0.01634024828672409,
0.10362642258405685,
0.03457453101873398,
0.03472691774368286,
0.058688461780548096,
-0.08725099265575409,
0.41594019532203674,
0.3433128893375397,
-0.026783503592014313,
0.08976544439792633,
-0.14056235551834106,
-0.1959487646818161,
0.12347178161144257,
0.1839057356119156,
-0.07433690130710602,
0.14829054474830627,
-0.05837376415729523,
-0.08266124129295349,
0.08751284331083298,
-0.16493746638298035,
-0.00726637989282608,
0.1756623089313507,
0.4000507891178131,
-0.3065685033798218,
-0.044338565319776535,
-0.2396281212568283,
-0.33606386184692383,
0.06899556517601013,
0.030874133110046387,
-0.03955397009849548,
-0.025659553706645966,
-0.07183414697647095,
-0.19313666224479675,
0.0033751726150512695,
-0.18494601547718048,
-0.05650279298424721,
0.19865579903125763,
-0.025718502700328827,
-0.08492009341716766,
0.273337721824646,
-0.24842879176139832,
0.17689597606658936,
-0.16211073100566864,
0.1049971729516983,
-0.07095175981521606,
0.24944645166397095,
-0.30399289727211,
-0.05368582904338837,
0.1868169605731964,
0.014110495336353779,
0.28183603286743164,
-0.17679685354232788,
-0.216813325881958,
0.40497809648513794,
0.08008401095867157,
-0.003585297614336014,
-0.3109728693962097,
0.09593303501605988,
0.1116848886013031,
0.168930321931839,
-0.06962411105632782,
0.11225724220275879,
0.23881857097148895,
-0.06569123268127441,
-0.34887567162513733,
0.6158360838890076,
-0.19505532085895538,
0.19115541875362396,
-0.0028904303908348083,
-0.04802750423550606,
0.4031699299812317,
0.07390112429857254,
-0.06538708508014679,
-0.2817152738571167,
-0.10249750316143036,
-0.000057874247431755066,
-0.19440531730651855,
-0.16305582225322723,
-0.4811514616012573,
0.06499922275543213,
0.299356073141098,
-0.012186206877231598,
0.2921740710735321,
0.19585412740707397,
0.16885247826576233,
-0.12170810252428055,
0.04852580279111862,
0.3547251224517822,
0.4803447127342224,
0.08586212992668152,
-0.058553580194711685,
0.03259820491075516,
-0.2768149971961975,
-0.06840872019529343,
0.21099066734313965,
0.09355030953884125,
0.18634581565856934,
0.21461549401283264,
0.3743012547492981,
0.1646432876586914,
-0.03747948631644249,
-0.00932207703590393,
-0.049590591341257095,
0.4065059721469879,
-0.3504667580127716,
0.2537349462509155,
-0.3707028031349182,
-0.09540972113609314,
0.014065653085708618,
-0.3526926040649414,
0.06469924747943878,
-0.5952848196029663,
-0.09079132974147797,
0.3246544599533081,
-0.31434378027915955,
0.258756160736084,
-0.010194174945354462,
0.14307159185409546,
0.10458308458328247,
-0.14090070128440857,
0.03592156618833542,
0.03282249718904495,
-0.14879873394966125,
0.1210905909538269,
-0.05281061679124832,
0.03744978830218315,
0.1556909829378128,
-0.25778093934059143,
0.07536038011312485,
-0.2071138471364975,
-0.13584300875663757,
-0.030720476061105728,
-0.18539084494113922,
0.225399449467659,
0.27671900391578674,
0.25395265221595764,
0.04641306400299072,
-0.23335367441177368,
0.20114612579345703,
0.023966968059539795,
-0.16109241545200348,
0.22312653064727783,
0.01541358232498169,
0.02924862876534462,
0.038231395184993744,
-0.49914631247520447,
-0.11077017337083817,
-0.43298080563545227,
0.2456970512866974,
-0.019069354981184006,
0.2844139635562897,
0.0861394852399826,
0.30361729860305786,
0.1965540200471878,
0.15733547508716583,
0.08587265014648438,
-0.22792692482471466,
-0.05036766827106476,
0.4292101562023163,
-0.101009801030159,
-0.18696999549865723,
0.03572786599397659,
-0.13034215569496155,
-0.14656269550323486,
-0.32242852449417114,
-0.313219279050827,
-0.5765370726585388,
-0.13105982542037964,
0.06944572180509567,
-0.010986795648932457,
0.11916982382535934,
0.32033562660217285,
0.08971485495567322,
-0.11124509572982788,
-0.0843484178185463,
-0.4834804832935333,
0.04058583080768585,
0.428983598947525,
-0.010277219116687775,
-0.04090488702058792,
0.7479660511016846,
0.1710020899772644,
0.017301715910434723,
0.24044367671012878,
-0.1544482558965683,
0.36368635296821594,
0.01574537344276905,
0.49671506881713867,
-0.2965731918811798,
-0.5810448527336121,
-0.30896857380867004,
-0.05659279227256775,
-0.030189886689186096,
-0.19576814770698547,
-0.10535235702991486,
-0.19257736206054688,
-0.07551512122154236,
-0.1900317668914795,
-0.17429260909557343,
-0.155053049325943,
0.13627564907073975,
-0.06822292506694794,
0.002286754548549652,
-0.03987948223948479,
0.11407224088907242,
-0.15779328346252441,
0.22269558906555176,
-0.05891608074307442,
0.3889944851398468,
0.13428592681884766,
-0.11559819430112839,
-0.21530286967754364,
-0.16363005340099335,
-0.2399628758430481,
0.14361196756362915,
0.05262381210923195,
0.6910127401351929,
-0.009059764444828033,
-0.11976677179336548,
-0.11026573926210403,
-0.2273748219013214,
0.47470784187316895,
-0.20222723484039307,
-0.10728485882282257,
0.3372448980808258,
-0.08258988708257675,
-0.169046550989151,
-0.02728865295648575,
-0.15051737427711487,
0.1264348328113556,
0.14941275119781494,
0.606181263923645,
-0.21854382753372192,
-0.10836774110794067,
0.42993518710136414,
0.04482860118150711,
-0.0749591812491417,
-0.1233605369925499,
-0.2351405918598175,
-0.19125044345855713,
-0.35138094425201416,
0.25159215927124023,
0.12419401854276657,
0.15346139669418335,
0.04318894445896149,
0.027097351849079132,
-0.14968445897102356,
-0.27901339530944824,
-0.11900462210178375,
0.0387997180223465,
-0.007148729637265205,
-0.08000446856021881,
0.18620550632476807,
-0.11347441375255585,
-0.021101512014865875,
0.5695310831069946,
0.4227297604084015,
-0.15711766481399536,
-0.2606201171875,
-0.028480099514126778,
0.20549429953098297,
0.036914944648742676,
0.14919178187847137,
-0.1995285302400589,
-0.04952609911561012,
-0.34730637073516846,
0.0343262255191803,
-0.049076080322265625,
-0.12806670367717743,
0.3679022192955017,
-0.04219606891274452,
-0.391722172498703,
-0.09379404783248901,
0.4841594696044922,
-0.00980459526181221,
-0.08381375670433044,
-0.029618505388498306,
0.38776475191116333,
-0.21663343906402588,
0.43975144624710083,
-0.04754307493567467,
0.61203932762146,
0.3581089377403259,
0.20291925966739655,
0.563874363899231,
-0.6610545516014099,
0.5187622904777527,
0.1990353912115097,
0.11208987236022949,
-0.434360533952713,
-0.02868214249610901,
0.009514495730400085,
-0.1420706957578659,
0.08494766056537628,
-0.09628832340240479,
-0.3282701075077057,
0.28087031841278076,
-0.4330025911331177,
0.21292003989219666,
-0.010293684899806976,
0.19594049453735352,
-0.16746850311756134,
-0.21691037714481354,
-0.5061136484146118,
0.2113702893257141,
0.07096372544765472,
-0.03801577538251877,
-0.01648523658514023,
-0.1420358270406723,
-0.18757256865501404,
-0.11185026168823242,
-0.37681496143341064,
0.10680011659860611,
0.213729590177536,
0.28878331184387207,
-0.09005162119865417,
-0.3430657386779785,
0.02445124089717865,
-0.046142078936100006,
0.20696960389614105,
-0.024183962494134903,
0.01803405024111271,
-0.13932575285434723,
-0.08584349602460861,
0.18051742017269135,
0.09004482626914978,
-0.19119256734848022,
0.37990114092826843,
0.10164391994476318,
-0.13463883101940155,
-0.0579654797911644,
-0.11836307495832443,
-0.35656237602233887,
-0.1902405321598053,
0.1434342861175537,
-0.2971864640712738,
-0.32575052976608276,
-0.2944655120372772,
-0.10327964276075363,
-0.04387768730521202,
-0.47363513708114624,
0.2117047905921936,
0.17640209197998047,
0.06600511074066162,
0.21570467948913574,
-0.25062885880470276,
-0.12458512932062149,
-0.13783670961856842,
0.5139035582542419,
-0.23868152499198914,
0.08775582909584045,
0.3121111989021301,
-0.014824390411376953,
-0.1940748691558838,
-0.22218067944049835,
0.4648107886314392,
0.45871061086654663,
-0.014273740351200104,
0.4301067292690277,
-0.32183578610420227,
-0.08845019340515137,
-0.14609158039093018,
0.09612412750720978,
0.22544462978839874,
0.19855591654777527,
0.03412400186061859,
-0.5368854999542236,
-0.2962775230407715,
0.25373199582099915,
0.16497358679771423,
0.20440712571144104,
-0.09626012295484543,
-0.00021951831877231598,
-0.09826546907424927,
0.0015013013035058975,
-0.3326495885848999,
0.105458565056324,
-0.3350783586502075,
0.0759449154138565,
0.017221201211214066,
0.026104476302862167,
0.14933647215366364,
-0.04729698225855827,
0.18621782958507538,
0.12616433203220367,
-0.07009641826152802,
-0.2560664415359497,
-0.24056373536586761,
0.07603804022073746,
0.251618355512619,
-0.2543492317199707,
-0.026336628943681717,
-0.32175368070602417,
-0.13449987769126892,
-0.11837653070688248,
-0.26324260234832764,
0.3659917712211609,
-0.12888985872268677,
0.2329995036125183,
0.08840648084878922,
0.10041110217571259,
0.3595883250236511,
-0.10933443903923035,
-0.139959454536438,
-0.06452813744544983,
-0.10312831401824951,
0.24447782337665558,
-0.2191685289144516,
-0.09671653807163239,
-0.19892938435077667,
0.112076535820961,
-0.25310850143432617,
0.18554653227329254,
0.2226732224225998,
-0.20700106024742126,
-0.093699149787426,
0.20801135897636414,
0.3124261498451233,
0.32492536306381226,
-0.2529393136501312,
0.10869172215461731,
0.047049619257450104,
0.2088230550289154,
-0.120719313621521,
-0.2148028016090393,
0.2583678960800171,
-0.006393905729055405,
0.03195464611053467,
0.19639042019844055,
-0.1838947981595993,
0.028356730937957764,
-0.13094845414161682,
0.003779750317335129,
0.34255579113960266,
-0.2249419242143631,
0.21914927661418915,
0.3145565986633301,
-0.259474515914917,
0.12283322215080261,
0.41401225328445435,
0.038204558193683624,
0.5025594830513,
0.3041920065879822,
0.12235450744628906,
0.015741651877760887,
0.3311174809932709,
-0.06665100157260895,
0.15033242106437683,
-0.09480302035808563,
-0.017143717035651207,
-0.003177739679813385,
-0.08556053787469864,
0.044047847390174866,
0.3356861472129822,
0.07546719908714294,
-0.5288480520248413,
0.07703526318073273,
-0.09177858382463455,
0.16633951663970947,
-0.20548182725906372,
-0.09270224720239639,
0.0416741818189621,
-0.15914693474769592,
0.0542384535074234,
-0.25047767162323,
-0.0857979878783226,
-0.2827491760253906,
-0.03889787569642067,
-0.11848080158233643,
-0.14106126129627228,
-0.22205589711666107,
0.1000034362077713,
0.10484979301691055,
0.32287684082984924,
-0.17125368118286133,
0.0035351254045963287,
0.3309279680252075,
-0.1383131593465805,
-0.022371191531419754,
0.27771246433258057,
0.5886396169662476,
0.2753101885318756,
-0.042076706886291504,
0.24433982372283936,
-0.13674065470695496,
-0.2566477656364441,
0.22073671221733093,
0.031086590141057968,
-0.16207122802734375,
-0.21985945105552673,
0.30865204334259033,
0.2508496046066284,
-0.19818657636642456,
0.41830360889434814,
0.1513909548521042,
0.16453279554843903,
-0.2573445439338684,
0.4893592298030853,
-0.07612490653991699,
-0.06679870188236237,
0.09114591032266617,
0.050008781254291534,
-0.06307529658079147,
-0.25255286693573,
-0.04180731624364853,
0.02207639068365097,
0.21660375595092773,
0.09668400883674622,
0.14779245853424072,
0.1838943064212799,
0.09405559301376343,
0.21213148534297943,
-0.24508622288703918,
-0.2946615219116211,
0.36719411611557007,
-0.3466048836708069,
-0.10994883626699448,
0.0014177761040627956,
0.15763849020004272,
0.06449297815561295,
0.21599340438842773,
-0.08458839356899261,
0.13144710659980774,
0.2226967066526413,
0.40422987937927246,
0.049384016543626785,
0.2393094152212143,
-0.4026135206222534,
-0.06694106757640839,
0.16929957270622253,
-0.08800788968801498,
-0.009476587176322937,
-0.26254725456237793,
0.22234457731246948,
0.035873644053936005,
0.16675373911857605,
-0.12069228291511536,
-0.12378369271755219,
-0.03656259551644325,
0.08277469873428345,
0.23899158835411072,
0.3829282522201538,
-0.06219449266791344,
-0.02505679801106453,
-0.13665321469306946,
-0.12001334130764008,
-0.20744436979293823,
-0.31539928913116455,
0.2777789235115051,
-0.1544419229030609,
0.5470094084739685,
-0.04141876846551895,
-0.3819502294063568,
-0.2176584154367447,
0.0532163605093956,
-0.25166553258895874,
-0.14887410402297974,
-0.335162490606308,
0.5878572463989258,
0.006620526313781738,
0.1106095165014267,
-0.06648089736700058,
0.12131309509277344,
-0.007578570395708084,
0.4691031575202942,
-0.25996699929237366,
-0.47057726979255676,
0.3291324973106384,
-0.30318838357925415,
-0.27846282720565796,
0.11653448641300201,
0.0595531091094017,
0.21065905690193176,
0.07322728633880615,
-0.12510007619857788,
-0.1562291383743286,
0.3195756673812866,
-0.16997244954109192,
-0.3948482275009155,
0.05792061612010002,
-0.07615172863006592,
0.08545467257499695,
-0.048767104744911194,
0.1707775592803955,
0.04669078812003136,
-0.07474896311759949,
0.26246458292007446,
-0.17706039547920227
] |
https://github.com/huggingface/datasets/issues/6195 | realized that need to pass the path at `cache_file_name` like
```python
tokenized_datasets = raw_datasets["train"].map(
tokenize_function,
batched=True,
num_proc=data_args.preprocessing_num_workers,
remove_columns=[text_column_name],
load_from_cache_file=True,
desc="Running tokenizer on dataset line_by_line",
# cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"}
cache_file_name="/project/huggingface_cache/datasets/..../cache-1982fea76aa54a13.arrow",
new_fingerprint="1982fea76aa54a13"
)
``` | Force to reuse cache at given path | ### Describe the bug
I have run the official example of MLM like:
```bash
python run_mlm.py \
--model_name_or_path roberta-base \
--dataset_name togethercomputer/RedPajama-Data-1T \
--dataset_config_name arxiv \
--per_device_train_batch_size 10 \
--preprocessing_num_workers 20 \
--validation_split_percentage 0 \
--cache_dir /project/huggingface_cache/datasets \
--line_by_line \
--do_train \
--pad_to_max_length \
--output_dir /project/huggingface_cache/test-mlm
```
it successfully runs and at my cache folder has `cache-1982fea76aa54a13_00001_of_00020.arrow`..... `cache-1982fea76aa54a13_00020_of_00020.arrow ` as tokenization cache of `map` method. And the cache works fine every time I run the command above.
However, when I switched to jupyter notebook (since I do not want to load datasets every time when I changed other parameters not related to the dataloading). It is not recognizing the cache files and starts to re-run the entire tokenization process.
I changed my code to
```python
tokenized_datasets = raw_datasets["train"].map(
tokenize_function,
batched=True,
num_proc=data_args.preprocessing_num_workers,
remove_columns=[text_column_name],
load_from_cache_file=True,
desc="Running tokenizer on dataset line_by_line",
# cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"}
cache_file_name="cache-1982fea76aa54a13.arrow",
new_fingerprint="1982fea76aa54a13"
)
```
it still does not recognize the previously cached files and trying to re-run the tokenization process.
### Steps to reproduce the bug
use jupyter notebook for dataset map function.
### Expected behavior
the map function accepts the given cache_file_name and new_fingerprint then load the previously cached files.
### Environment info
- `datasets` version: 2.14.4.dev0
- Platform: Linux-3.10.0-1160.59.1.el7.x86_64-x86_64-with-glibc2.10
- Python version: 3.8.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 32 | Force to reuse cache at given path
### Describe the bug
I have run the official example of MLM like:
```bash
python run_mlm.py \
--model_name_or_path roberta-base \
--dataset_name togethercomputer/RedPajama-Data-1T \
--dataset_config_name arxiv \
--per_device_train_batch_size 10 \
--preprocessing_num_workers 20 \
--validation_split_percentage 0 \
--cache_dir /project/huggingface_cache/datasets \
--line_by_line \
--do_train \
--pad_to_max_length \
--output_dir /project/huggingface_cache/test-mlm
```
it successfully runs and at my cache folder has `cache-1982fea76aa54a13_00001_of_00020.arrow`..... `cache-1982fea76aa54a13_00020_of_00020.arrow ` as tokenization cache of `map` method. And the cache works fine every time I run the command above.
However, when I switched to jupyter notebook (since I do not want to load datasets every time when I changed other parameters not related to the dataloading). It is not recognizing the cache files and starts to re-run the entire tokenization process.
I changed my code to
```python
tokenized_datasets = raw_datasets["train"].map(
tokenize_function,
batched=True,
num_proc=data_args.preprocessing_num_workers,
remove_columns=[text_column_name],
load_from_cache_file=True,
desc="Running tokenizer on dataset line_by_line",
# cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"}
cache_file_name="cache-1982fea76aa54a13.arrow",
new_fingerprint="1982fea76aa54a13"
)
```
it still does not recognize the previously cached files and trying to re-run the tokenization process.
### Steps to reproduce the bug
use jupyter notebook for dataset map function.
### Expected behavior
the map function accepts the given cache_file_name and new_fingerprint then load the previously cached files.
### Environment info
- `datasets` version: 2.14.4.dev0
- Platform: Linux-3.10.0-1160.59.1.el7.x86_64-x86_64-with-glibc2.10
- Python version: 3.8.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
realized that need to pass the path at `cache_file_name` like
```python
tokenized_datasets = raw_datasets["train"].map(
tokenize_function,
batched=True,
num_proc=data_args.preprocessing_num_workers,
remove_columns=[text_column_name],
load_from_cache_file=True,
desc="Running tokenizer on dataset line_by_line",
# cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"}
cache_file_name="/project/huggingface_cache/datasets/..../cache-1982fea76aa54a13.arrow",
new_fingerprint="1982fea76aa54a13"
)
``` | [
-0.0019599124789237976,
0.21225914359092712,
0.11871518194675446,
0.13832400739192963,
0.15499252080917358,
-0.021354787051677704,
0.43014252185821533,
0.15119801461696625,
0.028692856431007385,
-0.08496592938899994,
-0.05548159405589104,
0.5933548808097839,
-0.19288857281208038,
-0.1474481076002121,
0.15893521904945374,
0.05356813594698906,
-0.03520648926496506,
-0.03140578791499138,
0.08998394012451172,
0.19107630848884583,
-0.18464455008506775,
0.38084325194358826,
-0.08061625808477402,
0.03261445462703705,
-0.7064418792724609,
0.07463787496089935,
-0.08761599659919739,
0.1490778923034668,
0.09203644841909409,
-0.6049376726150513,
0.22068151831626892,
-0.05583963170647621,
0.27281585335731506,
0.4594793915748596,
-0.00012548912491183728,
0.028297744691371918,
0.11337949335575104,
-0.20154467225074768,
-0.34064382314682007,
-0.07491051405668259,
0.257650226354599,
-0.06358727812767029,
0.23020556569099426,
-0.22399604320526123,
-0.26582416892051697,
0.05149431899189949,
-0.01409549918025732,
-0.480715274810791,
0.5738639235496521,
0.3253915309906006,
0.07309828698635101,
0.13906580209732056,
-0.05508047714829445,
0.2530147433280945,
-0.03272812440991402,
0.0934092178940773,
-0.06813852488994598,
0.14686234295368195,
0.1035749763250351,
-0.20632371306419373,
-0.32595211267471313,
0.3560238480567932,
-0.21353167295455933,
0.28117886185646057,
0.3125131130218506,
0.0324578694999218,
0.34682488441467285,
-0.062381867319345474,
-0.10168499499559402,
-0.06834915280342102,
0.26918089389801025,
-0.32520928978919983,
-0.0711044892668724,
-0.33395275473594666,
-0.3949891924858093,
-0.46218228340148926,
0.1349393129348755,
-0.08443999290466309,
-0.08264951407909393,
0.3351578116416931,
0.0377865694463253,
-0.11186075210571289,
0.1580285131931305,
0.07324975728988647,
0.05580252408981323,
0.1482306569814682,
-0.06900624185800552,
0.0598970502614975,
0.15036912262439728,
-0.007707870099693537,
0.3076198697090149,
-0.033146150410175323,
-0.00829622708261013,
0.1046472117304802,
-0.051346927881240845,
0.01685366779565811,
-0.006383864209055901,
-0.006286434829235077,
-0.017182745039463043,
-0.03459650278091431,
0.3518798053264618,
0.11447704583406448,
0.24251562356948853,
0.3043938875198364,
-0.12685319781303406,
0.5009726285934448,
0.03507181257009506,
0.24267536401748657,
0.4693288207054138,
0.1072545051574707,
-0.4557221531867981,
-0.14414235949516296,
-0.08001061528921127,
-0.09634473919868469,
0.1828523576259613,
0.33659055829048157,
-0.0020801350474357605,
-0.02417127788066864,
-0.06656581908464432,
-0.12169162929058075,
-0.25907307863235474,
-0.25355595350265503,
0.2998605966567993,
0.1380496770143509,
0.04180722311139107,
0.1485280692577362,
-0.016374602913856506,
0.04058373346924782,
-0.24092695116996765,
-0.32746395468711853,
-0.028960149735212326,
0.03186297416687012,
-0.4527376890182495,
0.2704918384552002,
0.42387259006500244,
0.3906724154949188,
0.5555502772331238,
-0.05232919007539749,
0.10028950870037079,
-0.19686606526374817,
0.42399513721466064,
-0.0038474053144454956,
0.17305803298950195,
0.05636153370141983,
-0.22873374819755554,
0.12461166083812714,
0.3165273666381836,
-0.1408536732196808,
-0.16804125905036926,
0.06273537874221802,
-0.5256358981132507,
-0.3321191668510437,
0.5088341236114502,
-0.08557234704494476,
0.08521203696727753,
0.2051135152578354,
-0.2780589759349823,
-0.017941314727067947,
0.42740878462791443,
-0.05371803045272827,
-0.009796537458896637,
-0.19871006906032562,
0.07865703105926514,
-0.22079326212406158,
0.11335085332393646,
0.48001450300216675,
-0.18394486606121063,
-0.28694263100624084,
-0.09413141012191772,
0.34495535492897034,
0.3563363254070282,
0.3471842110157013,
-0.4133475720882416,
0.25076547265052795,
-0.3999623954296112,
0.08310355246067047,
0.2546951472759247,
-0.5813862085342407,
-0.320488840341568,
-0.06372342258691788,
-0.1342913806438446,
0.3589874804019928,
0.2788553535938263,
-0.018877189606428146,
0.10975369065999985,
-0.000011846423149108887,
0.23670396208763123,
0.26223912835121155,
0.2132938951253891,
-0.0832088440656662,
-0.5358511209487915,
-0.18884646892547607,
-0.023691069334745407,
-0.17891845107078552,
0.10436289757490158,
0.13246920704841614,
0.08169740438461304,
0.11931167542934418,
-0.010049194097518921,
-0.12754549086093903,
0.045153290033340454,
0.013287529349327087,
-0.1864577829837799,
-0.06660859286785126,
0.3005582392215729,
0.26610445976257324,
0.04916030913591385,
0.2957589626312256,
-0.3825792074203491,
-0.30063825845718384,
-0.05044369399547577,
-0.08505863696336746,
0.09610948711633682,
-0.29245585203170776,
-0.46819719672203064,
-0.639987587928772,
0.01169099286198616,
0.1617637425661087,
0.4083581864833832,
0.041200391948223114,
-0.15428940951824188,
0.24214689433574677,
0.24880245327949524,
0.2655014991760254,
-0.06939446926116943,
-0.061050210148096085,
-0.12839631736278534,
-0.21236906945705414,
-0.2085002064704895,
0.10897059738636017,
0.39805588126182556,
-0.19420282542705536,
0.01598547026515007,
0.23713164031505585,
0.4011104702949524,
-0.03138997405767441,
-0.24745717644691467,
0.2159687727689743,
-0.03946777433156967,
0.18285441398620605,
0.14090608060359955,
0.24508991837501526,
-0.09909432381391525,
-0.11340035498142242,
0.24567969143390656,
0.4803767204284668,
0.1567598581314087,
0.07199769467115402,
-0.02166144549846649,
0.08176153898239136,
0.1525040864944458,
-0.26226094365119934,
-0.1750447303056717,
-0.17323096096515656,
0.17655111849308014,
-0.09191178530454636,
0.07515989243984222,
-0.005454452708363533,
-0.007788203656673431,
0.04496511444449425,
0.30047568678855896,
0.3645269274711609,
0.22555160522460938,
-0.15629997849464417,
-0.4485896825790405,
0.06266935169696808,
0.12292514741420746,
0.19704915583133698,
0.3940088748931885,
0.12858912348747253,
0.1584727168083191,
0.1117103174328804,
-0.018680870532989502,
-0.20485971868038177,
0.13447844982147217,
-0.05948485806584358,
0.14210906624794006,
0.14026428759098053,
0.1305672526359558,
0.07128173112869263,
-0.3167641758918762,
0.2845047414302826,
0.14575186371803284,
0.013421570882201195,
-0.11393740028142929,
0.2444000095129013,
-0.5909275412559509,
-0.16468465328216553,
-0.3093941807746887,
-0.029184896498918533,
0.16688551008701324,
-0.17174828052520752,
-0.11102746427059174,
0.4724828600883484,
0.33788546919822693,
0.24936401844024658,
0.279594361782074,
0.4157329797744751,
-0.15045571327209473,
-0.046197663992643356,
0.0028348416090011597,
-0.19240382313728333,
-0.3455633521080017,
-0.14302507042884827,
0.41266345977783203,
-0.30414462089538574,
-0.051439687609672546,
-0.12396642565727234,
0.119259312748909,
-0.42658740282058716,
-0.3473316431045532,
0.07449635863304138,
0.3673114776611328,
0.3003538250923157,
-0.0008522793650627136,
0.09605433791875839,
-0.17523539066314697,
-0.06423164904117584,
0.05698481574654579,
0.012435413897037506,
-0.1311943531036377,
-0.1500665247440338,
0.04767095297574997,
-0.03325199335813522,
-0.14074063301086426,
-0.054645463824272156,
-0.3031342923641205,
-0.1561642289161682,
0.16973519325256348,
0.03592213988304138,
0.11160378158092499,
-0.15220531821250916,
-0.24316763877868652,
0.1219312846660614,
0.010453056544065475,
0.00028255581855773926,
-0.22380346059799194,
-0.24330902099609375,
0.3272305130958557,
-0.33021119236946106,
-0.011154694482684135,
0.10354730486869812,
-0.14800149202346802,
0.3336285352706909,
0.05236662179231644,
-0.5574278235435486,
-0.20693136751651764,
0.1292320042848587,
0.13831284642219543,
0.1710684895515442,
0.02174443192780018,
0.39856505393981934,
0.21623286604881287,
0.045122887939214706,
-0.09694661945104599,
-0.23236633837223053,
0.11263997852802277,
-0.06279313564300537,
0.554886519908905,
0.30375048518180847,
0.2511621415615082,
0.29913535714149475,
0.7793206572532654,
0.07405170798301697,
-0.09577526152133942,
0.41953784227371216,
0.13897928595542908,
0.12475499510765076,
-0.1813717484474182,
-0.25396832823753357,
-0.02774508111178875,
-0.35058534145355225,
-0.0828767716884613,
-0.05723302811384201,
0.13619941473007202,
-0.24595412611961365,
-0.11721646785736084,
0.05967714637517929,
0.0623604953289032,
-0.3993094563484192,
0.08070574700832367,
-0.4387771189212799,
0.16053161025047302,
0.2992897033691406,
0.11759741604328156,
-0.3223702907562256,
0.12873785197734833,
0.15007193386554718,
0.22944921255111694,
0.3082166016101837,
0.3706430494785309,
-0.3179192543029785,
-0.11095269024372101,
-0.4043367803096771,
0.19441422820091248,
-0.24634414911270142,
0.3297159671783447,
0.023623093962669373,
-0.11651486158370972,
-0.13531970977783203,
-0.19021984934806824,
0.7564859986305237,
-0.19170129299163818,
-0.2290356308221817,
0.020214654505252838,
0.013818889856338501,
-0.25090810656547546,
-0.23399090766906738,
0.38728803396224976,
0.4751867651939392,
0.2088044136762619,
0.4552731215953827,
0.04249472916126251,
0.00044265761971473694,
-0.31922009587287903,
0.2524062395095825,
-0.22387804090976715,
-0.016984794288873672,
-0.30608928203582764,
-0.08553538471460342,
-0.3974077105522156,
0.12704186141490936,
-0.021553590893745422,
-0.16702775657176971,
0.3104286789894104,
0.021034114062786102,
-0.3118874728679657,
-0.24919354915618896,
-0.022238120436668396,
0.2187894880771637,
0.47003817558288574,
-0.21334508061408997,
0.004551559686660767,
0.45510223507881165,
0.3576166331768036,
0.4720626473426819,
0.20101846754550934,
-0.5810461640357971,
0.021857455372810364,
0.09607760608196259,
-0.008085239678621292,
0.10543618351221085,
0.40873876214027405,
-0.18160367012023926,
0.1921570748090744,
-0.1328827440738678,
-0.23542949557304382,
0.006916888058185577,
0.1594935804605484,
0.051812492311000824,
0.2825574576854706,
-0.16581815481185913,
-0.2691357433795929,
-0.08085791766643524,
0.24193954467773438,
-0.12819184362888336,
0.18949514627456665,
-0.36998510360717773,
-0.3734288215637207,
0.19703947007656097,
0.05176790431141853,
1.0032918453216553,
0.08776279538869858,
0.35462769865989685,
-0.1127111092209816,
0.015017643570899963,
0.15077322721481323,
-0.32172584533691406,
0.5444294810295105,
-0.1611057072877884,
0.08832988142967224,
-0.11831052601337433,
-0.3116573095321655,
0.2271927297115326,
0.149783194065094,
-0.23605890572071075,
0.46648746728897095,
-0.10679757595062256,
0.05973894149065018,
0.00020761042833328247,
0.24587509036064148,
0.1634760946035385,
-0.14732466638088226,
0.032662902027368546,
-0.016172725707292557,
-0.03206757456064224,
0.37592846155166626,
-0.04541584104299545,
-0.054306235164403915,
0.11001431941986084,
-0.23293709754943848,
0.030558064579963684,
-0.1294316053390503,
-0.9258776307106018,
0.3282535672187805,
0.09596997499465942,
0.02001802623271942,
-0.22714030742645264,
0.04837240278720856,
0.23144397139549255,
0.011303004808723927,
-0.007499095052480698,
-0.041705694049596786,
0.44191470742225647,
-0.08159270882606506,
-0.3905560374259949,
-0.3983771502971649,
0.331906795501709,
-0.08565040677785873,
0.01978042721748352,
0.017398055642843246,
-0.07645188271999359,
-0.6288706660270691,
-0.176673024892807,
0.15549802780151367,
0.5999612212181091,
0.1938505470752716,
-0.006045840680599213,
0.11949382722377777,
-0.11824249476194382,
-0.17026406526565552,
0.022237733006477356,
-0.023242071270942688,
-0.06691177189350128,
0.28220972418785095,
-0.2588862478733063,
-0.049230098724365234,
-0.029194900766015053,
0.25289279222488403,
0.011834653094410896,
-0.10868419706821442,
0.38255590200424194,
-0.21542517840862274,
-0.17951998114585876,
-0.017818912863731384,
0.014177799224853516,
0.2445863038301468,
-0.027169786393642426,
0.2876221239566803,
-0.1983005255460739,
-0.1027131974697113,
0.204359769821167,
-0.20195820927619934,
0.32113131880760193,
0.23395442962646484,
-0.349972128868103,
-0.3595750629901886,
-0.42023321986198425,
-0.0033341310918331146,
-0.16941042244434357,
0.019136250019073486,
0.20576056838035583,
0.29001927375793457,
-0.25495511293411255,
0.13704517483711243,
-0.1505584567785263,
0.37761783599853516,
0.050509579479694366,
0.16125890612602234,
0.17333132028579712,
-0.25393959879875183,
0.11707968264818192,
0.04656911641359329,
-0.17962676286697388,
0.3091738522052765,
-0.2935192584991455,
-0.015303891152143478,
-0.2980252206325531,
0.18137648701667786,
-0.0037247873842716217,
-0.07537113130092621,
-0.041162073612213135,
-0.12993070483207703,
0.20853674411773682,
-0.20472973585128784,
0.042056649923324585,
0.13322600722312927,
-0.10758918523788452,
-0.09510130435228348,
0.3733781576156616,
0.0012026578187942505,
0.04561704397201538,
-0.19323493540287018,
-0.135175421833992,
-0.11971686780452728,
0.3481648862361908,
0.21982106566429138,
-0.20102906227111816,
0.1734069436788559,
-0.26266974210739136,
-0.056384503841400146,
-0.020619049668312073,
0.0848160907626152,
0.1907588541507721,
-0.2884886562824249,
-0.3081391751766205,
-0.0498826801776886,
-0.16583167016506195,
0.13403764367103577,
-0.017919478937983513,
-0.19671079516410828,
0.48095113039016724,
-0.000796106643974781,
-0.21140804886817932,
-0.3942602872848511,
0.28380030393600464,
-0.051823973655700684,
0.01699616014957428,
0.47240734100341797,
0.4947274923324585,
0.042541831731796265,
0.20560970902442932,
0.06272357702255249,
0.5799058675765991,
-0.2628825604915619,
0.17678982019424438,
-0.1071891337633133,
-0.06349898874759674,
0.16959717869758606,
0.48369041085243225,
0.22880828380584717,
0.12003405392169952,
0.028743479400873184,
-0.3425823450088501,
0.25767117738723755,
0.35624605417251587,
-0.1387435644865036,
-0.19855158030986786,
-0.31645748019218445,
0.025578774511814117,
0.15224292874336243,
0.012243296951055527,
0.4202966094017029,
-0.2728196680545807,
0.29968804121017456,
-0.14108437299728394,
-0.23962031304836273,
0.0017053484916687012,
0.25554659962654114,
-0.2840942442417145,
-0.35371890664100647,
0.08885408937931061,
-0.26769503951072693,
-0.055033884942531586,
-0.03538057580590248,
-0.034789878875017166,
0.1155112162232399,
0.06903354823589325,
-0.03264074772596359,
-0.1445118933916092,
-0.21169912815093994,
-0.097091905772686,
0.1886049509048462,
0.4124425947666168,
-0.14061784744262695,
0.32838961482048035,
-0.22854672372341156,
-0.12531842291355133,
-0.11551310122013092,
-0.08039356023073196,
0.4200288653373718,
0.4307584762573242,
-0.12289319932460785,
-0.3074115216732025,
-0.222432941198349,
0.18156908452510834,
-0.1569593846797943,
0.17291679978370667,
0.15501348674297333,
-0.5355120897293091,
-0.07645516097545624,
-0.10172396153211594,
0.039674945175647736,
0.2217915952205658,
0.08514335751533508,
0.10891732573509216,
-0.08726660907268524,
-0.008130893111228943,
0.13732114434242249,
-0.016888245940208435,
0.12902094423770905,
0.28158485889434814,
-0.4112524390220642,
0.03422633185982704,
0.4860614240169525,
-0.11915098875761032,
0.11953991651535034,
-0.23064757883548737,
0.03675299137830734,
0.07387371361255646,
0.19025957584381104,
0.2040441334247589,
-0.1458180546760559,
-0.36889761686325073,
0.08327476680278778,
-0.6383285522460938,
0.054537247866392136,
-0.28947770595550537,
-0.011073321104049683,
-0.17932695150375366,
0.02018875628709793,
-0.022693652659654617,
0.0803060382604599,
0.0770491436123848,
-0.0861624926328659,
0.0400114580988884,
-0.05501088872551918,
-0.3812565803527832,
0.06746058166027069,
0.3419487178325653,
0.1732785552740097,
0.15546578168869019,
-0.30299192667007446,
0.07648956775665283,
0.11602985858917236,
-0.017558671534061432,
0.03707689046859741,
-0.17140477895736694,
0.10673587024211884,
0.5438724756240845,
0.14893335103988647,
0.19903746247291565,
0.12268009781837463,
0.24859172105789185,
-0.18040597438812256,
-0.24890515208244324,
0.09330452978610992,
-0.034824393689632416,
-0.2344856858253479,
0.113393634557724,
0.2798028290271759,
-0.5586774945259094,
-0.3884328603744507,
-0.6991601586341858,
0.15864813327789307,
0.2613399028778076,
-0.5752149820327759,
0.04429356008768082,
0.16362541913986206,
0.022416889667510986,
0.2574107348918915,
0.1737845093011856,
0.6754014492034912,
-0.051644425839185715,
0.267989844083786,
-0.38467562198638916,
-0.027251776307821274,
0.41730809211730957,
-0.7116467356681824,
-0.21589426696300507,
-0.049279551953077316,
0.20828022062778473,
-0.04489143565297127,
-0.013206667266786098,
-0.1628139615058899,
-0.4337309002876282,
0.17964676022529602,
-0.07180330157279968,
-0.4017923176288605,
0.1582958847284317,
0.0030826255679130554,
0.15039008855819702,
-0.19367167353630066,
-0.13761885464191437,
0.2467314898967743,
-0.19170919060707092,
-0.09315267950296402,
-0.28066903352737427
] |
https://github.com/huggingface/datasets/issues/6195 | Thank you so much! I went through a lot of issues before finding similar experiences here. I have to say that the [docs](https://huggingface.co/docs/datasets/v2.11.0/en/package_reference/main_classes#datasets.Dataset.map) of `.map()` is really misleading, probably making people think that just assigning the file name to cache_file_name is enough. | Force to reuse cache at given path | ### Describe the bug
I have run the official example of MLM like:
```bash
python run_mlm.py \
--model_name_or_path roberta-base \
--dataset_name togethercomputer/RedPajama-Data-1T \
--dataset_config_name arxiv \
--per_device_train_batch_size 10 \
--preprocessing_num_workers 20 \
--validation_split_percentage 0 \
--cache_dir /project/huggingface_cache/datasets \
--line_by_line \
--do_train \
--pad_to_max_length \
--output_dir /project/huggingface_cache/test-mlm
```
it successfully runs and at my cache folder has `cache-1982fea76aa54a13_00001_of_00020.arrow`..... `cache-1982fea76aa54a13_00020_of_00020.arrow ` as tokenization cache of `map` method. And the cache works fine every time I run the command above.
However, when I switched to jupyter notebook (since I do not want to load datasets every time when I changed other parameters not related to the dataloading). It is not recognizing the cache files and starts to re-run the entire tokenization process.
I changed my code to
```python
tokenized_datasets = raw_datasets["train"].map(
tokenize_function,
batched=True,
num_proc=data_args.preprocessing_num_workers,
remove_columns=[text_column_name],
load_from_cache_file=True,
desc="Running tokenizer on dataset line_by_line",
# cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"}
cache_file_name="cache-1982fea76aa54a13.arrow",
new_fingerprint="1982fea76aa54a13"
)
```
it still does not recognize the previously cached files and trying to re-run the tokenization process.
### Steps to reproduce the bug
use jupyter notebook for dataset map function.
### Expected behavior
the map function accepts the given cache_file_name and new_fingerprint then load the previously cached files.
### Environment info
- `datasets` version: 2.14.4.dev0
- Platform: Linux-3.10.0-1160.59.1.el7.x86_64-x86_64-with-glibc2.10
- Python version: 3.8.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 42 | Force to reuse cache at given path
### Describe the bug
I have run the official example of MLM like:
```bash
python run_mlm.py \
--model_name_or_path roberta-base \
--dataset_name togethercomputer/RedPajama-Data-1T \
--dataset_config_name arxiv \
--per_device_train_batch_size 10 \
--preprocessing_num_workers 20 \
--validation_split_percentage 0 \
--cache_dir /project/huggingface_cache/datasets \
--line_by_line \
--do_train \
--pad_to_max_length \
--output_dir /project/huggingface_cache/test-mlm
```
it successfully runs and at my cache folder has `cache-1982fea76aa54a13_00001_of_00020.arrow`..... `cache-1982fea76aa54a13_00020_of_00020.arrow ` as tokenization cache of `map` method. And the cache works fine every time I run the command above.
However, when I switched to jupyter notebook (since I do not want to load datasets every time when I changed other parameters not related to the dataloading). It is not recognizing the cache files and starts to re-run the entire tokenization process.
I changed my code to
```python
tokenized_datasets = raw_datasets["train"].map(
tokenize_function,
batched=True,
num_proc=data_args.preprocessing_num_workers,
remove_columns=[text_column_name],
load_from_cache_file=True,
desc="Running tokenizer on dataset line_by_line",
# cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"}
cache_file_name="cache-1982fea76aa54a13.arrow",
new_fingerprint="1982fea76aa54a13"
)
```
it still does not recognize the previously cached files and trying to re-run the tokenization process.
### Steps to reproduce the bug
use jupyter notebook for dataset map function.
### Expected behavior
the map function accepts the given cache_file_name and new_fingerprint then load the previously cached files.
### Environment info
- `datasets` version: 2.14.4.dev0
- Platform: Linux-3.10.0-1160.59.1.el7.x86_64-x86_64-with-glibc2.10
- Python version: 3.8.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
Thank you so much! I went through a lot of issues before finding similar experiences here. I have to say that the [docs](https://huggingface.co/docs/datasets/v2.11.0/en/package_reference/main_classes#datasets.Dataset.map) of `.map()` is really misleading, probably making people think that just assigning the file name to cache_file_name is enough. | [
-0.0019599124789237976,
0.21225914359092712,
0.11871518194675446,
0.13832400739192963,
0.15499252080917358,
-0.021354787051677704,
0.43014252185821533,
0.15119801461696625,
0.028692856431007385,
-0.08496592938899994,
-0.05548159405589104,
0.5933548808097839,
-0.19288857281208038,
-0.1474481076002121,
0.15893521904945374,
0.05356813594698906,
-0.03520648926496506,
-0.03140578791499138,
0.08998394012451172,
0.19107630848884583,
-0.18464455008506775,
0.38084325194358826,
-0.08061625808477402,
0.03261445462703705,
-0.7064418792724609,
0.07463787496089935,
-0.08761599659919739,
0.1490778923034668,
0.09203644841909409,
-0.6049376726150513,
0.22068151831626892,
-0.05583963170647621,
0.27281585335731506,
0.4594793915748596,
-0.00012548912491183728,
0.028297744691371918,
0.11337949335575104,
-0.20154467225074768,
-0.34064382314682007,
-0.07491051405668259,
0.257650226354599,
-0.06358727812767029,
0.23020556569099426,
-0.22399604320526123,
-0.26582416892051697,
0.05149431899189949,
-0.01409549918025732,
-0.480715274810791,
0.5738639235496521,
0.3253915309906006,
0.07309828698635101,
0.13906580209732056,
-0.05508047714829445,
0.2530147433280945,
-0.03272812440991402,
0.0934092178940773,
-0.06813852488994598,
0.14686234295368195,
0.1035749763250351,
-0.20632371306419373,
-0.32595211267471313,
0.3560238480567932,
-0.21353167295455933,
0.28117886185646057,
0.3125131130218506,
0.0324578694999218,
0.34682488441467285,
-0.062381867319345474,
-0.10168499499559402,
-0.06834915280342102,
0.26918089389801025,
-0.32520928978919983,
-0.0711044892668724,
-0.33395275473594666,
-0.3949891924858093,
-0.46218228340148926,
0.1349393129348755,
-0.08443999290466309,
-0.08264951407909393,
0.3351578116416931,
0.0377865694463253,
-0.11186075210571289,
0.1580285131931305,
0.07324975728988647,
0.05580252408981323,
0.1482306569814682,
-0.06900624185800552,
0.0598970502614975,
0.15036912262439728,
-0.007707870099693537,
0.3076198697090149,
-0.033146150410175323,
-0.00829622708261013,
0.1046472117304802,
-0.051346927881240845,
0.01685366779565811,
-0.006383864209055901,
-0.006286434829235077,
-0.017182745039463043,
-0.03459650278091431,
0.3518798053264618,
0.11447704583406448,
0.24251562356948853,
0.3043938875198364,
-0.12685319781303406,
0.5009726285934448,
0.03507181257009506,
0.24267536401748657,
0.4693288207054138,
0.1072545051574707,
-0.4557221531867981,
-0.14414235949516296,
-0.08001061528921127,
-0.09634473919868469,
0.1828523576259613,
0.33659055829048157,
-0.0020801350474357605,
-0.02417127788066864,
-0.06656581908464432,
-0.12169162929058075,
-0.25907307863235474,
-0.25355595350265503,
0.2998605966567993,
0.1380496770143509,
0.04180722311139107,
0.1485280692577362,
-0.016374602913856506,
0.04058373346924782,
-0.24092695116996765,
-0.32746395468711853,
-0.028960149735212326,
0.03186297416687012,
-0.4527376890182495,
0.2704918384552002,
0.42387259006500244,
0.3906724154949188,
0.5555502772331238,
-0.05232919007539749,
0.10028950870037079,
-0.19686606526374817,
0.42399513721466064,
-0.0038474053144454956,
0.17305803298950195,
0.05636153370141983,
-0.22873374819755554,
0.12461166083812714,
0.3165273666381836,
-0.1408536732196808,
-0.16804125905036926,
0.06273537874221802,
-0.5256358981132507,
-0.3321191668510437,
0.5088341236114502,
-0.08557234704494476,
0.08521203696727753,
0.2051135152578354,
-0.2780589759349823,
-0.017941314727067947,
0.42740878462791443,
-0.05371803045272827,
-0.009796537458896637,
-0.19871006906032562,
0.07865703105926514,
-0.22079326212406158,
0.11335085332393646,
0.48001450300216675,
-0.18394486606121063,
-0.28694263100624084,
-0.09413141012191772,
0.34495535492897034,
0.3563363254070282,
0.3471842110157013,
-0.4133475720882416,
0.25076547265052795,
-0.3999623954296112,
0.08310355246067047,
0.2546951472759247,
-0.5813862085342407,
-0.320488840341568,
-0.06372342258691788,
-0.1342913806438446,
0.3589874804019928,
0.2788553535938263,
-0.018877189606428146,
0.10975369065999985,
-0.000011846423149108887,
0.23670396208763123,
0.26223912835121155,
0.2132938951253891,
-0.0832088440656662,
-0.5358511209487915,
-0.18884646892547607,
-0.023691069334745407,
-0.17891845107078552,
0.10436289757490158,
0.13246920704841614,
0.08169740438461304,
0.11931167542934418,
-0.010049194097518921,
-0.12754549086093903,
0.045153290033340454,
0.013287529349327087,
-0.1864577829837799,
-0.06660859286785126,
0.3005582392215729,
0.26610445976257324,
0.04916030913591385,
0.2957589626312256,
-0.3825792074203491,
-0.30063825845718384,
-0.05044369399547577,
-0.08505863696336746,
0.09610948711633682,
-0.29245585203170776,
-0.46819719672203064,
-0.639987587928772,
0.01169099286198616,
0.1617637425661087,
0.4083581864833832,
0.041200391948223114,
-0.15428940951824188,
0.24214689433574677,
0.24880245327949524,
0.2655014991760254,
-0.06939446926116943,
-0.061050210148096085,
-0.12839631736278534,
-0.21236906945705414,
-0.2085002064704895,
0.10897059738636017,
0.39805588126182556,
-0.19420282542705536,
0.01598547026515007,
0.23713164031505585,
0.4011104702949524,
-0.03138997405767441,
-0.24745717644691467,
0.2159687727689743,
-0.03946777433156967,
0.18285441398620605,
0.14090608060359955,
0.24508991837501526,
-0.09909432381391525,
-0.11340035498142242,
0.24567969143390656,
0.4803767204284668,
0.1567598581314087,
0.07199769467115402,
-0.02166144549846649,
0.08176153898239136,
0.1525040864944458,
-0.26226094365119934,
-0.1750447303056717,
-0.17323096096515656,
0.17655111849308014,
-0.09191178530454636,
0.07515989243984222,
-0.005454452708363533,
-0.007788203656673431,
0.04496511444449425,
0.30047568678855896,
0.3645269274711609,
0.22555160522460938,
-0.15629997849464417,
-0.4485896825790405,
0.06266935169696808,
0.12292514741420746,
0.19704915583133698,
0.3940088748931885,
0.12858912348747253,
0.1584727168083191,
0.1117103174328804,
-0.018680870532989502,
-0.20485971868038177,
0.13447844982147217,
-0.05948485806584358,
0.14210906624794006,
0.14026428759098053,
0.1305672526359558,
0.07128173112869263,
-0.3167641758918762,
0.2845047414302826,
0.14575186371803284,
0.013421570882201195,
-0.11393740028142929,
0.2444000095129013,
-0.5909275412559509,
-0.16468465328216553,
-0.3093941807746887,
-0.029184896498918533,
0.16688551008701324,
-0.17174828052520752,
-0.11102746427059174,
0.4724828600883484,
0.33788546919822693,
0.24936401844024658,
0.279594361782074,
0.4157329797744751,
-0.15045571327209473,
-0.046197663992643356,
0.0028348416090011597,
-0.19240382313728333,
-0.3455633521080017,
-0.14302507042884827,
0.41266345977783203,
-0.30414462089538574,
-0.051439687609672546,
-0.12396642565727234,
0.119259312748909,
-0.42658740282058716,
-0.3473316431045532,
0.07449635863304138,
0.3673114776611328,
0.3003538250923157,
-0.0008522793650627136,
0.09605433791875839,
-0.17523539066314697,
-0.06423164904117584,
0.05698481574654579,
0.012435413897037506,
-0.1311943531036377,
-0.1500665247440338,
0.04767095297574997,
-0.03325199335813522,
-0.14074063301086426,
-0.054645463824272156,
-0.3031342923641205,
-0.1561642289161682,
0.16973519325256348,
0.03592213988304138,
0.11160378158092499,
-0.15220531821250916,
-0.24316763877868652,
0.1219312846660614,
0.010453056544065475,
0.00028255581855773926,
-0.22380346059799194,
-0.24330902099609375,
0.3272305130958557,
-0.33021119236946106,
-0.011154694482684135,
0.10354730486869812,
-0.14800149202346802,
0.3336285352706909,
0.05236662179231644,
-0.5574278235435486,
-0.20693136751651764,
0.1292320042848587,
0.13831284642219543,
0.1710684895515442,
0.02174443192780018,
0.39856505393981934,
0.21623286604881287,
0.045122887939214706,
-0.09694661945104599,
-0.23236633837223053,
0.11263997852802277,
-0.06279313564300537,
0.554886519908905,
0.30375048518180847,
0.2511621415615082,
0.29913535714149475,
0.7793206572532654,
0.07405170798301697,
-0.09577526152133942,
0.41953784227371216,
0.13897928595542908,
0.12475499510765076,
-0.1813717484474182,
-0.25396832823753357,
-0.02774508111178875,
-0.35058534145355225,
-0.0828767716884613,
-0.05723302811384201,
0.13619941473007202,
-0.24595412611961365,
-0.11721646785736084,
0.05967714637517929,
0.0623604953289032,
-0.3993094563484192,
0.08070574700832367,
-0.4387771189212799,
0.16053161025047302,
0.2992897033691406,
0.11759741604328156,
-0.3223702907562256,
0.12873785197734833,
0.15007193386554718,
0.22944921255111694,
0.3082166016101837,
0.3706430494785309,
-0.3179192543029785,
-0.11095269024372101,
-0.4043367803096771,
0.19441422820091248,
-0.24634414911270142,
0.3297159671783447,
0.023623093962669373,
-0.11651486158370972,
-0.13531970977783203,
-0.19021984934806824,
0.7564859986305237,
-0.19170129299163818,
-0.2290356308221817,
0.020214654505252838,
0.013818889856338501,
-0.25090810656547546,
-0.23399090766906738,
0.38728803396224976,
0.4751867651939392,
0.2088044136762619,
0.4552731215953827,
0.04249472916126251,
0.00044265761971473694,
-0.31922009587287903,
0.2524062395095825,
-0.22387804090976715,
-0.016984794288873672,
-0.30608928203582764,
-0.08553538471460342,
-0.3974077105522156,
0.12704186141490936,
-0.021553590893745422,
-0.16702775657176971,
0.3104286789894104,
0.021034114062786102,
-0.3118874728679657,
-0.24919354915618896,
-0.022238120436668396,
0.2187894880771637,
0.47003817558288574,
-0.21334508061408997,
0.004551559686660767,
0.45510223507881165,
0.3576166331768036,
0.4720626473426819,
0.20101846754550934,
-0.5810461640357971,
0.021857455372810364,
0.09607760608196259,
-0.008085239678621292,
0.10543618351221085,
0.40873876214027405,
-0.18160367012023926,
0.1921570748090744,
-0.1328827440738678,
-0.23542949557304382,
0.006916888058185577,
0.1594935804605484,
0.051812492311000824,
0.2825574576854706,
-0.16581815481185913,
-0.2691357433795929,
-0.08085791766643524,
0.24193954467773438,
-0.12819184362888336,
0.18949514627456665,
-0.36998510360717773,
-0.3734288215637207,
0.19703947007656097,
0.05176790431141853,
1.0032918453216553,
0.08776279538869858,
0.35462769865989685,
-0.1127111092209816,
0.015017643570899963,
0.15077322721481323,
-0.32172584533691406,
0.5444294810295105,
-0.1611057072877884,
0.08832988142967224,
-0.11831052601337433,
-0.3116573095321655,
0.2271927297115326,
0.149783194065094,
-0.23605890572071075,
0.46648746728897095,
-0.10679757595062256,
0.05973894149065018,
0.00020761042833328247,
0.24587509036064148,
0.1634760946035385,
-0.14732466638088226,
0.032662902027368546,
-0.016172725707292557,
-0.03206757456064224,
0.37592846155166626,
-0.04541584104299545,
-0.054306235164403915,
0.11001431941986084,
-0.23293709754943848,
0.030558064579963684,
-0.1294316053390503,
-0.9258776307106018,
0.3282535672187805,
0.09596997499465942,
0.02001802623271942,
-0.22714030742645264,
0.04837240278720856,
0.23144397139549255,
0.011303004808723927,
-0.007499095052480698,
-0.041705694049596786,
0.44191470742225647,
-0.08159270882606506,
-0.3905560374259949,
-0.3983771502971649,
0.331906795501709,
-0.08565040677785873,
0.01978042721748352,
0.017398055642843246,
-0.07645188271999359,
-0.6288706660270691,
-0.176673024892807,
0.15549802780151367,
0.5999612212181091,
0.1938505470752716,
-0.006045840680599213,
0.11949382722377777,
-0.11824249476194382,
-0.17026406526565552,
0.022237733006477356,
-0.023242071270942688,
-0.06691177189350128,
0.28220972418785095,
-0.2588862478733063,
-0.049230098724365234,
-0.029194900766015053,
0.25289279222488403,
0.011834653094410896,
-0.10868419706821442,
0.38255590200424194,
-0.21542517840862274,
-0.17951998114585876,
-0.017818912863731384,
0.014177799224853516,
0.2445863038301468,
-0.027169786393642426,
0.2876221239566803,
-0.1983005255460739,
-0.1027131974697113,
0.204359769821167,
-0.20195820927619934,
0.32113131880760193,
0.23395442962646484,
-0.349972128868103,
-0.3595750629901886,
-0.42023321986198425,
-0.0033341310918331146,
-0.16941042244434357,
0.019136250019073486,
0.20576056838035583,
0.29001927375793457,
-0.25495511293411255,
0.13704517483711243,
-0.1505584567785263,
0.37761783599853516,
0.050509579479694366,
0.16125890612602234,
0.17333132028579712,
-0.25393959879875183,
0.11707968264818192,
0.04656911641359329,
-0.17962676286697388,
0.3091738522052765,
-0.2935192584991455,
-0.015303891152143478,
-0.2980252206325531,
0.18137648701667786,
-0.0037247873842716217,
-0.07537113130092621,
-0.041162073612213135,
-0.12993070483207703,
0.20853674411773682,
-0.20472973585128784,
0.042056649923324585,
0.13322600722312927,
-0.10758918523788452,
-0.09510130435228348,
0.3733781576156616,
0.0012026578187942505,
0.04561704397201538,
-0.19323493540287018,
-0.135175421833992,
-0.11971686780452728,
0.3481648862361908,
0.21982106566429138,
-0.20102906227111816,
0.1734069436788559,
-0.26266974210739136,
-0.056384503841400146,
-0.020619049668312073,
0.0848160907626152,
0.1907588541507721,
-0.2884886562824249,
-0.3081391751766205,
-0.0498826801776886,
-0.16583167016506195,
0.13403764367103577,
-0.017919478937983513,
-0.19671079516410828,
0.48095113039016724,
-0.000796106643974781,
-0.21140804886817932,
-0.3942602872848511,
0.28380030393600464,
-0.051823973655700684,
0.01699616014957428,
0.47240734100341797,
0.4947274923324585,
0.042541831731796265,
0.20560970902442932,
0.06272357702255249,
0.5799058675765991,
-0.2628825604915619,
0.17678982019424438,
-0.1071891337633133,
-0.06349898874759674,
0.16959717869758606,
0.48369041085243225,
0.22880828380584717,
0.12003405392169952,
0.028743479400873184,
-0.3425823450088501,
0.25767117738723755,
0.35624605417251587,
-0.1387435644865036,
-0.19855158030986786,
-0.31645748019218445,
0.025578774511814117,
0.15224292874336243,
0.012243296951055527,
0.4202966094017029,
-0.2728196680545807,
0.29968804121017456,
-0.14108437299728394,
-0.23962031304836273,
0.0017053484916687012,
0.25554659962654114,
-0.2840942442417145,
-0.35371890664100647,
0.08885408937931061,
-0.26769503951072693,
-0.055033884942531586,
-0.03538057580590248,
-0.034789878875017166,
0.1155112162232399,
0.06903354823589325,
-0.03264074772596359,
-0.1445118933916092,
-0.21169912815093994,
-0.097091905772686,
0.1886049509048462,
0.4124425947666168,
-0.14061784744262695,
0.32838961482048035,
-0.22854672372341156,
-0.12531842291355133,
-0.11551310122013092,
-0.08039356023073196,
0.4200288653373718,
0.4307584762573242,
-0.12289319932460785,
-0.3074115216732025,
-0.222432941198349,
0.18156908452510834,
-0.1569593846797943,
0.17291679978370667,
0.15501348674297333,
-0.5355120897293091,
-0.07645516097545624,
-0.10172396153211594,
0.039674945175647736,
0.2217915952205658,
0.08514335751533508,
0.10891732573509216,
-0.08726660907268524,
-0.008130893111228943,
0.13732114434242249,
-0.016888245940208435,
0.12902094423770905,
0.28158485889434814,
-0.4112524390220642,
0.03422633185982704,
0.4860614240169525,
-0.11915098875761032,
0.11953991651535034,
-0.23064757883548737,
0.03675299137830734,
0.07387371361255646,
0.19025957584381104,
0.2040441334247589,
-0.1458180546760559,
-0.36889761686325073,
0.08327476680278778,
-0.6383285522460938,
0.054537247866392136,
-0.28947770595550537,
-0.011073321104049683,
-0.17932695150375366,
0.02018875628709793,
-0.022693652659654617,
0.0803060382604599,
0.0770491436123848,
-0.0861624926328659,
0.0400114580988884,
-0.05501088872551918,
-0.3812565803527832,
0.06746058166027069,
0.3419487178325653,
0.1732785552740097,
0.15546578168869019,
-0.30299192667007446,
0.07648956775665283,
0.11602985858917236,
-0.017558671534061432,
0.03707689046859741,
-0.17140477895736694,
0.10673587024211884,
0.5438724756240845,
0.14893335103988647,
0.19903746247291565,
0.12268009781837463,
0.24859172105789185,
-0.18040597438812256,
-0.24890515208244324,
0.09330452978610992,
-0.034824393689632416,
-0.2344856858253479,
0.113393634557724,
0.2798028290271759,
-0.5586774945259094,
-0.3884328603744507,
-0.6991601586341858,
0.15864813327789307,
0.2613399028778076,
-0.5752149820327759,
0.04429356008768082,
0.16362541913986206,
0.022416889667510986,
0.2574107348918915,
0.1737845093011856,
0.6754014492034912,
-0.051644425839185715,
0.267989844083786,
-0.38467562198638916,
-0.027251776307821274,
0.41730809211730957,
-0.7116467356681824,
-0.21589426696300507,
-0.049279551953077316,
0.20828022062778473,
-0.04489143565297127,
-0.013206667266786098,
-0.1628139615058899,
-0.4337309002876282,
0.17964676022529602,
-0.07180330157279968,
-0.4017923176288605,
0.1582958847284317,
0.0030826255679130554,
0.15039008855819702,
-0.19367167353630066,
-0.13761885464191437,
0.2467314898967743,
-0.19170919060707092,
-0.09315267950296402,
-0.28066903352737427
] |
https://github.com/huggingface/datasets/issues/6194 | The `fingerprint` parameter serves a slightly different purpose - we use it to inject a new fingerprint after transforming a `Dataset` (computed from the previous fingerprint + transform + transform args), e.g., to be able to compute the cache file for a transform. There is no concept of `fingerprint` before a `Dataset` is fully initialized, but we still need to hash the args (e.g., generator func) of the "dataset creation methods" (`from_generator`, `from_csv`, etc.) to compute the cache directory (to store the initial version and transformed dataset versions)
I agree it should be easier to bypass the hashing mechanism in this instance, too. However, we should probably first address https://github.com/huggingface/datasets/issues/5080 before solving this (e.g., maybe exposing `hash` in `load_dataset`/`load_dataset_builder`. | Support custom fingerprinting with `Dataset.from_generator` | ### Feature request
When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`.
### Motivation
Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash.
### Your contribution
If validated, I can try to submit a PR for this. | 119 | Support custom fingerprinting with `Dataset.from_generator`
### Feature request
When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`.
### Motivation
Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash.
### Your contribution
If validated, I can try to submit a PR for this.
The `fingerprint` parameter serves a slightly different purpose - we use it to inject a new fingerprint after transforming a `Dataset` (computed from the previous fingerprint + transform + transform args), e.g., to be able to compute the cache file for a transform. There is no concept of `fingerprint` before a `Dataset` is fully initialized, but we still need to hash the args (e.g., generator func) of the "dataset creation methods" (`from_generator`, `from_csv`, etc.) to compute the cache directory (to store the initial version and transformed dataset versions)
I agree it should be easier to bypass the hashing mechanism in this instance, too. However, we should probably first address https://github.com/huggingface/datasets/issues/5080 before solving this (e.g., maybe exposing `hash` in `load_dataset`/`load_dataset_builder`. | [
-0.37626779079437256,
0.12814950942993164,
0.07224499434232712,
0.08254784345626831,
0.030975818634033203,
0.048969365656375885,
0.46350806951522827,
0.19914063811302185,
0.04077352583408356,
0.3023551106452942,
0.10347207635641098,
0.359960675239563,
-0.3150944411754608,
0.39351311326026917,
0.20371508598327637,
-0.02324279583990574,
-0.11796510219573975,
0.055483777076005936,
-0.27201753854751587,
0.21806730329990387,
-0.2015593945980072,
0.07073748856782913,
0.0020903199911117554,
0.2669888138771057,
-0.19774991273880005,
0.009127562865614891,
0.054199256002902985,
0.3388708531856537,
-0.17092593014240265,
-0.5105201005935669,
0.05623873323202133,
0.1974961906671524,
-0.009039413183927536,
0.24576380848884583,
-0.00010991488670697436,
0.17838890850543976,
0.16597811877727509,
-0.06900636106729507,
-0.07398761808872223,
0.0004529133439064026,
-0.09497383236885071,
0.1820671260356903,
-0.31535589694976807,
-0.19060958921909332,
-0.09289418160915375,
-0.18682095408439636,
0.0372268408536911,
-0.11630240827798843,
0.31690630316734314,
-0.24853426218032837,
0.23390333354473114,
0.20088151097297668,
0.16052238643169403,
-0.002273406833410263,
0.06940573453903198,
0.592983603477478,
-0.21861296892166138,
-0.004917804151773453,
0.26632630825042725,
-0.1960543394088745,
-0.2184564620256424,
0.2682291269302368,
0.13615508377552032,
-0.3149535357952118,
0.4789253771305084,
0.005687329918146133,
0.10854887962341309,
-0.07701556384563446,
-0.04028875380754471,
0.5590988397598267,
0.19329603016376495,
-0.3512749969959259,
-0.22831061482429504,
-0.5018240809440613,
-0.0021978355944156647,
-0.08089366555213928,
0.20835353434085846,
-0.16700825095176697,
-0.33600008487701416,
0.3731277883052826,
-0.4757448136806488,
-0.17013134062290192,
-0.20912490785121918,
-0.20690028369426727,
0.14022311568260193,
-0.11252889037132263,
-0.09061454236507416,
0.1754409819841385,
0.30718129873275757,
0.027438081800937653,
-0.11853739619255066,
-0.06610189378261566,
-0.019789502024650574,
0.0760735422372818,
0.028399746865034103,
-0.2788029909133911,
0.08480079472064972,
0.22394904494285583,
0.3638552129268646,
0.06031961739063263,
0.24574044346809387,
0.20588210225105286,
-0.1612868309020996,
0.085455983877182,
0.20037132501602173,
-0.21806108951568604,
0.0006522666662931442,
0.07451853156089783,
0.11676877737045288,
-0.05142456665635109,
-0.09334812313318253,
0.06756673753261566,
0.19925859570503235,
-0.26843392848968506,
0.3247185945510864,
0.06611005961894989,
0.04054173827171326,
-0.025838986039161682,
0.3081471025943756,
-0.32079508900642395,
-0.05691874772310257,
0.006983377039432526,
0.2879962921142578,
0.273998498916626,
-0.055997565388679504,
-0.09941792488098145,
-0.11202502995729446,
-0.29285141825675964,
-0.06274650245904922,
-0.20663858950138092,
-0.1376473754644394,
-0.1092257872223854,
-0.26265057921409607,
0.3435702919960022,
-0.051985565572977066,
-0.3381448984146118,
0.15209129452705383,
0.048339348286390305,
0.16466476023197174,
0.2545676827430725,
0.30156514048576355,
0.17020687460899353,
0.31505873799324036,
-0.05677618831396103,
-0.27234646677970886,
-0.13585500419139862,
-0.002240303438156843,
-0.10320460051298141,
-0.25034016370773315,
0.15137368440628052,
-0.16596288979053497,
-0.4990198612213135,
-0.1885129064321518,
0.16589821875095367,
-0.32544374465942383,
0.07114512473344803,
-0.3677956461906433,
0.03719305992126465,
0.05734192207455635,
-0.11302909255027771,
0.001124892383813858,
-0.011584431864321232,
-0.38470324873924255,
-0.32677409052848816,
0.1140400767326355,
0.4778541326522827,
-0.21864458918571472,
-0.2652480900287628,
-0.13621310889720917,
-0.2965533137321472,
-0.08802048861980438,
-0.16285359859466553,
-0.38076111674308777,
0.3492225408554077,
-0.4666573405265808,
0.20235061645507812,
0.20687206089496613,
-0.25128692388534546,
-0.26631948351860046,
0.21232400834560394,
-0.15216222405433655,
0.2831186056137085,
0.11501958966255188,
0.21195068955421448,
0.09468159079551697,
-0.26369547843933105,
-0.09989836066961288,
0.17160820960998535,
-0.21969422698020935,
0.06267703324556351,
-0.25582611560821533,
-0.4163089096546173,
0.1312815248966217,
0.2576014995574951,
-0.0034656128846108913,
0.05646003037691116,
0.11323843896389008,
-0.17871838808059692,
0.22297298908233643,
-0.3835095763206482,
0.0988171324133873,
0.08371062576770782,
0.41887417435646057,
-0.1997283697128296,
-0.14921560883522034,
-0.05967089161276817,
-0.4711567163467407,
0.4938598871231079,
-0.3022031784057617,
-0.09540845453739166,
-0.19051474332809448,
-0.2790149748325348,
0.19883255660533905,
-0.058319102972745895,
-0.3170482814311981,
-0.07980851083993912,
0.047111205756664276,
0.1751173585653305,
0.09728996455669403,
-0.23720122873783112,
-0.29150569438934326,
0.051060453057289124,
-0.1293109655380249,
0.16138127446174622,
-0.5328481793403625,
-0.049670279026031494,
0.1762470304965973,
0.09799449145793915,
-0.2871202826499939,
0.11522217094898224,
0.05838030204176903,
-0.22815155982971191,
0.17359213531017303,
0.33413809537887573,
-0.13890020549297333,
0.21075616776943207,
-0.17446376383304596,
0.3394562005996704,
0.09895702451467514,
-0.32894957065582275,
0.04434245079755783,
-0.3417593538761139,
0.0005424432456493378,
-0.17054465413093567,
-0.04537668824195862,
0.6078081727027893,
-0.45863401889801025,
-0.015210404992103577,
-0.1618904322385788,
-0.09929974377155304,
-0.0607236847281456,
-0.1556057631969452,
-0.006984934210777283,
-0.2445441335439682,
-0.21904738247394562,
0.026407208293676376,
0.3491230607032776,
0.07898510992527008,
-0.33726853132247925,
0.09333175420761108,
0.2258516103029251,
0.023968897759914398,
-0.020504873245954514,
0.026901347562670708,
-0.036790963262319565,
-0.08495447039604187,
0.06314043700695038,
0.24800196290016174,
0.3473222851753235,
0.19458454847335815,
0.08959642052650452,
0.22329816222190857,
0.0789959728717804,
0.026828620582818985,
0.17696018517017365,
-0.25199568271636963,
-0.1788548082113266,
0.10436957329511642,
-0.09726864099502563,
0.017162173986434937,
-0.08724850416183472,
-0.18171162903308868,
0.17137572169303894,
-0.041758943349123,
-0.45499521493911743,
-0.027554012835025787,
-0.12957975268363953,
-0.0065581947565078735,
-0.191445454955101,
-0.3727045953273773,
-0.24781276285648346,
-0.18861016631126404,
0.20383299887180328,
0.20701119303703308,
-0.1806674599647522,
0.0762382373213768,
-0.2201518565416336,
0.3005405068397522,
-0.2726328670978546,
-0.36997079849243164,
-0.05535745620727539,
-0.06960438191890717,
0.05512647330760956,
0.14303836226463318,
0.2844672203063965,
0.16602879762649536,
0.3548523485660553,
-0.07251066714525223,
0.036954328417778015,
-0.3011428713798523,
-0.4337594211101532,
0.2734138071537018,
-0.11251157522201538,
0.43550804257392883,
0.5453752279281616,
-0.14738669991493225,
0.05252743512392044,
-0.0796588882803917,
0.0374842993915081,
-0.08420052379369736,
-0.2701496481895447,
-0.1815706044435501,
0.04408368095755577,
0.1682485044002533,
-0.17150439321994781,
0.16663970053195953,
-0.15119053423404694,
-0.24410778284072876,
0.21120111644268036,
0.09510212391614914,
0.24570420384407043,
0.4404575228691101,
0.038151901215314865,
0.1532239019870758,
-0.06857212632894516,
-0.037100568413734436,
-0.08193471282720566,
-0.9802570343017578,
0.22196350991725922,
-0.4527684152126312,
0.07282961905002594,
0.044878050684928894,
0.04136002063751221,
0.220045268535614,
0.30541378259658813,
-0.40762490034103394,
-0.5047259330749512,
-0.004321746528148651,
0.6155418157577515,
0.039946384727954865,
0.006885092705488205,
0.13497081398963928,
0.37437936663627625,
-0.008430637419223785,
-0.002529747784137726,
-0.09574443101882935,
-0.009773969650268555,
-0.2386905997991562,
0.25885626673698425,
0.3025338649749756,
0.17033155262470245,
0.12407277524471283,
1.1659464836120605,
0.04343190789222717,
-0.383893221616745,
0.19314013421535492,
-0.07129943370819092,
0.4348633587360382,
-0.26891008019447327,
-0.3017897605895996,
-0.002650640904903412,
0.200474351644516,
0.16421937942504883,
0.004545796662569046,
0.06842296570539474,
0.27412787079811096,
0.025857500731945038,
0.003009125590324402,
-0.3251681327819824,
-0.502956748008728,
0.1531050205230713,
0.048806823790073395,
0.22048702836036682,
-0.22278815507888794,
0.17063306272029877,
-0.33170562982559204,
-0.10196849703788757,
0.2884857654571533,
0.17761366069316864,
0.4760344922542572,
-0.1620052009820938,
-0.42223700881004333,
0.25303003191947937,
-0.36691734194755554,
0.1960071623325348,
0.27087128162384033,
-0.2077445685863495,
-0.14871416985988617,
-0.24097241461277008,
-0.05254082381725311,
0.05145915225148201,
0.6129560470581055,
-0.3173772394657135,
0.24750655889511108,
0.09255978465080261,
-0.5091999173164368,
0.18138790130615234,
0.2555460035800934,
0.4354478418827057,
0.15183977782726288,
0.014649521559476852,
0.30839014053344727,
-0.2506152391433716,
-0.20486928522586823,
0.08593198657035828,
0.2877762019634247,
-0.13653510808944702,
-0.16289055347442627,
0.11861549317836761,
-0.20405258238315582,
-0.04521065950393677,
-0.02520182728767395,
-0.09132198989391327,
0.1039029061794281,
0.1298123002052307,
-0.14913839101791382,
-0.3244292140007019,
-0.140751451253891,
0.04509498551487923,
0.26684120297431946,
0.04421728476881981,
-0.17380766570568085,
0.33447933197021484,
0.19878602027893066,
0.025916967540979385,
0.22582760453224182,
0.5541197061538696,
-0.2860269248485565,
-0.5226189494132996,
-0.12218523025512695,
-0.07794851064682007,
0.004435397684574127,
0.41981810331344604,
0.06136133149266243,
0.12519177794456482,
0.22774291038513184,
0.07545226067304611,
-0.2861485779285431,
0.038333967328071594,
-0.14116501808166504,
-0.0501721054315567,
-0.3910399079322815,
-0.18790042400360107,
0.41561511158943176,
0.09678855538368225,
-0.2506682872772217,
0.5022731423377991,
0.19806037843227386,
-0.5636282563209534,
0.2730189561843872,
0.22765731811523438,
1.0330947637557983,
-0.20852524042129517,
-0.02134406566619873,
-0.2209501564502716,
0.0408310666680336,
0.3152846097946167,
0.2782368063926697,
-0.2366805374622345,
-0.4453059434890747,
-0.33347442746162415,
-0.1407395899295807,
-0.17459958791732788,
0.23047736287117004,
0.21477897465229034,
0.012428365647792816,
0.08486002683639526,
0.03456816077232361,
0.025447620078921318,
-0.2636133134365082,
0.19021689891815186,
0.012115610763430595,
-0.3168758749961853,
0.02134193852543831,
0.12864118814468384,
0.1734946221113205,
-0.17069491744041443,
0.013212382793426514,
-0.31647929549217224,
0.3230816721916199,
-0.19982030987739563,
-0.22266224026679993,
-0.08689258247613907,
-0.3290954530239105,
-0.1432114690542221,
0.5509881377220154,
-0.02374918758869171,
0.36770153045654297,
0.3001563847064972,
0.4507441520690918,
0.10787065327167511,
-0.16177967190742493,
0.22054077684879303,
-0.00941401720046997,
0.4241198003292084,
-0.1473117172718048,
-0.014096271246671677,
0.37629249691963196,
0.11401589214801788,
-0.11538271605968475,
0.22454297542572021,
-0.09867005050182343,
-0.7378588914871216,
-0.1496788114309311,
-0.008265320211648941,
0.11952988058328629,
-0.19018793106079102,
0.1553993672132492,
-0.25756508111953735,
-0.054717376828193665,
-0.10546441376209259,
0.1086365282535553,
0.21547608077526093,
-0.22042690217494965,
0.19587451219558716,
-0.03370193392038345,
-0.11858362704515457,
0.0380714125931263,
0.15620265901088715,
-0.3537656366825104,
0.20951825380325317,
0.142393559217453,
0.025495201349258423,
-0.08508504927158356,
-0.18385133147239685,
0.047918274998664856,
0.2683295011520386,
-0.24005335569381714,
-0.03592154011130333,
0.21520709991455078,
0.2471216320991516,
0.2502923607826233,
0.39367929100990295,
0.10914124548435211,
-0.028103817254304886,
-0.002133592963218689,
-0.0906682163476944,
-0.3382944166660309,
0.02628456987440586,
-0.11878761649131775,
0.36410343647003174,
0.09046651422977448,
0.15701007843017578,
-0.287349671125412,
0.23924262821674347,
-0.4018440842628479,
0.24612580239772797,
0.012492448091506958,
0.039464518427848816,
0.2416086494922638,
0.18699926137924194,
0.05003524199128151,
-0.1686323881149292,
0.0996529757976532,
0.35351085662841797,
-0.32943591475486755,
-0.17935335636138916,
-0.29305723309516907,
0.19303685426712036,
0.03481786325573921,
-0.11711762845516205,
0.04330409690737724,
0.19847913086414337,
-0.05957913398742676,
-0.08542777597904205,
0.48901626467704773,
0.24325397610664368,
-0.07074752449989319,
-0.008855395019054413,
0.10696573555469513,
0.1633796989917755,
-0.35458362102508545,
0.1954137086868286,
-0.14279551804065704,
0.37042081356048584,
-0.0047730952501297,
0.1541704684495926,
-0.5203458070755005,
-0.1536634862422943,
0.14923956990242004,
0.18797297775745392,
0.2277524173259735,
-0.18495409190654755,
0.33819133043289185,
0.1828390508890152,
-0.09861388802528381,
0.39527595043182373,
0.23996010422706604,
-0.17615672945976257,
-0.22576338052749634,
-0.062432508915662766,
0.49566107988357544,
0.23589053750038147,
-0.043569281697273254,
-0.1075381189584732,
-0.023699577897787094,
0.08631471544504166,
0.19043874740600586,
0.38110387325286865,
0.1519182026386261,
0.009270519018173218,
-0.061399366706609726,
-0.2426101565361023,
0.19160254299640656,
-0.30128443241119385,
0.11476922035217285,
0.5395082831382751,
-0.43146994709968567,
-0.022840790450572968,
0.5369037389755249,
0.30991414189338684,
0.22580352425575256,
0.44692128896713257,
-0.2657650113105774,
0.33381766080856323,
-0.24528323113918304,
0.24204181134700775,
0.04982609301805496,
-0.4627024829387665,
0.46580004692077637,
0.48112836480140686,
0.051836952567100525,
0.27814751863479614,
0.03439926728606224,
0.6663768887519836,
-0.12104085087776184,
0.03827360272407532,
-0.03639610856771469,
0.4325556755065918,
0.21440374851226807,
-0.2737163305282593,
-0.25232425332069397,
-0.10412412136793137,
-0.26637428998947144,
0.12794043123722076,
-0.06152423098683357,
-0.38164222240448,
0.3165148198604584,
-0.007866453379392624,
-0.004937775433063507,
-0.15584741532802582,
-0.026696259155869484,
0.026422366499900818,
0.23001763224601746,
-0.35278207063674927,
-0.15113747119903564,
0.07209457457065582,
-0.06549738347530365,
0.37300750613212585,
0.3196277320384979,
0.16946926712989807,
-0.03994918614625931,
-0.051398713141679764,
0.10686540603637695,
-0.28029975295066833,
0.11555948853492737,
-0.19802621006965637,
0.0995364636182785,
-0.2686834931373596,
-0.14600099623203278,
0.39694714546203613,
0.18857331573963165,
-0.07424822449684143,
-0.23337754607200623,
0.008001644164323807,
0.40444162487983704,
-0.28602251410484314,
0.353504478931427,
0.04421839490532875,
-0.05774099752306938,
-0.044871971011161804,
0.06336242705583572,
0.042886361479759216,
-0.17726203799247742,
0.24065347015857697,
-0.06569749861955643,
0.11473345756530762,
-0.002988439053297043,
0.10656730085611343,
0.15176928043365479,
0.23433564603328705,
0.34297987818717957,
-0.269728422164917,
-0.2035059779882431,
0.0992981493473053,
-0.4141927659511566,
0.09825325757265091,
0.06583525240421295,
0.003990799188613892,
-0.05951419472694397,
-0.07811550796031952,
0.17364564538002014,
0.23827169835567474,
-0.07364779710769653,
0.036689333617687225,
0.20298831164836884,
0.5340637564659119,
-0.1349530965089798,
0.16758957505226135,
-0.05546766147017479,
-0.1811075210571289,
0.02350647747516632,
-0.4273619055747986,
0.10499873757362366,
0.09263388812541962,
0.07585549354553223,
-0.03539441525936127,
0.008766993880271912,
0.016760483384132385,
-0.09796194732189178,
0.5257403254508972,
0.13766056299209595,
0.10457523912191391,
-0.07707657665014267,
-0.1553339809179306,
-0.03181939572095871,
-0.025690561160445213,
-0.12710700929164886,
0.0755946934223175,
0.1728392392396927,
0.2964460253715515,
0.028931260108947754,
-0.11794799566268921,
-0.5299631953239441,
0.07036782801151276,
-0.016487441956996918,
0.10684338212013245,
-0.3104080259799957,
0.14743468165397644,
-0.33796024322509766,
-0.14926177263259888,
0.21229855716228485,
0.36393943428993225,
-0.013527961447834969,
-0.010190922766923904,
-0.15417170524597168,
-0.07706067711114883,
0.3549764156341553,
-0.6031278967857361,
-0.013077624142169952,
0.040641263127326965,
0.14401644468307495,
0.15184490382671356,
-0.37254735827445984,
-0.47094908356666565,
0.028708651661872864,
0.32469427585601807,
-0.0022513289004564285,
0.27811262011528015,
0.05807194486260414,
-0.12025681138038635,
0.08396613597869873,
-0.15692885220050812,
0.027539128437638283,
0.06571069359779358,
0.1330157220363617,
-0.004305243492126465,
-0.22442448139190674
] |
https://github.com/huggingface/datasets/issues/6194 | Adding +1 here:
If the generator needs to access some external resources or state, then it's not always straightforward to make it pickle-able. So I'd like to be able to override how the default cache key derivation needs to pickle the generator (and of course, I'd accept responsibility for that part of cache consistency).
Appears to be a recurrent roadbump: #6118 #5963 #5819 #5750 #4983 | Support custom fingerprinting with `Dataset.from_generator` | ### Feature request
When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`.
### Motivation
Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash.
### Your contribution
If validated, I can try to submit a PR for this. | 65 | Support custom fingerprinting with `Dataset.from_generator`
### Feature request
When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`.
### Motivation
Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash.
### Your contribution
If validated, I can try to submit a PR for this.
Adding +1 here:
If the generator needs to access some external resources or state, then it's not always straightforward to make it pickle-able. So I'd like to be able to override how the default cache key derivation needs to pickle the generator (and of course, I'd accept responsibility for that part of cache consistency).
Appears to be a recurrent roadbump: #6118 #5963 #5819 #5750 #4983 | [
-0.20553195476531982,
0.264360249042511,
0.09052132070064545,
0.10795579850673676,
-0.10179486870765686,
-0.042616620659828186,
0.43080437183380127,
0.2865421175956726,
0.1000044122338295,
0.22101201117038727,
0.3442264795303345,
0.5742281675338745,
-0.228618785738945,
0.23749396204948425,
0.11718642711639404,
-0.05980287864804268,
-0.16073578596115112,
-0.07205088436603546,
0.012771191075444221,
0.2019987255334854,
-0.21262165904045105,
0.07842640578746796,
-0.0026363059878349304,
0.22308097779750824,
-0.28537288308143616,
0.027616167441010475,
0.1519533395767212,
0.2579459846019745,
-0.16279292106628418,
-0.4834293723106384,
0.0431460365653038,
0.26530951261520386,
-0.043102070689201355,
0.1516541689634323,
-0.00011668945080600679,
-0.02718086540699005,
0.17651958763599396,
-0.046182550489902496,
-0.04950731247663498,
0.18568281829357147,
-0.1845088005065918,
0.3682734966278076,
-0.339706152677536,
-0.08525095880031586,
-0.0576242133975029,
0.04158588871359825,
0.014202505350112915,
-0.14538206160068512,
0.24331596493721008,
-0.2288322001695633,
0.19334444403648376,
0.01840616762638092,
0.09815719723701477,
-0.07065802812576294,
0.14337773621082306,
0.5442293882369995,
-0.26890257000923157,
0.0703754797577858,
0.39803802967071533,
-0.28400009870529175,
-0.19282549619674683,
0.25094592571258545,
-0.03834513574838638,
-0.23632094264030457,
0.5635094046592712,
-0.12155890464782715,
0.14036116003990173,
-0.01610882580280304,
0.18715007603168488,
0.6712618470191956,
0.2199704945087433,
-0.11940731108188629,
-0.0804140642285347,
-0.4327486753463745,
-0.1260719895362854,
-0.12170104682445526,
0.2246040403842926,
-0.23822903633117676,
-0.4293815791606903,
0.3184475898742676,
-0.2280559539794922,
-0.25950849056243896,
-0.17315933108329773,
-0.2703324854373932,
0.09922371804714203,
0.027604669332504272,
0.023360315710306168,
0.10231952369213104,
0.3625158965587616,
0.033060651272535324,
0.15854257345199585,
-0.07099181413650513,
-0.01415568869560957,
0.02730434015393257,
0.22609098255634308,
-0.14978021383285522,
0.2395964115858078,
0.22823980450630188,
0.27915337681770325,
0.04076378792524338,
0.30619290471076965,
0.27501338720321655,
-0.23378245532512665,
0.0536138117313385,
0.1383277177810669,
-0.3694458603858948,
0.1434645652770996,
0.2259996086359024,
0.10715247690677643,
-0.0318627655506134,
-0.20266719162464142,
0.11371073126792908,
0.132528617978096,
-0.24517466127872467,
0.340604305267334,
0.1565558910369873,
-0.14509111642837524,
-0.10571859031915665,
0.30592408776283264,
-0.14016371965408325,
-0.05760685354471207,
-0.08024081587791443,
0.26445531845092773,
0.11148197948932648,
-0.000473853200674057,
0.08536365628242493,
-0.2451731115579605,
-0.3161342144012451,
-0.03371262177824974,
-0.3382582366466522,
-0.14731216430664062,
-0.04801429063081741,
-0.2511661648750305,
0.29722362756729126,
-0.07561835646629333,
-0.15162988007068634,
0.08273788541555405,
-0.0028636008501052856,
0.014333708211779594,
0.2858622670173645,
0.27679014205932617,
0.0649324506521225,
0.35283929109573364,
-0.06460221111774445,
-0.3894249200820923,
-0.06138487532734871,
0.08928671479225159,
-0.22949130833148956,
-0.31498903036117554,
0.2111104130744934,
-0.08505012094974518,
-0.5508289337158203,
-0.1785636842250824,
0.11480683088302612,
-0.32571810483932495,
0.006568756885826588,
-0.22391249239444733,
-0.073084756731987,
0.2567386031150818,
-0.11891786009073257,
0.04856462776660919,
-0.10987405478954315,
-0.42181748151779175,
-0.4191392958164215,
-0.0026133209466934204,
0.4789752960205078,
-0.4831106662750244,
-0.08125552535057068,
-0.34445303678512573,
0.042449358850717545,
0.14289775490760803,
-0.2222348153591156,
-0.3295038044452667,
0.3179287016391754,
-0.36159756779670715,
0.30443716049194336,
0.11854340881109238,
-0.2110900729894638,
-0.3817432224750519,
0.2475660741329193,
-0.1601608246564865,
0.22319284081459045,
0.20685963332653046,
0.17951518297195435,
-0.04024898633360863,
-0.311110258102417,
0.2697453498840332,
0.17222049832344055,
-0.2275630384683609,
-0.1325029879808426,
-0.413589209318161,
-0.47515958547592163,
0.1179596483707428,
0.21790704131126404,
0.15949687361717224,
-0.09415076673030853,
-0.010206073522567749,
-0.3405487537384033,
0.22200830280780792,
-0.25426188111305237,
0.031446024775505066,
-0.019918732345104218,
0.6004089117050171,
-0.2851001024246216,
-0.14439521729946136,
0.0449797585606575,
-0.31725794076919556,
0.4249650835990906,
-0.34711045026779175,
-0.14792203903198242,
-0.2609194219112396,
-0.16477367281913757,
0.2280718982219696,
-0.03021211549639702,
-0.3671830892562866,
-0.16477973759174347,
0.017724551260471344,
0.11404496431350708,
0.011638812720775604,
-0.21574415266513824,
-0.22101369500160217,
-0.09757453948259354,
-0.05369293689727783,
0.011229019612073898,
-0.3467656373977661,
-0.09676159918308258,
0.10729113966226578,
0.06005366891622543,
-0.44107937812805176,
0.11146117001771927,
0.15260964632034302,
-0.059889890253543854,
0.14434081315994263,
0.15939566493034363,
0.04721212759613991,
0.12449787557125092,
-0.14413517713546753,
0.2874729335308075,
0.010866986587643623,
-0.27536633610725403,
0.1240103617310524,
-0.3500151038169861,
-0.12587034702301025,
-0.28771746158599854,
0.04592422395944595,
0.47945886850357056,
-0.5295937657356262,
0.08505210280418396,
-0.30840250849723816,
0.016636617481708527,
-0.06257358938455582,
-0.10324382036924362,
0.15604738891124725,
-0.2426455318927765,
-0.13982325792312622,
0.18035133183002472,
0.27043649554252625,
0.055461034178733826,
-0.35409015417099,
0.408286452293396,
0.1488341987133026,
0.1742965579032898,
0.026720469817519188,
0.052928484976291656,
-0.009413860738277435,
-0.26848551630973816,
0.06014610081911087,
0.4501175880432129,
0.30201101303100586,
0.13798153400421143,
0.21368859708309174,
0.06254062056541443,
0.1436370462179184,
-0.08987610042095184,
0.12364712357521057,
-0.2914260923862457,
-0.2724492847919464,
0.2009953409433365,
-0.15343624353408813,
-0.010705448687076569,
0.000796981155872345,
-0.19155509769916534,
0.14918342232704163,
0.06368039548397064,
-0.27381449937820435,
0.0002066493034362793,
-0.1547815501689911,
0.04408109188079834,
-0.020737992599606514,
-0.3996956944465637,
-0.15008512139320374,
-0.3540491461753845,
0.3045211136341095,
0.30231091380119324,
-0.16846466064453125,
-0.06986342370510101,
-0.39247220754623413,
0.37422430515289307,
-0.27080729603767395,
-0.41680699586868286,
-0.04401209205389023,
-0.21329210698604584,
-0.06955975294113159,
0.10284345597028732,
0.3314690589904785,
0.10913188010454178,
0.30827096104621887,
-0.01034223660826683,
-0.055147211998701096,
-0.20418956875801086,
-0.3332803547382355,
0.24595925211906433,
0.009327154606580734,
0.4093320369720459,
0.6388257741928101,
-0.08025786280632019,
-0.01816827803850174,
-0.11648064851760864,
0.014282625168561935,
-0.08141503483057022,
-0.06875059008598328,
-0.1493912935256958,
-0.03795313462615013,
0.25047940015792847,
-0.14603178203105927,
0.31545159220695496,
-0.126448392868042,
-0.29209697246551514,
0.195473313331604,
0.13854722678661346,
0.2672962546348572,
0.5145525336265564,
0.084689661860466,
0.06194622814655304,
-0.061208441853523254,
-0.16689008474349976,
-0.12018421292304993,
-0.8937917947769165,
0.2796008288860321,
-0.366777241230011,
0.08784900605678558,
-0.01596398651599884,
-0.048986949026584625,
0.31149792671203613,
0.2405116707086563,
-0.35575124621391296,
-0.27693670988082886,
-0.0068046292290091515,
0.743349552154541,
0.01249399222433567,
-0.06005965918302536,
0.11731963604688644,
0.4212069511413574,
-0.016829952597618103,
-0.01685025542974472,
0.0989767462015152,
0.10005679726600647,
-0.1658438742160797,
0.3573470711708069,
0.4597862958908081,
-0.10876035690307617,
0.2029615193605423,
1.2119078636169434,
0.01982685923576355,
-0.31538936495780945,
0.25181326270103455,
0.10638771951198578,
0.3026069700717926,
-0.24533911049365997,
-0.2419804185628891,
-0.07355506718158722,
0.142796128988266,
-0.018579848110675812,
-0.1534619927406311,
0.08730262517929077,
0.2735871970653534,
0.029430553317070007,
0.028894416987895966,
-0.15296673774719238,
-0.505855917930603,
0.2200087010860443,
-0.17374145984649658,
0.12085048854351044,
-0.26924943923950195,
0.23179076611995697,
-0.4658803343772888,
-0.15807068347930908,
0.23478034138679504,
0.054360926151275635,
0.5718281865119934,
-0.1715826839208603,
-0.2966732084751129,
0.2824573814868927,
-0.4917818307876587,
0.22955691814422607,
0.20639197528362274,
-0.1926194578409195,
-0.2524382174015045,
-0.24985866248607635,
-0.06475535035133362,
0.01426742970943451,
0.5383867025375366,
-0.5797603130340576,
0.4201573431491852,
0.20982365310192108,
-0.1925775110721588,
0.3488744795322418,
0.18098604679107666,
0.5650169849395752,
0.2740155756473541,
-0.03147999942302704,
0.020216379314661026,
-0.17858274281024933,
-0.0400308333337307,
-0.029959101229906082,
0.1618404984474182,
-0.08133085817098618,
-0.23014390468597412,
0.18287581205368042,
-0.14882676303386688,
0.2228793203830719,
-0.12406991422176361,
0.10643576085567474,
0.15133753418922424,
0.06500805914402008,
-0.014193899929523468,
-0.18964381515979767,
-0.04040616378188133,
0.04861696809530258,
0.14963242411613464,
0.12492641806602478,
-0.36745357513427734,
0.21767938137054443,
0.23264861106872559,
-0.25402918457984924,
0.1938597857952118,
0.41964319348335266,
-0.31616249680519104,
-0.09704907983541489,
-0.16594189405441284,
-0.2560068964958191,
-0.03688704967498779,
0.47463127970695496,
0.05064685642719269,
0.19762316346168518,
0.2154228836297989,
-0.00904502347111702,
-0.05676668882369995,
-0.03486241400241852,
-0.24577483534812927,
-0.18217097222805023,
-0.23665566742420197,
-0.3474658131599426,
0.3779538869857788,
0.21536847949028015,
-0.3013956546783447,
0.6677635908126831,
0.08249007910490036,
-0.4457406997680664,
0.29256755113601685,
0.26944395899772644,
1.215869426727295,
-0.0966314822435379,
0.03228934109210968,
-0.30115407705307007,
0.02546645700931549,
0.31905850768089294,
0.19379298388957977,
-0.19720397889614105,
-0.49668076634407043,
-0.17837709188461304,
-0.18171244859695435,
-0.23123624920845032,
0.11308957636356354,
0.27892908453941345,
0.04631856083869934,
0.013594195246696472,
-0.14948037266731262,
-0.08255589753389359,
-0.08260740339756012,
0.07338035106658936,
-0.07483234256505966,
-0.10996340960264206,
0.31531739234924316,
0.08261759579181671,
0.10128740966320038,
-0.11362086236476898,
-0.016562994569540024,
-0.4069822430610657,
0.2637321352958679,
-0.21146103739738464,
-0.39240068197250366,
-0.04220335930585861,
-0.17446374893188477,
-0.09519056230783463,
0.6301490664482117,
-0.03290987014770508,
0.3068341612815857,
0.16159191727638245,
0.409989595413208,
0.022329865023493767,
-0.18859578669071198,
0.2493034303188324,
0.24830445647239685,
0.25822776556015015,
-0.04419106990098953,
-0.025090081617236137,
0.35597774386405945,
0.06505413353443146,
-0.11629434674978256,
0.23102709650993347,
-0.10560837388038635,
-0.8731072545051575,
-0.3531841039657593,
-0.06735531985759735,
0.2580961585044861,
-0.007092136889696121,
0.15746060013771057,
-0.14637182652950287,
-0.03519972786307335,
-0.04935101792216301,
0.09339854121208191,
0.3158733546733856,
-0.17335636913776398,
0.24800963699817657,
-0.15487056970596313,
0.000597536563873291,
0.06073158606886864,
0.1192542016506195,
-0.3368258774280548,
0.2390458583831787,
0.0811401829123497,
0.15017470717430115,
-0.09603860974311829,
-0.20097295939922333,
-0.040218859910964966,
0.1417701542377472,
-0.0792444497346878,
-0.10638369619846344,
-0.03327334672212601,
0.09190493822097778,
0.2877587378025055,
0.3548550009727478,
0.250789999961853,
0.04620542749762535,
0.012670092284679413,
-0.08827346563339233,
-0.3427261710166931,
-0.11151959002017975,
-0.25153809785842896,
0.287477970123291,
-0.1718636155128479,
-0.014469057321548462,
-0.31790417432785034,
0.23304444551467896,
-0.33495110273361206,
0.27110904455184937,
0.06889978051185608,
-0.08067728579044342,
0.055611975491046906,
0.08084828406572342,
-0.11863408982753754,
-0.14267586171627045,
0.04247550293803215,
0.28772270679473877,
-0.36986273527145386,
-0.1367253214120865,
-0.26185375452041626,
0.22342020273208618,
0.10788266360759735,
-0.171811044216156,
-0.010258659720420837,
0.1088571846485138,
-0.06222745031118393,
0.07220715284347534,
0.31306761503219604,
0.22821441292762756,
-0.07058733701705933,
0.08171600103378296,
0.08050179481506348,
0.33463555574417114,
-0.3528028726577759,
0.21335333585739136,
-0.11272730678319931,
0.48649173974990845,
0.01500660926103592,
0.17416267096996307,
-0.36153969168663025,
-0.17927534878253937,
0.16214823722839355,
0.15343984961509705,
0.023623764514923096,
-0.25804805755615234,
0.3443620800971985,
0.020222414284944534,
-0.1227392926812172,
0.29982495307922363,
0.11252948641777039,
-0.022154726088047028,
-0.15618650615215302,
-0.14530155062675476,
0.40150564908981323,
0.20346085727214813,
-0.027203727513551712,
-0.24252480268478394,
-0.10367324203252792,
0.18238823115825653,
0.1031995639204979,
0.2933969497680664,
0.2598778307437897,
-0.1440010964870453,
-0.1385788470506668,
-0.07805967330932617,
0.19777072966098785,
-0.4473191499710083,
0.04647817835211754,
0.5288049578666687,
-0.3293555974960327,
-0.07013818621635437,
0.4725746214389801,
0.2472112476825714,
0.1138441413640976,
0.4407498836517334,
-0.1300554722547531,
0.26802000403404236,
-0.15817920863628387,
0.05848403647542,
0.10369853675365448,
-0.5804475545883179,
0.5214471817016602,
0.6352404952049255,
0.08355619013309479,
0.24783816933631897,
0.16947144269943237,
0.6862427592277527,
-0.178735613822937,
0.1660281866788864,
0.025897972285747528,
0.3134593069553375,
0.19679203629493713,
-0.2673616409301758,
-0.2979311943054199,
-0.2935013473033905,
-0.4047192335128784,
0.07901865243911743,
-0.06056046858429909,
-0.14811968803405762,
0.4616711437702179,
-0.012583307921886444,
-0.0235942043364048,
-0.1769653707742691,
0.08945858478546143,
-0.14414533972740173,
0.32862016558647156,
-0.4075494408607483,
-0.2515287697315216,
0.03890529274940491,
-0.1829553246498108,
0.28390979766845703,
0.03863293677568436,
0.25135743618011475,
0.07063542306423187,
-0.24505141377449036,
-0.013026082888245583,
-0.3408498764038086,
0.02507680654525757,
-0.2879317104816437,
0.10157708823680878,
-0.1596972644329071,
-0.18787258863449097,
0.27466776967048645,
0.13873593509197235,
-0.0428294911980629,
-0.03427331522107124,
0.0849185436964035,
0.675372838973999,
-0.04275128245353699,
0.2845248579978943,
0.18717962503433228,
-0.13177040219306946,
0.1964290738105774,
0.09025055170059204,
0.053114764392375946,
-0.24488309025764465,
0.23340252041816711,
0.09919328987598419,
0.12632018327713013,
-0.0776199996471405,
0.06979282945394516,
0.1307101845741272,
0.17325255274772644,
0.35699188709259033,
-0.30867207050323486,
-0.34089112281799316,
0.12186451256275177,
-0.3450927734375,
0.19492106139659882,
-0.06441780924797058,
-0.15168771147727966,
-0.06624284386634827,
0.0066326335072517395,
0.22358298301696777,
0.17124800384044647,
-0.05673977732658386,
0.2056860476732254,
0.16754958033561707,
0.6705234050750732,
-0.19633746147155762,
0.1932702511548996,
0.22973859310150146,
-0.15874798595905304,
-0.014911241829395294,
-0.4661749005317688,
0.10535207390785217,
0.17790250480175018,
0.12007918208837509,
-0.12146876752376556,
-0.3387971520423889,
0.2843968868255615,
0.2816846966743469,
0.4453551173210144,
0.14377957582473755,
0.13585303723812103,
0.06804895401000977,
-0.25100308656692505,
-0.1224304586648941,
0.16127616167068481,
-0.05150969326496124,
-0.0005863197147846222,
0.06968668848276138,
0.2673979699611664,
0.0003917589783668518,
0.019675102084875107,
-0.6433542966842651,
0.14590594172477722,
-0.13466408848762512,
0.18558184802532196,
-0.3708707094192505,
0.08715371787548065,
-0.2804408669471741,
0.008292291313409805,
0.199475958943367,
0.24202671647071838,
-0.06522461026906967,
-0.001453012228012085,
-0.19831252098083496,
0.013819694519042969,
0.3645907938480377,
-0.5472650527954102,
-0.06246223673224449,
-0.004906393587589264,
0.14570753276348114,
0.19669896364212036,
-0.27857789397239685,
-0.2655089497566223,
-0.17109014093875885,
0.24301250278949738,
-0.10395616292953491,
0.3625953197479248,
0.020224928855895996,
-0.035230059176683426,
0.10986267030239105,
-0.2039416879415512,
0.16871510446071625,
-0.0635424256324768,
0.17339938879013062,
-0.21598291397094727,
-0.28590065240859985
] |
https://github.com/huggingface/datasets/issues/6194 | Silly hack incoming:
```python
import uuid
class _DatasetGeneratorPickleHack:
def __init__(self, generator, generator_id=None):
self.generator = generator
self.generator_id = (
generator_id if generator_id is not None else str(uuid.uuid4())
)
def __call__(self, *args, **kwargs):
return self.generator(*kwargs, **kwargs)
def __reduce__(self):
return (_DatasetGeneratorPickleHack_raise, (self.generator_id,))
def _DatasetGeneratorPickleHack_raise(*args, **kwargs):
raise AssertionError("cannot actually unpickle _DatasetGeneratorPickleHack!")
```
Now `Dataset.from_generator(_DatasetGeneratorPickleHack(gen))` works even if `gen` is unpicklable, because Dataset just pickles the shim object that avoids actually traversing `gen`. Then, one can work out how to set `generator_id` meaningfully to allow cache reuse. | Support custom fingerprinting with `Dataset.from_generator` | ### Feature request
When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`.
### Motivation
Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash.
### Your contribution
If validated, I can try to submit a PR for this. | 82 | Support custom fingerprinting with `Dataset.from_generator`
### Feature request
When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`.
### Motivation
Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash.
### Your contribution
If validated, I can try to submit a PR for this.
Silly hack incoming:
```python
import uuid
class _DatasetGeneratorPickleHack:
def __init__(self, generator, generator_id=None):
self.generator = generator
self.generator_id = (
generator_id if generator_id is not None else str(uuid.uuid4())
)
def __call__(self, *args, **kwargs):
return self.generator(*kwargs, **kwargs)
def __reduce__(self):
return (_DatasetGeneratorPickleHack_raise, (self.generator_id,))
def _DatasetGeneratorPickleHack_raise(*args, **kwargs):
raise AssertionError("cannot actually unpickle _DatasetGeneratorPickleHack!")
```
Now `Dataset.from_generator(_DatasetGeneratorPickleHack(gen))` works even if `gen` is unpicklable, because Dataset just pickles the shim object that avoids actually traversing `gen`. Then, one can work out how to set `generator_id` meaningfully to allow cache reuse. | [
-0.36780858039855957,
0.21587952971458435,
0.03805328905582428,
0.02745182067155838,
0.016834227368235588,
-0.03290639817714691,
0.5063583850860596,
0.18545609712600708,
0.1344025433063507,
0.3427473306655884,
0.11656101047992706,
0.5043578147888184,
-0.3798723816871643,
0.278560996055603,
0.1531367003917694,
0.06220964342355728,
-0.16079650819301605,
-0.023499920964241028,
-0.13464701175689697,
0.07630090415477753,
-0.256895512342453,
-0.07047224044799805,
0.011359646916389465,
0.16641530394554138,
-0.21861134469509125,
-0.04626869782805443,
0.01833300292491913,
0.31771785020828247,
-0.12051297724246979,
-0.5667914152145386,
0.04815860837697983,
0.23291529715061188,
-0.07248183339834213,
0.20147238671779633,
-0.00011039823584724218,
0.08026237040758133,
0.07250361144542694,
-0.08081351220607758,
-0.14090292155742645,
0.17454186081886292,
-0.1452121138572693,
0.1913173794746399,
-0.27874937653541565,
-0.1806524246931076,
-0.13726948201656342,
0.09090660512447357,
0.041377246379852295,
-0.15238267183303833,
0.20197178423404694,
-0.24159781634807587,
0.24159902334213257,
0.23501886427402496,
0.18656039237976074,
-0.05209391191601753,
0.049520570784807205,
0.4779251217842102,
-0.21428632736206055,
-0.016864478588104248,
0.19110527634620667,
-0.23046784102916718,
-0.2015748769044876,
0.3098112642765045,
-0.027619607746601105,
-0.27066880464553833,
0.45295363664627075,
-0.06213582679629326,
0.16581523418426514,
0.01711527444422245,
0.030063875019550323,
0.5725070238113403,
0.2047765552997589,
-0.33649083971977234,
-0.18076123297214508,
-0.3973843455314636,
-0.05137413740158081,
-0.07828859239816666,
0.11621759831905365,
-0.10769530385732651,
-0.390228807926178,
0.27447310090065,
-0.23172719776630402,
-0.16615328192710876,
-0.19522622227668762,
-0.1087798923254013,
0.21938492357730865,
0.17799437046051025,
-0.00355507992208004,
0.15032829344272614,
0.2668718099594116,
0.041502632200717926,
0.12835833430290222,
-0.04706195741891861,
0.03628108650445938,
0.11377894133329391,
0.000034052878618240356,
-0.2711118459701538,
0.1185934767127037,
0.15363359451293945,
0.2823207378387451,
0.1636033058166504,
0.41624966263771057,
0.2141151875257492,
-0.054599832743406296,
0.1245611384510994,
0.2449614405632019,
-0.42080453038215637,
0.020872188732028008,
0.25174811482429504,
0.07003620266914368,
-0.09692658483982086,
-0.17576467990875244,
0.07217142730951309,
0.09720612317323685,
-0.19346915185451508,
0.46566396951675415,
0.13111650943756104,
-0.022059664130210876,
-0.050494320690631866,
0.21871398389339447,
-0.2627325654029846,
-0.12601786851882935,
0.024192705750465393,
0.2361483871936798,
0.250316321849823,
-0.06400531530380249,
-0.04203023761510849,
-0.20193135738372803,
-0.3385114073753357,
-0.12799054384231567,
-0.16069704294204712,
-0.19419527053833008,
-0.019572116434574127,
-0.1639881730079651,
0.2838190793991089,
-0.06993269175291061,
-0.2078341543674469,
0.16318228840827942,
-0.023294635117053986,
0.09187885373830795,
0.24479393661022186,
0.4006347060203552,
0.06509947776794434,
0.27067118883132935,
-0.07453340291976929,
-0.2697252035140991,
-0.15231439471244812,
0.1586419641971588,
-0.2896574139595032,
-0.26828014850616455,
0.040990084409713745,
-0.09135153889656067,
-0.491047203540802,
-0.1628706306219101,
0.20562921464443207,
-0.3165600299835205,
0.013981722295284271,
-0.11791190505027771,
-0.1053333580493927,
0.12142720073461533,
-0.08569522947072983,
0.028167564421892166,
-0.11325979232788086,
-0.2864978015422821,
-0.415004700422287,
0.08333104103803635,
0.42615705728530884,
-0.2155904322862625,
-0.2657454311847687,
-0.29011452198028564,
-0.19534192979335785,
0.05960671976208687,
-0.17095613479614258,
-0.2745784521102905,
0.2104647159576416,
-0.4127744138240814,
0.24397367238998413,
0.11558285355567932,
-0.39139264822006226,
-0.40414488315582275,
0.20386292040348053,
-0.22468575835227966,
0.24968665838241577,
0.20662197470664978,
0.29888904094696045,
-0.04291178658604622,
-0.2929258942604065,
0.016779489815235138,
0.23266096413135529,
-0.17226704955101013,
-0.09086670726537704,
-0.362118124961853,
-0.38997721672058105,
0.03555482625961304,
0.20561714470386505,
0.10953105986118317,
-0.04651106894016266,
0.13518653810024261,
-0.2077043056488037,
0.29034483432769775,
-0.2961663603782654,
-0.017845433205366135,
0.1269124150276184,
0.6388330459594727,
-0.2559475302696228,
-0.1840132474899292,
-0.035694193094968796,
-0.35103198885917664,
0.4492648243904114,
-0.3258407711982727,
-0.11509387195110321,
-0.2188064157962799,
-0.3279581367969513,
0.19474494457244873,
-0.0011651962995529175,
-0.41762223839759827,
-0.10034223645925522,
0.11997974663972855,
0.13726018369197845,
0.14478909969329834,
-0.22182723879814148,
-0.16808603703975677,
-0.15235818922519684,
-0.13764514029026031,
0.10658963024616241,
-0.3260335624217987,
0.05156943202018738,
0.21195971965789795,
0.06765778362751007,
-0.26788657903671265,
0.17574292421340942,
0.07744407653808594,
-0.05654364824295044,
0.18330644071102142,
0.2800069749355316,
-0.017794694751501083,
0.039658673107624054,
-0.1744474470615387,
0.29716911911964417,
-0.08618234843015671,
-0.2941843867301941,
0.08227167278528214,
-0.21283061802387238,
0.050581417977809906,
-0.22782771289348602,
-0.06728069484233856,
0.6192030906677246,
-0.47805121541023254,
0.07096438854932785,
-0.12992441654205322,
-0.025506746023893356,
-0.07241415232419968,
-0.15687981247901917,
0.06196220964193344,
-0.31700563430786133,
-0.1649848222732544,
0.08717222511768341,
0.32722365856170654,
0.09946295619010925,
-0.44125622510910034,
0.27836844325065613,
0.20206038653850555,
0.07202789187431335,
0.13243259489536285,
-0.0968918651342392,
-0.11487016826868057,
-0.05916767567396164,
0.14671874046325684,
0.3297601044178009,
0.3590232729911804,
0.2129773199558258,
0.1209014505147934,
0.0966210663318634,
-0.01681886799633503,
-0.05726924538612366,
0.08546441793441772,
-0.23760855197906494,
-0.1398172527551651,
0.1807173490524292,
-0.10387574136257172,
-0.1204148381948471,
-0.13746033608913422,
-0.12880939245224,
0.037580572068691254,
0.017489319667220116,
-0.3377932012081146,
0.00034371763467788696,
-0.24966245889663696,
0.106373131275177,
-0.09196342527866364,
-0.2550256550312042,
-0.20462030172348022,
-0.33091211318969727,
0.2571626305580139,
0.3251589834690094,
-0.14488551020622253,
0.05117899179458618,
-0.3185623288154602,
0.21258649230003357,
-0.2781238257884979,
-0.38668131828308105,
0.0627669245004654,
-0.249126136302948,
0.0710497796535492,
0.18302644789218903,
0.2907193601131439,
0.25818753242492676,
0.42154935002326965,
0.13903123140335083,
-0.02079956978559494,
-0.258066326379776,
-0.2898014187812805,
0.12905102968215942,
0.08532777428627014,
0.3980313837528229,
0.5932027697563171,
-0.13600648939609528,
0.017829611897468567,
-0.21616092324256897,
0.0749162957072258,
-0.07184743136167526,
-0.18010300397872925,
-0.1008976623415947,
-0.02470988966524601,
0.18654680252075195,
-0.049438364803791046,
0.2691572606563568,
-0.36044976115226746,
-0.27725809812545776,
0.21207278966903687,
0.281514048576355,
0.23822370171546936,
0.3651627004146576,
0.1599322259426117,
0.17035317420959473,
0.005156058818101883,
-0.12934452295303345,
-0.10711909830570221,
-0.8241525888442993,
0.2422848343849182,
-0.36582884192466736,
0.07509016990661621,
-0.015257604420185089,
-0.18488359451293945,
0.2912013828754425,
0.2087637186050415,
-0.3717745542526245,
-0.3538130819797516,
0.030900774523615837,
0.591988205909729,
0.1375102996826172,
-0.07783591002225876,
0.032934412360191345,
0.46858179569244385,
-0.032678112387657166,
-0.01507885754108429,
0.18692393600940704,
0.05657176300883293,
-0.26114702224731445,
0.2441842406988144,
0.30752915143966675,
0.05324775353074074,
0.21150903403759003,
1.126110553741455,
0.05988308787345886,
-0.360019713640213,
0.1366438865661621,
-0.018910881131887436,
0.28633826971054077,
-0.20088498294353485,
-0.31686198711395264,
0.07469518482685089,
0.14330527186393738,
0.09225136041641235,
-0.141439288854599,
0.010641161352396011,
0.2284642904996872,
0.11932119727134705,
0.19065557420253754,
-0.16361919045448303,
-0.5647200345993042,
0.2163456231355667,
0.10262835770845413,
0.11516271531581879,
-0.16650325059890747,
0.20829030871391296,
-0.4300483763217926,
-0.121526338160038,
0.22425757348537445,
-0.012261617928743362,
0.38603392243385315,
-0.2225809246301651,
-0.4242895245552063,
0.2583177983760834,
-0.42564815282821655,
0.21356330811977386,
0.19487200677394867,
-0.24362599849700928,
-0.07498388737440109,
-0.284467875957489,
-0.09676705300807953,
-0.0070001669228076935,
0.42901039123535156,
-0.46608439087867737,
0.31202173233032227,
0.27773603796958923,
-0.44288864731788635,
0.13045033812522888,
0.22100648283958435,
0.3786994218826294,
0.1559753119945526,
-0.17994408309459686,
0.14923855662345886,
-0.265131413936615,
-0.0522402748465538,
0.14609955251216888,
0.22237172722816467,
-0.18184122443199158,
-0.1340920329093933,
0.17032670974731445,
-0.19184309244155884,
-0.015522684901952744,
0.01630980148911476,
-0.05327461659908295,
0.1055450290441513,
0.04642503708600998,
-0.06548164784908295,
-0.4225669503211975,
-0.09621338546276093,
0.11692972481250763,
0.19891251623630524,
0.10782129317522049,
-0.28799787163734436,
0.33319830894470215,
0.13344061374664307,
-0.19273394346237183,
0.33812904357910156,
0.47948333621025085,
-0.27476510405540466,
-0.26302868127822876,
-0.16487649083137512,
-0.16280126571655273,
0.013806246221065521,
0.3887840509414673,
0.12785175442695618,
0.28377673029899597,
0.2052878886461258,
0.04029902070760727,
-0.1823398619890213,
-0.030445029959082603,
-0.26327407360076904,
-0.09177178889513016,
-0.23233702778816223,
-0.36871135234832764,
0.43018487095832825,
0.20736940205097198,
-0.23170094192028046,
0.5052885413169861,
0.0649489164352417,
-0.4470372200012207,
0.3019115626811981,
0.40024334192276,
1.0979660749435425,
-0.15223601460456848,
0.009507955983281136,
-0.15330611169338226,
0.17114068567752838,
0.26112425327301025,
0.2550332546234131,
-0.22666530311107635,
-0.5599991083145142,
-0.38549354672431946,
-0.14558351039886475,
-0.1892971396446228,
0.20476216077804565,
0.2571845054626465,
-0.0339336097240448,
0.11578158289194107,
-0.18995404243469238,
0.025209588930010796,
-0.19498254358768463,
0.11358131468296051,
-0.07137622684240341,
-0.16463477909564972,
0.15876902639865875,
0.1677645742893219,
0.18885105848312378,
-0.18645824491977692,
0.01917625218629837,
-0.2403547465801239,
0.25564634799957275,
-0.20632365345954895,
-0.20614424347877502,
-0.010884381830692291,
-0.3802797496318817,
-0.0004034750163555145,
0.39874184131622314,
-0.09560228884220123,
0.154134601354599,
0.2290395200252533,
0.24789664149284363,
0.13553676009178162,
-0.030129341408610344,
0.21973025798797607,
0.2584453821182251,
0.3298317492008209,
-0.10096488893032074,
0.036582786589860916,
0.37487664818763733,
0.052986353635787964,
-0.1161021739244461,
0.3577348589897156,
-0.0968073159456253,
-0.7396478056907654,
-0.22994793951511383,
-0.011626876890659332,
0.24454988539218903,
-0.13821673393249512,
0.13728967308998108,
-0.24932987987995148,
-0.20158857107162476,
-0.14383096992969513,
0.13349048793315887,
0.28860095143318176,
-0.17650273442268372,
0.23219674825668335,
-0.0343170240521431,
-0.03665510565042496,
0.052787456661462784,
0.23810751736164093,
-0.18363814055919647,
0.3498755693435669,
0.18339791893959045,
-0.02093707025051117,
-0.08309567719697952,
-0.3139060437679291,
0.0496743842959404,
0.2238839864730835,
-0.13067740201950073,
0.026571456342935562,
0.06075906753540039,
0.1450551301240921,
0.26418817043304443,
0.19504870474338531,
0.18195441365242004,
0.021439794450998306,
-0.13322843611240387,
-0.041296541690826416,
-0.3028690218925476,
0.01705663651227951,
-0.016179703176021576,
0.35941043496131897,
-0.13883063197135925,
0.11647029221057892,
-0.4181000292301178,
0.25129270553588867,
-0.42397600412368774,
0.19885343313217163,
-0.19160020351409912,
-0.00705048767849803,
0.08389473706483841,
0.11605191975831985,
-0.041520774364471436,
-0.1585211604833603,
0.20063206553459167,
0.29234758019447327,
-0.2898348867893219,
-0.251041442155838,
-0.33957409858703613,
0.16520169377326965,
0.1565963625907898,
-0.1054326519370079,
0.14280447363853455,
0.19487124681472778,
-0.017378438264131546,
-0.09747888147830963,
0.36273255944252014,
0.2292827069759369,
-0.013631727546453476,
0.040687426924705505,
0.22506485879421234,
0.23020072281360626,
-0.33331143856048584,
0.1922767013311386,
-0.18693338334560394,
0.3802781105041504,
-0.015935570001602173,
0.11202850937843323,
-0.3886628746986389,
-0.1335325539112091,
0.28526049852371216,
0.1735430359840393,
0.14703123271465302,
-0.27599650621414185,
0.3502773642539978,
0.08504259586334229,
-0.2074500322341919,
0.2073046714067459,
0.14298702776432037,
-0.013262797147035599,
-0.14102298021316528,
-0.12364436686038971,
0.4281996786594391,
0.29943928122520447,
-0.15708452463150024,
-0.23873019218444824,
-0.08066955208778381,
0.13297858834266663,
0.32235562801361084,
0.3783324956893921,
0.024137631058692932,
-0.138970285654068,
-0.15639248490333557,
-0.19581617414951324,
0.23426507413387299,
-0.3951079249382019,
0.18103298544883728,
0.6177722215652466,
-0.3598342537879944,
-0.07138092070817947,
0.29993680119514465,
0.2209906280040741,
0.22429224848747253,
0.3861519992351532,
-0.18193645775318146,
0.29779374599456787,
-0.23427072167396545,
0.07381043583154678,
0.0011825598776340485,
-0.4394865930080414,
0.3682900369167328,
0.5493783354759216,
0.035474278032779694,
0.44599828124046326,
0.14476311206817627,
0.5565266609191895,
-0.12188580632209778,
0.09405063837766647,
0.06059270352125168,
0.39384934306144714,
0.21268311142921448,
-0.2969794273376465,
-0.44740572571754456,
-0.1304173320531845,
-0.3495379090309143,
0.10409961640834808,
-0.01103566586971283,
-0.4264064133167267,
0.2859453856945038,
-0.04741419106721878,
0.10111990571022034,
-0.17579784989356995,
0.07471029460430145,
0.05211656913161278,
0.25816071033477783,
-0.4734446108341217,
-0.3753529489040375,
0.20310775935649872,
-0.07068660110235214,
0.2561090588569641,
0.07624243944883347,
0.2068052589893341,
-0.021469473838806152,
-0.21689516305923462,
0.07981377840042114,
-0.2718397080898285,
0.04280892014503479,
-0.28775227069854736,
0.006377190351486206,
-0.22489899396896362,
-0.2632112205028534,
0.45059269666671753,
0.21615895628929138,
-0.1449729949235916,
-0.18531419336795807,
0.11820435523986816,
0.4852161705493927,
-0.20994596183300018,
0.2637564539909363,
0.04621891677379608,
-0.11245942860841751,
0.11590281128883362,
0.08903704583644867,
0.008155494928359985,
-0.23786096274852753,
0.2443682849407196,
0.07472488284111023,
0.19341549277305603,
0.0010518878698349,
0.10105051100254059,
0.05215147137641907,
0.20938533544540405,
0.18777841329574585,
-0.246275395154953,
-0.22616355121135712,
0.17426586151123047,
-0.42530086636543274,
0.1675332486629486,
-0.1205115020275116,
-0.2681989073753357,
-0.06663428992033005,
-0.004529047757387161,
0.22997133433818817,
0.2011285424232483,
-0.14746303856372833,
0.17443977296352386,
0.24299857020378113,
0.6980090737342834,
-0.22302484512329102,
0.08609908819198608,
-0.04108838364481926,
-0.17852330207824707,
0.05777263641357422,
-0.5622775554656982,
0.0037248628214001656,
0.07847148180007935,
0.19288793206214905,
-0.021460996940732002,
-0.19948925077915192,
0.171499103307724,
0.09657766669988632,
0.43837979435920715,
0.056957684457302094,
0.20161285996437073,
-0.0685814842581749,
-0.2331145852804184,
0.012932920828461647,
0.07731372117996216,
-0.13309751451015472,
0.017517413944005966,
0.23482884466648102,
0.38176649808883667,
0.08586906641721725,
-0.039668332785367966,
-0.44734376668930054,
0.1989680826663971,
-0.026018932461738586,
0.21192945539951324,
-0.22558429837226868,
0.2562369406223297,
-0.22760877013206482,
0.00555318221449852,
0.0932471975684166,
0.2433048039674759,
-0.024022739380598068,
0.021189391613006592,
-0.08228228986263275,
-0.05978325381875038,
0.38412266969680786,
-0.5068254470825195,
0.017959438264369965,
-0.03372849151492119,
0.15687495470046997,
0.056886591017246246,
-0.2806645333766937,
-0.15874828398227692,
-0.0895083025097847,
0.30654826760292053,
-0.02529672533273697,
0.2821526825428009,
-0.06051220744848251,
0.02183721587061882,
0.1257583200931549,
-0.17071202397346497,
0.01837804913520813,
-0.0884462296962738,
0.1188412457704544,
-0.08071024715900421,
-0.2905815839767456
] |
https://github.com/huggingface/datasets/issues/6194 | I'd like some way to do this too. I find that sometimes the hash doesn't cover enough, and that the dataset is not regenerated even when underlying data has changed, and by supplying a custom fingerprint I could do a better job of controlling when my dataset is regenerated. | Support custom fingerprinting with `Dataset.from_generator` | ### Feature request
When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`.
### Motivation
Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash.
### Your contribution
If validated, I can try to submit a PR for this. | 49 | Support custom fingerprinting with `Dataset.from_generator`
### Feature request
When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`.
### Motivation
Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash.
### Your contribution
If validated, I can try to submit a PR for this.
I'd like some way to do this too. I find that sometimes the hash doesn't cover enough, and that the dataset is not regenerated even when underlying data has changed, and by supplying a custom fingerprint I could do a better job of controlling when my dataset is regenerated. | [
-0.30125513672828674,
0.2775108516216278,
0.06664708256721497,
0.02324117347598076,
-0.1204926073551178,
0.03203746676445007,
0.5140148997306824,
0.18703512847423553,
0.022674553096294403,
0.288601279258728,
0.3510569930076599,
0.367605984210968,
-0.3413662612438202,
0.3644355535507202,
0.14058524370193481,
0.09621207416057587,
-0.12648895382881165,
0.06387478113174438,
0.006967555731534958,
0.08148372173309326,
-0.20946478843688965,
-0.01954459398984909,
0.00550428032875061,
0.23286554217338562,
-0.1825784146785736,
0.11059915274381638,
0.11814757436513901,
0.24907681345939636,
-0.2565435767173767,
-0.4675809144973755,
-0.0046247392892837524,
0.22773942351341248,
0.025169245898723602,
0.12545889616012573,
-0.00011660781456157565,
0.0803116112947464,
0.05417725071310997,
-0.049881838262081146,
0.0593155175447464,
0.12090623378753662,
-0.1995185911655426,
0.25387927889823914,
-0.3681681752204895,
-0.14817987382411957,
-0.10925529152154922,
-0.1197647750377655,
-0.010722048580646515,
-0.09368479996919632,
0.16075445711612701,
-0.3016067147254944,
0.1821022927761078,
-0.0018951669335365295,
0.11212988197803497,
-0.035416729748249054,
0.016654564067721367,
0.6909700036048889,
-0.20359742641448975,
0.008222822099924088,
0.4128703773021698,
-0.28417274355888367,
-0.12494362145662308,
0.18156304955482483,
0.08904273808002472,
-0.4171065092086792,
0.5351157188415527,
-0.08444608747959137,
0.24972794950008392,
-0.02951998822391033,
-0.0034338170662522316,
0.6510826945304871,
0.2205314040184021,
-0.10670161992311478,
-0.03348897024989128,
-0.41923612356185913,
0.02365628257393837,
0.05311155319213867,
0.10058112442493439,
-0.16122174263000488,
-0.37579357624053955,
0.38139981031417847,
-0.3428112864494324,
-0.3139302134513855,
-0.2830250859260559,
-0.17563000321388245,
0.1294708549976349,
-0.044543810188770294,
0.08767441660165787,
0.19021250307559967,
0.312505304813385,
0.06908532977104187,
0.1089700311422348,
-0.14792722463607788,
-0.07451420277357101,
0.07083794474601746,
0.14190515875816345,
-0.24633526802062988,
0.040205005556344986,
0.10646965354681015,
0.2436486780643463,
0.055347178131341934,
0.3524988889694214,
0.16564308106899261,
-0.21029449999332428,
0.0824398547410965,
0.21267397701740265,
-0.5216966867446899,
0.06162016838788986,
0.22263306379318237,
0.11735708266496658,
-0.14621016383171082,
-0.1646510362625122,
0.12612658739089966,
0.062447626143693924,
-0.1379406750202179,
0.35464245080947876,
-0.03753386065363884,
-0.11387515068054199,
-0.06476490199565887,
0.29827916622161865,
-0.3375646471977234,
-0.21531063318252563,
-0.06962213665246964,
0.2989411950111389,
0.09889228641986847,
-0.06366894394159317,
-0.11076609790325165,
-0.22745737433433533,
-0.3740762770175934,
-0.025728512555360794,
-0.3032171130180359,
-0.07764655351638794,
-0.07005222141742706,
-0.24484898149967194,
0.3296368718147278,
-0.10406991094350815,
-0.18287396430969238,
0.04422788321971893,
0.06069336459040642,
0.05370188504457474,
0.20705795288085938,
0.32807889580726624,
0.2131844460964203,
0.26568618416786194,
-0.17408326268196106,
-0.3068011403083801,
-0.16338594257831573,
-0.008731033653020859,
-0.12100563943386078,
-0.22141093015670776,
0.2881847620010376,
-0.06992566585540771,
-0.5055305361747742,
-0.23465527594089508,
0.12953710556030273,
-0.3473200798034668,
-0.07290045917034149,
-0.13168904185295105,
-0.07673028111457825,
0.08595342934131622,
-0.10171502828598022,
0.03908613324165344,
0.006209854036569595,
-0.31150466203689575,
-0.33930110931396484,
0.04317783564329147,
0.3793947398662567,
-0.34525811672210693,
-0.12769939005374908,
-0.32815948128700256,
-0.17841249704360962,
0.07245014607906342,
-0.28207841515541077,
-0.37552589178085327,
0.43800094723701477,
-0.409744530916214,
0.19888225197792053,
0.28839144110679626,
-0.14411774277687073,
-0.20053067803382874,
0.19933459162712097,
-0.1782592087984085,
0.17605242133140564,
0.1574462503194809,
0.3752111792564392,
0.09684133529663086,
-0.1442456841468811,
-0.02645774558186531,
0.1856595277786255,
-0.2717445194721222,
-0.11819224804639816,
-0.2509896159172058,
-0.3927328586578369,
0.17745532095432281,
0.28548264503479004,
0.10740833729505539,
0.003314543515443802,
0.12113643437623978,
-0.25254181027412415,
0.2799854576587677,
-0.3482007682323456,
0.049828894436359406,
0.02882070094347,
0.594371497631073,
-0.26903343200683594,
-0.23910309374332428,
-0.013659089803695679,
-0.14355352520942688,
0.46419045329093933,
-0.34175094962120056,
-0.12979573011398315,
-0.11294257640838623,
-0.16267389059066772,
0.1481478214263916,
-0.07788518816232681,
-0.2912406325340271,
-0.0481269471347332,
-0.031224224716424942,
0.18914639949798584,
-0.07521922886371613,
-0.2059788703918457,
-0.24191199243068695,
-0.1301567256450653,
-0.1606922298669815,
0.11533333361148834,
-0.3397778272628784,
0.00591704249382019,
0.2640652358531952,
0.1304854154586792,
-0.3546113967895508,
0.14409886300563812,
0.08417938649654388,
-0.13875821232795715,
0.2189388871192932,
0.21268236637115479,
-0.08517550677061081,
0.14634017646312714,
-0.18121185898780823,
0.3527981638908386,
-0.012604921124875546,
-0.36860841512680054,
0.1054379865527153,
-0.36910125613212585,
-0.06763651967048645,
-0.3112758994102478,
0.04442078247666359,
0.47239723801612854,
-0.4808557629585266,
0.025822443887591362,
-0.38249605894088745,
0.04504789412021637,
-0.14784947037696838,
-0.1778194010257721,
0.10986696928739548,
-0.27108126878738403,
-0.30531221628189087,
0.0951213538646698,
0.21651984751224518,
0.09458558261394501,
-0.4007553458213806,
0.1806466281414032,
0.15770526230335236,
0.08231718838214874,
-0.02584504708647728,
0.007069958373904228,
-0.015523064881563187,
-0.11980286240577698,
0.1005658432841301,
0.33602583408355713,
0.22939011454582214,
0.148149311542511,
0.09315429627895355,
0.15280599892139435,
0.08416634052991867,
0.02185523509979248,
0.1413014680147171,
-0.33488208055496216,
-0.16955500841140747,
0.10469003021717072,
-0.1718328893184662,
-0.07011815160512924,
0.009251117706298828,
-0.17847755551338196,
0.17551837861537933,
-0.04834720119833946,
-0.33995628356933594,
-0.12800878286361694,
-0.1675366461277008,
0.09891615062952042,
-0.09757409244775772,
-0.5075498223304749,
-0.17395015060901642,
-0.23522961139678955,
0.23176884651184082,
0.2518162131309509,
-0.04399949684739113,
-0.0729358047246933,
-0.36317408084869385,
0.24815043807029724,
-0.31084224581718445,
-0.5843687057495117,
0.12094853073358536,
-0.07982014119625092,
-0.0060463254339993,
0.14825719594955444,
0.22429807484149933,
0.27466893196105957,
0.3185736835002899,
0.07757864892482758,
0.13066768646240234,
-0.26818710565567017,
-0.3147740364074707,
0.22969363629817963,
-0.006480783224105835,
0.37790435552597046,
0.5993489623069763,
-0.1819351315498352,
-0.009656086564064026,
-0.05442063882946968,
-0.019855987280607224,
-0.02040296420454979,
-0.1484377235174179,
-0.17664724588394165,
0.01934703439474106,
0.2154993861913681,
-0.0732104554772377,
0.30582067370414734,
-0.18443450331687927,
-0.13540169596672058,
0.15622283518314362,
0.17968058586120605,
0.18110279738903046,
0.3172552287578583,
0.17972272634506226,
0.0772385224699974,
-0.07912616431713104,
-0.24641114473342896,
0.06478703022003174,
-1.0291941165924072,
0.2880616784095764,
-0.4248664379119873,
0.22857889533042908,
0.11718947440385818,
0.027466587722301483,
0.2994798421859741,
0.33295491337776184,
-0.35748109221458435,
-0.310004323720932,
0.07208012789487839,
0.6377308368682861,
-0.04701996594667435,
-0.10060001909732819,
0.021703531965613365,
0.3875056803226471,
0.06617400050163269,
0.030304044485092163,
0.06683023273944855,
0.0568019300699234,
-0.14454470574855804,
0.3577921688556671,
0.3213231563568115,
-0.010009098798036575,
0.11730451881885529,
1.1275817155838013,
-0.057142868638038635,
-0.3795805871486664,
0.1571708619594574,
-0.04474693536758423,
0.3221273720264435,
-0.08240646123886108,
-0.2856820821762085,
-0.017426814883947372,
0.30399632453918457,
0.059867434203624725,
-0.1273340880870819,
0.08716733753681183,
0.34567147493362427,
0.08088067919015884,
-0.03855762258172035,
-0.238531231880188,
-0.42814236879348755,
0.1440894454717636,
-0.06848333775997162,
0.3331093490123749,
-0.30847597122192383,
0.2304125726222992,
-0.35690462589263916,
-0.2531956136226654,
0.20181797444820404,
0.09717120230197906,
0.599486231803894,
-0.18496139347553253,
-0.49221813678741455,
0.28333809971809387,
-0.2706471383571625,
0.17064692080020905,
0.21376273036003113,
-0.16915729641914368,
-0.1454550176858902,
-0.09906424582004547,
-0.040283191949129105,
0.10278913378715515,
0.4957384765148163,
-0.4445551931858063,
0.29894140362739563,
0.15089906752109528,
-0.313631534576416,
0.3193871080875397,
0.24794405698776245,
0.5527383089065552,
0.20776912569999695,
-0.07840606570243835,
0.1006966084241867,
-0.05357545614242554,
-0.012830384075641632,
0.11532838642597198,
0.3479081690311432,
-0.20007780194282532,
-0.23157326877117157,
0.28148162364959717,
-0.19024433195590973,
0.19020754098892212,
-0.05146601423621178,
-0.07301653176546097,
0.21213720738887787,
0.1747288703918457,
-0.18608039617538452,
-0.2969686985015869,
-0.0862569659948349,
0.10884254425764084,
0.18333700299263,
-0.011303029954433441,
-0.2914973199367523,
0.3005914092063904,
0.0603642463684082,
-0.21643361449241638,
0.2737804353237152,
0.42066285014152527,
-0.2919999361038208,
-0.3600302040576935,
-0.2603102922439575,
-0.25273463129997253,
0.15162216126918793,
0.3153225779533386,
0.0626220703125,
0.23099204897880554,
0.21355649828910828,
-0.07812511175870895,
-0.15611743927001953,
-0.015039615333080292,
-0.17492374777793884,
-0.1639920175075531,
-0.32661738991737366,
-0.3256145715713501,
0.3198186159133911,
0.0918775349855423,
-0.21252389252185822,
0.576002836227417,
0.08218496292829514,
-0.5266649127006531,
0.21845677495002747,
0.31781113147735596,
1.0337495803833008,
-0.14165997505187988,
-0.10337422788143158,
-0.3975713849067688,
0.11069317162036896,
0.19997377693653107,
0.2326839566230774,
-0.3265364468097687,
-0.47913944721221924,
-0.2368721067905426,
-0.17804518342018127,
-0.19349588453769684,
0.310413658618927,
0.4477018713951111,
0.10871142894029617,
0.019288327544927597,
-0.018595919013023376,
0.06699071824550629,
-0.14995574951171875,
0.19818568229675293,
0.06269320100545883,
-0.1984930783510208,
0.2921462059020996,
0.07733307778835297,
0.1894429624080658,
-0.3141762316226959,
0.045565493404865265,
-0.37791600823402405,
0.374153196811676,
-0.16858071088790894,
-0.32754674553871155,
-0.09336996078491211,
-0.23780865967273712,
-0.20624776184558868,
0.5503945350646973,
-0.04189679026603699,
0.3981577754020691,
0.22970473766326904,
0.362823486328125,
0.13600453734397888,
-0.06712430715560913,
0.2430858612060547,
0.09879852831363678,
0.3274299204349518,
-0.1383708417415619,
0.046733558177948,
0.28479766845703125,
0.11133813858032227,
-0.3121461272239685,
0.3288520872592926,
-0.07261786609888077,
-0.9752753376960754,
-0.3342311382293701,
-0.02686220407485962,
0.24458235502243042,
-0.13628661632537842,
0.18857266008853912,
-0.2559330463409424,
-0.035961028188467026,
-0.09172242879867554,
0.06901831179857254,
0.3545030355453491,
-0.12908226251602173,
0.38392937183380127,
-0.08307291567325592,
-0.05496703088283539,
0.011448584496974945,
0.06770237535238266,
-0.34794363379478455,
0.21396881341934204,
0.04248569533228874,
-0.02140270173549652,
0.05692604184150696,
-0.20476272702217102,
0.15345509350299835,
0.1621459722518921,
0.023726843297481537,
-0.10699121654033661,
0.07800909131765366,
0.32992252707481384,
0.40242815017700195,
0.29376789927482605,
0.15972967445850372,
-0.011936966329813004,
-0.02509312331676483,
-0.1783726066350937,
-0.24724985659122467,
-0.10011819750070572,
-0.0343991219997406,
0.32896801829338074,
-0.10634984076023102,
0.14911960065364838,
-0.3630986511707306,
0.19154313206672668,
-0.3240519165992737,
0.2770051956176758,
0.09301690012216568,
-0.015872549265623093,
0.1407061219215393,
0.28899523615837097,
-0.12019729614257812,
-0.16323593258857727,
0.0680771991610527,
0.2939181923866272,
-0.19659237563610077,
-0.09916125237941742,
-0.28667283058166504,
0.2630937695503235,
0.133026123046875,
-0.06992001831531525,
0.03918716683983803,
0.11310798674821854,
-0.06509903073310852,
0.0019694194197654724,
0.29783403873443604,
0.18727977573871613,
-0.08756082504987717,
0.01764051616191864,
0.049700163304805756,
0.23905372619628906,
-0.4016112685203552,
0.17125675082206726,
-0.21477653086185455,
0.46474793553352356,
0.024865757673978806,
0.17941468954086304,
-0.28779253363609314,
-0.20376113057136536,
0.11935979872941971,
0.0967993512749672,
0.19906091690063477,
-0.254368394613266,
0.3130851984024048,
0.20461517572402954,
-0.054745566099882126,
0.2990865707397461,
0.09175816923379898,
-0.08176350593566895,
-0.18706029653549194,
-0.07321678102016449,
0.6015808582305908,
0.1967639923095703,
0.00651666522026062,
-0.21737660467624664,
0.033264003694057465,
0.20986127853393555,
0.13353869318962097,
0.35298970341682434,
0.21157467365264893,
-0.037660151720047,
-0.1785109043121338,
-0.2512555420398712,
0.11532466113567352,
-0.3152244985103607,
0.09656462073326111,
0.6697744131088257,
-0.4751805365085602,
-0.09605717658996582,
0.4613614082336426,
0.2579551339149475,
0.17283518612384796,
0.5076420307159424,
-0.1356174200773239,
0.2636459469795227,
-0.11081595718860626,
0.12472276389598846,
0.09544507414102554,
-0.43022334575653076,
0.5364046692848206,
0.5291328430175781,
0.14949259161949158,
0.31778109073638916,
0.11103342473506927,
0.6095490455627441,
-0.06142695993185043,
0.21672378480434418,
-0.017195086926221848,
0.46004146337509155,
0.318945050239563,
-0.18557880818843842,
-0.373745322227478,
-0.17697934806346893,
-0.39414963126182556,
0.05686467885971069,
0.007126061711460352,
-0.3791032135486603,
0.1886557638645172,
-0.08024688065052032,
-0.042653635144233704,
-0.0991990864276886,
0.065579853951931,
-0.0028874806594103575,
0.12570595741271973,
-0.4095335602760315,
-0.36121875047683716,
-0.006940603256225586,
-0.09050357341766357,
0.4220238924026489,
0.0970967561006546,
0.011686567217111588,
-0.025563599541783333,
-0.10458122938871384,
0.023037154227495193,
-0.4468343257904053,
0.053101345896720886,
-0.2621306777000427,
0.07118114084005356,
-0.32252630591392517,
-0.14862212538719177,
0.31711718440055847,
0.12839457392692566,
-0.0170262660831213,
-0.15129995346069336,
0.06944043189287186,
0.5272295475006104,
-0.21718479692935944,
0.37884145975112915,
0.2882596552371979,
-0.13795602321624756,
0.06937233358621597,
0.0325469896197319,
0.17726168036460876,
-0.30066099762916565,
0.290778249502182,
-0.0011619068682193756,
0.06442469358444214,
-0.003146946430206299,
0.07858021557331085,
0.02148224040865898,
0.11695954203605652,
0.26850426197052,
-0.3937772810459137,
-0.14838650822639465,
0.044839248061180115,
-0.3538481593132019,
0.13416720926761627,
-0.11458189785480499,
-0.18095150589942932,
-0.037858396768569946,
-0.09505745768547058,
0.28503355383872986,
0.2148449420928955,
-0.09070056676864624,
0.20221653580665588,
0.09902892261743546,
0.7010624408721924,
-0.14614582061767578,
0.14000897109508514,
0.03999457508325577,
-0.08491318672895432,
-0.030302803963422775,
-0.3535129427909851,
0.11211653053760529,
0.11976124346256256,
0.07591985166072845,
-0.07679452002048492,
-0.2633989453315735,
0.08312368392944336,
-0.017616892233490944,
0.6122212409973145,
0.10468729585409164,
0.09699857234954834,
-0.054806992411613464,
-0.11696414649486542,
-0.03654893860220909,
0.11403872817754745,
-0.1592082977294922,
0.12313330173492432,
0.1630995124578476,
0.31432873010635376,
0.06286937743425369,
0.030759431421756744,
-0.5611984133720398,
0.08005058765411377,
-0.11384502053260803,
0.11092595756053925,
-0.29966986179351807,
0.10608568787574768,
-0.32494765520095825,
-0.11127310991287231,
0.19081555306911469,
0.19160021841526031,
-0.03488350287079811,
-0.06576468795537949,
-0.034870445728302,
0.09484227001667023,
0.21894237399101257,
-0.53522789478302,
-0.018891241401433945,
0.06239563226699829,
0.06112033873796463,
0.06919214129447937,
-0.27731066942214966,
-0.2424597442150116,
-0.13238154351711273,
0.4531705975532532,
-0.01018549781292677,
0.5695859789848328,
-0.055449482053518295,
0.031138937920331955,
0.12416255474090576,
-0.1429750919342041,
-0.132085382938385,
-0.010467756539583206,
0.1544209122657776,
-0.14385810494422913,
-0.26201415061950684
] |